Ejemplo n.º 1
0
        private void tslQuestionDown_Click(object sender, EventArgs e)
        {
            int count = PaperDetailBll.GetQuestionCount(selectPaper, "questionProblem");

            if (Convert.ToInt32(tslblQuestion.Text) < count)
            {
                tslblQuestion.Text    = (Convert.ToInt32(tslblQuestion.Text) + 1).ToString();
                tslQuestionUp.Enabled = true;
            }
            if (Convert.ToInt32(tslblQuestion.Text) == count)
            {
                tslQuestionDown.Enabled = false;
            }
            Add(txtQuestion.Text);
            ReadAnswer();
        }
Ejemplo n.º 2
0
        private void tslJudgeDown_Click(object sender, EventArgs e)
        {
            int    count  = PaperDetailBll.GetQuestionCount(selectPaper, "judgeProblem");
            string answer = "";

            if (Convert.ToInt32(tslblJudge.Text) < count)
            {
                if (rdoRight.Checked == false && rdoWrong.Checked == false)
                {
                    answer = "";
                    Add(answer);
                }
                tslblJudge.Text    = (Convert.ToInt32(tslblJudge.Text) + 1).ToString();
                tslJudgeUp.Enabled = true;
            }
            if (Convert.ToInt32(tslblJudge.Text) == count)
            {
                tslJudgeDown.Enabled = false;
            }
            ReadAnswer();
        }
