예제 #1
0
        private void StartTest()
        {
            Test test = (Test)WindowLoader.createMainWindow(typeof(Test));

            AppConstants.TESTLOCATION = fileName.Text.Replace(".txt", "");
            test.testClose           += Reload;
            test.SettupTest(filePath);
        }
 private void Next_Click(object sender, RoutedEventArgs e)
 {
     if (currentQuestion < totalQuestions - 1)
     {
         DisplayQuestion(currentQuestion + 1);
     }
     else
     {
         Sounds.PlayAudio(Sounds.finishedTest);
         WindowLoader.createMainWindow(typeof(ResultScreen), true);
         AppConstants.QUESTIONS.Clear();
         Close();
     }
 }
        private void Explanation_Click(object sender, RoutedEventArgs e)
        {
            Explanation explanation = (Explanation)WindowLoader.createMainWindow(typeof(Explanation));

            if (!AppConstants.QUESTIONS[currentQuestion].GetAVideoURI().Equals(""))
            {
                explanation.SetMediaPlayerVideo(AppConstants.QUESTIONS[currentQuestion].GetAVideoURI());
            }
            try
            {
                if (!AppConstants.QUESTIONS[currentQuestion].GetAimage().Equals(""))
                {
                    explanation.SetImage(new BitmapImage(new Uri(AppConstants.QUESTIONS[currentQuestion].GetAimage())));
                }
            }
            catch (Exception f)
            {
                MessageBox.Show("There was a problem with the image. " + f.Message);
            }
            if (!AppConstants.QUESTIONS[currentQuestion].GetExplanation().Equals(""))
            {
                explanation.SetExplanation(AppConstants.QUESTIONS[currentQuestion].GetExplanation());
            }
        }