Exemple #1
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;
                    }
                }
            }
        }
 /// <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;
             }
         }
     }
 }