protected override void OnMouseClick(MouseEventArgs e) { if (currentProblem == ProblemType.Locate) { int?hitIndex = GetCountry(e.Location); if (hitIndex.HasValue) { teacher.OnProblemInput(hitIndex.Value); } } else if (reviewing == 1 || reviewing == 2) { int?hitIndex = GetCountry(e.Location); if (hitIndex.HasValue) { switch (reviewing) { case 1: HighlightCountry(hitIndex.Value, new Bgra(91, 166, 38, 255)); teacher.PlayVorbis(0, string.Concat("sounds\\", mapData.CountryNames[hitIndex.Value].ToLower())); helpControl.ShowHelp(hitIndex.Value, ProblemType.SpellCountry); break; case 2: HighlightCountry(hitIndex.Value, new Bgra(24, 30, 217, 255)); teacher.PlayVorbis(0, string.Concat("sounds\\", mapData.CountryCapitals[hitIndex.Value].ToLower())); helpControl.ShowHelp(hitIndex.Value, ProblemType.SpellCapital); break; } } else { StopHighlighting(); helpControl.Clear(); } } }
public void OnProblemInput(object data) { if (current == null) { return; } //Clear map from sending input control.SetProblem(ProblemType.None); //Test if correct, if correct, move on to next problem //If incorrect, show correct answer UpdateStatistics(data); if (current.IsCorrect(data)) { //Correct! control.HighlightCountry(currentCountry, new Bgra(91, 166, 38, 255)); //Update momentum and momentum rate UpdateMomentum(1); inputBox.SetComplete(true, 0); } else { switch (current.Type) { case ProblemType.Locate: control.HighlightCountry((int)current.Answer, new Bgra(24, 30, 217, 255)); break; case ProblemType.SpellCountryVoice: case ProblemType.SpellCountry: break; case ProblemType.SpellCapitalVoice: case ProblemType.SpellCapital: break; } //Update momentum and momentum rate UpdateMomentum(-1); int timeStudySeconds = (int)Math.Round(10 * (1 - momentum)); inputBox.SetComplete(false, timeStudySeconds); //TODO: Load help info helpControl.ShowHelp(currentCountry, current.Type); } }