struct&&assiQues

This commit is contained in:
SpecialX
2025-06-20 15:37:39 +08:00
parent f37262d72e
commit d20c051c51
68 changed files with 1927 additions and 2869 deletions

View File

@@ -0,0 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Entities.DTO
{
}

View File

@@ -0,0 +1,25 @@
using Entities.Contracts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Entities.DTO
{
public class AssignmentQuestionDto
{
public float Score { get; set; } = 0;
public byte Index { get; set; } = 0;
public QuestionGroupState GroupState { get; set; } = QuestionGroupState.Standalone;
public AssignmentQuestionDto? ParentAssignmentQuestion { get; set; }
public ICollection<AssignmentQuestionDto> ChildrenAssignmentQuestion { get; set; } = new List<AssignmentQuestionDto>();
public QuestionDto Question { 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;
@@ -7,36 +8,88 @@ using System.Xml.Serialization;
namespace Entities.DTO
{
public class AssignmentStructDto
{
public Guid Id { get; set; } = Guid.Empty;
public string Title { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public float Score { get; set; } = 0;
public byte Index { get; set; } = 0;
public Layout Layout { get; set; } = Layout.horizontal;
public ICollection<AssignmentQuestionDto> AssignmentQuestions { get; set; } = new List<AssignmentQuestionDto>();
public AssignmentStructDto? ParentStruct { get; set; }
public ICollection<AssignmentStructDto> ChildrenGroups { get; set; } = new List<AssignmentStructDto>();
}
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 AssignmentStructDto ExamStruct { get; set; } = new AssignmentStructDto();
}
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 ExamDto
{
public Guid? AssignmentId { get; set; }
public string CreaterEmail { get; set; }
public string CreaterEmail { get; set; }
public string AssignmentTitle { get; set; } = string.Empty;
public string Description { get; set; }
public string SubjectArea { get; set; }
public QuestionGroupDto QuestionGroups { get; set; } = new QuestionGroupDto();
public QuestionGroupDto ExamStruct { get; set; } = new QuestionGroupDto();
}
public class QuestionGroupDto
{
public byte Index { get; set; }
public byte Index { get; set; }
public string? Title { get; set; }
public float Score { get; set; }
public string? Descript { get; set; }
public string? Descript { get; set; }
public List<SubQuestionDto> SubQuestions { get; set; } = new List<SubQuestionDto>();
public List<QuestionGroupDto> SubQuestionGroups { get; set; } = new List<QuestionGroupDto>();
// 标记是否是一个具有上下文的单独问题
public bool ValidQuestionGroup { get; set; } = false;
}
public class SubQuestionDto
{
public byte Index { get; set; }
public byte Index { get; set; }
public string? Stem { get; set; }
@@ -44,12 +97,11 @@ namespace Entities.DTO
public List<OptionDto> Options { get; set; } = new List<OptionDto>();
public string? SampleAnswer { get; set; }
public string? SampleAnswer { get; set; }
public string? QuestionType { get; set; }
public string? QuestionType { get; set; }
public string? DifficultyLevel { get; set; }
// 标记是否是一个独立的问题
public bool ValidQuestion { get; set; } = false;
}
@@ -64,13 +116,13 @@ namespace Entities.DTO
{
public static void Convert(this ExamDto examDto)
{
var qg = examDto.QuestionGroups;
var qg = examDto.ExamStruct;
}
public static void Convert(this QuestionGroupDto examDto)
{
if(examDto.ValidQuestionGroup)
if (examDto.ValidQuestionGroup)
{
}

View File

@@ -0,0 +1,41 @@
using Entities.Contracts;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Entities.DTO
{
public class QuestionDto
{
public Guid Id { get; set; } = Guid.Empty;
public string Title { get; set; } = string.Empty;
public QuestionContextDto? Description { get; set; }
public QuestionType Type { get; set; } = QuestionType.Unknown;
public string? Answer { get; set; } = string.Empty;
public string? Options { get; set; }
public DifficultyLevel DifficultyLevel { get; set; } = DifficultyLevel.easy;
public SubjectAreaEnum SubjectArea { get; set; } = SubjectAreaEnum.Unknown;
public Guid CreatorId { get; set; }
public Guid? KeyPointId { get; set; }
public Guid? LessonId { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime UpdatedAt { get; set; } = DateTime.Now;
}
}