public xml_reader_N5_question_instruction_ref ( |
||
N2 | ||
Результат |
//Essay分類,各分類特殊需求操作 public List<string> findkey(XmlNode N2) { string type = ""; string mainKey = "Nu11"; XmlNodeList N3D, N3I, N4IR, N4QI, N4DU, N5QIR; List<string> Key = new List<string>(); Essay_exam_reader xml_reader = new Essay_exam_reader(); N3D = xml_reader.xml_reader_N3_data(N2); N3I = xml_reader.xml_reader_N3_instruction(N2); //Analytics question if (N2.Attributes["minimal"].Value == "yes") { //type1,2 //Analytics instruction foreach (XmlNode N3 in N3I) { //set type if (N3.HasChildNodes) { //type1 type = "type-1"; Key.Add(type); N4IR = xml_reader.xml_reader_N4_instruction_ref(N2); foreach (XmlNode N4 in N4IR) { mainKey = N4.Attributes["target"].Value.Trim(); } } else { //type2 type = "type-2"; Key.Add(type); } //Analytics instruction by nlp String instruction = N3.InnerText; foreach (string k in nlp(instruction)) { Key.Add("#/" + k.Trim()); } } //Analytics data foreach (XmlNode N3 in N3D) { if (N3.Attributes["id"].Value.Trim() == mainKey) { //all main key String data = N3.InnerText; string[] datalist = data.Split(','); foreach (string d in datalist) { Key.Add("@/" + d.Trim()); } } else { //Analytics data by nlp foreach (string k in nlp(N3.InnerText)) { Key.Add("#/" + k.Trim()); } } } } else { //type3,4 //Analytics instruction foreach (XmlNode N3 in N3I) { //set type if (N3.HasChildNodes) { //type3 type = "type-3"; Key.Add(type); } else { //type4 type = "type-4"; Key.Add(type); } //Analytics instruction by nlp foreach (string k in nlp(N3.InnerText)) { Key.Add("#/" + k.Trim()); } } //Analytics data foreach (XmlNode N3 in N3D) { //Analytics data by nlp foreach (string k in nlp(N3.InnerText)) { Key.Add("#/" + k.Trim()); } } //Analytics question_instruction N4QI = xml_reader.xml_reader_N4_question_instruction(N2); N4DU = xml_reader.xml_reader_N4_data_utext(N2); N5QIR = xml_reader.xml_reader_N5_question_instruction_ref(N2); foreach (XmlNode N4 in N4QI) { //have ref target if (N5QIR != null) { foreach (XmlNode N5 in N5QIR) { try { string tager = N5.Attributes["target"].Value; foreach (XmlNode N4_5 in N4DU) { if (N4_5.Attributes["id"].Value == tager) { string[] w = N4_5.InnerText.Split(')'); Key.Add("@/" + w[1].Trim()); break; } } } catch (Exception e) { } } } //Analytics question_instruction by nlp foreach (string k in nlp(N4.InnerText)) { Key.Add("#/" + k.Trim()); } } } Key = delete_repeat_key(Key); return Key; }