ChoiceQuestionVO.java 714 B

12345678910111213141516171819202122232425262728293031
  1. package nju.seec.helper.vo.question;
  2. import lombok.Data;
  3. import lombok.EqualsAndHashCode;
  4. import lombok.NonNull;
  5. import nju.seec.helper.sys.bok.vo.QuestionVO;
  6. /**
  7. * @author xst
  8. * <p>
  9. * updated by cst
  10. */
  11. @EqualsAndHashCode(callSuper = true)
  12. @Data
  13. public class ChoiceQuestionVO extends BaseQuestionVO {
  14. private String answer;
  15. public ChoiceQuestionVO(@NonNull QuestionVO questionVO, boolean withAnswer) {
  16. super(questionVO);
  17. if (withAnswer) {
  18. this.answer = questionVO.getAnswer();
  19. this.analysis = questionVO.getAnalysis();
  20. }
  21. }
  22. @Override
  23. public boolean pass(Object answer) {
  24. return this.answer.equals(String.valueOf(answer));
  25. }
  26. }