This commit is contained in:
SpecialX
2025-06-27 19:03:10 +08:00
parent 14fbe6397a
commit a21ca80782
57 changed files with 3872 additions and 611 deletions

View File

@@ -76,4 +76,15 @@ namespace Entities.Contracts
Option
}
public enum SubmissionStatus
{
Pending, // 待提交/未开始
Submitted, // 已提交
Graded, // 已批改
Resubmission, // 待重新提交 (如果允许)
Late, // 迟交
Draft, // 草稿
}
}

View File

@@ -31,6 +31,9 @@ namespace Entities.Contracts
[Column("question_number")]
public byte Index { get; set; }
[Column("sequence")]
public string Sequence { get; set; } = string.Empty;
[Column("parent_question_group_id")]
public Guid? ParentAssignmentQuestionId { get; set; }

View File

@@ -37,7 +37,7 @@ namespace Entities.Contracts
public float? OverallGrade { get; set; }
[Column("overall_feedback")]
public string OverallFeedback { get; set; }
public string? OverallFeedback { get; set; }
[Column("graded_by")]
[ForeignKey("Grader")]
@@ -66,13 +66,4 @@ namespace Entities.Contracts
}
}
public enum SubmissionStatus
{
Pending, // 待提交/未开始
Submitted, // 已提交
Graded, // 已批改
Resubmission, // 待重新提交 (如果允许)
Late, // 迟交
Draft, // 草稿
}
}

View File

@@ -31,16 +31,16 @@ namespace Entities.Contracts
public Guid AssignmentQuestionId { get; set; }
[Column("student_answer")]
public string StudentAnswer { get; set; }
public string? StudentAnswer { get; set; }
[Column("is_correct")]
public bool? IsCorrect { get; set; }
[Column("points_awarded")]
public float? PointsAwarded { get; set; }
public float? PointsAwarded { get; set; } // score
[Column("teacher_feedback")]
public string TeacherFeedback { get; set; }
public string? TeacherFeedback { get; set; }
[Column("created_at")]
public DateTime CreatedAt { get; set; }
@@ -54,8 +54,10 @@ namespace Entities.Contracts
[ForeignKey(nameof(StudentId))]
public User Student { get; set; }
[ForeignKey(nameof(SubmissionId))]
public Submission Submission { get; set; }
[ForeignKey(nameof(AssignmentQuestionId))]
public AssignmentQuestion AssignmentQuestion { get; set; }
public SubmissionDetail()

View File

@@ -0,0 +1,23 @@
using Entities.Contracts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
namespace Entities.DTO
{
public class AssignmentClassDto
{
public AssignmentDto Assignment { get; set; }
public Class ClassId { get; set; }
public DateTime AssignedAt { get; set; }
}
}

View File

@@ -1,4 +1,5 @@
using System;
using Entities.Contracts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -6,4 +7,20 @@ using System.Threading.Tasks;
namespace Entities.DTO
{
public class AssignmentDto
{
public Guid Id { get; set; } = Guid.Empty;
public string Title { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public byte TotalQuestions { get; set; }
public float Score { get; set; } = 0;
public SubjectAreaEnum SubjectArea { get; set; } = SubjectAreaEnum.Unknown;
public DateTime CreatedAt { get; set; }
public DateTime UpdatedAt { get; set; }
public DateTime DueDate { get; set; }
public Guid CreatorId { get; set; }
public AssignmentQuestionDto ExamStruct { get; set; } = new AssignmentQuestionDto();
}
}

View File

@@ -15,6 +15,7 @@ namespace Entities.DTO
public byte Index { get; set; } = 0;
public float Score { get; set; } = 0;
public string Sequence { get; set; } = string.Empty;
public Layout Layout { get; set; } = Layout.horizontal;
public AssignmentStructType StructType { get; set; } = AssignmentStructType.Question;
@@ -24,4 +25,6 @@ namespace Entities.DTO
public QuestionDto? Question { get; set; }
}
}

View File

@@ -1,46 +0,0 @@
using Entities.Contracts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
namespace Entities.DTO
{
public class AssignmentDto
{
public Guid Id { get; set; } = Guid.Empty;
public string Title { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public byte TotalQuestions { get; set; }
public float Score { get; set; } = 0;
public SubjectAreaEnum SubjectArea { get; set; } = SubjectAreaEnum.Unknown;
public DateTime CreatedAt { get; set; }
public DateTime UpdatedAt { get; set; }
public DateTime DueDate { get; set; }
public Guid CreatorId { get; set; }
public AssignmentQuestionDto ExamStruct { get; set; } = new AssignmentQuestionDto();
}
public class AssignmentClassDto
{
public AssignmentDto Assignment { get; set; }
public Class ClassId { get; set; }
public DateTime AssignedAt { get; set; }
}
public class QuestionContextDto
{
public Guid Id { get; set; } = Guid.Empty;
public string Description { get; set; } = string.Empty;
}
public class OptionDto
{
public string? Value { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Entities.DTO
{
public class QuestionContextDto
{
public Guid Id { get; set; } = Guid.Empty;
public string Description { get; set; } = string.Empty;
}
}

View File

@@ -36,4 +36,13 @@ namespace Entities.DTO
public DateTime UpdatedAt { get; set; } = DateTime.Now;
}
/// <summary>
/// Can be removed because the class isn't used
/// </summary>
public class OptionDto
{
public string? Value { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,20 @@
using Entities.Contracts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Entities.DTO
{
public class StudentDto
{
public Guid Id { get; set; }
public string? DisplayName { get; set; }
public UInt32 ErrorQuestionNum { get; set; }
public Dictionary<QuestionType, UInt32> ErrorQuestionTypes { get; set; } = new Dictionary<QuestionType, UInt32>();
public Dictionary<SubjectAreaEnum, UInt32> SubjectAreaErrorQuestionDis { get; set; } = new Dictionary<SubjectAreaEnum, UInt32>();
public Dictionary<byte, UInt32> LessonErrorDis { get; set; } = new Dictionary<byte, UInt32>();
}
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Entities.DTO
{
public class SubmissionDetailDto
{
public Guid Id { get; set; } = Guid.Empty;
public Guid StudentId { get; set; }
public Guid AssignmentQuestionId { get; set; }
public string? StudentAnswer { get; set; }
public bool? IsCorrect { get; set; }
public float? PointsAwarded { get; set; }
public string? TeacherFeedback { get; set; }
}
}

View File

@@ -0,0 +1,23 @@
using Entities.Contracts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Entities.DTO
{
public class SubmissionDto
{
public Guid Id { get; set; } = Guid.Empty;
public Guid AssignmentId { get; set; }
public Guid StudentId { get; set; }
public DateTime SubmissionTime { get; set; }
public float OverallGrade { get; set; } = 0;
public string OverallFeedback { get; set; } = string.Empty;
public Guid? GraderId { get; set; }
public DateTime? GradedAt { get; set; }
public SubmissionStatus Status { get; set; }
public List<SubmissionDetailDto> SubmissionDetails { get; set; } = new List<SubmissionDetailDto>();
}
}

15
Entities/DTO/UserDto.cs Normal file
View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Entities.DTO
{
public class UserDto
{
public Guid Id { get; set; }
public string? DisplayName { get; set; }
}
}