Beispiel #1
0
        private void AppendButton_Click(object sender, EventArgs e)
        {
            DataFileManager dataManager = new DataFileManager(username, testName);

            dataManager.updateDirectoryTests();
            dataManager.writeToFile(dataManager.getFilePath(), qList, true);
            this.Close();
        }
Beispiel #2
0
        public void saveResult(int result)
        {
            DataFileManager dataManager = new DataFileManager(username, testName, usernameToGuess);

            dataManager.updateDirectoryAnswers();
            if (!dataManager.fileExists())
            {
                dataManager.createDirectory(dataManager.getDirectoryPath(usernameToGuess));
                dataManager.saveAnswers(dataManager.getFilePath(usernameToGuess), result);
            }
        }
Beispiel #3
0
        private void loadComboBox()
        {
            DataFileManager dataManager = new DataFileManager(usernameToGuess, testName, username);

            dataManager.updateDirectoryTests();
            string[] files = Directory.GetFiles(dataManager.getDirectoryPath());
            foreach (string file in files)
            {
                comboBox1.Items.Add(Path.GetFileName(file));
            }
        }
Beispiel #4
0
        private void loadComboBox()
        {
            DataFileManager dataManager = new DataFileManager(username, testName, statisticsUsername);

            dataManager.updateDirectoryAnswers();
            string[] files = Directory.GetFiles(dataManager.getDirectoryPath(statisticsUsername));
            foreach (string file in files)
            {
                comboBox2.Items.Add(Path.GetFileName(file));
            }
        }
Beispiel #5
0
        private void testEnd_Click(object sender, EventArgs e)
        {
            DataFileManager dataManager = new DataFileManager(username, testName);

            dataManager.updateDirectoryTests();
            if (!dataManager.fileExists())
            {
                dataManager.createDirectory(dataManager.getDirectoryPath());
                dataManager.writeToFile(dataManager.getFilePath(), qList, true);
                this.Close();
            }
            if (dataManager.fileExists())
            {
                sameFilePanel.Show();
            }
        }
Beispiel #6
0
 private void loadResults()
 {
     try
     {
         DataFileManager dataManager = new DataFileManager(username, testName, statisticsUsername);
         dataManager.updateDirectoryAnswers();
         int[] results = new int[2];
         results           = dataManager.getAnswers(dataManager.getFilePath(statisticsUsername));
         resultLabel.Text += results[0] + "%";
         label1.Text      += results[1] + " times";
         label2.Text      += results[2] + "%";
     }
     catch (NullReferenceException ex)
     {
         Console.WriteLine(ex);
         MessageBox.Show("You haven't tried taking this test yet");
     }
 }