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

import cn.reghao.jutil.jdk.converter.DateTimeConverter;
import cn.reghao.tnb.content.app.exam.model.po.Paper;

/**
 * @author reghao
 * @date 2024-08-28 09:02:59
 */
public class PaperView {
    private Integer paperId;
    private String paperName;
    private String subject;
    private Integer markType;
    private Integer scope;
    private String passcode;
    private Integer duration;
    private String startTime;
    private Integer totalScore;
    private Boolean expired;

    public PaperView(String subject, Paper paper, boolean expired) {
        this.subject = subject;
        this.paperId = paper.getId();
        this.paperName = paper.getName();
        this.markType = paper.getMarkType();
        this.scope = paper.getScope();
        this.passcode = paper.getPasscode();
        this.duration = paper.getDuration();
        this.startTime = paper.getStartTime() != null ? DateTimeConverter.format(paper.getStartTime()) : "Anytime";
        this.totalScore = paper.getTotalScore();
        this.expired = expired;
    }
}
