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

import cn.reghao.jutil.jdk.web.db.BaseObject;
import cn.reghao.tnb.common.auth.UserContext;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @author reghao
 * @date 2024-08-28 15:20:08
 */
@NoArgsConstructor
@Getter
public class PaperResult extends BaseObject<Integer> {
    private Integer paperId;
    private Integer objectiveScore;
    private Integer subjectiveScore;
    private Integer userScore;
    private LocalDateTime examTime;
    private Integer consumedTime;
    private Long createBy;
    private Boolean marked;

    public PaperResult(int paperId, int objectiveScore, boolean marked) {
        this.paperId = paperId;
        this.objectiveScore = objectiveScore;
        this.subjectiveScore = 0;
        this.userScore = this.objectiveScore + this.subjectiveScore;
        this.examTime = LocalDateTime.now();
        this.consumedTime = 0;
        this.createBy = UserContext.getUserId();
        this.marked = marked;
    }
}
