public ActionResult Test(List <Character> model) { if (ModelState.IsValid) { if (PunctuationExercises.Test(model)) { PunctuationExercises.End(); return(RedirectToAction("Index", "Scores")); } else { return(RedirectToAction("Result", new { enteredText = db.Join(db.Split(PunctuationExercises.Punctuation.Text), model) })); } } else { return(View(db.Split(PunctuationExercises.Punctuation.Text))); } }
public ActionResult Result(string enteredText) { if (enteredText == null || PunctuationExercises.Score == null) { PunctuationExercises.End(); return(RedirectToAction("Index", "Main")); } string originalText = PunctuationExercises.Punctuation.Text; Score score = PunctuationExercises.Score; PunctuationExercises.End(); return(View(new PunctuationWrongAnswer { OriginalText = originalText, EnteredText = enteredText, Score = score })); }