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

import cn.reghao.tnb.content.app.exam.model.po.PaperQuestion;
import cn.reghao.tnb.content.app.exam.model.po.Question;
import cn.reghao.tnb.content.app.exam.model.po.QuestionOption;

import java.util.List;

/**
 * @author reghao
 * @date 2025-08-08 16:18:35
 */
public class PaperQuestionInfo {
    private int pos;
    private int type;
    private long questionId;
    private String questionContent;
    private List<QuestionOptionInfo> questionOptions;
    private int score;
    private List<PaperQuestionInfo> children;

    public PaperQuestionInfo(PaperQuestion paperQuestion, Question question) {
        this.pos = paperQuestion.getPos();
        this.type = question.getType();
        this.questionId = question.getQuestionId();
        this.questionContent = question.getContent();
        this.score = paperQuestion.getScore();
    }

    class QuestionOptionInfo {
        private Long questionId;
        private Integer pos;
        private String optionContent;
        private Boolean correct;

        public QuestionOptionInfo(QuestionOption questionOption) {
            this.questionId = questionOption.getQuestionId();
            this.pos = questionOption.getPos();
            this.optionContent = questionOption.getContent();
            this.correct = null;
        }
    }
}
