private void BtnStartTest_Click(object sender, RoutedEventArgs e) { if (QuizzDictionary.nova.Count > 0) { BtnCheck.Visibility = Visibility.Visible; TbWordMain.AppendText(QuizzDictionary.nova.Keys.First()); BtnStartTest.Visibility = Visibility.Hidden; TbTranslate.Focus(); } else { MessageBox.Show("You made a test with no words in it !", "Change your testing settings !", MessageBoxButton.OK); this.Close(); TestingSettings testing = new TestingSettings(); testing.ShowDialog(); } }
private void BtnCheck_Click(object sender, RoutedEventArgs e) { while (i < QuizzDictionary.nova.Count) { if (QuizzDictionary.nova.TryGetValue(TbWordMain.Text, out string lol) && lol == TbTranslate.Text.TrimEnd()) { MessageBox.Show("Correct"); Tacno(i); QuizzDictionary.BrojTacno += 1; ClearTextBoxes(); } else { MessageBox.Show("Not Correct"); Netacno(i); QuizzDictionary.BrojNetacno += 1; ClearTextBoxes(); } i++; if (i < QuizzDictionary.nova.Count) { TbWordMain.AppendText(QuizzDictionary.nova.Keys.ElementAt(i)); } else { MessageBox.Show("Test is finished"); BtnCheck.Visibility = Visibility.Hidden; BtnEnd.Visibility = Visibility.Hidden; BtnFinish.Visibility = Visibility.Visible; TbNameOfTest.Visibility = Visibility.Visible; TextBlock1.Visibility = Visibility.Visible; TbNameOfTest.Focus(); //Treba da moze da se vidi rezultat mozda... } break; } }