Exemplo n.º 1
0
        private void buttonDeleteQuiz_Click(object sender, EventArgs e)
        {
            var dir = listBoxShowQuizForSelection.SelectedItem as CustomFileObject;

            File.Delete(dir.FilePath);
            listBoxShowQuizForSelection.Items.Remove(listBoxShowQuizForSelection.SelectedItem);
            PanelVisibility.Show(panelQuizStartSelection);
        }
Exemplo n.º 2
0
        private void buttonQuizCreationContinue_Click(object sender, EventArgs e)
        {
            if (listBoxQuizGroupsCreationAvaliable.SelectedIndex >= 0)
            {
                _WorkingPath = ((CustomFileObject)listBoxQuizGroupsCreationAvaliable.SelectedItem).FilePath;
            }

            PanelVisibility.Show(panelCreate);
        }
Exemplo n.º 3
0
        private void buttonStartActiveQuiz_Click(object sender, EventArgs e)
        {
            // top: listBoxAvaliableQuizes
            // bottom: listBoxShowQuizForSelection

            var file = ((CustomFileObject)listBoxShowQuizForSelection.SelectedItem).FilePath;

            //DirectoryInfo dirInfo = new DirectoryInfo(file);
            // assign the _WorkingTermSet object based on the data read from the file
            ReadQuiz(file);
            PanelVisibility.Show(panelActiveQuiz);
        }
Exemplo n.º 4
0
        private void buttonQuizCreationFinished_Click(object sender, EventArgs e)
        {
            // here add all the files to the quiz group


            CreateQuiz(_WorkingPath);
            PanelVisibility.Show(panelQuizStartSelection);

            listBoxPreviewTerm.Items.Clear();
            textBoxTermName.Clear();
            textBoxTermDefinition.Clear();
        }
Exemplo n.º 5
0
        private void buttonUntimedQuiz_Click(object sender, EventArgs e)
        {
            if (Directory.GetDirectories(_DefaultPath).Length >= 1)
            {
                PanelVisibility.Show(panelQuizStartSelection);
            }
            else
            {
                PanelVisibility.Show(panelNoQuizesFound);
            }

            radioButtonUntimedQuiz.Checked  = true;
            panelSecondsPerQuestion.Enabled = false;
        }
Exemplo n.º 6
0
        private void buttonSubmitAnswer_Click(object sender, EventArgs e)
        {
            MessageBox.Show(questionLocation.ToString());
            if (_WorkingTermSetDictionary.ContainsKey(textBoxActiveQuizTerm.Text))
            {
                string val;
                if (_WorkingTermSetDictionary.TryGetValue(textBoxActiveQuizTerm.Text, out val))
                {
                    if (val == textBoxActiveQuizDefinition.Text)
                    {
                        correctAnswers++;
                        correctAnswersArray[questionLocation] = 1;
                    }
                }
            }
            questionLocation++;

            textBoxActiveQuizDefinition.Text = _WorkingTermSetDictionary.Values.ElementAtOrDefault(questionLocation);
            if (questionLocation == _WorkingTermSet.Terms.Count)
            {
                labelQuizResultScore.Text = String.Format("{0:F0}", ((correctAnswers / (float)_WorkingTermSet.Terms.Count) * 100));
                for (int i = 0; i < _WorkingTermSetDictionary.Count; i++)
                {
                    checkedListBoxCorrectAnswers.Items.Add(_WorkingTermSetDictionary.Keys.ElementAtOrDefault(i) + " --> " + _WorkingTermSetDictionary.Values.ElementAtOrDefault(i));
                    if (correctAnswersArray[i] == 1)
                    {
                        checkedListBoxCorrectAnswers.SetItemCheckState(i, CheckState.Checked);
                    }
                }
                PanelVisibility.Show(panelGradeResultsMenu);

                _WorkingTermSetDictionary.Clear();
                correctAnswers   = 0;
                questionLocation = 0;
                _WorkingPath     = _DefaultPath;
            }
            // what is this garbage.. (can't think right now)
            var tempQuestionLocation = questionLocation + 1;

            labelQuestionProgression.Text = tempQuestionLocation.ToString() + "/" + _WorkingTermSet.Terms.Count;
            //
            textBoxActiveQuizTerm.Clear();
        }
Exemplo n.º 7
0
        private void buttonQuizTimed_Click(object sender, EventArgs e)
        {
            // now set to greater than one to not include the loaded_quizes group (dir)
            if (Directory.GetDirectories(_DefaultPath).Length > 1)
            {
                PanelVisibility.Show(panelQuizStartSelection);
            }
            else
            {
                PanelVisibility.Show(panelNoQuizesFound);
            }

            radioButtonTimedQuiz.Checked    = true;
            panelSecondsPerQuestion.Enabled = true;

            // from timed and untimed you can populate the two list boxes.
            //listBoxAvaliableQuizes <-- Quiz Groups which will expand into the individual quizes
            //listBoxShowQuizForSelection <-- here is where the individual quizes will be shown
        }
Exemplo n.º 8
0
 private void buttonCloseGradeResultMenu_Click(object sender, EventArgs e)
 {
     PanelVisibility.Show(panelMainMenu);
 }
Exemplo n.º 9
0
 private void buttonQuizCreationCancel_Click(object sender, EventArgs e)
 {
     PanelVisibility.Show(panelMainMenu);
 }
Exemplo n.º 10
0
 private void buttonSettingsCancel_Click(object sender, EventArgs e)
 {
     PanelVisibility.Show(panelMainMenu);
 }
Exemplo n.º 11
0
 private void buttonCancelQuizAction_Click(object sender, EventArgs e)
 {
     PanelVisibility.Show(panelQuizStartSelection);
 }
Exemplo n.º 12
0
 private void buttonCopyQuiz_Click(object sender, EventArgs e)
 {
     //Clipboard.SetData(DataFormats.Serializable, (listBoxShowQuizForSelection.SelectedItem as CustomFileObject));
     PanelVisibility.Show(panelQuizStartSelection);
 }
Exemplo n.º 13
0
 private void buttonGoToMainMenu_Click(object sender, EventArgs e)
 {
     _WorkingTermSetDictionary.Clear();
     PanelVisibility.Show(panelMainMenu);
 }
Exemplo n.º 14
0
 private void buttonCreateAQuiz_Click(object sender, EventArgs e)
 {
     PanelVisibility.Show(panelQuizCreation);
 }
Exemplo n.º 15
0
 private void buttonSettings_Click(object sender, EventArgs e)
 {
     PanelVisibility.Show(panelSettings);
 }
Exemplo n.º 16
0
 private void buttonCreate_Click(object sender, EventArgs e)
 {
     textBoxQuizName.Clear();
     PanelVisibility.Show(panelQuizCreation);
 }