Example #1
0
        private void AskToStartTest()
        {
            var result = MessageBox.Show("Would you like to start this test?", "Start test", MessageBoxButton.YesNo);

            if (result == MessageBoxResult.Yes)
            {
                var textInputWindow = new TextInputWindow("Enter your name");
                textInputWindow.ShowDialog();

                if (textInputWindow.DialogResult == true)
                {
                    var studentName = textInputWindow.EnteredText;

                    var testPath      = filePaths[PathsList.SelectedIndex];
                    var testDirectory = testPath.Substring(0, testPath.LastIndexOf('\\'));

                    var passingWindow = new PassingWindow(testPath, $"{testDirectory}\\Results\\{studentName}.tmr", false, studentName);

                    if (passingWindow.IsLoadedProperly)
                    {
                        passingWindow.Show();
                        Close();
                    }
                }
            }
        }
Example #2
0
        private void AskToViewResult()
        {
            var result = MessageBox.Show("Would you like to view this result?", "View result", MessageBoxButton.YesNo);

            if (result == MessageBoxResult.Yes)
            {
                var resultPath = filePaths[PathsList.SelectedIndex];

                var resultWindow = new PassingWindow(resultPath, resultPath, true, null);

                if (resultWindow.IsLoadedProperly)
                {
                    resultWindow.Show();
                    Close();
                }
            }
        }