Example #1
0
 public static void ReadOfficeExcel(string path)
 {
     pXml = new ProblemXML(path + "e.xml", true);
     if (!pXml.isError)
     {
         List<OfficeExcel> list = pXml.GetExcelProbelm();
         foreach (OfficeExcel c in list)
         {
             ClientControl.paper.Add(c);
         }
         ClientControl.MainForm.addPage(ProblemType.Excel);
     }
 }
Example #2
0
 public static void ReadOfficePPT(string path)
 {
     pXml = new ProblemXML(path + "f.xml", true);
     if (!pXml.isError)
     {
         List<OfficePowerPoint> list = pXml.GetPowerPointProbelm();
         foreach (OfficePowerPoint c in list)
         {
             ClientControl.paper.Add(c);
         }
         ClientControl.MainForm.addPage(ProblemType.PowerPoint);
     }
 }
Example #3
0
 public static void ReadJudge(string path)
 {
     pXml = new ProblemXML(path + "c.xml", true);
     if (!pXml.isError)
     {
         List<Judgment> list = pXml.GetJudgeProbelms();
         foreach (Judgment c in list)
         {
             ClientControl.paper.Add(c);
         }
         ClientControl.MainForm.addPage(ProblemType.Judgment);
     }
 }
Example #4
0
 public static void ReadCompletion(string path)
 {
     pXml = new ProblemXML(path + "b.xml", true);
     if (!pXml.isError)
     {
         List<Completion> list = pXml.GetCompletionProbelms();
         foreach (Completion c in list)
         {
             ClientControl.paper.Add(c);
         }
         ClientControl.MainForm.addPage(ProblemType.Completion);
     }
 }
Example #5
0
 public static void ReadChoice(string path)
 {
     pXml = new ProblemXML(path + "a.xml", true);
     if (!pXml.isError)
     {
         List<Choice> list = pXml.GetChoiceProbelms();
         foreach (Choice c in list)
         {
             ClientControl.paper.Add(c);
         }
         ClientControl.MainForm.addPage(ProblemType.Choice);
     }
 }
Example #6
0
 public static void ClearAll()
 {
     choiceList.Clear();
     completionList.Clear();
     judgeList.Clear();
     officeexcel.Clear();
     officeppt.Clear();
     officeword.Clear();
     pcompletion.Clear();
     pmodif.Clear();
     pfunction.Clear();
     problemList.Clear();
     paperid = "";
     pXml = null;
 }
