Esempio n. 1
0
        /// <summary>
        /// 显示用户答案
        /// </summary>
        public void ReadAnswer()
        {
            PaperDetailBll.UserPaperFillDs(selectPaper);
            switch (tabConQustion.SelectedTab.Text)
            {
            case "单选题":
                TitleID        = tslblSingle.Text;
                txtSingle.Text = PaperDetailBll.sp[Convert.ToInt32(TitleID) - 1].Title;
                oldTitleID     = PaperDetailBll.sp[Convert.ToInt32(TitleID) - 1].TID;
                lblA.Text      = PaperDetailBll.sp[Convert.ToInt32(TitleID) - 1].AnswerA;
                lblB.Text      = PaperDetailBll.sp[Convert.ToInt32(TitleID) - 1].AnswerB;
                lblC.Text      = PaperDetailBll.sp[Convert.ToInt32(TitleID) - 1].AnswerC;
                lblD.Text      = PaperDetailBll.sp[Convert.ToInt32(TitleID) - 1].AnswerD;
                if (Traversal("singleProblem" + TitleID) == "A")
                {
                    rdoA.Checked = true;
                }
                else if (Traversal("singleProblem" + TitleID) == "B")
                {
                    rdoB.Checked = true;
                }
                else if (Traversal("singleProblem" + TitleID) == "C")
                {
                    rdoC.Checked = true;
                }
                else if (Traversal("singleProblem" + TitleID) == "D")
                {
                    rdoD.Checked = true;
                }
                else
                {
                    rdoA.Checked = false;
                    rdoB.Checked = false;
                    rdoC.Checked = false;
                    rdoD.Checked = false;
                }
                break;

            case "多选题":
                TitleID         = tslblMulti.Text;
                txtMulti.Text   = PaperDetailBll.mp[Convert.ToInt32(TitleID) - 1].Title;
                oldTitleID      = PaperDetailBll.mp[Convert.ToInt32(TitleID) - 1].TID;
                lblAnswerA.Text = PaperDetailBll.mp[Convert.ToInt32(TitleID) - 1].AnswerA;
                lblAnswerB.Text = PaperDetailBll.mp[Convert.ToInt32(TitleID) - 1].AnswerB;
                lblAnswerC.Text = PaperDetailBll.mp[Convert.ToInt32(TitleID) - 1].AnswerC;
                lblAnswerD.Text = PaperDetailBll.mp[Convert.ToInt32(TitleID) - 1].AnswerD;
                if (Traversal("multiProblem" + TitleID).IndexOf('A') != -1)
                {
                    ckbA.Checked = true;
                }
                if (Traversal("multiProblem" + TitleID).IndexOf('B') != -1)
                {
                    ckbA.Checked = true;
                }
                if (Traversal("multiProblem" + TitleID).IndexOf('C') != -1)
                {
                    ckbA.Checked = true;
                }
                if (Traversal("multiProblem" + TitleID).IndexOf('D') != -1)
                {
                    ckbA.Checked = true;
                }
                else
                {
                    ckbA.Checked = false;
                    ckbB.Checked = false;
                    ckbC.Checked = false;
                    ckbD.Checked = false;
                }
                break;

            case "判断题":
                TitleID       = tslblJudge.Text;
                txtJudge.Text = PaperDetailBll.jp[Convert.ToInt32(TitleID) - 1].Title;
                oldTitleID    = PaperDetailBll.jp[Convert.ToInt32(TitleID) - 1].TID;
                if (Traversal("judgeProblem" + TitleID) == "0")
                {
                    rdoRight.Checked = true;
                }
                else if (Traversal("judgeProblem" + TitleID) == "1")
                {
                    rdoWrong.Checked = true;
                }
                else
                {
                    rdoRight.Checked = false;
                    rdoWrong.Checked = false;
                }
                break;

            case "填空题":
                TitleID            = tslblFillBlank.Text;
                txtFrontTitle.Text = PaperDetailBll.fbp[Convert.ToInt32(TitleID) - 1].FrontTitle;
                txtBackTitle.Text  = PaperDetailBll.fbp[Convert.ToInt32(TitleID) - 1].BackTitle;
                oldTitleID         = PaperDetailBll.fbp[Convert.ToInt32(TitleID) - 1].TID;
                if (Traversal("fillBlankProblem" + TitleID) != "" || Traversal("fillBlankProblem" + TitleID) != "NULL")
                {
                    txtAnswer.Text = Traversal("fillBlankProblem" + TitleID);
                }
                break;

            case "简答题":
                TitleID       = tslblQuestion.Text;
                txtTitle.Text = PaperDetailBll.qp[Convert.ToInt32(TitleID) - 1].Title;
                oldTitleID    = PaperDetailBll.qp[Convert.ToInt32(TitleID) - 1].TID;
                if (Traversal("questionProblem" + TitleID) != "" || Traversal("questionProblem" + TitleID) != "NULL")
                {
                    txtQuestion.Text = Traversal("questionProblem" + TitleID);
                }
                break;

            default:
                break;
            }
        }
