Beispiel #1
0
        private void NextQwButton_Click(object sender, EventArgs e)
        {
            int answer = GetAnswerNumberFromInputs();

            userProgress.RecordAnswer(currentQuiz.CorrectAnswerNumber, answer);

            if (stepNumber + 1 == quizesCount)
            {
                Close();
            }
            else
            {
                QuestionsForm questionsForm = new QuestionsForm(currentQuiz.TestId, stepNumber + 1);
                Hide();
                questionsForm.FormClosed += (s, args) => Close();
                questionsForm.ShowDialog();
            }
        }
Beispiel #2
0
        private void OpenTest(Guid testId)
        {
            UserProgressProvider.StartNewTest();
            QuestionsForm questionsForm = new QuestionsForm(testId, 0);

            Hide();
            questionsForm.FormClosed += (s, args) =>
            {
                if (UserProgressProvider.GetInstance() != null)
                {
                    int progress = UserProgressProvider.GetInstance().CalculateProgress();
                    AddProgress(testId, progress);
                }

                Show();
            };
            questionsForm.ShowDialog();
        }