1
This commit is contained in:
@@ -56,6 +56,7 @@ namespace TechHelper.Client.Exam
|
||||
public string Description { get; set; } = string.Empty;
|
||||
public byte Index { get; set; } = 0;
|
||||
public float Score { get; set; }
|
||||
public string Sequence { get; set; } = string.Empty;
|
||||
public QuestionEx? Question { get; set; }
|
||||
public AssignmentStructType Type { get; set; }
|
||||
public List<AssignmentQuestionEx> ChildrenAssignmentQuestion { get; set; } = new List<AssignmentQuestionEx>();
|
||||
@@ -344,6 +345,8 @@ namespace TechHelper.Client.Exam
|
||||
assignmentQuestionStack.Pop();
|
||||
}
|
||||
|
||||
string sequence = assignmentQuestionStack.Count > 0 ? assignmentQuestionStack.Peek().Sequence : string.Empty;
|
||||
|
||||
// 验证捕获组:Group 1 是编号,Group 2 是题目内容
|
||||
if (pm.RegexMatch.Groups.Count < 3 || !pm.RegexMatch.Groups[1].Success || string.IsNullOrWhiteSpace(pm.RegexMatch.Groups[2].Value))
|
||||
{
|
||||
@@ -372,6 +375,8 @@ namespace TechHelper.Client.Exam
|
||||
// 提取标题,这里使用 Group 2 的值,它不包含分数
|
||||
string title = pm.RegexMatch.Groups[2].Value.Trim();
|
||||
|
||||
string seq = pm.RegexMatch.Groups[1].Value.Trim();
|
||||
seq = string.IsNullOrEmpty(seq) || string.IsNullOrEmpty(sequence) ? seq : " ." + seq;
|
||||
|
||||
AssignmentQuestionEx newAssignmentQuestion;
|
||||
if (pm.PatternConfig.Type == AssignmentStructType.Struct)
|
||||
@@ -380,6 +385,7 @@ namespace TechHelper.Client.Exam
|
||||
{
|
||||
Title = title,
|
||||
Score = score,
|
||||
Sequence = sequence + seq,
|
||||
Priority = pm.PatternConfig.Priority,
|
||||
Type = pm.PatternConfig.Type
|
||||
};
|
||||
@@ -390,6 +396,7 @@ namespace TechHelper.Client.Exam
|
||||
{
|
||||
Priority = pm.PatternConfig.Priority,
|
||||
Type = pm.PatternConfig.Type,
|
||||
Sequence = sequence + seq,
|
||||
Score = score,
|
||||
Question = new QuestionEx
|
||||
{
|
||||
|
Reference in New Issue
Block a user