public void Previous_Question_Click(object sender, RoutedEventArgs e)
 {
     checkAnswer();
     pointer--;
     myQuestion = (Octopus.fetchRandomQuestionsfromQuiz_Result) this.questionListBox.Items[pointer];
     questionHandler();
 }
        public QuizTaker(int id, int number) :  this()
        {
            quizdata = new QuizData
            {
                QuizID   = id,
                UserID   = 0,
                QuizTime = 100000
            };

            this.DataContext    = quizdata;
            quizdata.quizEnded += Quizdata_quizEnded;
            octopusEntities1 db = new octopusEntities1();

            questionListBox.ItemsSource = db.fetchRandomQuestionsfromQuiz(id, number);
            answers = new bool[number];
            for (int i = 0; i < answers.Length; i++)
            {
                answers[i] = false;
            }

            // randomly select 10 of these questions

            myQuestion = (Octopus.fetchRandomQuestionsfromQuiz_Result) this.questionListBox.Items[pointer];
            questionHandler();
        }
        public void Next_Question_Click(object sender, RoutedEventArgs e)
        {
            if ((string)next_button.Content == "Submit")
            {
                Submit_Quiz();
            }
            else if (pointer < answers.Length)
            {
                checkAnswer();
                pointer++;
                if (pointer == answers.Length - 1)
                {
                    next_button.Content = "Submit";
                }

                else
                {
                    myQuestion = (Octopus.fetchRandomQuestionsfromQuiz_Result) this.questionListBox.Items[pointer];
                    questionHandler();
                    next_button.Content = "Next";
                }
            }
        }