重构项目结构,移除Assignment相关功能,优化Submission模块
Some checks failed
TechAct / explore-gitea-actions (push) Failing after 12s
Some checks failed
TechAct / explore-gitea-actions (push) Failing after 12s
This commit is contained in:
@@ -17,18 +17,30 @@ namespace Entities.Contracts
|
||||
public Guid Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("assignment_id")]
|
||||
[ForeignKey("Assignment")]
|
||||
public Guid AssignmentId { get; set; }
|
||||
[Column("exam_id")]
|
||||
public Guid ExamId { get; set; }
|
||||
[ForeignKey(nameof(ExamId))]
|
||||
public virtual Exam Exam { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("student_id")]
|
||||
[ForeignKey("Student")]
|
||||
public Guid StudentId { get; set; }
|
||||
[ForeignKey(nameof(StudentId))]
|
||||
public virtual User Student { get; set; }
|
||||
|
||||
[Column("graded_by")]
|
||||
public Guid? GraderId { get; set; }
|
||||
[ForeignKey(nameof(GraderId))]
|
||||
public virtual User Grader { get; set; }
|
||||
|
||||
[Column("class_id")]
|
||||
public Guid ClassId { get; set; }
|
||||
[ForeignKey(nameof(ClassId))]
|
||||
public virtual Class Class { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("attempt_number")]
|
||||
public byte AttemptNumber { get; set; }
|
||||
public byte AttemptNumber { get; set; } // 第几次提交
|
||||
|
||||
[Column("submission_time")]
|
||||
public DateTime SubmissionTime { get; set; }
|
||||
@@ -39,31 +51,36 @@ namespace Entities.Contracts
|
||||
[Column("overall_feedback")]
|
||||
public string? OverallFeedback { get; set; }
|
||||
|
||||
[Column("graded_by")]
|
||||
[ForeignKey("Grader")]
|
||||
public Guid? GraderId { get; set; }
|
||||
|
||||
[Column("graded_at")]
|
||||
public DateTime? GradedAt { get; set; }
|
||||
|
||||
[Column("deleted")]
|
||||
public bool IsDeleted { get; set; }
|
||||
|
||||
public byte TotalQuesNum { get; set; }
|
||||
|
||||
public byte ErrorQuesNum { get; set; }
|
||||
|
||||
public byte TotalScore { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("status")]
|
||||
public SubmissionStatus Status { get; set; }
|
||||
|
||||
[Column("deleted")]
|
||||
public bool IsDeleted { get; set; }
|
||||
// Navigation Properties
|
||||
public Assignment Assignment { get; set; }
|
||||
public User Student { get; set; }
|
||||
public User Grader { get; set; }
|
||||
public ICollection<SubmissionDetail> SubmissionDetails { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public int ErrorCount => SubmissionDetails.Where(sd => sd?.IsCorrect == false && sd.IsCorrect != null).Count();
|
||||
|
||||
[NotMapped]
|
||||
public Dictionary<string, int> ErrorQuestionTypeDistribution => SubmissionDetails
|
||||
.Where(sd => sd?.IsCorrect == false)
|
||||
.GroupBy(sd => sd.ExamQuestion.Type.Name)
|
||||
.ToDictionary(g => g.Key, g => g.Count());
|
||||
|
||||
[NotMapped]
|
||||
public Dictionary<string, int> ErrorQuestionLessonDistribution => SubmissionDetails
|
||||
.Where(sd => sd?.IsCorrect == false && sd.ExamQuestion.Question?.Lesson != null)
|
||||
.GroupBy(sd => sd.ExamQuestion.Question.Lesson.Title)
|
||||
.ToDictionary(g => g.Key, g => g.Count());
|
||||
|
||||
|
||||
|
||||
[InverseProperty(nameof(SubmissionDetail.Submission))]
|
||||
public virtual ICollection<SubmissionDetail> SubmissionDetails { get; set; }
|
||||
|
||||
public Submission()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user