@RequestMapping(value = "/candidate-results-{lrid}.zip", method = RequestMethod.GET)
 public void streamDeliveryCandidateResults(final HttpServletResponse response)
     throws PrivilegeException, DomainEntityNotFoundException, IOException {
   final Delivery thisDelivery = identityService.getCurrentThreadLtiResource().getDelivery();
   response.setContentType("application/zip");
   assessmentReportingService.streamAssessmentReports(
       thisDelivery.getId(), response.getOutputStream());
 }
 @RequestMapping(value = "/candidate-summary-report-{lrid}.csv", method = RequestMethod.GET)
 public void streamDeliveryCandidateSummaryReportCsv(final HttpServletResponse response)
     throws PrivilegeException, DomainEntityNotFoundException, IOException {
   final Delivery thisDelivery = identityService.getCurrentThreadLtiResource().getDelivery();
   response.setContentType("text/plain");
   response.setCharacterEncoding("UTF-8");
   assessmentReportingService.streamDeliveryCandidateSummaryReportCsv(
       thisDelivery.getId(), response.getOutputStream());
 }
  @RequestMapping(value = "/delete-all-sessions", method = RequestMethod.POST)
  public String deleteAllCandidateSessions(final RedirectAttributes redirectAttributes)
      throws PrivilegeException, DomainEntityNotFoundException {
    final Delivery thisDelivery = identityService.getCurrentThreadLtiResource().getDelivery();
    final int deletedCount =
        assessmentProctoringService.deleteCandidateSessionsForDelivery(thisDelivery.getId());

    GlobalRouter.addFlashMessage(
        redirectAttributes,
        "Deleted " + deletedCount + " candidate session" + (deletedCount != 1 ? "s" : ""));
    return ltiInstructorRouter.buildInstructorRedirect("/candidate-sessions");
  }
  @RequestMapping(value = "/candidate-sessions", method = RequestMethod.GET)
  public String showCandidateSummaryReport(final Model model)
      throws PrivilegeException, DomainEntityNotFoundException {
    final Delivery thisDelivery = identityService.getCurrentThreadLtiResource().getDelivery();
    final DeliveryCandidateSummaryReport report =
        assessmentReportingService.buildDeliveryCandidateSummaryReport(thisDelivery.getId());

    model.addAttribute(report);
    model.addAttribute(
        "candidateSessionListRouting",
        ltiInstructorRouter.buildCandidateSessionListRouting(report));
    return "instructor/listCandidateSessions";
  }