重构试卷相关内容

This commit is contained in:
SpecialX
2025-06-13 19:01:32 +08:00
parent b77ed0b30f
commit bcf351ff25
23 changed files with 980 additions and 84 deletions

View File

@@ -16,10 +16,12 @@ namespace Entities.Contracts
[Column("id")]
public Guid Id { get; set; }
[Required]
[Column("question_id")]
[ForeignKey("Question")]
public Guid QuestionId { get; set; }
public Guid? QuestionId { get; set; } // 设为可空
// 当 IsGroup 为 true 时,此为 QuestionGroup 的外键
[Column("question_group_id")] // 新增一个外键列
public Guid? QuestionGroupId { get; set; } // 设为可空
[Required]
[Column("group_id")]
@@ -38,11 +40,16 @@ namespace Entities.Contracts
[Column("score")]
public float? Score { get; set; }
[Required]
[Column("bgroup")]
public bool IsGroup { get; set; }
[Column("deleted")]
public bool IsDeleted { get; set; }
public Question Question { get; set; }
public QuestionGroup QuestionGroup { get; set; }
public ICollection<SubmissionDetail> SubmissionDetails { get; set; }
public AssignmentGroup AssignmentGroup { get; set; }