1
This commit is contained in:
@@ -28,6 +28,8 @@ namespace Entities.DTO
|
|||||||
public string? Descript { get; set; }
|
public string? Descript { get; set; }
|
||||||
public List<SubQuestionDto> SubQuestions { get; set; } = new List<SubQuestionDto>();
|
public List<SubQuestionDto> SubQuestions { get; set; } = new List<SubQuestionDto>();
|
||||||
public List<QuestionGroupDto> SubQuestionGroups { get; set; } = new List<QuestionGroupDto>();
|
public List<QuestionGroupDto> SubQuestionGroups { get; set; } = new List<QuestionGroupDto>();
|
||||||
|
|
||||||
|
// 标记是否是一个具有上下文的单独问题
|
||||||
public bool ValidQuestionGroup { get; set; } = false;
|
public bool ValidQuestionGroup { get; set; } = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,12 +48,34 @@ namespace Entities.DTO
|
|||||||
|
|
||||||
public string? QuestionType { get; set; }
|
public string? QuestionType { get; set; }
|
||||||
public string? DifficultyLevel { get; set; }
|
public string? DifficultyLevel { get; set; }
|
||||||
|
|
||||||
|
// 标记是否是一个独立的问题
|
||||||
public bool ValidQuestion { get; set; } = false;
|
public bool ValidQuestion { get; set; } = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class OptionDto
|
public class OptionDto
|
||||||
{
|
{
|
||||||
public string Value { get; set; }
|
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)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -82,6 +82,12 @@ namespace TechHelper.Context
|
|||||||
CreateMap<SubQuestionDto, AssignmentQuestion>()
|
CreateMap<SubQuestionDto, AssignmentQuestion>()
|
||||||
.ForMember(dest => dest.Question, opt => opt.MapFrom(src => src)); // 映射到嵌套的 Question 对象
|
.ForMember(dest => dest.Question, opt => opt.MapFrom(src => src)); // 映射到嵌套的 Question 对象
|
||||||
|
|
||||||
|
CreateMap<QuestionGroupDto, QuestionGroup>()
|
||||||
|
.ForMember(dest => dest.ChildQuestionGroups, opt => opt.MapFrom(src => src.SubQuestionGroups))
|
||||||
|
.ForMember(dest => dest.Title, opt => opt.MapFrom(src => src.Title))
|
||||||
|
.ForMember(dest => dest.Description, opt => opt.MapFrom(src => src.Descript));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CreateMap<Assignment, ExamDto>();
|
CreateMap<Assignment, ExamDto>();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user