重构项目结构,移除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:
18
Entities/DTO/Exam/AssigExamToStudentsDto.cs
Normal file
18
Entities/DTO/Exam/AssigExamToStudentsDto.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Entities.DTO
|
||||
{
|
||||
public class AssigExamToStudentsDto
|
||||
{
|
||||
public Guid CreaterId { get; set; }
|
||||
public Guid ExamId { get; set; }
|
||||
public Guid ClassId { get; set; }
|
||||
public List<Guid> StudentIds { get; set; } = new List<Guid>();
|
||||
}
|
||||
|
||||
public record AssigExamToClassDto(Guid examId, Guid classId);
|
||||
}
|
||||
23
Entities/DTO/Exam/AssignmentClassDto.cs
Normal file
23
Entities/DTO/Exam/AssignmentClassDto.cs
Normal 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 ExamDto Assignment { get; set; }
|
||||
public ClassDto ClassId { get; set; }
|
||||
public DateTime AssignedAt { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
35
Entities/DTO/Exam/CreateExamDto.cs
Normal file
35
Entities/DTO/Exam/CreateExamDto.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Entities.DTO
|
||||
{
|
||||
public class CreateExamDto
|
||||
{
|
||||
[Required(ErrorMessage = "考试标题是必填项。")]
|
||||
[StringLength(255, ErrorMessage = "考试标题不能超过 255 个字符。")]
|
||||
public string Title { get; set; }
|
||||
|
||||
public string Description { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "科目ID是必填项。")]
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "考试结构ID是必填项。")]
|
||||
public Guid ExamStructId { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "考试类型ID是必填项。")]
|
||||
public Guid ExamTypeId { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "创建者ID是必填项。")]
|
||||
public Guid CreatorId { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "截止日期是必填项。")]
|
||||
public DateTime DueDate { get; set; }
|
||||
|
||||
public byte TotalQuestions { get; set; }
|
||||
|
||||
public float Score { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
||||
44
Entities/DTO/Exam/ExamDto.cs
Normal file
44
Entities/DTO/Exam/ExamDto.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using Entities.Contracts;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Entities.DTO
|
||||
{
|
||||
public class ExamDto
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
|
||||
[Required(ErrorMessage = "考试标题是必填项。")]
|
||||
[StringLength(255, ErrorMessage = "考试标题不能超过 255 个字符。")]
|
||||
public string Title { get; set; }
|
||||
|
||||
public string Description { get; set; }
|
||||
|
||||
public byte TotalQuestions { get; set; }
|
||||
|
||||
public float Score { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[Required(ErrorMessage = "截止日期是必填项。")]
|
||||
public DateTime DueDate { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
public Guid ExamTypeId { get; set; }
|
||||
|
||||
public Guid CreatorId { get; set; }
|
||||
|
||||
//public Guid ExamStructId { get; set; }
|
||||
|
||||
|
||||
public ExamQuestionDto ExamStruct { get; set; } = new ExamQuestionDto();
|
||||
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
}
|
||||
}
|
||||
10
Entities/DTO/Exam/ExamListDto.cs
Normal file
10
Entities/DTO/Exam/ExamListDto.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Entities.DTO
|
||||
{
|
||||
public record ExamListDto(Guid Id, string Name);
|
||||
}
|
||||
33
Entities/DTO/Exam/ExamQuestionDto.cs
Normal file
33
Entities/DTO/Exam/ExamQuestionDto.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Entities.Contracts;
|
||||
|
||||
namespace Entities.DTO
|
||||
{
|
||||
public class ExamQuestionDto
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
|
||||
public string Title { get; set; } = string.Empty;
|
||||
|
||||
public float Score { get; set; } = 0;
|
||||
|
||||
public byte Index { get; set; } = 0;
|
||||
|
||||
public string Sequence { get; set; } = string.Empty;
|
||||
|
||||
|
||||
public Guid QuestionTypeId { get; set; }
|
||||
|
||||
//public Guid? QuestionId { get; set; }
|
||||
|
||||
//public Guid? ParentExamQuestionId { get; set; }
|
||||
|
||||
public QuestionDto? Question { get; set; }
|
||||
|
||||
//public ExamQuestionDto? ParentExamQuestion { get; set; }
|
||||
|
||||
public ICollection<ExamQuestionDto> ChildExamQuestions { get; set; } = new List<ExamQuestionDto>();
|
||||
|
||||
// public Layout Layout { get; set; } = Layout.horizontal;
|
||||
// public QuestionContextDto? Description { get; set; }
|
||||
}
|
||||
}
|
||||
34
Entities/DTO/Exam/ExamResponseDto.cs
Normal file
34
Entities/DTO/Exam/ExamResponseDto.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Entities.DTO
|
||||
{
|
||||
public class ExamResponseDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string Description { get; set; }
|
||||
public Guid SubjectId { get; set; }
|
||||
public string SubjectName { get; set; }
|
||||
public Guid ExamStructId { get; set; }
|
||||
public string ExamStructName { get; set; }
|
||||
public Guid ExamTypeId { get; set; }
|
||||
public string ExamTypeName { get; set; }
|
||||
public Guid CreatorId { get; set; }
|
||||
public string CreatorName { get; set; }
|
||||
public DateTime DueDate { get; set; }
|
||||
public byte TotalQuestions { get; set; }
|
||||
public float Score { get; set; }
|
||||
public string Name { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
public bool IsDeleted { get; set; }
|
||||
|
||||
// Navigation properties for response
|
||||
public int AttachmentCount { get; set; }
|
||||
public int SubmissionCount { get; set; }
|
||||
public List<string> AttachmentNames { get; set; } = new List<string>();
|
||||
public List<string> StudentNames { get; set; } = new List<string>();
|
||||
public List<DateTime> SubmissionTimes { get; set; } = new List<DateTime>();
|
||||
}
|
||||
}
|
||||
38
Entities/DTO/Exam/UpdateExamDto.cs
Normal file
38
Entities/DTO/Exam/UpdateExamDto.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Entities.DTO
|
||||
{
|
||||
public class UpdateExamDto
|
||||
{
|
||||
[Required(ErrorMessage = "考试ID是必填项。")]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "考试标题是必填项。")]
|
||||
[StringLength(255, ErrorMessage = "考试标题不能超过 255 个字符。")]
|
||||
public string Title { get; set; }
|
||||
|
||||
public string Description { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "科目ID是必填项。")]
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "考试结构ID是必填项。")]
|
||||
public Guid ExamStructId { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "考试类型ID是必填项。")]
|
||||
public Guid ExamTypeId { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "创建者ID是必填项。")]
|
||||
public Guid CreatorId { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "截止日期是必填项。")]
|
||||
public DateTime DueDate { get; set; }
|
||||
|
||||
public byte TotalQuestions { get; set; }
|
||||
|
||||
public float Score { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user