giteaCICD

This commit is contained in:
SpecialX
2025-05-27 11:58:36 +08:00
parent d36fef2bbb
commit 95daf9471b
9 changed files with 200 additions and 32 deletions

View File

@@ -35,17 +35,13 @@ namespace TechHelper.Client.Exam
public string Id { get; set; }
[JsonProperty("标题")]
[XmlAttribute("T")] // T for Title
[XmlElement("T")] // T for Title
public string Title { get; set; }
[JsonProperty("分值")]
[XmlAttribute("S")] // S for Score
public int Score { get; set; }
[JsonProperty("分值问题标记")]
[XmlAttribute("SPM")] // SPM for ScoreProblemMarker
public string ScoreProblemMarker { get; set; } = ""; // 初始化为空字符串,避免 null
[JsonProperty("题目引用")]
[XmlElement("QR")] // QR for QuestionReference作为 <QR> 元素
public string QuestionReference { get; set; } = ""; // 初始化为空字符串
@@ -69,26 +65,20 @@ namespace TechHelper.Client.Exam
public string SubId { get; set; }
[JsonProperty("题干")]
[XmlAttribute("T")] // T for Text (Stem)
[XmlElement("T")] // T for Text (Stem)
public string Stem { get; set; }
[JsonProperty("分值")]
[XmlAttribute("S")] // S for Score
public int Score { get; set; } // 分值通常为整数
[JsonProperty("分值问题标记")]
[XmlAttribute("SPM")] // SPM for ScoreProblemMarker
public string ScoreProblemMarker { get; set; } = "";
// 注意:这里的 Options 需要适配 XML 结构 <Os><O V="X"/></Os>
// 因此它不再是 List<string>,而是 List<Option>
[JsonProperty("选项")]
[XmlArray("Os")] // Os 包含 <O> 列表
[XmlArrayItem("O")]
public List<Option> Options { get; set; } = new List<Option>();
[JsonProperty("示例答案")]
[XmlAttribute("SA")] // SA for SampleAnswer
[XmlElement("SA")] // SA for SampleAnswer
public string SampleAnswer { get; set; } = "";
}

View File

@@ -0,0 +1,36 @@
using System.Xml.Serialization;
namespace TechHelper.Client.Exam.QuestionSimple
{
[XmlRoot("QG")]
public class QuestionGroup
{
[XmlElement("T")]
public string Title { get; set; }
[XmlElement("QR")]
public string QuestionReference { get; set; } = "";
[XmlArray("SQs")]
[XmlArrayItem("SQ")]
public List<SubQuestion> SubQuestions { get; set; } = new List<SubQuestion>();
[XmlArray("SQGs")]
[XmlArrayItem("QG")]
public List<QuestionGroup> SubQuestionGroups { get; set; } = new List<QuestionGroup>();
}
public class SubQuestion
{
[XmlElement("T")]
public string Stem { get; set; }
[XmlArray("Os")]
[XmlArrayItem("O")]
public List<Option> Options { get; set; } = new List<Option>();
[XmlElement("SA")]
public string SampleAnswer { get; set; } = "";
}
public class Option
{
[XmlAttribute("V")]
public string Value { get; set; }
}
}