private void NextMaterialFlatButton_Click(object sender, EventArgs e) { try { if (isAnswerChosen == false) { throw new AnswerNotSelectedException("Оберіть один із варіантів"); } chosenUserPreference.specialtyIndex = UserPreferencesTest.CurrentSpecialityIndex; UserPreferencesTest.answerStack.Push(chosenUserPreference); if (UserPreferencesTest.isLastQuestion) { UserPreferencesTest.SaveTestResult(); PreferredSpecialtiesDeterminant.SetSpecialties(UserPreferencesTest.resultSpecialties); Navigation.ToResultForm(this); } else { UserPreferencesTest.NextQuestion(); LoadQuestion(); } } catch (Exception ex) { ExceptionHandler.HandleException(ex); } }
private void TestResultForm_Load(object sender, EventArgs e) { TestTimer.StopTimer(); TimerResultLabel.Text = $"Тест пройдено за: {TestTimer.time.ToString("mm:ss")}"; List <Specialty> specialties = PreferredSpecialtiesDeterminant.GetDetermineSpecialties(); titleLabel.Text = $"{User.name}, за результатами тесту вам більш підходять такі спеціальності як:"; try { firstSpecialtyNameMaterialLabel.Text = specialties[0].name; firstSpecialtyDescriptionLabel.Text = specialties[0].description; firstSpecialtyProfessionsLabel.Text = GetProfessionsStr(specialties[0].professions); secondSpecialtyNameMaterialLabel.Text = specialties[1].name; secondSpecialtyDescriptionLabel.Text = specialties[1].description; secondSpecialtyProfessionsLabel.Text = GetProfessionsStr(specialties[1].professions); thirdSpecialtyNameMaterialLabel.Text = specialties[2].name; thirdSpecialtyDescriptionLabel.Text = specialties[2].description; thirdSpecialtyProfessionsLabel.Text = GetProfessionsStr(specialties[2].professions); } catch (Exception ex) { string message = "Неможливо отримати дані. Перевірте цілісність файлів."; ExceptionHandler.CriticalException(ex, message); } }
static private void RepeatItem_Click(object sender, EventArgs e) { User.Reset(); PreferredSpecialtiesDeterminant.Reset(); TestTimer.StopTimer(); Navigation.ToRegistrationForm(Program.Context.MainForm); }