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); }
private void buttonQuizCreationContinue_Click(object sender, EventArgs e) { if (listBoxQuizGroupsCreationAvaliable.SelectedIndex >= 0) { _WorkingPath = ((CustomFileObject)listBoxQuizGroupsCreationAvaliable.SelectedItem).FilePath; } PanelVisibility.Show(panelCreate); }
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(); }
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); }
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; }
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) { } } }
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 }
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(); }
private void buttonCloseGradeResultMenu_Click(object sender, EventArgs e) { PanelVisibility.Show(panelMainMenu); }
private void buttonCreate_Click(object sender, EventArgs e) { textBoxQuizName.Clear(); PanelVisibility.Show(panelQuizCreation); }
private void buttonSettingsCancel_Click(object sender, EventArgs e) { PanelVisibility.Show(panelMainMenu); }
private void buttonQuizCreationCancel_Click(object sender, EventArgs e) { PanelVisibility.Show(panelMainMenu); }
private void buttonCancelQuizAction_Click(object sender, EventArgs e) { PanelVisibility.Show(panelQuizStartSelection); }
private void buttonSettings_Click(object sender, EventArgs e) { PanelVisibility.Show(panelSettings); }
private void buttonCopyQuiz_Click(object sender, EventArgs e) { //Clipboard.SetData(DataFormats.Serializable, (listBoxShowQuizForSelection.SelectedItem as CustomFileObject)); PanelVisibility.Show(panelQuizStartSelection); }
private void buttonCreateAQuiz_Click(object sender, EventArgs e) { PanelVisibility.Show(panelQuizCreation); }
private void buttonGoToMainMenu_Click(object sender, EventArgs e) { _WorkingTermSetDictionary.Clear(); PanelVisibility.Show(panelMainMenu); }