package com.ruoyi.system.domain.paper.dto.response;


import com.ruoyi.system.domain.paper.dto.PaperDTO;
import com.ruoyi.system.domain.paper.dto.PaperQuDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Calendar;
import java.util.List;

/**
 * @author 13560
 */
@Data
@ApiModel(value="考试详情", description="考试详情")
public class ExamDetailRespDTO extends PaperDTO {


    @ApiModelProperty(value = "单选题列表")
    private List<PaperQuDTO> radioList;

    @ApiModelProperty(value = "多选题列表")
    private List<PaperQuDTO> multiList;

    @ApiModelProperty(value = "判断题")
    private List<PaperQuDTO> judgeList;


    @ApiModelProperty(value = "剩余结束秒数")
    public Long getLeftSeconds(){

        // 结束时间
        Calendar cl = Calendar.getInstance();
        cl.setTime(this.getCreateTime());
        cl.add(Calendar.MINUTE, getTotalTime());

        return (cl.getTimeInMillis() - System.currentTimeMillis()) / 1000;
    }

}
