struct&&assiQues
This commit is contained in:
@@ -16,36 +16,43 @@ namespace Entities.Contracts
|
||||
public Guid Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("question_text")]
|
||||
[Column("title")]
|
||||
[MaxLength(65535)]
|
||||
public string QuestionText { get; set; }
|
||||
public string Title { get; set; }
|
||||
|
||||
[Column("answer")]
|
||||
[MaxLength(65535)]
|
||||
public string? Answer { get; set; }
|
||||
|
||||
[Column("description")]
|
||||
public Guid? DescriptionId { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("question_type")]
|
||||
[Column("type")]
|
||||
[MaxLength(20)]
|
||||
public QuestionType QuestionType { get; set; }
|
||||
|
||||
[Column("correct_answer")]
|
||||
[MaxLength(65535)]
|
||||
public string CorrectAnswer { get; set; }
|
||||
|
||||
[Column("question_group_id")]
|
||||
public Guid? QuestionGroupId { get; set; }
|
||||
public QuestionType Type { get; set; } = QuestionType.Unknown;
|
||||
|
||||
[Column("difficulty_level")]
|
||||
[MaxLength(10)]
|
||||
public DifficultyLevel DifficultyLevel { get; set; }
|
||||
public DifficultyLevel DifficultyLevel { get; set; } = DifficultyLevel.easy;
|
||||
|
||||
[Column("subject_area")]
|
||||
public SubjectAreaEnum SubjectArea { get; set; }
|
||||
public SubjectAreaEnum SubjectArea { get; set; } = SubjectAreaEnum.Unknown;
|
||||
|
||||
|
||||
[Column("options")]
|
||||
public string? Options { get; set; }
|
||||
|
||||
[Column("key_point")]
|
||||
public Guid? KeyPointId { get; set; }
|
||||
|
||||
[Column("lesson")]
|
||||
public Guid? LessonId { get; set; }
|
||||
|
||||
|
||||
[Required]
|
||||
[Column("created_by")]
|
||||
[ForeignKey("Creator")]
|
||||
public Guid CreatedBy { get; set; }
|
||||
public Guid CreatorId { get; set; }
|
||||
|
||||
[Column("created_at")]
|
||||
public DateTime CreatedAt { get; set; }
|
||||
@@ -56,54 +63,30 @@ namespace Entities.Contracts
|
||||
[Column("deleted")]
|
||||
public bool IsDeleted { get; set; }
|
||||
|
||||
[Column("valid_question")]
|
||||
public bool ValidQuestion { get; set; }
|
||||
|
||||
// Navigation Properties
|
||||
[ForeignKey(nameof(CreatorId))]
|
||||
public User Creator { get; set; }
|
||||
public QuestionGroup QuestionGroup { get; set; }
|
||||
public ICollection<AssignmentQuestion> AssignmentQuestions { get; set; }
|
||||
|
||||
[ForeignKey(nameof(DescriptionId))]
|
||||
public QuestionContext Description { get; set; }
|
||||
public Question? ParentQuestion { get; set; }
|
||||
public ICollection<Question>? ChildrenQuestion { get; set; }
|
||||
|
||||
[ForeignKey(nameof(KeyPointId))]
|
||||
public KeyPoint? KeyPoint { get; set; }
|
||||
[ForeignKey(nameof(LessonId))]
|
||||
public Lesson? Lesson { get; set; }
|
||||
|
||||
public ICollection<AssignmentQuestion>? AssignmentQuestions { get; set; }
|
||||
|
||||
public Question()
|
||||
{
|
||||
Id = Guid.NewGuid();
|
||||
AssignmentQuestions = new HashSet<AssignmentQuestion>();
|
||||
ChildrenQuestion = new HashSet<Question>();
|
||||
}
|
||||
}
|
||||
|
||||
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, // 计算机科学
|
||||
// ... 你可以根据需要添加更多科目
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user