public static void GetProblemData(ProblemData pd) { string file = path + "problems.xml"; string data = GetStringFromXML(file); ProblemDataXMLLoader.ProblemDataXmlLoad(data, pd); foreach (string id in pd.pd.Keys) { DataManager.ita.AssociateAssessmentProblemWithSkill(pd.pd[id].tags, pd.pd[id].groupId, id, 0, 0, 0); } }
public static void ProblemDataXmlLoad(string data, ProblemData pd) { XmlDocument problemXmlDocument = new XmlDocument(); problemXmlDocument.LoadXml(data); foreach (XmlNode problemNode in problemXmlDocument.GetElementsByTagName("problem")) { string id = problemNode.Attributes.GetNamedItem("UID").InnerText; string tags = problemNode.Attributes.GetNamedItem("tags").InnerText; bool isChallenge = (problemNode.Attributes.GetNamedItem("isChallenge").InnerText == "true"); string groupId = problemNode.Attributes.GetNamedItem("GroupID").InnerText; string statement = problemNode.Attributes.GetNamedItem("statement").InnerText; pd.AddProblem(id, groupId, tags, isChallenge, statement); } }