public void g_three_2Generate(NuGenEQML control1, string number) { this.xmlDocument.Load("GapfillingXML/g_three_2.xml"); foreach (XmlNode node in this.xmlDocument.FirstChild.ChildNodes) { int num = 0; int num2 = 0; int num3 = 0; int num4 = 0; int num5 = 0; int num6 = 0; int num7 = 0; int num8 = 0; int num9 = 0; int num10 = 0; int num11 = 0; int num12 = 0; int num13 = 0; int num14 = 0; int num15 = 0; if (StudentModel.isReGeneration) { num = 1; num2 = this.numberTools.myRandom(5); num3 = this.numberTools.myRandom(5); num4 = this.numberTools.myRandom(5); num5 = 6; num6 = this.numberTools.myRandom(5); num7 = this.numberTools.myRandom(5); num8 = this.numberTools.myRandom(5); num9 = this.numberTools.myRandom(3); num10 = this.numberTools.myRandom(3); num11 = this.random.Next(0, 2); num12 = (num9 * num) + (num10 * num5); num13 = (num9 * num2) + (num10 * num6); num14 = ((num9 * num3) + (num10 * num7)) + num11; num15 = ((num9 * num4) + (num10 * num8)) + num11; string str = SupportTools.getGuid(); string path = "temp/generate/g_three_2.xml"; FileStream w = new FileStream(path, FileMode.Create); XmlTextWriter writer = new XmlTextWriter(w, Encoding.UTF8) { Formatting = Formatting.Indented }; writer.WriteStartDocument(); writer.WriteStartElement("Info"); writer.WriteAttributeString("save", "false"); writer.WriteAttributeString("guid", str); writer.WriteStartElement("Params"); writer.WriteElementString("a11", num.ToString()); writer.WriteElementString("a12", num2.ToString()); writer.WriteElementString("a13", num3.ToString()); writer.WriteElementString("a14", num4.ToString()); writer.WriteElementString("a21", num5.ToString()); writer.WriteElementString("a22", num6.ToString()); writer.WriteElementString("a23", num7.ToString()); writer.WriteElementString("a24", num8.ToString()); writer.WriteElementString("a31", num12.ToString()); writer.WriteElementString("a32", num13.ToString()); writer.WriteElementString("a33", num14.ToString()); writer.WriteElementString("a34", num15.ToString()); writer.WriteEndElement(); writer.WriteStartElement("Answer"); if (num11 == 1) { writer.WriteElementString("D", "3"); } else { writer.WriteElementString("D", "2"); } writer.WriteEndElement(); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); writer.Close(); } else { XmlDocument xmldoc = new XmlDocument(); xmldoc.Load("temp/generate/g_three_2.xml"); XmlNode node2 = SupportTools.ParamsXmlNode(xmldoc); foreach (XmlNode node3 in node2.ChildNodes) { if (node3.Name.Equals("a11")) { num = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a12")) { num2 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a13")) { num3 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a14")) { num4 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a21")) { num5 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a22")) { num6 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a23")) { num7 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a24")) { num8 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a31")) { num12 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a32")) { num13 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a33")) { num14 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a34")) { num15 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("k1")) { num9 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("k2")) { num10 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("d")) { num11 = int.Parse(node3.InnerText); } } } string sXML = node.InnerText.Replace("#x#", number).Replace("#a#", num.ToString()).Replace("#b#", num2.ToString()).Replace("#c#", num3.ToString()).Replace("#d#", num4.ToString()).Replace("#e#", num5.ToString()).Replace("#f#", num6.ToString()).Replace("#g#", num7.ToString()).Replace("#h#", num8.ToString()).Replace("#i#", num12.ToString()).Replace("#j#", num13.ToString()).Replace("#k#", num14.ToString()).Replace("#l#", num15.ToString()); control1.Size = new Size(350, 0x4b); control1.Enabled = false; control1.pub_LoadXML(sXML); control1.Anchor = AnchorStyles.None; } }
public void g_seven_2Generate(NuGenEQML control0, TableLayoutPanel tableLayoutPanel, List <TextBox> list, string number) { this.xmlDocument.Load("GapfillingXML/g_seven_2.xml"); foreach (XmlNode node in this.xmlDocument.FirstChild.ChildNodes) { int num = 0; int num2 = 0; int num3 = 0; int num4 = 0; int num5 = 0; int num6 = 0; if (StudentModel.isReGeneration) { num = this.numberTools.myRandom(6); num2 = this.numberTools.myRandom(6); num3 = this.numberTools.myRandom(6); num4 = this.numberTools.myRandom(6); num5 = this.numberTools.myRandom(6); num6 = this.numberTools.myRandom(6); string str = SupportTools.getGuid(); string path = "temp/generate/g_seven_2.xml"; FileStream w = new FileStream(path, FileMode.Create); XmlTextWriter writer = new XmlTextWriter(w, Encoding.UTF8) { Formatting = Formatting.Indented }; writer.WriteStartDocument(); writer.WriteStartElement("Info"); writer.WriteAttributeString("save", "false"); writer.WriteAttributeString("guid", str); writer.WriteStartElement("Params"); writer.WriteElementString("a1", num.ToString()); writer.WriteElementString("a2", num2.ToString()); writer.WriteElementString("a3", num3.ToString()); writer.WriteElementString("a", num4.ToString()); writer.WriteElementString("b", num5.ToString()); writer.WriteElementString("c", num6.ToString()); writer.WriteEndElement(); int num7 = ((num - (num4 * num2)) + ((num4 * num6) * num3)) - (num5 * num3); int num8 = num2 - (num6 * num3); int num9 = num3; writer.WriteStartElement("Answer"); writer.WriteElementString("b11", num7.ToString()); writer.WriteElementString("b12", num8.ToString()); writer.WriteElementString("b13", num9.ToString()); writer.WriteEndElement(); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); writer.Close(); } else { XmlDocument xmldoc = new XmlDocument(); xmldoc.Load("temp/generate/g_seven_2.xml"); XmlNode node2 = SupportTools.ParamsXmlNode(xmldoc); foreach (XmlNode node3 in node2.ChildNodes) { if (node3.Name.Equals("a")) { num4 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("b")) { num5 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("c")) { num6 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a1")) { num = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a2")) { num2 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a3")) { num3 = int.Parse(node3.InnerText); } } } string sXML = node.InnerText.Replace("#x#", number).Replace("#a#", num.ToString()).Replace("#b#", num2.ToString()).Replace("#c#", num3.ToString()).Replace("#ba#", num4.ToString()).Replace("#ca#", num5.ToString()).Replace("#cb#", num6.ToString()); control0.pub_LoadXML(sXML); control0.Size = new Size(600, 90); control0.Enabled = false; control0.Anchor = AnchorStyles.None; new InitControls().matrixOneToThree(tableLayoutPanel, list); } }
public void C6Generate(NuGenEQML control, string number) { this.xmldocument.Load("CalculationXML/c6.xml"); foreach (XmlNode node in this.xmldocument.FirstChild.ChildNodes) { string innerText = null; string str2 = null; string str3 = null; string str4 = null; string str5 = null; string str6 = null; string str7 = null; string str8 = null; string str9 = null; string str10 = null; string str11 = null; int i = 0; int num2 = 0; int num3 = 0; int num4 = 0; int num5 = 0; int num6 = 0; int num7 = 0; int num8 = 0; int num9 = 0; int num10 = 0; int num11 = 0; if (StudentModel.isReGeneration) { i = this.numberTools.myRandom(9); innerText = ((i == 1) || (i == -1)) ? this.numberTools.compare(i).Replace("+", "").Replace("1", "") : this.numberTools.compare(i).Replace("+", ""); num2 = this.numberTools.myRandom(9); str2 = ((num2 == 1) || (num2 == -1)) ? this.numberTools.compare(num2).Replace("1", "") : this.numberTools.compare(num2); num3 = this.numberTools.myRandom(9); str3 = ((num3 == 1) || (num3 == -1)) ? this.numberTools.compare(num3).Replace("1", "") : this.numberTools.compare(num3); num4 = this.numberTools.myRandom(9); str4 = ((num4 == 1) || (num4 == -1)) ? this.numberTools.compare(num4).Replace("+", "").Replace("1", "") : this.numberTools.compare(num4).Replace("+", ""); num5 = this.numberTools.myRandom(9); str5 = ((num5 == 1) || (num5 == -1)) ? this.numberTools.compare(num5).Replace("1", "") : this.numberTools.compare(num5); num6 = this.numberTools.myRandom(9); str6 = ((num6 == 1) || (num6 == -1)) ? this.numberTools.compare(num6).Replace("1", "") : this.numberTools.compare(num6); num7 = this.numberTools.myRandom(9); str7 = ((num7 == 1) || (num7 == -1)) ? this.numberTools.compare(num7).Replace("1", "") : this.numberTools.compare(num7); num8 = this.numberTools.myRandom(9); str8 = ((num8 == 1) || (num8 == -1)) ? this.numberTools.compare(num8).Replace("+", "").Replace("1", "") : this.numberTools.compare(num8).Replace("+", ""); num9 = this.numberTools.myRandom(9); str9 = ((num9 == 1) || (num9 == -1)) ? this.numberTools.compare(num9).Replace("1", "") : this.numberTools.compare(num9); num10 = this.numberTools.myRandom(9); str10 = ((num10 == 1) || (num10 == -1)) ? this.numberTools.compare(num10).Replace("1", "") : this.numberTools.compare(num10); num11 = this.numberTools.myRandom(9); str11 = ((num11 == 1) || (num11 == -1)) ? this.numberTools.compare(num11).Replace("1", "") : this.numberTools.compare(num11); string str12 = SupportTools.getGuid(); string path = "temp/generate/c6.xml"; FileStream w = new FileStream(path, FileMode.Create); XmlTextWriter writer = new XmlTextWriter(w, Encoding.UTF8) { Formatting = Formatting.Indented }; writer.WriteStartDocument(); writer.WriteStartElement("Info"); writer.WriteAttributeString("save", "false"); writer.WriteAttributeString("guid", str12); writer.WriteStartElement("Params"); writer.WriteElementString("k1 ", innerText); writer.WriteElementString("k2 ", str2); writer.WriteElementString("k3 ", str3); writer.WriteElementString("c1 ", str4); writer.WriteElementString("c2 ", str5); writer.WriteElementString("c3 ", str6); writer.WriteElementString("c4", str7); writer.WriteElementString("d1", str8); writer.WriteElementString("d2", str9); writer.WriteElementString("d3", str10); writer.WriteElementString("d4", str11); writer.WriteEndElement(); writer.WriteStartElement("Answer"); writer.WriteElementString("k1 ", i.ToString()); writer.WriteElementString("k2 ", num2.ToString()); writer.WriteElementString("k3 ", num3.ToString()); writer.WriteElementString("c1 ", num4.ToString()); writer.WriteElementString("c2 ", num5.ToString()); writer.WriteElementString("c3 ", num6.ToString()); writer.WriteElementString("c4", num7.ToString()); writer.WriteElementString("d1 ", num8.ToString()); writer.WriteElementString("d2 ", num9.ToString()); writer.WriteElementString("d3 ", num10.ToString()); writer.WriteElementString("d4", num11.ToString()); writer.WriteEndElement(); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); writer.Close(); } else { XmlDocument xmldoc = new XmlDocument(); xmldoc.Load("temp/generate/c6.xml"); XmlNode node2 = SupportTools.ParamsXmlNode(xmldoc); foreach (XmlNode node3 in node2.ChildNodes) { if (node3.Name.Equals("k1")) { innerText = node3.InnerText; } else if (node3.Name.Equals("k2")) { str2 = node3.InnerText; } else if (node3.Name.Equals("k3")) { str3 = node3.InnerText; } else if (node3.Name.Equals("c1")) { str4 = node3.InnerText; } else if (node3.Name.Equals("c2")) { str5 = node3.InnerText; } else if (node3.Name.Equals("c3")) { str6 = node3.InnerText; } else if (node3.Name.Equals("c4")) { str7 = node3.InnerText; } else if (node3.Name.Equals("d1")) { str8 = node3.InnerText; } else if (node3.Name.Equals("d2")) { str9 = node3.InnerText; } else if (node3.Name.Equals("d3")) { str10 = node3.InnerText; } else if (node3.Name.Equals("d4")) { str11 = node3.InnerText; } } } string sXML = node.InnerText.Replace("#x#", number).Replace("#m#", innerText).Replace("#n#", str2).Replace("#o#", str3).Replace("#p#", str4).Replace("#q#", str5).Replace("#r#", str6).Replace("#s#", str7).Replace("#t#", str8).Replace("#u#", str9).Replace("#v#", str10).Replace("#w#", str7).Replace("#y#", str11); control.Size = new Size(0x640, 70); control.Enabled = false; control.pub_LoadXML(sXML); } }
public void C7Generate(NuGenEQML control, string number) { this.xmldocument.Load("CalculationXML/c7.xml"); foreach (XmlNode node in this.xmldocument.FirstChild.ChildNodes) { int num21; int num = 0; int num2 = 0; int num3 = 0; int num4 = 0; int num5 = 0; int num6 = 0; int num7 = 0; int num8 = 0; int num9 = 0; int num10 = 0; int num11 = 0; int num12 = 0; int num13 = 0; int num14 = 0; int num15 = 0; int num16 = 0; int num17 = 0; int num18 = 0; int num19 = 0; int num20 = 0; if (StudentModel.isReGeneration) { num = this.numberTools.myRandom(4); num2 = this.numberTools.myRandom(4); num3 = this.numberTools.myRandom(4); num4 = this.numberTools.myRandom(6); num5 = this.numberTools.myRandom(6); num6 = this.numberTools.myRandom(6); num7 = this.numberTools.myRandom(6); if (((num4 * num7) - (num5 * num6)) == 0) { num4 = -1 * num4; } num8 = (num4 * num7) - (num5 * num6); num9 = this.numberTools.myRandom(9); num10 = this.numberTools.myRandom(9); num11 = this.numberTools.myRandom(9); num12 = this.numberTools.myRandom(9); num13 = this.numberTools.myRandom(9); num14 = this.numberTools.myRandom(9); num15 = ((num9 + (num * num11)) * num4) + ((num10 + (num * num12)) * num6); num16 = ((num9 + (num * num11)) * num5) + ((num10 + (num * num12)) * num7); num17 = ((num11 + (num2 * num13)) * num4) + ((num12 + (num2 * num14)) * num6); num18 = ((num11 + (num2 * num13)) * num5) + ((num12 + (num2 * num14)) * num7); num19 = ((((num3 * num9) + ((num * num3) * num11)) + num13) * num4) + ((((num3 * num10) + ((num * num3) * num12)) + num14) * num6); num20 = ((((num3 * num9) + ((num * num3) * num11)) + num13) * num5) + ((((num3 * num10) + ((num * num3) * num12)) + num14) * num7); string str = SupportTools.getGuid(); string path = "temp/generate/c7.xml"; FileStream w = new FileStream(path, FileMode.Create); XmlTextWriter writer = new XmlTextWriter(w, Encoding.UTF8) { Formatting = Formatting.Indented }; writer.WriteStartDocument(); writer.WriteStartElement("Info"); writer.WriteAttributeString("save", "false"); writer.WriteAttributeString("guid", str); writer.WriteStartElement("Params"); writer.WriteElementString("a1 ", num.ToString()); writer.WriteElementString("a2 ", num2.ToString()); writer.WriteElementString("a3 ", num3.ToString()); writer.WriteElementString("b11 ", num4.ToString()); writer.WriteElementString("b12 ", num5.ToString()); writer.WriteElementString("b21 ", num6.ToString()); writer.WriteElementString("b22 ", num7.ToString()); writer.WriteElementString("x11", num9.ToString()); writer.WriteElementString("x12", num10.ToString()); writer.WriteElementString("x21", num11.ToString()); writer.WriteElementString("x22", num12.ToString()); writer.WriteElementString("x31", num13.ToString()); writer.WriteElementString("x32", num14.ToString()); writer.WriteElementString("c11", num15.ToString()); writer.WriteElementString("c12", num16.ToString()); writer.WriteElementString("c21", num17.ToString()); writer.WriteElementString("c22", num18.ToString()); writer.WriteElementString("c31", num19.ToString()); writer.WriteElementString("c32", num20.ToString()); writer.WriteEndElement(); writer.WriteStartElement("Answer"); num21 = 1 - ((num * num2) * num3); writer.WriteElementString("d11", num21.ToString()); num21 = -1 * num; writer.WriteElementString("d12", num21.ToString()); num21 = num * num2; writer.WriteElementString("d13", num21.ToString()); num21 = num2 * num3; writer.WriteElementString("d14", num21.ToString()); num21 = 1; writer.WriteElementString("d15", num21.ToString()); num21 = -1 * num2; writer.WriteElementString("d16", num21.ToString()); num21 = -1 * num3; writer.WriteElementString("d17", num21.ToString()); num21 = 0; writer.WriteElementString("d18", num21.ToString()); num21 = 1; writer.WriteElementString("d19", num21.ToString()); writer.WriteElementString("d20", SupportTools.DoubleFormat((1.0 * num7) / ((double)num8)).ToString()); writer.WriteElementString("d21", SupportTools.DoubleFormat((-num5 * 1.0) / ((double)num8)).ToString()); writer.WriteElementString("d22", SupportTools.DoubleFormat((-num6 * 1.0) / ((double)num8)).ToString()); writer.WriteElementString("d23", SupportTools.DoubleFormat((num4 * 1.0) / ((double)num8)).ToString()); writer.WriteElementString("d24", num9.ToString()); writer.WriteElementString("d25", num10.ToString()); writer.WriteElementString("d26", num11.ToString()); writer.WriteElementString("d27", num12.ToString()); writer.WriteElementString("d28", num13.ToString()); writer.WriteElementString("d29", num14.ToString()); writer.WriteEndElement(); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); writer.Close(); } else { XmlDocument xmldoc = new XmlDocument(); xmldoc.Load("temp/generate/c7.xml"); XmlNode node2 = SupportTools.ParamsXmlNode(xmldoc); foreach (XmlNode node3 in node2.ChildNodes) { if (node3.Name.Equals("a1")) { num = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a2")) { num2 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a3")) { num3 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("b11")) { num4 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("b12")) { num5 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("b21")) { num6 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("b22")) { num7 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("c11")) { num15 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("c12")) { num16 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("c21")) { num17 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("c22")) { num18 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("c31")) { num19 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("c32")) { num20 = int.Parse(node3.InnerText); } } } num21 = num * num3; string sXML = node.InnerText.Replace("#x#", number).Replace("#k#", num.ToString()).Replace("#l#", num2.ToString()).Replace("#m#", num3.ToString()).Replace("#n#", num21.ToString()).Replace("#o#", num4.ToString()).Replace("#p#", num5.ToString()).Replace("#q#", num6.ToString()).Replace("#r#", num7.ToString()).Replace("#s#", num15.ToString()).Replace("#t#", num16.ToString()).Replace("#u#", num17.ToString()).Replace("#v#", num18.ToString()).Replace("#w#", num19.ToString()).Replace("#y#", num20.ToString()); control.Size = new Size(440, 100); control.Enabled = false; control.pub_LoadXML(sXML); } }
public void C4Generate(NuGenEQML control, string number) { this.xmldocument.Load("CalculationXML/c4.xml"); foreach (XmlNode node in this.xmldocument.FirstChild.ChildNodes) { int i = 0; int num2 = 0; int num3 = 0; int num4 = 0; int num5 = 0; int num6 = 0; string newValue = null; string innerText = null; string str3 = null; string str4 = null; string str5 = null; string str6 = null; if (StudentModel.isReGeneration) { List <int> list = new List <int>(); list = this.numberTools.Generaterandom(7, 5, 4); i = (list[3] + list[4]) + list[5]; num2 = (list[3] + list[4]) + list[5]; num3 = (list[4] + list[5]) - list[3]; num4 = list[4] - (2 * list[5]); num5 = list[4] - (2 * list[5]); num6 = list[4] + (4 * list[5]); if ((i == 1) || (i == -1)) { newValue = this.numberTools.compare(i).Replace("+", "").Replace("1", ""); } else { newValue = this.numberTools.compare(i).Replace("+", ""); } if ((num2 == 1) || (num2 == -1)) { innerText = this.numberTools.compare(num2).Replace("1", ""); } else { innerText = this.numberTools.compare(num2); } str4 = this.numberTools.compare(num3 * 2); str5 = this.numberTools.compare(num4 * 2); str6 = this.numberTools.compare(num5 * 2); if ((num6 == 1) || (num6 == -1)) { str3 = this.numberTools.compare(num6).Replace("1", ""); } else { str3 = this.numberTools.compare(num6); } string str7 = SupportTools.getGuid(); string path = "temp/generate/c4.xml"; FileStream w = new FileStream(path, FileMode.Create); XmlTextWriter writer = new XmlTextWriter(w, Encoding.UTF8) { Formatting = Formatting.Indented }; writer.WriteStartDocument(); writer.WriteStartElement("Info"); writer.WriteAttributeString("save", "false"); writer.WriteAttributeString("guid", str7); writer.WriteStartElement("Params"); int num7 = list[3]; writer.WriteElementString("k ", num7.ToString()); num7 = list[4]; writer.WriteElementString("m ", num7.ToString()); num7 = list[5]; writer.WriteElementString("n ", num7.ToString()); writer.WriteElementString("s11 ", newValue.ToString()); writer.WriteElementString("s22 ", innerText.ToString()); writer.WriteElementString("s33 ", str3.ToString()); writer.WriteElementString("s12 ", str4.ToString()); writer.WriteElementString("s13 ", str5.ToString()); writer.WriteElementString("s23 ", str6.ToString()); writer.WriteEndElement(); writer.WriteStartElement("Answer"); num7 = list[3]; writer.WriteElementString("k ", num7.ToString()); num7 = list[4]; writer.WriteElementString("m ", num7.ToString()); writer.WriteElementString("n ", list[5].ToString()); writer.WriteElementString("a11 ", i.ToString()); writer.WriteElementString("a22 ", num2.ToString()); writer.WriteElementString("a33 ", num6.ToString()); writer.WriteElementString("a12 ", num3.ToString()); writer.WriteElementString("a13 ", num4.ToString()); writer.WriteElementString("a23 ", num5.ToString()); writer.WriteEndElement(); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); writer.Close(); } else { XmlDocument xmldoc = new XmlDocument(); xmldoc.Load("temp/generate/c4.xml"); XmlNode node2 = SupportTools.ParamsXmlNode(xmldoc); foreach (XmlNode node3 in node2.ChildNodes) { if (node3.Name.Equals("s11")) { newValue = node3.InnerText; } else if (node3.Name.Equals("s22")) { innerText = node3.InnerText; } else if (node3.Name.Equals("s33")) { str3 = node3.InnerText; } else if (node3.Name.Equals("s12")) { str4 = node3.InnerText; } else if (node3.Name.Equals("s13")) { str5 = node3.InnerText; } else if (node3.Name.Equals("s23")) { str6 = node3.InnerText; } } } string sXML = node.InnerText.Replace("#x#", number).Replace("#k#", newValue).Replace("#l#", innerText).Replace("#m#", str3).Replace("#n#", str4).Replace("#o#", str5).Replace("#p#", str6); control.Size = new Size(880, 60); control.Enabled = false; control.pub_LoadXML(sXML); } }
public void g_four_1Generate(NuGenEQML control0, string number) { this.xmlDocument.Load("GapfillingXML/g_four_1.xml"); foreach (XmlNode node in this.xmlDocument.FirstChild.ChildNodes) { Dictionary <int, string> dictionary = null; if (StudentModel.isReGeneration) { dictionary = this.initial(); string str = SupportTools.getGuid(); string path = "temp/generate/g_four_1.xml"; FileStream w = new FileStream(path, FileMode.Create); XmlTextWriter writer = new XmlTextWriter(w, Encoding.UTF8) { Formatting = Formatting.Indented }; writer.WriteStartDocument(); writer.WriteStartElement("Info"); writer.WriteAttributeString("save", "false"); writer.WriteAttributeString("guid", str); writer.WriteStartElement("Params"); writer.WriteElementString("a11", dictionary[1].ToString()); writer.WriteElementString("a12", dictionary[2].ToString()); writer.WriteElementString("a13", dictionary[3].ToString()); writer.WriteElementString("a21", dictionary[4].ToString()); writer.WriteElementString("a22", dictionary[5].ToString()); writer.WriteElementString("a23", dictionary[6].ToString()); writer.WriteElementString("a31", dictionary[7].ToString()); writer.WriteElementString("a32", dictionary[8].ToString()); writer.WriteElementString("a33", dictionary[9].ToString()); writer.WriteEndElement(); writer.WriteStartElement("Answer"); double num = int.Parse(dictionary[((this.i - 1) * 3) + this.r]) * ((int.Parse(dictionary[((this.j - 1) * 3) + this.s]) * int.Parse(dictionary[((this.l - 1) * 3) + this.t])) - (int.Parse(dictionary[((this.j - 1) * 3) + this.t]) * int.Parse(dictionary[((this.l - 1) * 3) + this.s]))); int num2 = (-1 * this.a) * ((int.Parse(dictionary[((this.j - 1) * 3) + this.t]) * int.Parse(dictionary[((this.l - 1) * 3) + this.r])) - (int.Parse(dictionary[((this.j - 1) * 3) + this.r]) * int.Parse(dictionary[((this.l - 1) * 3) + this.t]))); int num3 = this.b * ((int.Parse(dictionary[((this.j - 1) * 3) + this.s]) * int.Parse(dictionary[((this.l - 1) * 3) + this.r])) - (int.Parse(dictionary[((this.j - 1) * 3) + this.r]) * int.Parse(dictionary[((this.l - 1) * 3) + this.s]))); writer.WriteElementString("k", SupportTools.DoubleFormat(num / ((double)(num2 + num3))).ToString()); writer.WriteEndElement(); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); writer.Close(); } else { XmlDocument xmldoc = new XmlDocument(); xmldoc.Load("temp/generate/g_four_1.xml"); XmlNode node2 = SupportTools.ParamsXmlNode(xmldoc); dictionary = new Dictionary <int, string>(); foreach (XmlNode node3 in node2.ChildNodes) { if (node3.Name.Equals("a11")) { dictionary.Add(1, node3.InnerText); } else if (node3.Name.Equals("a12")) { dictionary.Add(2, node3.InnerText); } else if (node3.Name.Equals("a13")) { dictionary.Add(3, node3.InnerText); } else if (node3.Name.Equals("a21")) { dictionary.Add(4, node3.InnerText); } else if (node3.Name.Equals("a22")) { dictionary.Add(5, node3.InnerText); } else if (node3.Name.Equals("a23")) { dictionary.Add(6, node3.InnerText); } else if (node3.Name.Equals("a31")) { dictionary.Add(7, node3.InnerText); } else if (node3.Name.Equals("a32")) { dictionary.Add(8, node3.InnerText); } else if (node3.Name.Equals("a33")) { dictionary.Add(9, node3.InnerText); } } } string sXML = node.InnerText.Replace("#x#", number).Replace("#a#", dictionary[1].ToString()).Replace("#b#", dictionary[2].ToString()).Replace("#c#", dictionary[3].ToString()).Replace("#d#", dictionary[4].ToString()).Replace("#e#", dictionary[5].ToString()).Replace("#f#", dictionary[6].ToString()).Replace("#g#", dictionary[7].ToString()).Replace("#h#", dictionary[8].ToString()).Replace("#i#", dictionary[9].ToString()); control0.pub_LoadXML(sXML); control0.Size = new Size(0x235, 90); control0.Enabled = false; control0.Anchor = AnchorStyles.None; } }
public void g_five_1Generate(NuGenEQML control1, string number) { this.xmlDocument.Load("GapfillingXML/g_five_1.xml"); foreach (XmlNode node in this.xmlDocument.FirstChild.ChildNodes) { int num4; int num = 0; int i = 0; string innerText = null; string str2 = null; string str3 = null; string str4 = null; string str5 = null; string str6 = null; string str7 = null; string str8 = null; string str9 = null; if (StudentModel.isReGeneration) { num = this.numberTools.myRandom(5); i = this.numberTools.myRandom(5); innerText = "k" + this.numberTools.compare(i); str2 = "k" + this.numberTools.compare(i); str3 = "k" + this.numberTools.compare(-1 * i); str4 = "k" + this.numberTools.compare(-1 * i); num4 = -1 * i; str5 = num4.ToString(); num4 = -1 * i; str6 = num4.ToString(); str7 = i.ToString(); str8 = i.ToString(); str9 = i.ToString(); string str10 = SupportTools.getGuid(); string path = "temp/generate/g_five_1.xml"; FileStream w = new FileStream(path, FileMode.Create); XmlTextWriter writer = new XmlTextWriter(w, Encoding.UTF8) { Formatting = Formatting.Indented }; writer.WriteStartDocument(); writer.WriteStartElement("Info"); writer.WriteAttributeString("save", "false"); writer.WriteAttributeString("guid", str10); writer.WriteStartElement("Params"); writer.WriteElementString("a", num.ToString()); writer.WriteElementString("b", i.ToString()); writer.WriteElementString("a11", innerText.ToString()); writer.WriteElementString("a12", str3.ToString()); writer.WriteElementString("a13", str5.ToString()); writer.WriteElementString("a21", str4.ToString()); writer.WriteElementString("a22", str2.ToString()); writer.WriteElementString("a23", str7.ToString()); writer.WriteElementString("a31", str6.ToString()); writer.WriteElementString("a32", str8.ToString()); writer.WriteElementString("a33", str9.ToString()); writer.WriteEndElement(); writer.WriteStartElement("Answer"); writer.WriteElementString("k", SupportTools.DoubleFormat(((double)num) / 2.0).ToString()); writer.WriteEndElement(); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); writer.Close(); } else { XmlDocument xmldoc = new XmlDocument(); xmldoc.Load("temp/generate/g_five_1.xml"); XmlNode node2 = SupportTools.ParamsXmlNode(xmldoc); foreach (XmlNode node3 in node2.ChildNodes) { if (node3.Name.Equals("a")) { num = int.Parse(node3.InnerText); } else if (node3.Name.Equals("b")) { i = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a11")) { innerText = node3.InnerText; } else if (node3.Name.Equals("a22")) { str2 = node3.InnerText; } else if (node3.Name.Equals("a12")) { str3 = node3.InnerText; } else if (node3.Name.Equals("a21")) { str4 = node3.InnerText; } else if (node3.Name.Equals("a13")) { str5 = node3.InnerText; } else if (node3.Name.Equals("a31")) { str6 = node3.InnerText; } else if (node3.Name.Equals("a23")) { str7 = node3.InnerText; } else if (node3.Name.Equals("a32")) { str8 = node3.InnerText; } else if (node3.Name.Equals("a33")) { str9 = node3.InnerText; } } } num4 = 3 * i; string sXML = node.InnerText.Replace("#x#", number).Replace("#a#", innerText.ToString()).Replace("#b#", str3.ToString()).Replace("#c#", str5.ToString()).Replace("#d#", str4.ToString()).Replace("#e#", str2.ToString()).Replace("#f#", str7.ToString()).Replace("#g#", str6.ToString()).Replace("#h#", str8.ToString()).Replace("#i#", str9.ToString()).Replace("#j#", num.ToString()).Replace("#k#", num4.ToString()).Replace("#l#", ""); control1.Size = new Size(500, 80); control1.Enabled = false; control1.pub_LoadXML(sXML); control1.Anchor = AnchorStyles.None; } }
public void g_two_1Generate(NuGenEQML control0, TableLayoutPanel tableLayoutPanel, List <TextBox> listT, string number) { this.xmlDocument.Load("GapfillingXML/g_two_1.xml"); foreach (XmlNode node in this.xmlDocument.FirstChild.ChildNodes) { double num = 0.0; double num2 = 0.0; double num3 = 0.0; double num4 = 0.0; double num5 = 0.0; double num6 = 0.0; double num7 = 0.0; double num8 = 0.0; double num9 = 0.0; double num10 = 0.0; double num11 = 0.0; double num12 = 0.0; double num13 = 0.0; double num14 = 0.0; double num15 = 0.0; double num16 = 0.0; double num17 = 0.0; double num18 = 0.0; double num19 = 0.0; if (StudentModel.isReGeneration) { num = 1.0; num2 = this.numberTools.myRandom(5); num3 = this.numberTools.myRandom(5); num4 = this.numberTools.myRandom(5); num5 = this.numberTools.myRandom(5); num6 = this.numberTools.myRandom(5); num7 = this.numberTools.myRandom(5); num8 = this.numberTools.myRandom(3); num9 = this.numberTools.myRandom(3); num10 = this.numberTools.myRandom(3); num11 = (num5 * num2) + 1.0; num12 = (num6 * num2) + 1.0; num13 = (num7 * num2) + 1.0; num14 = (num5 * num3) + num8; num15 = (num5 * num4) + num9; num16 = ((num6 * num3) + num8) + 1.0; num17 = ((num7 * num3) + num8) + 1.0; num18 = ((num6 * num4) + num9) + num10; num19 = (((num7 * num4) + num9) + num10) + 1.0; string str = SupportTools.getGuid(); string path = "temp/generate/g_two_1.xml"; FileStream w = new FileStream(path, FileMode.Create); XmlTextWriter writer = new XmlTextWriter(w, Encoding.UTF8) { Formatting = Formatting.Indented }; writer.WriteStartDocument(); writer.WriteStartElement("Info"); writer.WriteAttributeString("save", "false"); writer.WriteAttributeString("guid", str); writer.WriteStartElement("Params"); writer.WriteElementString("a11", num.ToString()); writer.WriteElementString("a12", num2.ToString()); writer.WriteElementString("a13", num3.ToString()); writer.WriteElementString("a14", num4.ToString()); writer.WriteElementString("a21", num5.ToString()); writer.WriteElementString("a22", num11.ToString()); writer.WriteElementString("a23", num14.ToString()); writer.WriteElementString("a24", num15.ToString()); writer.WriteElementString("a31", num6.ToString()); writer.WriteElementString("a32", num12.ToString()); writer.WriteElementString("a33", num16.ToString()); writer.WriteElementString("a34", num18.ToString()); writer.WriteElementString("a41", num7.ToString()); writer.WriteElementString("a42", num13.ToString()); writer.WriteElementString("a43", num17.ToString()); writer.WriteElementString("a44", num19.ToString()); writer.WriteEndElement(); double k = ((((((num6 * num8) - (num5 * num8)) - num5) - (num6 * num9)) + (num7 * num9)) + ((num6 * num8) * num10)) - ((num7 * num8) * num10); double num21 = num8 + 1.0; double num22 = (num9 - num8) - (num8 * num10); double num23 = (num8 * num10) - num9; double num24 = ((num5 - num6) - (num6 * num10)) + (num7 * num10); double num25 = -1.0; double num26 = 1.0 + num10; double num27 = -num10; double num28 = num6 - num7; double num29 = 0.0; double num30 = -1.0; double num31 = 1.0; double num32 = (((((((((((((num2 * num5) - (num3 * num5)) + (num3 * num6)) - (num4 * num6)) + (num4 * num7)) + ((num2 * num5) * num8)) - ((num2 * num6) * num8)) + ((num2 * num6) * num9)) - ((num2 * num7) * num9)) + ((num3 * num6) * num10)) - ((num3 * num7) * num10)) - (((num2 * num6) * num8) * num10)) + (((num2 * num7) * num8) * num10)) + 1.0; double num33 = (num3 - num2) - (num2 * num8); double num34 = ((((num4 - num3) + (num2 * num8)) - (num2 * num9)) - (num3 * num10)) + ((num2 * num8) * num10); double num35 = (((num2 * num9) - num4) + (num3 * num10)) - ((num2 * num8) * num10); writer.WriteStartElement("Answer"); writer.WriteElementString("b11", SupportTools.DoubleFormat(num32).ToString()); writer.WriteElementString("b12", SupportTools.DoubleFormat(num33).ToString()); writer.WriteElementString("b13", SupportTools.DoubleFormat(num34).ToString()); writer.WriteElementString("b14", SupportTools.DoubleFormat(num35).ToString()); writer.WriteElementString("b21", SupportTools.DoubleFormat(k).ToString()); writer.WriteElementString("b22", SupportTools.DoubleFormat(num21).ToString()); writer.WriteElementString("b23", SupportTools.DoubleFormat(num22).ToString()); writer.WriteElementString("b24", SupportTools.DoubleFormat(num23).ToString()); writer.WriteElementString("b31", SupportTools.DoubleFormat(num24).ToString()); writer.WriteElementString("b32", SupportTools.DoubleFormat(num25).ToString()); writer.WriteElementString("b33", SupportTools.DoubleFormat(num26).ToString()); writer.WriteElementString("b34", SupportTools.DoubleFormat(num27).ToString()); writer.WriteElementString("b41", SupportTools.DoubleFormat(num28).ToString()); writer.WriteElementString("b42", SupportTools.DoubleFormat(num29).ToString()); writer.WriteElementString("b43", SupportTools.DoubleFormat(num30).ToString()); writer.WriteElementString("b44", SupportTools.DoubleFormat(num31).ToString()); writer.WriteEndElement(); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); writer.Close(); } else { XmlDocument xmldoc = new XmlDocument(); xmldoc.Load("temp/generate/g_two_1.xml"); XmlNode node2 = SupportTools.ParamsXmlNode(xmldoc); foreach (XmlNode node3 in node2.ChildNodes) { if (node3.Name.Equals("a11")) { num = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a12")) { num2 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a13")) { num3 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a14")) { num4 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a21")) { num5 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a22")) { num11 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a23")) { num14 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a24")) { num15 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a31")) { num6 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a32")) { num12 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a33")) { num16 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a34")) { num18 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a41")) { num7 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a42")) { num13 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a43")) { num17 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a44")) { num19 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("b3")) { num8 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("b4")) { num9 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("c")) { num10 = int.Parse(node3.InnerText); } } } control0.pub_LoadXML(node.InnerText.Replace("#x#", number).Replace("#a#", num.ToString()).Replace("#b#", num2.ToString()).Replace("#c#", num3.ToString()).Replace("#d#", num4.ToString()).Replace("#e#", num5.ToString()).Replace("#f#", num11.ToString()).Replace("#g#", num14.ToString()).Replace("#h#", num15.ToString()).Replace("#i#", num6.ToString()).Replace("#j#", num12.ToString()).Replace("#k#", num16.ToString()).Replace("#l#", num18.ToString()).Replace("#m#", num7.ToString()).Replace("#n#", num13.ToString()).Replace("#o#", num17.ToString()).Replace("#p#", num19.ToString())); control0.Size = new Size(410, 120); control0.Anchor = AnchorStyles.None; control0.Enabled = false; new InitControls().matrixFourToFour(tableLayoutPanel, listT); } }
public void C3Generate(NuGenEQML control1, string number) { this.xmldocument.Load("CalculationXML/c3.xml"); foreach (XmlNode node in this.xmldocument.FirstChild.ChildNodes) { int num = 0; int num2 = 0; int num3 = 0; int num4 = 0; int num5 = 0; int num6 = 0; int num7 = 0; int num8 = 0; int num9 = 0; int num10 = 0; int num11 = 0; int num12 = 0; int num13 = 0; int num14 = 0; int num15 = 0; int num16 = 0; if (StudentModel.isReGeneration) { List <int> list = new List <int>(); list = this.numberTools.Generaterandom(7, 5, 4); num = list[0]; num2 = list[1]; num3 = list[2]; num4 = (list[3] + list[4]) + list[5]; num5 = (-list[3] + list[4]) + list[5]; num6 = list[4] - (2 * list[5]); num7 = list[4] + (4 * list[5]); num8 = num4; num9 = num4; num10 = num5; num11 = num6; num12 = num6; num13 = num7; num14 = 2 * list[3]; num15 = 3 * list[4]; num16 = 6 * list[5]; string str = SupportTools.getGuid(); string path = "temp/generate/c3.xml"; FileStream w = new FileStream(path, FileMode.Create); XmlTextWriter writer = new XmlTextWriter(w, Encoding.UTF8) { Formatting = Formatting.Indented }; writer.WriteStartDocument(); writer.WriteStartElement("Info"); writer.WriteAttributeString("save", "false"); writer.WriteAttributeString("guid", str); writer.WriteStartElement("Params"); writer.WriteElementString("a11", num8.ToString()); writer.WriteElementString("a12", num10.ToString()); writer.WriteElementString("a13", num11.ToString()); writer.WriteElementString("a22", num9.ToString()); writer.WriteElementString("a23", num12.ToString()); writer.WriteElementString("a33", num13.ToString()); writer.WriteEndElement(); writer.WriteStartElement("Answer"); writer.WriteElementString("x1", num14.ToString()); writer.WriteElementString("x2", num15.ToString()); writer.WriteElementString("x3", num16.ToString()); writer.WriteEndElement(); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); writer.Close(); } else { XmlDocument xmldoc = new XmlDocument(); xmldoc.Load("temp/generate/c3.xml"); XmlNode node2 = SupportTools.ParamsXmlNode(xmldoc); foreach (XmlNode node3 in node2.ChildNodes) { if (node3.Name.Equals("a11")) { num8 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a12")) { num10 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a13")) { num11 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a33")) { num13 = int.Parse(node3.InnerText); } num4 = num8; num5 = num10; num6 = num11; num7 = num13; } } string sXML = node.InnerText.Replace("#x#", number).Replace("#a#", num4.ToString()).Replace("#b#", num5.ToString()).Replace("#c#", num6.ToString()).Replace("#d#", num5.ToString()).Replace("#e#", num4.ToString()).Replace("#f#", num6.ToString()).Replace("#g#", num6.ToString()).Replace("#h#", num6.ToString()).Replace("#i#", num7.ToString()); control1.Size = new Size(610, 110); control1.Enabled = false; control1.pub_LoadXML(sXML); } }
public void C1Generate(NuGenEQML control1, string number) { this.xmldocument.Load("CalculationXML/c1.xml"); foreach (XmlNode node in this.xmldocument.FirstChild.ChildNodes) { int num = 0; int num2 = 0; int num3 = 0; int num4 = 0; int num5 = 0; int num6 = 0; int num7 = 0; int num8 = 0; int num9 = 0; int num10 = 0; int num11 = 0; int num12 = 0; int num13 = 0; int num14 = 0; int num15 = 0; int num16 = 0; int num17 = 0; int num18 = 0; int num19 = 0; int num20 = 0; if (StudentModel.isReGeneration) { List <int> list = new List <int>(); List <int> list2 = new List <int>(); List <int> list3 = new List <int>(); int num21 = 0; while (num21 < 4) { list.Add(this.numberTools.myRandom(9)); num21++; } num21 = 0; while (num21 < 3) { list2.Add(this.numberTools.myRandom(9)); num21++; } list3.Add(this.numberTools.myRandom(9)); list3.Add(this.numberTools.myRandom(9)); int minValue = this.random.Next(0, 2); int num23 = this.random.Next(minValue, 2); List <int> list4 = new List <int>(); for (num21 = 0; num21 < 6; num21++) { list4.Add(this.numberTools.myRandom(4)); } num = 1; num2 = list4[0]; num3 = ((1 - num23) * (list3[0] + (list4[0] * list3[1]))) + (num23 * list4[1]); num4 = ((1 - minValue) * ((list2[0] + (list4[0] * list2[1])) + ((list4[1] * num23) * list2[2]))) + (minValue * list4[2]); num5 = ((list[0] + (list4[0] * list[1])) + ((list4[1] * num23) * list[2])) + ((list4[2] * minValue) * list[3]); num6 = list4[3]; num7 = (list4[3] * num2) + 1; num8 = (list4[3] * num3) + ((1 - num23) * list3[1]); num9 = (list4[3] * num4) + ((1 - minValue) * list2[1]); num10 = (list4[3] * num5) + list[1]; num11 = list4[4]; num12 = list4[4] * num2; num13 = (list4[4] * num3) + num23; num14 = (list4[4] * num4) + ((num23 * (1 - minValue)) * list2[2]); num15 = (list4[4] * num5) + (num23 * list[2]); num16 = list4[5]; num17 = list4[5] * num2; num18 = list4[5] * num3; num19 = (list4[5] * num4) + minValue; num20 = (list4[5] * num5) + (minValue * list[3]); string str = SupportTools.getGuid(); string path = "temp/generate/c1.xml"; FileStream w = new FileStream(path, FileMode.Create); XmlTextWriter writer = new XmlTextWriter(w, Encoding.UTF8) { Formatting = Formatting.Indented }; writer.WriteStartDocument(); writer.WriteStartElement("Info"); writer.WriteAttributeString("save", "false"); writer.WriteAttributeString("guid", str); writer.WriteStartElement("Params"); writer.WriteElementString("a11", num.ToString()); writer.WriteElementString("a12", num2.ToString()); writer.WriteElementString("a13", num3.ToString()); writer.WriteElementString("a14", num4.ToString()); writer.WriteElementString("a15", num5.ToString()); writer.WriteElementString("a21", num6.ToString()); writer.WriteElementString("a22", num7.ToString()); writer.WriteElementString("a23", num8.ToString()); writer.WriteElementString("a24", num9.ToString()); writer.WriteElementString("a25", num10.ToString()); writer.WriteElementString("a31", num11.ToString()); writer.WriteElementString("a32", num12.ToString()); writer.WriteElementString("a33", num13.ToString()); writer.WriteElementString("a34", num14.ToString()); writer.WriteElementString("a35", num15.ToString()); writer.WriteElementString("a41", num16.ToString()); writer.WriteElementString("a42", num17.ToString()); writer.WriteElementString("a43", num18.ToString()); writer.WriteElementString("a44", num19.ToString()); writer.WriteElementString("a45", num20.ToString()); int num24 = list[0]; writer.WriteElementString("x1", num24.ToString()); num24 = list[1]; writer.WriteElementString("x2", num24.ToString()); num24 = list[2]; writer.WriteElementString("x3", num24.ToString()); num24 = list2[0]; writer.WriteElementString("y1", num24.ToString()); num24 = list2[1]; writer.WriteElementString("y2", num24.ToString()); writer.WriteElementString("y3", list2[2].ToString()); writer.WriteEndElement(); writer.WriteStartElement("Answer"); writer.WriteElementString("c", num23.ToString()); writer.WriteElementString("d", minValue.ToString()); writer.WriteEndElement(); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); writer.Close(); } else { XmlDocument xmldoc = new XmlDocument(); xmldoc.Load("temp/generate/c1.xml"); XmlNode node2 = SupportTools.ParamsXmlNode(xmldoc); foreach (XmlNode node3 in node2.ChildNodes) { if (node3.Name.Equals("a11")) { num = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a12")) { num2 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a13")) { num3 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a14")) { num4 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a15")) { num5 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a21")) { num6 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a22")) { num7 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a23")) { num8 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a24")) { num9 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a25")) { num10 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a31")) { num11 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a32")) { num12 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a33")) { num13 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a34")) { num14 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a35")) { num15 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a41")) { num16 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a42")) { num17 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a43")) { num18 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a44")) { num19 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a45")) { num20 = int.Parse(node3.InnerText); } } } string sXML = node.InnerText.Replace("#x#", number + " ").Replace("#aa#", num.ToString()).Replace("#ab#", num6.ToString()).Replace("#ac#", num11.ToString()).Replace("#ad#", num16.ToString()).Replace("#ba#", num2.ToString()).Replace("#bb#", num7.ToString()).Replace("#bc#", num12.ToString()).Replace("#bd#", num17.ToString()).Replace("#ca#", num3.ToString()).Replace("#cb#", num8.ToString()).Replace("#cc#", num13.ToString()).Replace("#cd#", num18.ToString()).Replace("#da#", num4.ToString()).Replace("#db#", num9.ToString()).Replace("#dc#", num14.ToString()).Replace("#dd#", num19.ToString()).Replace("#ea#", num5.ToString()).Replace("#eb#", num10.ToString()).Replace("#ec#", num15.ToString()).Replace("#ed#", num20.ToString()); control1.Size = new Size(610, 0x7d); control1.Enabled = false; control1.pub_LoadXML(sXML); } }
public void C9Generate(NuGenEQML control, string number) { this.xmldocument.Load("CalculationXML/c9.xml"); foreach (XmlNode node in this.xmldocument.FirstChild.ChildNodes) { int num5; int num = 0; int i = 0; int num3 = 0; int num4 = 0; if (StudentModel.isReGeneration) { List <int> list = this.GenerateDifferent(9); num = list[0]; i = list[1]; num3 = list[2]; num4 = list[3]; string str = SupportTools.getGuid(); string path = "temp/generate/c9.xml"; FileStream w = new FileStream(path, FileMode.Create); XmlTextWriter writer = new XmlTextWriter(w, Encoding.UTF8) { Formatting = Formatting.Indented }; writer.WriteStartDocument(); writer.WriteStartElement("Info"); writer.WriteAttributeString("save", "false"); writer.WriteAttributeString("guid", str); writer.WriteStartElement("Params"); writer.WriteElementString("a", num.ToString()); writer.WriteElementString("b", i.ToString()); writer.WriteElementString("c", num3.ToString()); writer.WriteElementString("d", num4.ToString()); writer.WriteEndElement(); writer.WriteStartElement("Answer"); num5 = ((i - num) * (num3 - num)) * (num3 - i); writer.WriteElementString("D2", num5.ToString()); writer.WriteElementString("x1", SupportTools.DoubleFormat((((i - num4) * (num3 - num4)) * 1.0) / ((double)((i - num) * (num3 - num)))).ToString()); writer.WriteElementString("x2", SupportTools.DoubleFormat((((num4 - num) * (num3 - num4)) * 1.0) / ((double)((i - num) * (num3 - i)))).ToString()); writer.WriteElementString("x3", SupportTools.DoubleFormat((((num4 - num) * (num4 - i)) * 1.0) / ((double)((num3 - i) * (num3 - num)))).ToString()); writer.WriteEndElement(); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); writer.Close(); } else { XmlDocument xmldoc = new XmlDocument(); xmldoc.Load("temp/generate/c9.xml"); XmlNode node2 = SupportTools.ParamsXmlNode(xmldoc); foreach (XmlNode node3 in node2.ChildNodes) { if (node3.Name.Equals("a")) { num = int.Parse(node3.InnerText); } else if (node3.Name.Equals("b")) { i = int.Parse(node3.InnerText); } else if (node3.Name.Equals("c")) { num3 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("d")) { num4 = int.Parse(node3.InnerText); } } } num5 = num4 * num4; string sXML = node.InnerText.Replace("#x#", number).Replace("#k#", ((num == 1) || (num == -1)) ? num.ToString().Replace("1", "") : num.ToString()).Replace("#l#", ((i == 1) || (i == -1)) ? this.numberTools.compare(i).Replace("1", "") : this.numberTools.compare(i)).Replace("#m#", ((num3 == 1) || (num3 == -1)) ? this.numberTools.compare(num3).Replace("1", "") : this.numberTools.compare(num3)).Replace("#n#", num4.ToString()).Replace("#o#", ((num == 1) || (num == -1)) ? (num5 = num * num).ToString().Replace("1", "") : (num5 = num * num).ToString()).Replace("#p#", ((i == 1) || (i == -1)) ? this.numberTools.compare(i * i).Replace("1", "") : this.numberTools.compare(i * i)).Replace("#q#", ((num3 == 1) || (num3 == -1)) ? this.numberTools.compare(num3 * num3).Replace("1", "") : this.numberTools.compare(num3 * num3)).Replace("#r#", num5.ToString()); control.Size = new Size(440, 100); control.Enabled = false; control.pub_LoadXML(sXML); } }
public void C10Generate(NuGenEQML control, string number) { this.xmldocument.Load("CalculationXML/c10.xml"); foreach (XmlNode node in this.xmldocument.FirstChild.ChildNodes) { int num = 0; int num2 = 0; int num3 = 0; int num4 = 0; int num5 = 0; int num6 = 0; int num7 = 0; int num8 = 0; int num9 = 0; int num10 = 0; int num11 = 0; int num12 = 0; int num13 = 0; int num14 = 0; int num15 = 0; int num16 = 0; int num17 = 0; int num18 = 0; int num19 = 0; int num20 = 0; int num21 = 0; int num22 = 0; int num23 = 0; int num24 = 0; int num25 = 0; int i = 0; int num27 = 0; int num28 = 0; int num29 = 0; int num30 = 0; int num31 = 0; int num32 = 0; int num33 = 0; if (StudentModel.isReGeneration) { num = this.numberTools.myRandom(5); num2 = this.numberTools.myRandom(5); num3 = this.numberTools.myRandom(5); num4 = this.numberTools.myRandom(5); num5 = this.numberTools.myRandom(5); num6 = this.numberTools.myRandom(5); num7 = this.numberTools.myRandom(5); num8 = this.numberTools.myRandom(5); num9 = this.numberTools.myRandom(5); num10 = this.numberTools.myRandom(5); num11 = this.numberTools.myRandom(5); num12 = this.numberTools.myRandom(5); num13 = this.numberTools.myRandom(5); num14 = this.numberTools.myRandom(5); num15 = num7; num16 = (num7 * num4) + num; num17 = (num7 * num5) + num2; num18 = (num7 * num6) + num3; num19 = num10; num20 = (num7 * num10) + 1; num21 = (num10 * num16) + num4; num22 = (num10 * num17) + num5; num23 = (num10 * num18) + num6; num24 = num11; num25 = num8; i = (num11 * num) + (num8 * num4); num27 = (num11 * num2) + (num8 * num5); num28 = ((num11 * num3) + (num8 * num6)) + num13; num29 = num12; num30 = num9; num31 = (num12 * num) + (num9 * num4); num32 = (num12 * num2) + (num9 * num5); num33 = ((num12 * num3) + (num9 * num6)) + num13; string str = SupportTools.getGuid(); string path = "temp/generate/c10.xml"; FileStream w = new FileStream(path, FileMode.Create); XmlTextWriter writer = new XmlTextWriter(w, Encoding.UTF8) { Formatting = Formatting.Indented }; writer.WriteStartDocument(); writer.WriteStartElement("Info"); writer.WriteAttributeString("save", "false"); writer.WriteAttributeString("guid", str); writer.WriteStartElement("Params"); writer.WriteElementString("a1", num.ToString()); writer.WriteElementString("a2", num2.ToString()); writer.WriteElementString("a3", num3.ToString()); writer.WriteElementString("d1", num4.ToString()); writer.WriteElementString("d2", num5.ToString()); writer.WriteElementString("d3", num6.ToString()); writer.WriteElementString("n1", num7.ToString()); writer.WriteElementString("n2", num8.ToString()); writer.WriteElementString("n3", num9.ToString()); writer.WriteElementString("m1", num10.ToString()); writer.WriteElementString("m2", num11.ToString()); writer.WriteElementString("m3", num12.ToString()); writer.WriteElementString("b", num13.ToString()); writer.WriteElementString("k", num14.ToString()); writer.WriteElementString("a12", num15.ToString()); writer.WriteElementString("a13", num16.ToString()); writer.WriteElementString("a14", num17.ToString()); writer.WriteElementString("a15", num18.ToString()); writer.WriteElementString("a21", num19.ToString()); writer.WriteElementString("a22", num20.ToString()); writer.WriteElementString("a23", num21.ToString()); writer.WriteElementString("a24", num22.ToString()); writer.WriteElementString("a25", num23.ToString()); writer.WriteElementString("a31", num24.ToString()); writer.WriteElementString("a32", num25.ToString()); writer.WriteElementString("a33", i.ToString()); writer.WriteElementString("a34", num27.ToString()); writer.WriteElementString("a35", num28.ToString()); writer.WriteElementString("a41", num29.ToString()); writer.WriteElementString("a42", num30.ToString()); writer.WriteElementString("a43", num31.ToString()); writer.WriteElementString("a44", num32.ToString()); writer.WriteElementString("a45", num33.ToString()); writer.WriteEndElement(); writer.WriteStartElement("Answer"); writer.WriteElementString("k", num14.ToString()); writer.WriteElementString("a3", num3.ToString()); writer.WriteElementString("a1", num.ToString()); writer.WriteElementString("b", num13.ToString()); writer.WriteElementString("d3", num6.ToString()); writer.WriteElementString("d1", num4.ToString()); writer.WriteElementString("a2", num2.ToString()); writer.WriteElementString("d2", num5.ToString()); writer.WriteElementString("n1", num7.ToString()); writer.WriteElementString("n2", num8.ToString()); writer.WriteElementString("n3", num9.ToString()); writer.WriteElementString("m1", num10.ToString()); writer.WriteElementString("m2", num11.ToString()); writer.WriteElementString("m3", num12.ToString()); writer.WriteEndElement(); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); writer.Close(); } else { XmlDocument xmldoc = new XmlDocument(); xmldoc.Load("temp/generate/c10.xml"); XmlNode node2 = SupportTools.ParamsXmlNode(xmldoc); foreach (XmlNode node3 in node2.ChildNodes) { if (node3.Name.Equals("a12")) { num15 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a13")) { num16 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a14")) { num17 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a15")) { num18 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a21")) { num19 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a22")) { num20 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a23")) { num21 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a24")) { num22 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a25")) { num23 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a31")) { num24 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a32")) { num25 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a33")) { i = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a34")) { num27 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a35")) { num28 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a41")) { num29 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a42")) { num30 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a43")) { num31 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a44")) { num32 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a45")) { num33 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("k")) { num14 = int.Parse(node3.InnerText); } } } string sXML = node.InnerText.Replace("#x#", number).Replace("#a#", num15.ToString()).Replace("#b#", num16.ToString()).Replace("#c#", num17.ToString()).Replace("#d#", num19.ToString()).Replace("#e#", num20.ToString()).Replace("#f#", num21.ToString()).Replace("#g#", num22.ToString()).Replace("#h#", num24.ToString()).Replace("#i#", num25.ToString()).Replace("#j#", this.numberTools.compare(i)).Replace("#k#", num27.ToString()).Replace("#l#", num29.ToString()).Replace("#m#", num30.ToString()).Replace("#n#", this.numberTools.compare(num31)).Replace("#o#", ((num14 == 1) || (num14 == -1)) ? this.numberTools.compare(-num14).Replace("1", "") : this.numberTools.compare(-num14)).Replace("#p#", this.numberTools.compare(num32)).Replace("#q#", num18.ToString()).Replace("#r#", num23.ToString()).Replace("#s#", num28.ToString()).Replace("#t#", num33.ToString()); control.Size = new Size(540, 120); control.Enabled = false; control.pub_LoadXML(sXML); } }
public void g_six_1Generate(NuGenEQML control1, string number) { this.xmlDocument.Load("GapfillingXML/g_six_1.xml"); foreach (XmlNode node in this.xmlDocument.FirstChild.ChildNodes) { int num = 0; int num2 = 0; int num3 = 0; int num4 = 0; int num5 = 0; int num6 = 0; int num7 = 0; int i = 0; int num9 = 0; int num10 = 0; int num11 = 0; int num12 = 0; if (StudentModel.isReGeneration) { num = this.numberTools.myRandom(3); num2 = this.numberTools.myRandom(3); num3 = this.numberTools.myRandom(3); num4 = this.numberTools.myRandom(3); num5 = this.numberTools.myRandom(3); num6 = this.numberTools.myRandom(3); num7 = num; i = ((num * num4) * num4) + num2; num9 = (((num * num5) * num5) + ((num2 * num6) * num6)) + num3; num10 = num * num4; num11 = num * num5; num12 = ((num * num4) * num5) + (num2 * num6); string str = SupportTools.getGuid(); string path = "temp/generate/g_six_1.xml"; FileStream w = new FileStream(path, FileMode.Create); XmlTextWriter writer = new XmlTextWriter(w, Encoding.UTF8) { Formatting = Formatting.Indented }; writer.WriteStartDocument(); writer.WriteStartElement("Info"); writer.WriteAttributeString("save", "false"); writer.WriteAttributeString("guid", str); writer.WriteStartElement("Params"); writer.WriteElementString("a11", num7.ToString()); writer.WriteElementString("a12", num10.ToString()); writer.WriteElementString("a13", num11.ToString()); writer.WriteElementString("a22", i.ToString()); writer.WriteElementString("a23", num12.ToString()); writer.WriteElementString("a33", num9.ToString()); writer.WriteEndElement(); writer.WriteStartElement("Answer"); int num13 = 0; if (num > 0) { num13++; } if (num2 > 0) { num13++; } if (num3 > 0) { num13++; } writer.WriteElementString("k", num13.ToString()); writer.WriteEndElement(); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); writer.Close(); } else { XmlDocument xmldoc = new XmlDocument(); xmldoc.Load("temp/generate/g_six_1.xml"); XmlNode node2 = SupportTools.ParamsXmlNode(xmldoc); foreach (XmlNode node3 in node2.ChildNodes) { if (node3.Name.Equals("a")) { num = int.Parse(node3.InnerText); } else if (node3.Name.Equals("b")) { num2 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("c")) { num3 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("m")) { num4 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("n")) { num5 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("t")) { num6 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a11")) { num7 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a22")) { i = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a33")) { num9 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a12")) { num10 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a13")) { num11 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a23")) { num12 = int.Parse(node3.InnerText); } } } string sXML = node.InnerText.Replace("#x#", number).Replace("#a#", num7.ToString()).Replace("#b#", this.numberTools.compare(i)).Replace("#c#", this.numberTools.compare(num9)).Replace("#d#", this.numberTools.compare(2 * num10)).Replace("#e#", this.numberTools.compare(2 * num11)).Replace("#f#", this.numberTools.compare(2 * num12)); control1.Size = new Size(580, 0x2d); control1.Enabled = false; control1.pub_LoadXML(sXML); control1.Anchor = AnchorStyles.None; } }
public void g_seven_1_1Generate(NuGenEQML control0, TableLayoutPanel tableLayoutPanel, List <TextBox> list, string number) { this.xmlDocument.Load("GapfillingXML/g_seven_1_1.xml"); foreach (XmlNode node in this.xmlDocument.FirstChild.ChildNodes) { int num = 0; int num2 = 0; int num3 = 0; int num4 = 0; int num5 = 0; int num6 = 0; int num7 = 0; int num8 = 0; int num9 = 0; int num10 = 0; int num11 = 0; int num12 = 0; if (StudentModel.isReGeneration) { num = this.random.Next(-5, 6); num2 = this.random.Next(-5, 6); num3 = this.random.Next(-5, 6); num4 = this.random.Next(-5, 6); num5 = this.random.Next(-5, 6); num6 = this.random.Next(-5, 6); num7 = this.random.Next(-5, 6); num8 = this.random.Next(-5, 6); num9 = this.random.Next(-5, 6); num10 = this.numberTools.myRandom(4); num11 = this.numberTools.myRandom(4); num12 = this.numberTools.myRandom(4); string str = SupportTools.getGuid(); string path = "temp/generate/g_seven_1_1.xml"; FileStream w = new FileStream(path, FileMode.Create); XmlTextWriter writer = new XmlTextWriter(w, Encoding.UTF8) { Formatting = Formatting.Indented }; writer.WriteStartDocument(); writer.WriteStartElement("Info"); writer.WriteAttributeString("save", "false"); writer.WriteAttributeString("guid", str); writer.WriteStartElement("Params"); writer.WriteElementString("a11", num.ToString()); writer.WriteElementString("a12", num2.ToString()); writer.WriteElementString("a13", num3.ToString()); writer.WriteElementString("a21", num4.ToString()); writer.WriteElementString("a22", num5.ToString()); writer.WriteElementString("a23", num6.ToString()); writer.WriteElementString("a31", num7.ToString()); writer.WriteElementString("a32", num8.ToString()); writer.WriteElementString("a33", num9.ToString()); writer.WriteElementString("a", num10.ToString()); writer.WriteElementString("b", num11.ToString()); writer.WriteElementString("c", num12.ToString()); writer.WriteEndElement(); int num13 = num; double num14 = ((1.0 * num11) * num2) / ((double)num10); double num15 = ((1.0 * num12) * num3) / ((double)num10); double num16 = ((1.0 * num10) * num4) / ((double)num11); int num17 = num5; double num18 = ((1.0 * num12) * num6) / ((double)num11); double num19 = ((1.0 * num10) * num7) / ((double)num12); double num20 = ((1.0 * num11) * num8) / ((double)num12); int num21 = num9; writer.WriteStartElement("Answer"); writer.WriteElementString("b11", num13.ToString()); writer.WriteElementString("b12", num14.ToString()); writer.WriteElementString("b13", num15.ToString()); writer.WriteElementString("b21", num16.ToString()); writer.WriteElementString("b22", num17.ToString()); writer.WriteElementString("b23", num18.ToString()); writer.WriteElementString("b31", num19.ToString()); writer.WriteElementString("b32", num20.ToString()); writer.WriteElementString("b33", num21.ToString()); writer.WriteEndElement(); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); writer.Close(); } else { XmlDocument xmldoc = new XmlDocument(); xmldoc.Load("temp/generate/g_seven_1_1.xml"); XmlNode node2 = SupportTools.ParamsXmlNode(xmldoc); foreach (XmlNode node3 in node2.ChildNodes) { if (node3.Name.Equals("a")) { num10 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("b")) { num11 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("c")) { num12 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a11")) { num = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a12")) { num2 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a13")) { num3 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a21")) { num4 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a22")) { num5 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a23")) { num6 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a31")) { num7 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a32")) { num8 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a33")) { num9 = int.Parse(node3.InnerText); } } } string sXML = node.InnerText.Replace("#x#", number).Replace("#a#", num.ToString()).Replace("#b#", num2.ToString()).Replace("#c#", num3.ToString()).Replace("#d#", num4.ToString()).Replace("#e#", num5.ToString()).Replace("#f#", num6.ToString()).Replace("#g#", num7.ToString()).Replace("#h#", num8.ToString()).Replace("#i#", num9.ToString()).Replace("#aa#", num10.ToString()).Replace("#bb#", num11.ToString()).Replace("#cc#", num12.ToString()); control0.pub_LoadXML(sXML); control0.Size = new Size(950, 90); control0.Enabled = false; control0.Anchor = AnchorStyles.None; new InitControls().matrixThreeToThree(tableLayoutPanel, list); } }
public void g_seven_1_3Generate(NuGenEQML control0, TableLayoutPanel tableLayoutPanel, List <TextBox> list, string number) { this.xmlDocument.Load("GapfillingXML/g_seven_1_3.xml"); foreach (XmlNode node in this.xmlDocument.FirstChild.ChildNodes) { int i = 0; int num2 = 0; int num3 = 0; int num4 = 0; string newValue = null; string str2 = null; string str3 = null; if (StudentModel.isReGeneration) { i = this.numberTools.myRandom(6); num2 = this.numberTools.myRandom(6); num3 = this.numberTools.myRandom(6); num4 = this.numberTools.myRandom(6); newValue = this.numberTools.compare(i); str2 = this.numberTools.compare(num2); str3 = this.numberTools.compare(num3); string str4 = SupportTools.getGuid(); string path = "temp/generate/g_seven_1_3.xml"; FileStream w = new FileStream(path, FileMode.Create); XmlTextWriter writer = new XmlTextWriter(w, Encoding.UTF8) { Formatting = Formatting.Indented }; writer.WriteStartDocument(); writer.WriteStartElement("Info"); writer.WriteAttributeString("save", "false"); writer.WriteAttributeString("guid", str4); writer.WriteStartElement("Params"); writer.WriteElementString("a", i.ToString()); writer.WriteElementString("b", num2.ToString()); writer.WriteElementString("c", num3.ToString()); writer.WriteElementString("d", num4.ToString()); writer.WriteEndElement(); int num5 = 0; double num6 = SupportTools.DoubleFormat(1.0 / ((double)num4)); double num7 = SupportTools.DoubleFormat((num2 - (2.0 * i)) / ((double)num4)); int num8 = 0; int num9 = 0; int num10 = 2; int num11 = 0; int num12 = 0; int num13 = 0; writer.WriteStartElement("Answer"); writer.WriteElementString("b11", num5.ToString()); writer.WriteElementString("b12", num6.ToString()); writer.WriteElementString("b13", num7.ToString()); writer.WriteElementString("b21", num8.ToString()); writer.WriteElementString("b22", num9.ToString()); writer.WriteElementString("b23", num10.ToString()); writer.WriteElementString("b31", num11.ToString()); writer.WriteElementString("b32", num12.ToString()); writer.WriteElementString("b33", num13.ToString()); writer.WriteEndElement(); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); writer.Close(); } else { XmlDocument xmldoc = new XmlDocument(); xmldoc.Load("temp/generate/g_seven_1_3.xml"); XmlNode node2 = SupportTools.ParamsXmlNode(xmldoc); foreach (XmlNode node3 in node2.ChildNodes) { if (node3.Name.Equals("a")) { i = int.Parse(node3.InnerText); } else if (node3.Name.Equals("b")) { num2 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("c")) { num3 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("d")) { num4 = int.Parse(node3.InnerText); } } newValue = this.numberTools.compare(i); str2 = this.numberTools.compare(num2); str3 = this.numberTools.compare(num3); } if (str2 == "+1") { str2 = "+"; } else if (str2 == "-1") { str2 = "-"; } string sXML = node.InnerText.Replace("#x#", number).Replace("#a#", newValue).Replace("#b#", str2).Replace("#c#", str3).Replace("#d#", num4.ToString()); control0.pub_LoadXML(sXML); control0.Size = new Size(850, 60); control0.Enabled = false; control0.Anchor = AnchorStyles.None; new InitControls().matrixThreeToThree(tableLayoutPanel, list); } }
public void C8Generate(NuGenEQML control, string number) { this.xmldocument.Load("CalculationXML/c8.xml"); foreach (XmlNode node in this.xmldocument.FirstChild.ChildNodes) { int num25; int num = 0; int num2 = 0; int num3 = 0; int num4 = 0; int num5 = 0; int num6 = 0; int num7 = 0; int num8 = 0; int num9 = 0; int num10 = 0; int num11 = 0; int num12 = 0; int num13 = 0; int num14 = 0; int num15 = 0; int num16 = 0; int num17 = 0; int num18 = 0; int num19 = 0; int num20 = 0; int num21 = 0; int num22 = 0; int num23 = 0; int num24 = 0; if (StudentModel.isReGeneration) { num = this.numberTools.myRandom(5); num2 = this.numberTools.myRandom(5); num3 = this.numberTools.myRandom(5); num4 = this.numberTools.myRandom(5); num5 = this.random.Next(-3, 4); num6 = this.random.Next(-3, 4); num7 = this.random.Next(-9, 10); num8 = this.random.Next(-9, 10); num9 = this.random.Next(-9, 10); num10 = this.random.Next(-9, 10); num11 = this.random.Next(-9, 10); num12 = this.random.Next(-9, 10); num13 = this.random.Next(-9, 10); num14 = this.random.Next(-9, 10); num15 = this.random.Next(-9, 10); num16 = this.random.Next(-9, 10); num17 = this.random.Next(-9, 10); num18 = this.random.Next(-9, 10); num19 = ((num13 + (num * num15)) + (num3 * num17)) + num7; num20 = ((num14 + (num * num16)) + (num3 * num18)) + num8; num21 = (((num2 * num13) + ((1 + (num * num2)) * num15)) + (((num2 * num3) + num5) * num17)) + num9; num22 = (((num2 * num14) + ((1 + (num * num2)) * num16)) + (((num2 * num3) + num5) * num18)) + num10; num23 = (((num4 * num13) + (((num * num4) + num6) * num15)) + (((1 + (num4 * num3)) + (num6 * num5)) * num17)) + num11; num24 = (((num4 * num14) + (((num * num4) + num6) * num16)) + (((1 + (num4 * num3)) + (num6 * num5)) * num18)) + num12; string str = SupportTools.getGuid(); string path = "temp/generate/c8.xml"; FileStream w = new FileStream(path, FileMode.Create); XmlTextWriter writer = new XmlTextWriter(w, Encoding.UTF8) { Formatting = Formatting.Indented }; writer.WriteStartDocument(); writer.WriteStartElement("Info"); writer.WriteAttributeString("save", "false"); writer.WriteAttributeString("guid", str); writer.WriteStartElement("Params"); writer.WriteElementString("a1 ", num.ToString()); writer.WriteElementString("a2 ", num2.ToString()); writer.WriteElementString("b1 ", num3.ToString()); writer.WriteElementString("b2 ", num4.ToString()); writer.WriteElementString("c1 ", num5.ToString()); writer.WriteElementString("c2 ", num6.ToString()); writer.WriteElementString("b11", num7.ToString()); writer.WriteElementString("b12", num8.ToString()); writer.WriteElementString("b21", num9.ToString()); writer.WriteElementString("b22", num10.ToString()); writer.WriteElementString("b31", num11.ToString()); writer.WriteElementString("b32", num12.ToString()); writer.WriteElementString("x11", num13.ToString()); writer.WriteElementString("x12", num14.ToString()); writer.WriteElementString("x21", num15.ToString()); writer.WriteElementString("x22", num16.ToString()); writer.WriteElementString("x31", num17.ToString()); writer.WriteElementString("x32", num18.ToString()); writer.WriteElementString("c11", num19.ToString()); writer.WriteElementString("c12", num20.ToString()); writer.WriteElementString("c21", num21.ToString()); writer.WriteElementString("c22", num22.ToString()); writer.WriteElementString("c31", num23.ToString()); writer.WriteElementString("c32", num24.ToString()); writer.WriteEndElement(); writer.WriteStartElement("Answer"); num25 = (1 + (num * num2)) + (((num * num5) - num3) * ((num2 * num6) - num4)); writer.WriteElementString("d11", num25.ToString()); num25 = (num3 * num6) - (num * (1 + (num5 * num6))); writer.WriteElementString("d12", num25.ToString()); num25 = (num * num5) - num3; writer.WriteElementString("d13", num25.ToString()); num25 = ((num4 - (num2 * num6)) * num5) - num2; writer.WriteElementString("d14", num25.ToString()); num25 = 1 + (num5 * num6); writer.WriteElementString("d15", num25.ToString()); num25 = -num5; writer.WriteElementString("d16", num25.ToString()); num25 = (num2 * num6) - num4; writer.WriteElementString("d17", num25.ToString()); num25 = -num6; writer.WriteElementString("d18", num25.ToString()); num25 = 1; writer.WriteElementString("d19", num25.ToString()); num25 = num19 - num7; writer.WriteElementString("d20", num25.ToString()); num25 = num20 - num8; writer.WriteElementString("d21", num25.ToString()); num25 = num21 - num9; writer.WriteElementString("d22", num25.ToString()); num25 = num22 - num10; writer.WriteElementString("d23", num25.ToString()); num25 = num23 - num11; writer.WriteElementString("d24", num25.ToString()); num25 = num24 - num12; writer.WriteElementString("d25", num25.ToString()); writer.WriteElementString("d26", num13.ToString()); writer.WriteElementString("d27", num14.ToString()); writer.WriteElementString("d28", num15.ToString()); writer.WriteElementString("d29", num16.ToString()); writer.WriteElementString("d30", num17.ToString()); writer.WriteElementString("d31", num18.ToString()); writer.WriteEndElement(); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); writer.Close(); } else { XmlDocument xmldoc = new XmlDocument(); xmldoc.Load("temp/generate/c8.xml"); XmlNode node2 = SupportTools.ParamsXmlNode(xmldoc); foreach (XmlNode node3 in node2.ChildNodes) { if (node3.Name.Equals("a1")) { num = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a2")) { num2 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("b1")) { num3 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("b2")) { num4 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("c1")) { num5 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("c2")) { num6 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("b11")) { num7 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("b12")) { num8 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("b21")) { num9 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("b22")) { num10 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("b31")) { num11 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("b32")) { num12 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("c11")) { num19 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("c12")) { num20 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("c21")) { num21 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("c22")) { num22 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("c31")) { num23 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("c32")) { num24 = int.Parse(node3.InnerText); } } } num25 = 1 + (num * num2); num25 = (num2 * num3) + num5; num25 = (num * num4) + num6; num25 = (1 + (num4 * num3)) + (num5 * num6); string sXML = node.InnerText.Replace("#x#", number).Replace("#a#", num.ToString()).Replace("#b#", num3.ToString()).Replace("#c#", num2.ToString()).Replace("#d#", num25.ToString()).Replace("#e#", num25.ToString()).Replace("#f#", num4.ToString()).Replace("#g#", num25.ToString()).Replace("#h#", num25.ToString()).Replace("#i#", num7.ToString()).Replace("#j#", num8.ToString()).Replace("#k#", num9.ToString()).Replace("#l#", num10.ToString()).Replace("#m#", num11.ToString()).Replace("#n#", num12.ToString()).Replace("#o#", num19.ToString()).Replace("#p#", num20.ToString()).Replace("#q#", num21.ToString()).Replace("#r#", num22.ToString()).Replace("#s#", num23.ToString()).Replace("#t#", num24.ToString()); control.Size = new Size(440, 100); control.Enabled = false; control.pub_LoadXML(sXML); } }
public void g_one_1Generate(NuGenEQML control1, string number) { this.xmlDocument.Load("GapfillingXML/g_one_1.xml"); foreach (XmlNode node in this.xmlDocument.FirstChild.ChildNodes) { int num = 0; int num2 = 0; int num3 = 0; int num4 = 0; int num5 = 0; int num6 = 0; int num7 = 0; int num8 = 0; int num9 = 0; int num10 = 0; int num11 = 0; int num12 = 0; int num13 = 0; int num14 = 0; int num15 = 0; int num16 = 0; int num17 = 0; int num18 = 0; int num19 = 0; int num20 = 0; int num21 = 0; int num22 = 0; int num23 = 0; int num24 = 0; int num25 = 0; if (StudentModel.isReGeneration) { num = this.numberTools.myRandom(5); num2 = this.numberTools.myRandom(5); num3 = this.numberTools.myRandom(5); num4 = this.numberTools.myRandom(5); num5 = this.numberTools.myRandom(5); num6 = this.numberTools.myRandom(5); num7 = this.numberTools.myRandom(5); num8 = this.numberTools.myRandom(5); num9 = this.numberTools.myRandom(5); num10 = 1; num11 = num4; num12 = num5; num13 = num6; num14 = num; num15 = num2; num16 = num3; num17 = (num * num4) + num7; num18 = num * num5; num19 = (num * num6) - num7; num20 = num2 * num4; num21 = (num2 * num5) + num8; num22 = (num2 * num6) - num8; num23 = num3 * num4; num24 = num3 * num5; num25 = (num3 * num6) + num9; string str = SupportTools.getGuid(); string path = "temp/generate/g_one_1.xml"; FileStream w = new FileStream(path, FileMode.Create); XmlTextWriter writer = new XmlTextWriter(w, Encoding.UTF8) { Formatting = Formatting.Indented }; writer.WriteStartDocument(); writer.WriteStartElement("Info"); writer.WriteAttributeString("guid", str); writer.WriteAttributeString("save", "false"); writer.WriteStartElement("Params"); writer.WriteElementString("a11", num10.ToString()); writer.WriteElementString("a12", num11.ToString()); writer.WriteElementString("a13", num12.ToString()); writer.WriteElementString("a14", num13.ToString()); writer.WriteElementString("a21", num14.ToString()); writer.WriteElementString("a22", num17.ToString()); writer.WriteElementString("a23", num18.ToString()); writer.WriteElementString("a24", num19.ToString()); writer.WriteElementString("a31", num15.ToString()); writer.WriteElementString("a32", num20.ToString()); writer.WriteElementString("a33", num21.ToString()); writer.WriteElementString("a34", num22.ToString()); writer.WriteElementString("a41", num16.ToString()); writer.WriteElementString("a42", num23.ToString()); writer.WriteElementString("a43", num24.ToString()); writer.WriteElementString("a44", num25.ToString()); writer.WriteEndElement(); writer.WriteStartElement("Answer"); writer.WriteElementString("D", ((num7 * num8) * num9).ToString()); writer.WriteEndElement(); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); writer.Close(); } else { XmlDocument xmldoc = new XmlDocument(); xmldoc.Load("temp/generate/g_one_1.xml"); XmlNode node2 = SupportTools.ParamsXmlNode(xmldoc); foreach (XmlNode node3 in node2.ChildNodes) { if (node3.Name.Equals("a11")) { num10 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a12")) { num11 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a13")) { num12 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a14")) { num13 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a21")) { num14 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a22")) { num17 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a23")) { num18 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a24")) { num19 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a31")) { num15 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a32")) { num20 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a33")) { num21 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a34")) { num22 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a41")) { num16 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a42")) { num23 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a43")) { num24 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a44")) { num25 = int.Parse(node3.InnerText); } } } string sXML = node.InnerText.Replace("#x#", number).Replace("#a#", num10.ToString()).Replace("#b#", num11.ToString()).Replace("#c#", num12.ToString()).Replace("#d#", num13.ToString()).Replace("#e#", num14.ToString()).Replace("#f#", num17.ToString()).Replace("#g#", num18.ToString()).Replace("#h#", num19.ToString()).Replace("#i#", num15.ToString()).Replace("#j#", num20.ToString()).Replace("#k#", num21.ToString()).Replace("#l#", num22.ToString()).Replace("#m#", num16.ToString()).Replace("#n#", num23.ToString()).Replace("#o#", num24.ToString()).Replace("#p#", num25.ToString()); control1.Size = new Size(360, 120); control1.Enabled = false; control1.Font = new Font("宋体", 14f, FontStyle.Bold); control1.Anchor = AnchorStyles.None; control1.pub_LoadXML(sXML); } }
public void g_two_2_1Generate(NuGenEQML control1, string number) { this.xmlDocument.Load("GapfillingXML/g_two_2_1.xml"); foreach (XmlNode node in this.xmlDocument.FirstChild.ChildNodes) { int num = 0; int num2 = 0; int i = 0; int j = 0; int num5 = 0; int num6 = 0; int num7 = 0; if (StudentModel.isReGeneration) { int l; num = this.numberTools.myRandom(9); if (num == 1) { num = 2; } num2 = this.numberTools.myRandom(9); i = this.random.Next(1, 3); j = this.random.Next(i + 1, 4); num5 = this.random.Next(1, 3); num6 = this.random.Next(num5 + 1, 4); num7 = this.random.Next(1, 4); string str = SupportTools.getGuid(); string path = "temp/generate/g_two_2_1.xml"; FileStream w = new FileStream(path, FileMode.Create); XmlTextWriter writer = new XmlTextWriter(w, Encoding.UTF8) { Formatting = Formatting.Indented }; writer.WriteStartDocument(); writer.WriteStartElement("Info"); writer.WriteAttributeString("save", "false"); writer.WriteAttributeString("guid", str); writer.WriteStartElement("Params"); writer.WriteElementString("i", i.ToString()); writer.WriteElementString("j", j.ToString()); writer.WriteElementString("k", num.ToString()); writer.WriteElementString("t", num7.ToString()); writer.WriteEndElement(); List <int> list = new List <int>(); for (int k = 0; k < 9; k++) { list.Add(0); } if (i == num7) { list[(((i - 1) * 3) + j) - 1] = num; list[(((j - 1) * 3) + i) - 1] = 1; l = SupportTools.GetL(i, j); list[(((l - 1) * 3) + l) - 1] = 1; } else if (j == num7) { list[(((i - 1) * 3) + j) - 1] = 1; list[(((j - 1) * 3) + i) - 1] = num; l = SupportTools.GetL(i, j); list[(((l - 1) * 3) + l) - 1] = 1; } else { list[(((i - 1) * 3) + j) - 1] = 1; list[(((j - 1) * 3) + i) - 1] = 1; l = SupportTools.GetL(i, j); list[(((num7 - 1) * 3) + num7) - 1] = num; } writer.WriteStartElement("Answer"); int num10 = list[0]; writer.WriteElementString("b11", num10.ToString()); num10 = list[1]; writer.WriteElementString("b12", num10.ToString()); num10 = list[2]; writer.WriteElementString("b13", num10.ToString()); num10 = list[3]; writer.WriteElementString("b21", num10.ToString()); num10 = list[4]; writer.WriteElementString("b22", num10.ToString()); num10 = list[5]; writer.WriteElementString("b23", num10.ToString()); num10 = list[6]; writer.WriteElementString("b31", num10.ToString()); num10 = list[7]; writer.WriteElementString("b32", num10.ToString()); writer.WriteElementString("b33", list[8].ToString()); writer.WriteEndElement(); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); writer.Close(); } else { XmlDocument xmldoc = new XmlDocument(); xmldoc.Load("temp/generate/g_two_2_1.xml"); XmlNode node2 = SupportTools.ParamsXmlNode(xmldoc); foreach (XmlNode node3 in node2.ChildNodes) { if (node3.Name.Equals("k")) { num = int.Parse(node3.InnerText); } else if (node3.Name.Equals("s")) { num2 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("i")) { i = int.Parse(node3.InnerText); } else if (node3.Name.Equals("j")) { j = int.Parse(node3.InnerText); } else if (node3.Name.Equals("m")) { num5 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("n")) { num6 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("t")) { num7 = int.Parse(node3.InnerText); } } } string sXML = node.InnerText.Replace("#x#", number).Replace("#k#", num.ToString()).Replace("#s#", num2.ToString()).Replace("#i#", i.ToString()).Replace("#j#", j.ToString()).Replace("#m#", num5.ToString()).Replace("#n#", num6.ToString()).Replace("#t#", num7.ToString()); control1.Size = new Size(900, 60); control1.Enabled = false; control1.Anchor = AnchorStyles.None; control1.pub_LoadXML(sXML); } }
public void C5Generate(NuGenEQML control, string number) { this.xmldocument.Load("CalculationXML/c5.xml"); foreach (XmlNode node in this.xmldocument.FirstChild.ChildNodes) { int num = 0; int num2 = 0; int num3 = 0; int num4 = 0; string newValue = null; if (StudentModel.isReGeneration) { num = this.numberTools.myRandom(8); num2 = this.numberTools.myRandom(8); num3 = this.numberTools.myRandom(8); num4 = this.numberTools.myRandom(8); if ((num4 == num3) || (num4 == (2 * num3))) { num4 = -1 * num4; } if (((-1 * num) - num2) == 0) { num2++; } newValue = ((-1 * num) - num2).ToString(); string str2 = SupportTools.getGuid(); string path = "temp/generate/c5.xml"; FileStream w = new FileStream(path, FileMode.Create); XmlTextWriter writer = new XmlTextWriter(w, Encoding.UTF8) { Formatting = Formatting.Indented }; writer.WriteStartDocument(); writer.WriteStartElement("Info"); writer.WriteAttributeString("save", "false"); writer.WriteAttributeString("guid", str2); writer.WriteStartElement("Params"); writer.WriteElementString("k ", num3.ToString()); writer.WriteElementString("a ", num.ToString()); writer.WriteElementString("b ", num2.ToString()); writer.WriteElementString("m ", num4.ToString()); writer.WriteElementString("m1 ", newValue.ToString()); writer.WriteEndElement(); writer.WriteStartElement("Answer"); writer.WriteElementString("k ", num3.ToString()); writer.WriteElementString("a ", num.ToString()); writer.WriteElementString("b ", num2.ToString()); writer.WriteElementString("m ", num4.ToString()); writer.WriteEndElement(); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); writer.Close(); } else { XmlDocument xmldoc = new XmlDocument(); xmldoc.Load("temp/generate/c5.xml"); XmlNode node2 = SupportTools.ParamsXmlNode(xmldoc); foreach (XmlNode node3 in node2.ChildNodes) { if (node3.Name.Equals("k")) { num3 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("a")) { num = int.Parse(node3.InnerText); } else if (node3.Name.Equals("b")) { num2 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("m")) { num4 = int.Parse(node3.InnerText); } else if (node3.Name.Equals("m1")) { newValue = node3.InnerText; } } } string sXML = node.InnerText.Replace("#x#", number).Replace("#k#", num3.ToString()).Replace("#a#", num.ToString()).Replace("#b#", num2.ToString()).Replace("#n#", newValue).Replace("#m#", num4.ToString()); control.Size = new Size(0x410, 70); control.Enabled = false; control.pub_LoadXML(sXML); } }