exam_service

This commit is contained in:
SpecialX
2025-06-11 15:02:20 +08:00
parent 97843ab5fd
commit e26881ec2f
52 changed files with 3510 additions and 1174 deletions

View File

@@ -15,10 +15,9 @@ namespace Entities.Contracts
[Column("id")]
public Guid Id { get; set; }
[Required]
[Column("assignment")]
[ForeignKey("Assignment")]
public Guid AssignmentId { get; set; }
public Guid? AssignmentId { get; set; }
[Required]
[Column("title")]
@@ -31,7 +30,7 @@ namespace Entities.Contracts
[Column("total_points")]
public decimal? TotalPoints { get; set; }
public float? TotalPoints { get; set; }
[Column("number")]
public byte Number { get; set; }
@@ -42,9 +41,12 @@ namespace Entities.Contracts
[Column("deleted")]
public bool IsDeleted { get; set; }
[Column("valid_question_group")]
public bool ValidQuestionGroup { get; set; }
// Navigation Properties
public Assignment Assignment { get; set; }
public AssignmentGroup ParentAssignmentGroup { get; set;}
public Assignment? Assignment { get; set; }
public AssignmentGroup? ParentAssignmentGroup { get; set;}
public ICollection<AssignmentGroup> ChildAssignmentGroups { get; set; }
public ICollection<AssignmentQuestion> AssignmentQuestions { get; set; }

View File

@@ -21,21 +21,23 @@ namespace Entities.Contracts
[ForeignKey("Question")]
public Guid QuestionId { get; set; }
[Required]
[Column("group_id")]
[ForeignKey("AssignmentGroup")]
public Guid AssignmentGroupId { get; set; }
[Required]
[Column("question_number")]
public byte QuestionNumber { get; set; }
[Column("created_at")]
public DateTime CreatedAt { get; set; }
[Column("score")]
public float? Score { get; set; }
[Required]
[Column("detail_id")]
[ForeignKey("AssignmentGroup")]
public Guid AssignmentGroupId { get; set; }
[Column("deleted")]
public bool IsDeleted { get; set; }

View File

@@ -50,6 +50,9 @@ namespace Entities.Contracts
[Column("deleted")]
public bool IsDeleted { get; set; }
[Column("valid_question")]
public bool ValidQuestion { get; set; }
// Navigation Properties
public User Creator { get; set; }
public ICollection<AssignmentQuestion> AssignmentQuestions { get; set; }