QuestionViewModel.java
package edu.rit.coopeval.viewmodel.evaluation;
import edu.rit.coopeval.model.EmployerQuestionAnswer;
import edu.rit.coopeval.model.StudentQuestionAnswer;
/**
* Created by mhickson on 3/5/15.
*/
public class QuestionViewModel {
private Long questionOrder;
private String questionType;
private String isRequired;
private String isCommentAllowed;
private String text;
private String helpText;
private Long questionAnswerId;
private String answer;
private String comment;
public QuestionViewModel(){}
public QuestionViewModel(StudentQuestionAnswer studentQuestionAnswerEntity){
this.questionOrder=studentQuestionAnswerEntity.getFormQuestionByFormQuestionId().getQuestionOrder();
this.questionType=studentQuestionAnswerEntity.getFormQuestionByFormQuestionId()
.getQuestionByQuestionId().getQuestionTypeByQuestionTypeId().getName();
this.isRequired=studentQuestionAnswerEntity.getFormQuestionByFormQuestionId().getIsRequired();
this.isCommentAllowed=studentQuestionAnswerEntity.getFormQuestionByFormQuestionId().getIsCommentAllowed();
this.text=studentQuestionAnswerEntity.getFormQuestionByFormQuestionId().getQuestionByQuestionId().getText();
this.questionAnswerId=studentQuestionAnswerEntity.getStudentQuestionAnswerId();
this.answer=studentQuestionAnswerEntity.getAnswer();
this.comment=studentQuestionAnswerEntity.getComment();
}
public QuestionViewModel(EmployerQuestionAnswer employerQuestionAnswerEntity){
this.questionOrder=employerQuestionAnswerEntity.getFormQuestionByFormQuestionId().getQuestionOrder();
this.questionType=employerQuestionAnswerEntity.getFormQuestionByFormQuestionId()
.getQuestionByQuestionId().getQuestionTypeByQuestionTypeId().getName();
this.isRequired=employerQuestionAnswerEntity.getFormQuestionByFormQuestionId().getIsRequired();
this.isCommentAllowed=employerQuestionAnswerEntity.getFormQuestionByFormQuestionId().getIsCommentAllowed();
this.text=employerQuestionAnswerEntity.getFormQuestionByFormQuestionId().getQuestionByQuestionId().getText();
this.questionAnswerId=employerQuestionAnswerEntity.getEmployerQuestionAnswerId();
this.answer=employerQuestionAnswerEntity.getAnswer();
this.comment=employerQuestionAnswerEntity.getComment();
}
public Long getQuestionOrder() {
return questionOrder;
}
public void setQuestionOrder(Long questionOrder) {
this.questionOrder = questionOrder;
}
public String getQuestionType() {
return questionType;
}
public void setQuestionType(String questionType) {
this.questionType = questionType;
}
public String getIsRequired() {
return isRequired;
}
public void setIsRequired(String isRequired) {
this.isRequired = isRequired;
}
public String getIsCommentAllowed() {
return isCommentAllowed;
}
public void setIsCommentAllowed(String isCommentAllowed) {
this.isCommentAllowed = isCommentAllowed;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public String getHelpText() {
return helpText;
}
public void setHelpText(String helpText) {
this.helpText = helpText;
}
public Long getQuestionAnswerId() {
return questionAnswerId;
}
public void setQuestionAnswerId(Long questionAnswerId) {
this.questionAnswerId = questionAnswerId;
}
public String getAnswer() {
return answer;
}
public void setAnswer(String answer) {
this.answer = answer;
}
public String getComment() { return comment; }
public void setComment(String comment) { this.comment = comment; }
}