using System.ComponentModel;
using Hotline.Exams.Base;
using Hotline.Share.Enums.Exams;
using SqlSugar;

namespace Hotline.Exams.ExamManages
{
    /// <summary>
    /// 考试管理
    /// </summary>
    [Description("考试管理")]
    public class ExamManage:ExamBusinessEntity
    {
        /// <summary>
        /// 考试标题
        /// </summary>
        [SugarColumn(ColumnDescription ="考试标题")]
        [Description("考试标题")]
        public string Name { get; set; }

        /// <summary>
        /// 考试编号
        /// </summary>
        [SugarColumn(ColumnDescription ="考试编号")]
        [Description("考试编号")]
        public string Code { get; set; }

        /// <summary>
        /// 考试类型
        /// </summary>
        [SugarColumn(ColumnDescription ="考试类型")]
        [Description("考试类型")]
        public EExamType ExamType { get; set; }

        /// <summary>
        /// 考核方式
        /// </summary>
        [SugarColumn(ColumnDescription = "考试类型")]
        [Description("考核方式")]
        public EMethod Method { get; set; }

        /// <summary>
        /// 组卷方式
        /// </summary>
        [SugarColumn(ColumnDescription = "组卷方式")]
        [Description("组卷方式")]
        public EMethod Mode { get; set; }

        /// <summary>
        /// 试卷Id
        /// </summary>
        [SugarColumn(ColumnDescription ="试卷Id")]
        [Description("试卷Id")]
        public string TestPaperId { get; set; }

        /// <summary>
        /// 抽题规则Id
        /// </summary>
        [SugarColumn(ColumnDescription = "抽题规则Id")]
        [Description("抽题规则Id")]
        public string? ExtractRuleId { get; set; }

        /// <summary>
        /// 可考次数
        /// </summary>
        [SugarColumn(ColumnDescription ="可考次数")]
        [Description("可考次数")]
        public int Count { get; set; }

        /// <summary>
        /// 考试时长
        /// </summary>
        [SugarColumn(ColumnDescription = "考试时长")]
        [Description("考试时长")]
        public int TimeSpan { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        [SugarColumn(ColumnDescription ="开始时间")]
        [Description("开始时间")]
        public DateTime StartTime { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        [SugarColumn(ColumnDescription ="结束时间")]
        [Description("结束时间")]
        public DateTime EndTime { get; set; }

        /// <summary>
        /// 试题顺序
        /// </summary>
        [SugarColumn(ColumnDescription ="试题顺序")]
        [Description("试题顺序")]
        public int QuestionSort { get; set; }

        /// <summary>
        /// 选项顺序
        /// </summary>
        [SugarColumn(ColumnDescription ="选项顺序")]
        [Description("选项顺序")]
        public int OptionSort { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(ColumnDescription ="备注")]
        [Description("备注")]
        public string Remark { get; set; }

        /// <summary>
        /// 分数线
        /// </summary>
        [SugarColumn(ColumnDescription ="分数线")]
        [Description("分数线")]
        public int CutoffScore { get; set; }

        /// <summary>
        /// 总分
        /// </summary>
        [SugarColumn(ColumnDescription = "总分")]
        [Description("总分")]
        public int TotalScore { get; set; }

        /// <summary>
        /// 考试状态
        /// </summary>
        [SugarColumn(ColumnDescription = "考试状态")]
        [Description("考试状态")]
        public EExamStatus ExamStatus { get; set; }

        [Navigate(NavigateType.OneToMany,nameof(ExamQuestionScoreBak.ExamManageId))]
        public List<ExamQuestionScoreBak> ExamQuestionScores { get; set; }

        [Navigate(NavigateType.OneToMany,nameof(ExamUserExam.ExamId))]
        public List<ExamUserExam> UserExams { get; set; }
    }
}
