Beispiel #1
0
        public frmQuesChange(Problem problem)
        {
            InitializeComponent();
            InitCombText();

            this.Typecombo.SelectedIndex = 0;
            this.Diffcombo.SelectedIndex = 0;
            this.Textcombo.SelectedIndex = 0;

            if (problem != null)
            {
                int quesType = Convert.ToInt32(problem.type);
                this.Typecombo.SelectedIndex = quesType;
                this.scoreBox.Text = Convert.ToString(problem.score);
            }
            else
            {
                this.scoreBox.Text = "";
            }

            aList = (ListItem)this.Unitcombo.SelectedItem;
            pointWords = this.PcontentText.Text;
            theType = this.Typecombo.SelectedIndex;
            InitList(this.Typecombo.SelectedIndex, Convert.ToInt32(aList.key), Convert.ToInt32(bList.key), this.Diffcombo.SelectedIndex, pointWords, 1);
            this.Pagecombo.Items.Clear();
            InitCombPage(quesNum);
        }
Beispiel #2
0
 private void UpdateBut_Click(object sender, EventArgs e)
 {
     thePro = null;
     this.Visible = false;
 }
Beispiel #3
0
 private void frmQuesChange_FormClosed(object sender, FormClosedEventArgs e)
 {
     thePro=null;
 }
Beispiel #4
0
 private void AddButton_Click(object sender, EventArgs e)
 {
     switch (this.Typecombo.SelectedIndex)
     {
         case 0: thePro = InfoControl.OesData.FindChoiceByPID(Convert.ToInt32(this.ProblemDGV.Rows[this.ProblemDGV.CurrentRow.Index].Cells[1].Value))[0]; break;
         case 1: thePro = InfoControl.OesData.FindCompletionByPID(Convert.ToInt32(this.ProblemDGV.Rows[this.ProblemDGV.CurrentRow.Index].Cells[1].Value))[0]; break;
         case 2: thePro = InfoControl.OesData.FindJudgmentByPID(Convert.ToInt32(this.ProblemDGV.Rows[this.ProblemDGV.CurrentRow.Index].Cells[1].Value))[0]; break;
         case 3: thePro = InfoControl.OesData.FindOfficeWordByPID(Convert.ToInt32(this.ProblemDGV.Rows[this.ProblemDGV.CurrentRow.Index].Cells[1].Value))[0]; break;
         case 4: thePro = InfoControl.OesData.FindOfficeExcelByPID(Convert.ToInt32(this.ProblemDGV.Rows[this.ProblemDGV.CurrentRow.Index].Cells[1].Value))[0]; break;
         case 5: thePro = InfoControl.OesData.FindOfficePowerPointByPID(Convert.ToInt32(this.ProblemDGV.Rows[this.ProblemDGV.CurrentRow.Index].Cells[1].Value))[0]; break;
         case 6: thePro = InfoControl.OesData.FindCompletionByPID(Convert.ToInt32(this.ProblemDGV.Rows[this.ProblemDGV.CurrentRow.Index].Cells[1].Value))[0]; break;
         case 7: thePro = InfoControl.OesData.FindModifyProgramByPID(Convert.ToInt32(this.ProblemDGV.Rows[this.ProblemDGV.CurrentRow.Index].Cells[1].Value))[0]; break;
         case 8: thePro = InfoControl.OesData.FindFunctionProgramByPID(Convert.ToInt32(this.ProblemDGV.Rows[this.ProblemDGV.CurrentRow.Index].Cells[1].Value))[0]; break;
         case 9: thePro = InfoControl.OesData.FindCompletionByPID(Convert.ToInt32(this.ProblemDGV.Rows[this.ProblemDGV.CurrentRow.Index].Cells[1].Value))[0]; break;
         case 10: thePro = InfoControl.OesData.FindModifyProgramByPID(Convert.ToInt32(this.ProblemDGV.Rows[this.ProblemDGV.CurrentRow.Index].Cells[1].Value))[0]; break;
         case 11: thePro = InfoControl.OesData.FindFunctionProgramByPID(Convert.ToInt32(this.ProblemDGV.Rows[this.ProblemDGV.CurrentRow.Index].Cells[1].Value))[0]; break;
         case 12: thePro = InfoControl.OesData.FindCompletionByPID(Convert.ToInt32(this.ProblemDGV.Rows[this.ProblemDGV.CurrentRow.Index].Cells[1].Value))[0]; break;
         case 13: thePro = InfoControl.OesData.FindModifyProgramByPID(Convert.ToInt32(this.ProblemDGV.Rows[this.ProblemDGV.CurrentRow.Index].Cells[1].Value))[0]; break;
         case 14: thePro = InfoControl.OesData.FindFunctionProgramByPID(Convert.ToInt32(this.ProblemDGV.Rows[this.ProblemDGV.CurrentRow.Index].Cells[1].Value))[0]; break;
     }
     if (scoreBox.Text == "")
         MessageBox.Show("请输入分值!");
     else
     {
         thePro.score = Convert.ToInt32(scoreBox.Text);
         this.Visible = false;
     }
 }
