Exemple #1
0
        public ResultsPage(QuestionViewModel questionVM)
        {
            QuestionVM = questionVM;

            foreach (Question question in QuestionVM.level_question)
            {
                if (!question.Solve())
                {
                    List <string> wrong       = new List <string>();
                    WrongAnswer   wrongAnswer = new WrongAnswer();
                    wrongAnswer.Question = "Question: " + question.QuestionText;
                    foreach (Answer answer in question.AnswerList.Answer)
                    {
                        if (answer.SelectedAnswer && !answer.CorrectAnswer)
                        {
                            wrongAnswer.SelectedAnswer = "WRONG: " + answer.Text;
                        }
                    }
                    foreach (Answer answer in question.AnswerList.Answer)
                    {
                        if (answer.CorrectAnswer)
                        {
                            wrongAnswer.RightAnswer = "RIGHT: " + answer.Text;
                        }
                    }
                    QuestionVM.WrongAnswers.Add(wrongAnswer);
                }
            }

            InitializeComponent();
            this.DataContext = QuestionVM;
        }
Exemple #2
0
 private void document_Loaded(Word.Document doc)
 {
     Choice.addStyle(doc);
     RightAnswer.addStyle(doc);
     WrongAnswer.addStyle(doc);
 }