package nju.seec.helper.vo.question; import cn.hutool.core.convert.Convert; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NonNull; import nju.seec.helper.enums.QuestionType; /** * @author xst *

* updated by cst */ @EqualsAndHashCode(callSuper = true) @Data public class TrueOrFalseQuestionVO extends BaseQuestionVO { private Boolean answer; private String analysis; @Override public boolean pass(Object answer) { return this.answer.equals(Convert.toBool(answer)); } public TrueOrFalseQuestionVO(@NonNull BokQuestionVO bokQuestionVO, boolean withAnswer) { super(bokQuestionVO); this.type = QuestionType.TRUE_FALSE; if (withAnswer) { this.answer = Boolean.valueOf(bokQuestionVO.getAnswer()); this.analysis = bokQuestionVO.getAnalysis(); } } }