package com.qmth.themis.business.cache.bean;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.themis.business.bean.admin.OpenRecordAnswerBean;
import com.qmth.themis.business.enums.FinishTypeEnum;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
 * @Description: 考试明细查看试卷bean
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2022/4/26
 */
public class ExamRecordPaperViewBean implements Serializable {

    @ApiModelProperty(value = "考试记录id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long examRecordId;

    @ApiModelProperty(value = "考生名称")
    private String examStudentName;

    @ApiModelProperty(value = "考生身份证")
    private String identity;

    @ApiModelProperty(value = "科目编码")
    private String courseCode;

    @ApiModelProperty(value = "科目名称")
    private String courseName;

    @ApiModelProperty(value = "考场编码")
    private String roomCode;

    @ApiModelProperty(value = "考场名称")
    private String roomName;

    @ApiModelProperty(value = "交卷方式")
    private FinishTypeEnum finishType;

    @ApiModelProperty(value = "交卷方式")
    private String finishTypeStr;

    @ApiModelProperty(value = "试卷结构json")
    private String paperStructJson;

    @ApiModelProperty(value = "标答json")
    private String answerJson;

    @ApiModelProperty(value = "答题记录json")
    private String examStudentAnswerJson;

    @ApiModelProperty(value = "乱序后的试卷结构json，没有则为null")
    private String randomPaperStructPath;

    @ApiModelProperty(value = "主观题分数明细")
    private String subjectiveScoreDetailJson;

    public ExamRecordPaperViewBean() {

    }

    public ExamRecordPaperViewBean(Long examRecordId,
                                   String examStudentName,
                                   String identity,
                                   String courseCode,
                                   String courseName,
                                   String roomCode,
                                   String roomName,
                                   FinishTypeEnum finishType,
                                   String paperStructJson,
                                   String answerJson,
                                   String examStudentAnswerJson,
                                   String randomPaperStructPath,
                                   String subjectiveScoreDetailJson) {
        this.examRecordId = examRecordId;
        this.examStudentName = examStudentName;
        this.identity = identity;
        this.courseCode = courseCode;
        this.courseName = courseName;
        this.roomCode = roomCode;
        this.roomName = roomName;
        this.finishType = finishType;
        this.paperStructJson = paperStructJson;
        this.answerJson = answerJson;
        this.examStudentAnswerJson = examStudentAnswerJson;
        this.randomPaperStructPath = randomPaperStructPath;
        this.subjectiveScoreDetailJson = subjectiveScoreDetailJson;
    }

    public String getSubjectiveScoreDetailJson() {
        return subjectiveScoreDetailJson;
    }

    public void setSubjectiveScoreDetailJson(String subjectiveScoreDetailJson) {
        this.subjectiveScoreDetailJson = subjectiveScoreDetailJson;
    }

    public String getRandomPaperStructPath() {
        return randomPaperStructPath;
    }

    public void setRandomPaperStructPath(String randomPaperStructPath) {
        this.randomPaperStructPath = randomPaperStructPath;
    }

    public String getPaperStructJson() {
        return paperStructJson;
    }

    public void setPaperStructJson(String paperStructJson) {
        this.paperStructJson = paperStructJson;
    }

    public String getAnswerJson() {
        return answerJson;
    }

    public void setAnswerJson(String answerJson) {
        this.answerJson = answerJson;
    }

    public String getExamStudentAnswerJson() {
        return examStudentAnswerJson;
    }

    public void setExamStudentAnswerJson(String examStudentAnswerJson) {
        this.examStudentAnswerJson = examStudentAnswerJson;
    }

    public String getFinishTypeStr() {
        if (Objects.nonNull(finishType)) {
            return finishType.getCode();
        } else {
            return finishTypeStr;
        }
    }

    public Long getExamRecordId() {
        return examRecordId;
    }

    public void setExamRecordId(Long examRecordId) {
        this.examRecordId = examRecordId;
    }

    public String getExamStudentName() {
        return examStudentName;
    }

    public void setExamStudentName(String examStudentName) {
        this.examStudentName = examStudentName;
    }

    public String getIdentity() {
        return identity;
    }

    public void setIdentity(String identity) {
        this.identity = identity;
    }

    public String getCourseCode() {
        return courseCode;
    }

    public void setCourseCode(String courseCode) {
        this.courseCode = courseCode;
    }

    public String getCourseName() {
        return courseName;
    }

    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }

    public String getRoomCode() {
        return roomCode;
    }

    public void setRoomCode(String roomCode) {
        this.roomCode = roomCode;
    }

    public String getRoomName() {
        return roomName;
    }

    public void setRoomName(String roomName) {
        this.roomName = roomName;
    }

    public FinishTypeEnum getFinishType() {
        return finishType;
    }

    public void setFinishType(FinishTypeEnum finishType) {
        this.finishType = finishType;
    }

    public void setFinishTypeStr(String finishTypeStr) {
        this.finishTypeStr = finishTypeStr;
    }
}