Esempio n. 2
0
 int m5; //简答题每题分数
 /// <summary>
 /// 界面初始化
 /// </summary>
 private void StartReadQuestion()
 {
     timer1.Start();
     tslNo.Text   = User.UserID;
     tslName.Text = User.UserName;
     PaperDetailBll.UserPaperFillDs(selectPaper);
     if (PaperDetailBll.sp != null)
     {
         tsslblTime.Text = PaperDetailBll.sp[0].WriteTime;
         m1             = int.Parse(PaperDetailBll.sp[0].Mark);
         txtSingle.Text = PaperDetailBll.sp[0].Title;
         lblA.Text      = PaperDetailBll.sp[0].AnswerA;
         lblB.Text      = PaperDetailBll.sp[0].AnswerB;
         lblC.Text      = PaperDetailBll.sp[0].AnswerC;
         lblD.Text      = PaperDetailBll.sp[0].AnswerD;
         oldTitleID     = PaperDetailBll.sp[0].TID;
     }
     else
     {
         m1 = 0;
         tslSingleDown.Enabled = false;
         rdoA.Enabled          = false;
         rdoB.Enabled          = false;
         rdoC.Enabled          = false;
         rdoD.Enabled          = false;
     }
     if (PaperDetailBll.mp != null)
     {
         tsslblTime.Text = PaperDetailBll.mp[0].WriteTime;
         m2              = int.Parse(PaperDetailBll.mp[0].Mark);
         txtMulti.Text   = PaperDetailBll.mp[0].Title;
         lblAnswerA.Text = PaperDetailBll.mp[0].AnswerA;
         lblAnswerB.Text = PaperDetailBll.mp[0].AnswerB;
         lblAnswerC.Text = PaperDetailBll.mp[0].AnswerC;
         lblAnswerD.Text = PaperDetailBll.mp[0].AnswerD;
     }
     else
     {
         m2 = 0;
         tslMultiDown.Enabled = false;
         ckbA.Enabled         = false;
         ckbB.Enabled         = false;
         ckbC.Enabled         = false;
         ckbD.Enabled         = false;
     }
     if (PaperDetailBll.jp != null)
     {
         tsslblTime.Text = PaperDetailBll.jp[0].WriteTime;
         m3            = int.Parse(PaperDetailBll.jp[0].Mark);
         txtJudge.Text = PaperDetailBll.jp[0].Title;
     }
     else
     {
         m3 = 0;
         tslJudgeDown.Enabled = false;
         rdoRight.Enabled     = false;
         rdoWrong.Enabled     = false;
     }
     if (PaperDetailBll.fbp != null)
     {
         tsslblTime.Text = PaperDetailBll.fbp[0].WriteTime;
         m4 = int.Parse(PaperDetailBll.fbp[0].Mark);
         txtFrontTitle.Text = PaperDetailBll.fbp[0].FrontTitle;
         txtBackTitle.Text  = PaperDetailBll.fbp[0].BackTitle;
     }
     else
     {
         m4 = 0;
         tslFillBlankDown.Enabled = false;
         txtAnswer.Enabled        = false;
     }
     if (PaperDetailBll.qp != null)
     {
         tsslblTime.Text = PaperDetailBll.qp[0].WriteTime;
         m5            = int.Parse(PaperDetailBll.qp[0].Mark);
         txtTitle.Text = PaperDetailBll.qp[0].Title;
     }
     else
     {
         m5 = 0;
         tslQuestionDown.Enabled = false;
         txtQuestion.Enabled     = false;
     }
 }