package cn.reghao.tnb.content.app.exam.model.po;

import cn.reghao.jutil.jdk.web.db.BaseObject;
import cn.reghao.tnb.content.app.exam.model.vo.QuestionAnswer;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * 用户提交的答案
 *
 * @author reghao
 * @date 2024-09-02 09:37:46
 */
@NoArgsConstructor
@Setter
@Getter
public class PaperAnswer extends BaseObject<Integer> {
    private Integer resultId;
    private Integer pos;
    private Long pid;
    private Long questionId;
    private Integer questionType;
    private String answer;
    private Boolean correct;
    private Integer score;
    private String review;

    public PaperAnswer(QuestionAnswer userAnswer) {
        this.pos = userAnswer.getPos();
        this.pid = userAnswer.getPid();
        this.questionId = userAnswer.getQuestionId();
        this.questionType = userAnswer.getQuestionType();
    }

    public void setResultId(Integer resultId) {
        this.resultId = resultId;
    }

    public void setCorrect(Boolean correct) {
        this.correct = correct;
    }

    public void setScore(Integer score) {
        this.score = score;
    }
}
