using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Entities.Contracts { [Table("questions")] public class Question { [Key] [Column("id")] public Guid Id { get; set; } [Required] [Column("question_text")] [MaxLength(65535)] public string QuestionText { get; set; } [Required] [Column("question_type")] [MaxLength(20)] public QuestionType QuestionType { get; set; } [Column("correct_answer")] [MaxLength(65535)] public string CorrectAnswer { get; set; } [Column("difficulty_level")] [MaxLength(10)] public DifficultyLevel DifficultyLevel { get; set; } [Column("subject_area")] public SubjectAreaEnum SubjectArea { get; set; } [Required] [Column("created_by")] [ForeignKey("Creator")] public Guid CreatedBy { get; set; } [Column("created_at")] public DateTime CreatedAt { get; set; } [Column("updated_at")] public DateTime UpdatedAt { get; set; } [Column("deleted")] public bool IsDeleted { get; set; } [Column("valid_question")] public bool ValidQuestion { get; set; } // Navigation Properties public User Creator { get; set; } public ICollection AssignmentQuestions { get; set; } public Question() { Id = Guid.NewGuid(); AssignmentQuestions = new HashSet(); } } public enum DifficultyLevel { easy, medium, hard } public enum QuestionType { Unknown, // 可以有一个未知类型或作为默认 Spelling, // 拼写 Pronunciation, // 给带点字选择正确读音 WordFormation, // 组词 FillInTheBlanks, // 选词填空 / 补充词语 SentenceDictation, // 默写句子 SentenceRewriting, // 仿句 / 改写句子 ReadingComprehension, // 阅读理解 Composition // 作文 // ... 添加您其他题目类型 } public enum SubjectAreaEnum // 建议命名为 SubjectAreaEnum 以避免与属性名冲突 { Unknown, // 未知或默认 Mathematics, // 数学 Physics, // 物理 Chemistry, // 化学 Biology, // 生物 History, // 历史 Geography, // 地理 Literature, // 语文/文学 English, // 英语 ComputerScience, // 计算机科学 // ... 你可以根据需要添加更多科目 } }