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 ExamDto { public Guid? AssignmentId { 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 class QuestionGroupDto { public byte Index { get; set; } public string? Title { get; set; } public float Score { get; set; } public string? Descript { get; set; } public List SubQuestions { get; set; } = new List(); public List SubQuestionGroups { get; set; } = new List(); // 标记是否是一个具有上下文的单独问题 public bool ValidQuestionGroup { get; set; } = false; } public class SubQuestionDto { public byte Index { get; set; } public string? Stem { get; set; } public float Score { get; set; } public List Options { get; set; } = new List(); public string? SampleAnswer { get; set; } public string? QuestionType { get; set; } public string? DifficultyLevel { get; set; } // 标记是否是一个独立的问题 public bool ValidQuestion { get; set; } = false; } public class OptionDto { public string? Value { get; set; } = string.Empty; } public static class ExamDtoExtension { public static void Convert(this ExamDto examDto) { var qg = examDto.QuestionGroups; } public static void Convert(this QuestionGroupDto examDto) { if(examDto.ValidQuestionGroup) { } } } }