Beispiel #5
0
        /// <summary>
        /// 往试卷中添加一道题目
        /// </summary>
        /// <param name="p">题目</param>
        public void Add(Problem p)
        {
            if (p is Choice)
            {
                p.orderId = choice.Count;
                choice.Add((Choice) p);
            }
            else if (p is Completion)
            {
                p.orderId = completion.Count;
                completion.Add((Completion) p);
            }
            else if (p is Judgment)
            {
                p.orderId = judge.Count;
                judge.Add((Judgment) p);
            }
            else if (p is PCompletion)
            {
                p.orderId = pCompletion.Count;
                pCompletion.Add((PCompletion) p);
            }
            else if (p is PModif)
            {
                p.orderId = pModif.Count;
                pModif.Add((PModif) p);
            }
            else if (p is PFunction)
            {
                p.orderId = pFunction.Count;
                pFunction.Add((PFunction) p);
            }
            else if (p is OfficeExcel)
            {
                p.orderId = officeExcel.Count;
                officeExcel.Add((OfficeExcel) p);
            }
            else if (p is OfficePowerPoint)
            {
                p.orderId = officePPT.Count;
                officePPT.Add((OfficePowerPoint) p);
            }
            else if (p is OfficeWord)
            {
                p.orderId = officeWord.Count;
                officeWord.Add((OfficeWord) p);
            }
            p.problemId = problemList.Count;

            problemList.Add(p);
        }
Beispiel #6
0
 public static void Paper_FilesComplete()
 {
     Problem tmpPro;
     TmpPaper.paperPath = InfoControl.config["TempPaperPath"] + TmpPaper.paperID + ".xml";
     List<IdScoreType> tmpList = XMLControl.ReadPaper(TmpPaper.paperPath);
     InfoControl.TmpPaper.problemList = new List<Problem>();
     foreach (IdScoreType pro in tmpList)
     {
         tmpPro = new Problem();
         switch (pro.pt)
         {
             case ProblemType.Choice:
                 tmpPro = InfoControl.OesData.FindChoiceByPID(pro.id)[0];
                 InfoControl.TmpPaper.problemList.Add(tmpPro);
                 InfoControl.TmpPaper.score_choice = pro.score;
                 break;
             case ProblemType.Judgment:
                 tmpPro = InfoControl.OesData.FindJudgmentByPID(pro.id)[0];
                 InfoControl.TmpPaper.problemList.Add(tmpPro);
                 InfoControl.TmpPaper.score_judge = pro.score;
                 break;
             case ProblemType.Completion:
                 tmpPro = InfoControl.OesData.FindCompletionByPID(pro.id)[0];
                 InfoControl.TmpPaper.problemList.Add(tmpPro);
                 InfoControl.TmpPaper.score_completion = pro.score;
                 break;
             case ProblemType.Word:
                 tmpPro = InfoControl.OesData.FindOfficeByPID(pro.id)[0];
                 InfoControl.TmpPaper.problemList.Add(tmpPro);
                 InfoControl.TmpPaper.score_officeWord = pro.score;
                 break;
             case ProblemType.PowerPoint:
                 tmpPro = InfoControl.OesData.FindOfficeByPID(pro.id)[0];
                 InfoControl.TmpPaper.problemList.Add(tmpPro);
                 InfoControl.TmpPaper.score_officePPT = pro.score;
                 break;
             case ProblemType.Excel:
                 tmpPro = InfoControl.OesData.FindOfficeByPID(pro.id)[0];
                 InfoControl.TmpPaper.problemList.Add(tmpPro);
                 InfoControl.TmpPaper.score_officeExcel = pro.score;
                 break;
             case ProblemType.CProgramCompletion:
             case ProblemType.CppProgramCompletion:
             case ProblemType.VbProgramCompletion:
                 tmpPro = InfoControl.OesData.FindProgramByPID(pro.id)[0];
                 InfoControl.TmpPaper.problemList.Add(tmpPro);
                 InfoControl.TmpPaper.score_pModif = pro.score;
                 break;
             case ProblemType.CProgramModification:
             case ProblemType.CppProgramModification:
             case ProblemType.VbProgramModification:
                 tmpPro = InfoControl.OesData.FindProgramByPID(pro.id)[0];
                 InfoControl.TmpPaper.problemList.Add(tmpPro);
                 InfoControl.TmpPaper.score_pCompletion = pro.score;
                 break;
             case ProblemType.CProgramFun:
             case ProblemType.CppProgramFun:
             case ProblemType.VbProgramFun:
                 tmpPro = InfoControl.OesData.FindProgramByPID(pro.id)[0];
                 InfoControl.TmpPaper.problemList.Add(tmpPro);
                 InfoControl.TmpPaper.score_pFunction = pro.score;
                 break;
         }
         tmpPro.problemId = pro.id;
         tmpPro.score = pro.score;
     }
 }
Beispiel #7
0
 public void SetQuestion(int x)
 {
     proID = x;
     switch (type)
     {
         case ProblemType.BaseProgramCompletion:
             prob = ClientControl.GetProgramCompletion(proID);
             break;
         case ProblemType.BaseProgramModification:
             prob = ClientControl.GetProgramModif(proID);
             break;
         case ProblemType.BaseProgramFun:
             prob = ClientControl.GetProgramFunction(proID);
             break;
     }
     switch (prob.type)
     {
         case ProblemType.CProgramCompletion:
             this.filename = "g" + proID.ToString() + ".c";
             break;
         case ProblemType.CppProgramCompletion:
             this.filename = "g" + proID.ToString() + ".cpp";
             break;
         case ProblemType.VbProgramCompletion:
             this.filename = "g" + proID.ToString() + ".vb";
             break;
         case ProblemType.CProgramModification:
             this.filename = "h" + proID.ToString() + ".c";
             break;
         case ProblemType.CppProgramModification:
             this.filename = "h" + proID.ToString() + ".cpp";
             break;
         case ProblemType.VbProgramModification:
             this.filename = "h" + proID.ToString() + ".vb";
             break;
         case ProblemType.CProgramFun:
             this.filename = "i" + proID.ToString() + ".c";
             break;
         case ProblemType.CppProgramFun:
             this.filename = "i" + proID.ToString() + ".cpp";
             break;
         case ProblemType.VbProgramFun:
             this.filename = "i" + proID.ToString() + ".vb";
             break;
     }
     this.Question.Text = prob.problem;
 }