using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Abp.Domain.Entities;
using YGNT.QuestionLibrary.Core.Disciplines;
using YGNT.QuestionLibrary.Core.Questions;

namespace YGNT.QuestionLibrary.Core.Papers
{
    /// <summary>
    /// 试题题目
    /// </summary>
    public class PaperQuestion : Entity<long>
    {
        /// <summary>
        /// 试题Id
        /// </summary>
        [Required]
        public long QuestionId { get; set; }

        /// <summary>
        /// 细分题型Id
        /// </summary>
        [Required]
        public int DisciplineQuestionTypeId { get; set; }

        /// <summary>
        /// 试卷id
        /// </summary>
        [Required]
        public int PaperId { get; set; }

        /// <summary>
        /// 题型排序
        /// </summary>
        [Required]
        public int QuestionTypeSort { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public int Sort { get; set; }

        /// <summary>
        /// 单独分值
        /// </summary>
        [Required]
        public float SingleScore { get; set; }

        /// <summary>
        /// 试卷
        /// </summary>
        [ForeignKey(nameof(PaperId))]
        [Required]
        public Paper Paper { get; set; }

        /// <summary>
        /// 细分试题类型
        /// </summary>
        [Required]
        [ForeignKey(nameof(DisciplineQuestionTypeId))]
        public DisciplineQuestionType DisciplineQuestionType { get; set; }

        /// <summary>
        /// 试题
        /// </summary>
        [Required]
        [ForeignKey(nameof(QuestionId))]
        public Question Question { get; set; }


    }
}