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

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

import java.util.List;

/**
 * @author reghao
 * @date 2024-08-25 17:42:04
 */
public class QuestionDetail {
    private long questionId;
    private String subject;
    private int type;
    private String typeStr;
    private String level;
    private String content;
    private String analysis;
    private List<QuestionOptionDetail> options;
    private List<QuestionDetail> children;

    public QuestionDetail(Question question, String subject, String type, String level, List<QuestionOptionDetail> options) {
        this.questionId = question.getQuestionId();
        this.subject = subject;
        this.type = question.getType();
        this.typeStr = type;
        this.level = level;
        this.content = question.getContent();
        this.analysis = question.getAnalysis().isBlank() ? "无" : question.getAnalysis();
        this.options = options;
    }

    public void setChildren(List<QuestionDetail> children) {
        this.children = children;
    }
}
