148 lines
3.5 KiB
Java
148 lines
3.5 KiB
Java
package com.example.questionbank.service.dto;
|
|
|
|
import com.example.questionbank.domain.enumeration.OptionKey;
|
|
import jakarta.validation.constraints.*;
|
|
import java.io.Serializable;
|
|
import java.util.Objects;
|
|
|
|
/**
|
|
* A DTO for the {@link com.example.questionbank.domain.ExamAnswer} entity.
|
|
*/
|
|
@SuppressWarnings("common-java:DuplicatedBlocks")
|
|
public class ExamAnswerDTO implements Serializable {
|
|
|
|
private Long id;
|
|
|
|
@NotNull
|
|
@Size(max = 2000)
|
|
private String questionTextSnapshot;
|
|
|
|
@Size(max = 2000)
|
|
private String explanationSnapshot;
|
|
|
|
private OptionKey selectedOption;
|
|
|
|
@Size(max = 500)
|
|
private String selectedContentSnapshot;
|
|
|
|
private Boolean correct;
|
|
|
|
@Min(value = 0)
|
|
private Integer awardedPoints;
|
|
|
|
@NotNull
|
|
private QuestionDTO question;
|
|
|
|
@NotNull
|
|
private ExamAttemptDTO attempt;
|
|
|
|
public Long getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(Long id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public String getQuestionTextSnapshot() {
|
|
return questionTextSnapshot;
|
|
}
|
|
|
|
public void setQuestionTextSnapshot(String questionTextSnapshot) {
|
|
this.questionTextSnapshot = questionTextSnapshot;
|
|
}
|
|
|
|
public String getExplanationSnapshot() {
|
|
return explanationSnapshot;
|
|
}
|
|
|
|
public void setExplanationSnapshot(String explanationSnapshot) {
|
|
this.explanationSnapshot = explanationSnapshot;
|
|
}
|
|
|
|
public OptionKey getSelectedOption() {
|
|
return selectedOption;
|
|
}
|
|
|
|
public void setSelectedOption(OptionKey selectedOption) {
|
|
this.selectedOption = selectedOption;
|
|
}
|
|
|
|
public String getSelectedContentSnapshot() {
|
|
return selectedContentSnapshot;
|
|
}
|
|
|
|
public void setSelectedContentSnapshot(String selectedContentSnapshot) {
|
|
this.selectedContentSnapshot = selectedContentSnapshot;
|
|
}
|
|
|
|
public Boolean getCorrect() {
|
|
return correct;
|
|
}
|
|
|
|
public void setCorrect(Boolean correct) {
|
|
this.correct = correct;
|
|
}
|
|
|
|
public Integer getAwardedPoints() {
|
|
return awardedPoints;
|
|
}
|
|
|
|
public void setAwardedPoints(Integer awardedPoints) {
|
|
this.awardedPoints = awardedPoints;
|
|
}
|
|
|
|
public QuestionDTO getQuestion() {
|
|
return question;
|
|
}
|
|
|
|
public void setQuestion(QuestionDTO question) {
|
|
this.question = question;
|
|
}
|
|
|
|
public ExamAttemptDTO getAttempt() {
|
|
return attempt;
|
|
}
|
|
|
|
public void setAttempt(ExamAttemptDTO attempt) {
|
|
this.attempt = attempt;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
if (this == o) {
|
|
return true;
|
|
}
|
|
if (!(o instanceof ExamAnswerDTO)) {
|
|
return false;
|
|
}
|
|
|
|
ExamAnswerDTO examAnswerDTO = (ExamAnswerDTO) o;
|
|
if (this.id == null) {
|
|
return false;
|
|
}
|
|
return Objects.equals(this.id, examAnswerDTO.id);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(this.id);
|
|
}
|
|
|
|
// prettier-ignore
|
|
@Override
|
|
public String toString() {
|
|
return "ExamAnswerDTO{" +
|
|
"id=" + getId() +
|
|
", questionTextSnapshot='" + getQuestionTextSnapshot() + "'" +
|
|
", explanationSnapshot='" + getExplanationSnapshot() + "'" +
|
|
", selectedOption='" + getSelectedOption() + "'" +
|
|
", selectedContentSnapshot='" + getSelectedContentSnapshot() + "'" +
|
|
", correct='" + getCorrect() + "'" +
|
|
", awardedPoints=" + getAwardedPoints() +
|
|
", question=" + getQuestion() +
|
|
", attempt=" + getAttempt() +
|
|
"}";
|
|
}
|
|
}
|