Esempio n. 1
0
        public void updateQuestionToForm(MyBaseQuestion question)
        {
            if (this.txQuestion.InvokeRequired)
            {
                SetQuestionCallback d = new SetQuestionCallback(updateQuestionToForm);
                this.Invoke(d, new object[] { question });
            }
            else
            {
                _answer = "";
                clearAllAnswerButton();
                txQuestion.Text = _currentQuestion.Question;
                lbTime.Text     = _currentQuestion.Time.ToString();

                switch (_currentQuestion.type)
                {
                case MyQuestionType.MyMissingFieldQuestion:
                    lbType.Text = "Điền khuyết";
                    gbFillMissingField.Visible = true;
                    gbOneChoice.Visible        = false;
                    tbClientAnswer.Focus();
                    break;

                case MyQuestionType.MyOneChoiceQuestion:
                    lbType.Text = "Câu trả lời DUY NHẤT";
                    gbFillMissingField.Visible = false;
                    gbOneChoice.Visible        = true;
                    _multi_aswer = false;
                    break;

                case MyQuestionType.MyMultiChoiceQuestion:
                    lbType.Text = "Nhiều lựa chọn";
                    gbFillMissingField.Visible = false;
                    gbOneChoice.Visible        = true;
                    _multi_aswer = true;
                    break;
                }

                btChoiseA.Text = _currentQuestion.choiceA;
                btChoiseB.Text = _currentQuestion.choiceB;
                btChoiseC.Text = _currentQuestion.choiceC;
                btChoiseD.Text = _currentQuestion.choiceD;

                pbTime.Maximum = _currentQuestion.Time;
                pbTime.Minimum = 0;
                pbTime.Value   = 0;

                tmProcessBar.Enabled = true;
                tmProcessBar.Start();
                tmProcessBar.Interval = 1000;
            }
        }
Esempio n. 2
0
        public void updateQuestionToForm(MyBaseQuestion question)
        {
            if (this.txQuestion.InvokeRequired)
            {
                SetQuestionCallback d = new SetQuestionCallback(updateQuestionToForm);
                this.Invoke(d, new object[] { question });
            }
            else
            {
                _answer = "";
                clearAllAnswerButton();
                txQuestion.Text = _currentQuestion.Question;
                lbTime.Text = _currentQuestion.Time.ToString();

                switch (_currentQuestion.type)
                {
                    case MyQuestionType.MyMissingFieldQuestion:
                        lbType.Text = "Điền khuyết";
                        gbFillMissingField.Visible = true;
                        gbOneChoice.Visible = false;
                        tbClientAnswer.Focus();
                        break;
                    case MyQuestionType.MyOneChoiceQuestion:
                        lbType.Text = "Câu trả lời DUY NHẤT";
                        gbFillMissingField.Visible = false;
                        gbOneChoice.Visible = true;
                        _multi_aswer = false;
                        break;
                    case MyQuestionType.MyMultiChoiceQuestion:
                        lbType.Text = "Nhiều lựa chọn";
                        gbFillMissingField.Visible = false;
                        gbOneChoice.Visible = true;
                        _multi_aswer = true;
                        break;
                }

                btChoiseA.Text = _currentQuestion.choiceA;
                btChoiseB.Text = _currentQuestion.choiceB;
                btChoiseC.Text = _currentQuestion.choiceC;
                btChoiseD.Text = _currentQuestion.choiceD;

                pbTime.Maximum = _currentQuestion.Time;
                pbTime.Minimum = 0;
                pbTime.Value = 0;

                tmProcessBar.Enabled = true;
                tmProcessBar.Start();
                tmProcessBar.Interval = 1000;
            }
        }