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.dto.QuestionAddDto;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * @author reghao
 * @date 2024-08-25 20:32:55
 */
@NoArgsConstructor
@Setter
@Getter
public class QuestionOption extends BaseObject<Integer> {
    private Long questionId;
    private Integer pos;
    private String content;
    private String analysis;
    private Boolean correct;

    public QuestionOption(long questionId, String content, int pos, boolean correct) {
        this.questionId = questionId;
        this.pos = pos;
        this.content = content;
        this.analysis = "";
        this.correct = correct;
    }

    public QuestionOption(int pos, QuestionAddDto.Option option) {
        this.pos = pos;
        this.content = option.getContent();
        this.analysis = option.getAnalysis();
        this.correct = option.getCorrect();
    }

    public void setQuestionId(long questionId) {
        this.questionId = questionId;
    }
}
