public ActionResult Take(long id) { TestProctor proctor = new TestProctor(id); int step; if (Request.QueryString["Step"] != null && int.TryParse(Request.QueryString["Step"], out step)) { proctor.SaveCurrentTestTakingStep(step); } else if (proctor.CompletedPresentation && proctor.Assignment.CurrentStatus.Section != Domain.StatusType.Testing) { proctor.SaveCurrentTestTakingStep(1); } if (!proctor.IsFinished && proctor.Quiz.CurrentQuestion != null) { return View(proctor); } else if (proctor.IsFinished) { ViewBag.ReturnToHub = Resources.Literals.ReturnToControlCenter; return View("Finished", proctor); } return RedirectToAction("Start", "Access", new { EmployeeID = ViewBag.EmployeeID, CCApp = ViewBag.CCApp }); }
public ActionResult View(long id) { TestProctor proctor = new TestProctor(id); int step = 0; bool userSuppliedStep = false; if (Request.QueryString["Step"] != null) { userSuppliedStep = int.TryParse(Request.QueryString["Step"], out step); } if (userSuppliedStep) { proctor.SaveCurrentPresentationStep(step); } else if (proctor.Assignment.CurrentStatus != null) { if (proctor.CompletedPresentation) { return RedirectToAction("Take", new { id = id, EmployeeID = ViewBag.EmployeeID, CCApp = ViewBag.CCApp }); } step = proctor.Assignment.CurrentStatus.Sequence; proctor.SaveCurrentPresentationStep(step); } else { proctor.SaveCurrentPresentationStep(1); } switch (proctor.Presentation.CurrentStep.PresentationType) { case Domain.MediaType.Image: return View("ImageItem", proctor); case Domain.MediaType.Video: return View("VideoItem", proctor); } return RedirectToAction("Start", "Access", new { EmployeeID = ViewBag.EmployeeID, CCApp = ViewBag.CCApp }); }
public ActionResult Take(long id, FormCollection collection) { TestProctor proctor = new TestProctor(id); if (string.IsNullOrEmpty(collection["Answer-radio"])) { //This indicates no answer was chosen, the user just pressed submit. proctor.ShowNoChoiceMadeMessage = collection["Answer-radio"] != null && collection["Answer-radio"].Trim() == string.Empty; return Take(id); } int answerChosen = int.Parse(collection["Answer-radio"]); //Record the answer proctor.SaveResponse(answerChosen); if (!proctor.IsFinished && proctor.Quiz.CurrentQuestion != null) { return View(proctor); } else if (proctor.IsFinished) { ViewBag.ReturnToHub = Resources.Literals.ReturnToControlCenter; return View("Finished", proctor); } return new HttpNotFoundResult(); }
public ActionResult Welcome(long id) { TestProctor proctor = new TestProctor(id); return View(proctor); }