예제 #1
0
 //Set openquestion
 public void SetOpenQuestion(Model.OpenQuestion openQuestion)
 {
     this.openQuestion = openQuestion;
     mainForm.statusLabel.Visible = false;
 }
예제 #2
0
        //Literally goes to the next question if there is one, otherwise it'll go back to the waitingscreen.
        public void goToNextQuestion()
        {
            view.startLabelTimer();

            view.cleanUpPreviousQuestion();
            view.getAnswerButtons().Clear();
            questionTimer.Stop();

            if (controller.getCurrentQuestionIndex() < this.questionList.MCQuestions.Count + this.questionList.OpenQuestions.Count) {
                controller.setCurrentQuestionIndex(controller.getCurrentQuestionIndex() + 1);
            }

            if (this.questionList.MCQuestions.Count + this.questionList.OpenQuestions.Count  - 1 >= controller.getCurrentQuestionIndex())
            {
                if (controller.getCurrentQuestionIndex() < this.questionList.MCQuestions.Count)
                {
                    view.initMCQuestionScreen();
                    busy = true;
                    questionTimeProgressBar.Value = questionTimeProgressBar.Maximum;

                    currentMCQuestion = this.questionList.MCQuestions[controller.getCurrentQuestionIndex()];
                    if (currentMCQuestion.Time > 1)
                    {
                        questionTimeProgressBar.Maximum = currentMCQuestion.Time * 1000;
                        questionTimeProgressBar.Value = currentMCQuestion.Time * 1000;
                        questionTimer.Start();
                        this.questionCountLabel.Location = new Point(this.getProgressBar().Location.X + this.getProgressBar().Width - this.questionCountLabel.Width, this.getProgressBar().Location.Y - this.questionCountLabel.Height);
                    }
                    else
                    {
                        questionTimeProgressBar.Visible = false;
                        timeLabel.Visible = false;
                        this.questionCountLabel.Location = new Point(this.getProgressBar().Location.X + this.getProgressBar().Width - this.questionCountLabel.Width, this.getProgressBar().Location.Y + this.getProgressBar().Height - this.questionCountLabel.Height);
                    }
                    this.view.adjustSizeOfButtons(currentMCQuestion);
                    questionLabel.Text = currentMCQuestion.Text;
                }
                else
                {
                    view.initOpenQuestionScreen();
                    currentOpenQuestion = this.questionList.OpenQuestions[controller.getCurrentQuestionIndex() - this.questionList.MCQuestions.Count];
                    busy = true;
                    questionLabel.Text = currentOpenQuestion.Text;
                }

            }
            else if (this.questionList.Ended)
            {
                MessageBox.Show("De vragenlijst is gestopt.");
                this.questionList.Ended = false;

            }
            else
            {
                view.initWaitScreen();
                questionTimer.Stop();
                view.stopLabelTimer();
                busy = false;
            }
        }