Example #7
0
        public static void xmltoxml(string xmlpath)
        {
            ClearAll();

            problemList = XMLControl.ReadPaper(xmlpath);
            paperid = XMLControl.getPaperId(xmlpath);

            string paperpath = "";

            paperpath = Program.config["Root"] + Program.config["PaperPkg"] + paperid + "\\";
            Directory.CreateDirectory(paperpath);

            foreach (IdScoreType problem in problemList)
            {
                switch (problem.pt)
                {
                    case ProblemType.Choice:
                        choiceList.Add(PaperControl.OesData.FindChoiceByPID(problem.id)[0]);
                        break;
                    case ProblemType.Completion:
                        completionList.Add(PaperControl.OesData.FindCompletionByPID(problem.id)[0]);
                        break;
                    case ProblemType.Judgment:
                        judgeList.Add(PaperControl.OesData.FindJudgmentByPID(problem.id)[0]);
                        break;

                    case ProblemType.Word:
                        officeword.Add(PaperControl.OesData.FindOfficeByPID(problem.id)[0] as OfficeWord);
                        File.Copy(Program.config["Root"] + Program.config["Word"] + "p" + problem.id.ToString() + ".doc", paperpath + "d" + (officeword.Count - 1).ToString() + ".doc", true);
                        break;
                    case ProblemType.Excel:
                        officeexcel.Add(PaperControl.OesData.FindOfficeByPID(problem.id)[0] as OfficeExcel);
                        File.Copy(Program.config["Root"] + Program.config["Excel"] + "p" + problem.id.ToString() + ".xls", paperpath + "e" + (officeexcel.Count-1).ToString() + ".xls", true);
                        break;
                    case ProblemType.PowerPoint:
                        officeppt.Add(PaperControl.OesData.FindOfficeByPID(problem.id)[0] as OfficePowerPoint);
                        File.Copy(Program.config["Root"] + Program.config["PowerPoint"] + "p" + problem.id.ToString() + ".ppt", paperpath + "f" + (officeppt.Count - 1).ToString() + ".ppt", true);
                        break;

                    case ProblemType.CProgramCompletion:
                        pcompletion.Add(PaperControl.OesData.FindProgramByPID(problem.id)[0] as PCompletion);
                        File.Copy(Program.config["Root"] + Program.config["CCompletion"] + "p" + problem.id.ToString() + ".c", paperpath + "g" + (pcompletion.Count - 1).ToString() + ".c", true);
                        break;
                    case ProblemType.CProgramModification:
                        pmodif.Add(PaperControl.OesData.FindProgramByPID(problem.id)[0] as PModif);
                        File.Copy(Program.config["Root"] + Program.config["CModification"] + "p" + problem.id.ToString() + ".c", paperpath + "h" + (pmodif.Count - 1).ToString() + ".c", true);
                        break;
                    case ProblemType.CProgramFun:
                        pfunction.Add(PaperControl.OesData.FindProgramByPID(problem.id)[0] as PFunction);
                        File.Copy(Program.config["Root"] + Program.config["CFunction"] + "p" + problem.id.ToString() + ".c", paperpath + "i" + (pfunction.Count - 1).ToString() + ".c", true);
                        break;

                    case ProblemType.CppProgramCompletion:
                        pcompletion.Add(PaperControl.OesData.FindProgramByPID(problem.id)[0] as PCompletion);
                        File.Copy(Program.config["Root"] + Program.config["CppCompletion"] + "p" + problem.id.ToString() + ".cpp", paperpath + "g" + (pcompletion.Count - 1).ToString() + ".cpp", true);
                        break;
                    case ProblemType.CppProgramModification:
                        pmodif.Add(PaperControl.OesData.FindProgramByPID(problem.id)[0] as PModif);
                        File.Copy(Program.config["Root"] + Program.config["CppModification"] + "p" + problem.id.ToString() + ".cpp", paperpath + "h" + (pmodif.Count - 1).ToString() + ".cpp", true);
                        break;
                    case ProblemType.CppProgramFun:
                        pfunction.Add(PaperControl.OesData.FindProgramByPID(problem.id)[0] as PFunction);
                        File.Copy(Program.config["Root"] + Program.config["CppFunction"] + "p" + problem.id.ToString() + ".cpp", paperpath + "i" + (pfunction.Count - 1).ToString() + ".cpp", true);
                        break;

                    case ProblemType.VbProgramCompletion:
                        pcompletion.Add(PaperControl.OesData.FindProgramByPID(problem.id)[0] as PCompletion);
                        File.Copy(Program.config["Root"] + Program.config["VbCompletion"] + "p" + problem.id.ToString() + ".vb", paperpath + "g" + (pcompletion.Count - 1).ToString() + ".vb", true);
                        break;
                    case ProblemType.VbProgramModification:
                        pmodif.Add(PaperControl.OesData.FindProgramByPID(problem.id)[0] as PModif);
                        File.Copy(Program.config["Root"] + Program.config["VbModification"] + "p" + problem.id.ToString() + ".vb", paperpath + "h" + (pmodif.Count - 1).ToString() + ".vb", true);
                        break;
                    case ProblemType.VbProgramFun:
                        pfunction.Add(PaperControl.OesData.FindProgramByPID(problem.id)[0] as PFunction);
                        File.Copy(Program.config["Root"] + Program.config["VbFunction"] + "p" + problem.id.ToString() + ".vb", paperpath + "i" + (pfunction.Count - 1).ToString() + ".vb", true);
                        break;
                }
            }
            if (choiceList.Count != 0)
            {
                pXml = new ProblemXML(paperpath + "a.xml", false);
                pXml.SetChoiceProbelms(choiceList);
            }
            if (completionList.Count != 0)
            {
                pXml = new ProblemXML(paperpath + "b.xml", false);
                pXml.SetCompletionProbelms(completionList);
            }
            if (judgeList.Count != 0)
            {
                pXml = new ProblemXML(paperpath + "c.xml", false);
                pXml.SetJudgeProbelms(judgeList);
            }
            if (officeword.Count != 0)
            {
                pXml = new ProblemXML(paperpath + "d.xml", false);
                pXml.SetWordProbelm(officeword);
            }
            if (officeexcel.Count != 0)
            {
                pXml = new ProblemXML(paperpath + "e.xml", false);
                pXml.SetExcelProbelm(officeexcel);
            }
            if (officeppt.Count != 0)
            {
                pXml = new ProblemXML(paperpath + "f.xml", false);
                pXml.SetPowerPointProbelm(officeppt);
            }
            if (pcompletion.Count != 0)
            {
                pXml = new ProblemXML(paperpath + "g.xml", false);
                pXml.SetPCompletionProbelm(pcompletion);
            }
            if (pmodif.Count != 0)
            {
                pXml = new ProblemXML(paperpath + "h.xml", false);
                pXml.SetPModifProbelm(pmodif);
            }
            if (pfunction.Count != 0)
            {
                pXml = new ProblemXML(paperpath + "i.xml", false);
                pXml.SetPFunctionProbelm(pfunction);
            }
            RARHelper.CompressRAR(paperpath, paperid, Program.config["Root"] + Program.config["PaperPkg"], "123456");
            ClearAll();
        }
Example #8
0
 public static void ReadPModif(string path)
 {
     pXml = new ProblemXML(path + "h.xml", true);
     if (!pXml.isError)
     {
         List<PModif> list = pXml.GetPModifProbelm();
         foreach (PModif c in list)
         {
             ClientControl.paper.Add(c);
         }
         ClientControl.MainForm.addPage(ProblemType.BaseProgramModification);
     }
 }
Example #9
0
 public static void ReadPFunction(string path)
 {
     pXml = new ProblemXML(path + "i.xml", true);
     if (!pXml.isError)
     {
         List<PFunction> list = pXml.GetPFunctionProbelm();
         foreach (PFunction c in list)
         {
             ClientControl.paper.Add(c);
         }
         ClientControl.MainForm.addPage(ProblemType.BaseProgramFun);
     }
 }