コード例 #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);
        }
コード例 #2
0
        private void buttonQuizCreationContinue_Click(object sender, EventArgs e)
        {
            if (listBoxQuizGroupsCreationAvaliable.SelectedIndex >= 0)
            {
                _WorkingPath = ((CustomFileObject)listBoxQuizGroupsCreationAvaliable.SelectedItem).FilePath;
            }

            PanelVisibility.Show(panelCreate);
        }
コード例 #3
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();
        }
コード例 #4
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);
        }
コード例 #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;
        }
コード例 #6
0
 private void ListBoxShowQuizForSelection_MouseDown(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         // Fix this, make a secondary click activate a control in the list
         // box
         try
         {
             labelQuizActionQuizName.Text = (listBoxShowQuizForSelection.SelectedItem as CustomFileObject).FileName;
             PanelVisibility.ShowWith(panelQuizStartSelection, panelActiveQuizSelectionContextMenu);
         }
         catch (Exception)
         {
         }
     }
 }
コード例 #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
        }
コード例 #8
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();
        }
コード例 #9
0
 private void buttonCloseGradeResultMenu_Click(object sender, EventArgs e)
 {
     PanelVisibility.Show(panelMainMenu);
 }
コード例 #10
0
 private void buttonCreate_Click(object sender, EventArgs e)
 {
     textBoxQuizName.Clear();
     PanelVisibility.Show(panelQuizCreation);
 }
コード例 #11
0
 private void buttonSettingsCancel_Click(object sender, EventArgs e)
 {
     PanelVisibility.Show(panelMainMenu);
 }
コード例 #12
0
 private void buttonQuizCreationCancel_Click(object sender, EventArgs e)
 {
     PanelVisibility.Show(panelMainMenu);
 }
コード例 #13
0
 private void buttonCancelQuizAction_Click(object sender, EventArgs e)
 {
     PanelVisibility.Show(panelQuizStartSelection);
 }
コード例 #14
0
 private void buttonSettings_Click(object sender, EventArgs e)
 {
     PanelVisibility.Show(panelSettings);
 }
コード例 #15
0
 private void buttonCopyQuiz_Click(object sender, EventArgs e)
 {
     //Clipboard.SetData(DataFormats.Serializable, (listBoxShowQuizForSelection.SelectedItem as CustomFileObject));
     PanelVisibility.Show(panelQuizStartSelection);
 }
コード例 #16
0
 private void buttonCreateAQuiz_Click(object sender, EventArgs e)
 {
     PanelVisibility.Show(panelQuizCreation);
 }
コード例 #17
0
 private void buttonGoToMainMenu_Click(object sender, EventArgs e)
 {
     _WorkingTermSetDictionary.Clear();
     PanelVisibility.Show(panelMainMenu);
 }