Exemple #1
0
        private async void ViewMarks_Click(object sender, RoutedEventArgs e)
        {
            var tests = await TestController.GetAllTestsAsync();

            // Ask the user what test they want to edit
            TestSelectionWindow testSelection = new TestSelectionWindow();

            testSelection.PopulateComboBox(tests);
            testSelection.Owner = this;
            Effect = Utility.Blur;
            testSelection.ShowDialog();

            if (testSelection.DialogResult == true)
            {
                ViewMarksWindow viewMarks = new ViewMarksWindow(testSelection.SelectedValue, _userId);
                viewMarks.Show();
                Close();
            }
        }
        private async void ButtonViewMemo_Click(object sender, RoutedEventArgs e)
        {
            var tests = await StudentController.GetTestsUserHasWrittenAsync(_userId);

            // Ask the student what test they want to view
            TestSelectionWindow testSelection = new TestSelectionWindow();

            testSelection.PopulateComboBox(tests);
            testSelection.Owner = this;
            Effect = Utility.Blur;
            testSelection.ShowDialog();

            //  Display the memo
            if (testSelection.DialogResult != true)
            {
                return;
            }
            MemoWindow memo = new MemoWindow(testSelection.SelectedValue, _userId);

            memo.Show();
            Close();
        }
        private async void ButtonStartTest_Click(object sender, RoutedEventArgs e)
        {
            var tests = await StudentController.GetTestsUserHasNotWrittenAsync(_userId);

            // Ask the student what test they want to write
            TestSelectionWindow testSelection = new TestSelectionWindow();

            testSelection.PopulateComboBox(tests);
            testSelection.Owner = this;
            Effect = Utility.Blur;
            testSelection.ShowDialog();

            //  Open the test window
            if (testSelection.DialogResult != true)
            {
                return;
            }
            TestWindow test = new TestWindow(_userId, testSelection.SelectedValue);

            test.Show();
            Close();
        }