Ejemplo n.º 3
0
        private void tslMultiDown_Click(object sender, EventArgs e)
        {
            int    count  = PaperDetailBll.GetQuestionCount(selectPaper, "multiProblem");
            string answer = "";

            if (Convert.ToInt32(tslblMulti.Text) < count)
            {
                if (ckbA.Checked == false && ckbB.Checked == false && ckbC.Checked == false && ckbD.Checked == false)
                {
                    answer = "";
                    Add(answer);
                }
                tslblMulti.Text    = (Convert.ToInt32(tslblMulti.Text) + 1).ToString();
                tslMultiUp.Enabled = true;
            }
            if (Convert.ToInt32(tslblMulti.Text) == count)
            {
                tslMultiDown.Enabled = false;
            }
            ReadAnswer();
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 用户答案初始化
 /// </summary>
 public void FillUa()
 {
     if (PaperDetailBll.GetQuestionCount(selectPaper, "singleProblem") != 0)
     {
         for (int i = 1; i <= PaperDetailBll.GetQuestionCount(selectPaper, "singleProblem"); i++)
         {
             ua.Add("singleProblem" + i.ToString(), new UserAnswer(Convert.ToInt32(selectPaper), User.UserID, "singleProblem", DateTime.Now.ToString(), 0, m1, "", 0, "singleProblem" + i.ToString()));
         }
     }
     if (PaperDetailBll.GetQuestionCount(selectPaper, "multiProblem") != 0)
     {
         for (int i = 1; i <= PaperDetailBll.GetQuestionCount(selectPaper, "multiProblem"); i++)
         {
             ua.Add("multiProblem" + i.ToString(), new UserAnswer(Convert.ToInt32(selectPaper), User.UserID, "multiProblem", DateTime.Now.ToString(), 0, m2, "", 0, "multiProblem" + i.ToString()));
         }
     }
     if (PaperDetailBll.GetQuestionCount(selectPaper, "judgeProblem") != 0)
     {
         for (int i = 1; i <= PaperDetailBll.GetQuestionCount(selectPaper, "judgeProblem"); i++)
         {
             ua.Add("judgeProblem" + i.ToString(), new UserAnswer(Convert.ToInt32(selectPaper), User.UserID, "judgeProblem", DateTime.Now.ToString(), 0, m3, "", 0, "judgeProblem" + i.ToString()));
         }
     }
     if (PaperDetailBll.GetQuestionCount(selectPaper, "fillBlankProblem") != 0)
     {
         for (int i = 1; i <= PaperDetailBll.GetQuestionCount(selectPaper, "fillBlankProblem"); i++)
         {
             ua.Add("fillBlankProblem" + i.ToString(), new UserAnswer(Convert.ToInt32(selectPaper), User.UserID, "fillBlankProblem", DateTime.Now.ToString(), 0, m4, "", 0, "fillBlankProblem" + i.ToString()));
         }
     }
     if (PaperDetailBll.GetQuestionCount(selectPaper, "questionProblem") != 0)
     {
         for (int i = 1; i <= PaperDetailBll.GetQuestionCount(selectPaper, "questionProblem"); i++)
         {
             ua.Add("questionProblem" + i.ToString(), new UserAnswer(Convert.ToInt32(selectPaper), User.UserID, "questionProblem", DateTime.Now.ToString(), 0, m5, "", 0, "questionProblem" + i.ToString()));
         }
     }
 }
Ejemplo n.º 5
0
        /// <summary>
        /// 答题卡显示
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tsbAnswer_Click(object sender, EventArgs e)
        {
            frmAnswerCard fac = new frmAnswerCard(ua);

            fac.ShowDialog();
            if (fac.title.IndexOf("singleProblem") != -1)
            {
                tabConQustion.SelectedTab = tabPage1;
                foreach (KeyValuePair <string, UserAnswer> a in ua)
                {
                    if (a.Key == fac.title)
                    {
                        tslblSingle.Text = fac.title.Substring("singleProblem".Length, fac.title.Length - "singleProblem".Length);
                        ReadAnswer();
                        if (tslblSingle.Text == "1")
                        {
                            tslSingleUp.Enabled   = false;
                            tslSingleDown.Enabled = true;
                        }
                        if (tslblSingle.Text == PaperDetailBll.GetQuestionCount(selectPaper, "singleProblem").ToString())
                        {
                            tslSingleDown.Enabled = false;
                            tslSingleUp.Enabled   = true;
                        }
                        if (tslblSingle.Text == "1" && tslblSingle.Text == PaperDetailBll.GetQuestionCount(selectPaper, "singleProblem").ToString())
                        {
                            tslSingleUp.Enabled   = false;
                            tslSingleDown.Enabled = false;
                        }
                        break;
                    }
                }
            }
            else if (fac.title.IndexOf("multiProblem") != -1)
            {
                tabConQustion.SelectedTab = tabPage2;
                foreach (KeyValuePair <string, UserAnswer> a in ua)
                {
                    if (a.Key == fac.title)
                    {
                        tslblMulti.Text = fac.title.Substring("multiProblem".Length, fac.title.Length - "multiProblem".Length);
                        ReadAnswer();
                        if (tslblMulti.Text == "1")
                        {
                            tslMultiUp.Enabled   = false;
                            tslMultiDown.Enabled = true;
                        }
                        if (tslblMulti.Text == PaperDetailBll.GetQuestionCount(selectPaper, "multiProblem").ToString())
                        {
                            tslMultiDown.Enabled = false;
                            tslMultiUp.Enabled   = true;
                        }
                        if (tslblMulti.Text == "1" && tslblMulti.Text == PaperDetailBll.GetQuestionCount(selectPaper, "multiProblem").ToString())
                        {
                            tslMultiUp.Enabled   = false;
                            tslMultiDown.Enabled = false;
                        }
                        break;
                    }
                }
            }
            else if (fac.title.IndexOf("judgeProblem") != -1)
            {
                tabConQustion.SelectedTab = tabPage3;
                foreach (KeyValuePair <string, UserAnswer> a in ua)
                {
                    if (a.Key == fac.title)
                    {
                        tslblJudge.Text = fac.title.Substring("judgeProblem".Length, fac.title.Length - "judgeProblem".Length);
                        ReadAnswer();
                        if (tslblJudge.Text == "1")
                        {
                            tslJudgeUp.Enabled   = false;
                            tslJudgeDown.Enabled = true;
                        }
                        if (tslblJudge.Text == PaperDetailBll.GetQuestionCount(selectPaper, "judgeProblem").ToString())
                        {
                            tslJudgeDown.Enabled = false;
                            tslJudgeUp.Enabled   = true;
                        }
                        if (tslblJudge.Text == "1" && tslblJudge.Text == PaperDetailBll.GetQuestionCount(selectPaper, "judgeProblem").ToString())
                        {
                            tslJudgeUp.Enabled   = false;
                            tslJudgeDown.Enabled = false;
                        }
                        break;
                    }
                }
            }
            else if (fac.title.IndexOf("fillBlankProblem") != -1)
            {
                tabConQustion.SelectedTab = tabPage4;
                foreach (KeyValuePair <string, UserAnswer> a in ua)
                {
                    if (a.Key == fac.title)
                    {
                        tslblFillBlank.Text = fac.title.Substring("fillBlankProblem".Length, fac.title.Length - "fillBlankProblem".Length);
                        ReadAnswer();
                        if (tslblFillBlank.Text == "1")
                        {
                            tslFillBlankUp.Enabled   = false;
                            tslFillBlankDown.Enabled = true;
                        }
                        if (tslblFillBlank.Text == PaperDetailBll.GetQuestionCount(selectPaper, "fillBlankProblem").ToString())
                        {
                            tslFillBlankDown.Enabled = false;
                            tslFillBlankUp.Enabled   = true;
                        }
                        if (tslblFillBlank.Text == "1" && tslblFillBlank.Text == PaperDetailBll.GetQuestionCount(selectPaper, "fillBlankProblem").ToString())
                        {
                            tslFillBlankUp.Enabled   = false;
                            tslFillBlankDown.Enabled = false;
                        }
                        break;
                    }
                }
            }
            else if (fac.title.IndexOf("questionProblem") != -1)
            {
                tabConQustion.SelectedTab = tabPage5;
                foreach (KeyValuePair <string, UserAnswer> a in ua)
                {
                    if (a.Key == fac.title)
                    {
                        tslblQuestion.Text = fac.title.Substring("questionProblem".Length, fac.title.Length - "questionProblem".Length);
                        ReadAnswer();
                        if (tslblQuestion.Text == "1")
                        {
                            tslQuestionUp.Enabled   = false;
                            tslQuestionDown.Enabled = true;
                        }
                        if (tslblQuestion.Text == PaperDetailBll.GetQuestionCount(selectPaper, "questionProblem").ToString())
                        {
                            tslQuestionDown.Enabled = false;
                            tslQuestionUp.Enabled   = true;
                        }
                        if (tslblQuestion.Text == "1" && tslblQuestion.Text == PaperDetailBll.GetQuestionCount(selectPaper, "questionProblem").ToString())
                        {
                            tslQuestionUp.Enabled   = false;
                            tslQuestionDown.Enabled = false;
                        }
                        break;
                    }
                }
            }
        }