using Exam.Infrastructure.Data.Entity;
using Exam.Infrastructure.Data.Interface;
using Exam.Infrastructure.Enums;
using Exam.Infrastructure.Extensions;
using Hotline.Share.Dtos.Questions;
using Hotline.Share.Enums.Exams;
using Hotline.Share.Exams.Interface;
using System.ComponentModel;
using System.Runtime.CompilerServices;

namespace Hotline.Share.Dtos.Trains
{
    /// <summary>
    /// 培训习题
    /// </summary>
    [Description("培训习题")]
    public class TrainPracticeDto : SimpleTrainPracticeDto
    {
        // <summary>
        /// 关联课件
        /// </summary>
        [Description("关联课件")]
        public new List<TrainPracticeSourcewareDto> TrainPracticeSourcewareDtos { get; set; }

        /// <summary>
        /// 关联知识
        /// </summary>
        [Description("关联知识")]
        public new List<TrainPracticeKnowladgeDto> TrainPracticeKnowladgeDtos { get; set; }
    }

    /// <summary>
    /// 培训习题
    /// </summary>
    [Description("培训习题")]
    public class SimpleTrainPracticeDto : UpdateTrainPracticeDto
    {
        /// <summary>
        /// 题型
        /// </summary>
        [Description("题型")]
        public string QuestionTypeDesc
        {
            get
            {
                return QuestionType.GetDescription();
            }
        }

        /// <summary>
        /// 难度
        /// </summary>
        [Description("难度")]
        public string DifficultyLevelDesc
        {
            get
            {
                return DifficultyLevel.GetDescription();
            }
        }


        /// <summary>
        /// 培训习题选项
        /// </summary>
        [Description("培训习题选项")]
        public List<SimpleTrainPracticeOptionsDto> TrainPracticeOptionsDtos { get; set; }


        /// <summary>
        /// 答案
        /// </summary>
        public AddTrainRecordAnswerDto? AddTrainRecordAnswerDto { get; set; }
    }

    public class AddTrainPracticeDto : IAddRequest, IOperationStatus
    {
        /// <summary>
        /// 培训模版Id
        /// </summary>
        [Description("培训模版Id")]
        public string TrainTemplateId { get; set; }

        /// <summary>
        /// 试题Id
        /// </summary>
        [Description("试题Id")]
        public string QuestionId { get; set; }


        /// <summary>
        /// 题干
        /// </summary>
        [Description("题干")]
        public string Title { get; set; }

        /// <summary>
        /// 题型
        /// </summary>
        [Description("题型")]
        public EQuestionType QuestionType { get; set; }

        /// <summary>
        /// 难易程度
        /// </summary>
        [Description("难易程度")]
        public EDifficultyLevel DifficultyLevel { get; set; }

        /// <summary>
        /// 操作状态
        /// </summary>
        [Description("操作状态")]
        public EEOperationStatus OperationStatus { get; set; }



        // <summary>
        /// 关联课件
        /// </summary>
        [Description("关联课件")]
        public List<AddTrainPracticeSourcewareDto> TrainPracticeSourcewareDtos { get; set; }

        /// <summary>
        /// 关联知识
        /// </summary>
        [Description("关联知识")]
        public List<AddTrainPracticeKnowladgeDto> TrainPracticeKnowladgeDtos { get; set; }
    }

    public class UpdateTrainPracticeDto : AddTrainPracticeDto, IActionRequest
    {
        /// <summary>
        /// 主键
        /// </summary>
        [Description("主键")]
        public string Id { get; set; }

        // <summary>
        /// 关联课件
        /// </summary>
        [Description("关联课件")]
        public new List<UpdateTrainPracticeSourcewareDto> TrainPracticeSourcewareDtos { get; set; }

        /// <summary>
        /// 关联知识
        /// </summary>
        [Description("关联知识")]
        public new List<UpdateTrainPracticeKnowladgeDto> TrainPracticeKnowladgeDtos { get; set; }
    }
}
