Source:
public ActionResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); String questionId = getRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_ID); String selectedSection = getRequestParamValue(Const.ParamsNames.FEEDBACK_RESULTS_GROUPBYSECTION); FeedbackSessionResultsBundle bundle; Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); switch (intent) { case INSTRUCTOR_RESULT: InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.id); try { if (questionId == null && selectedSection != null) { bundle = logic.getFeedbackSessionResultsForInstructorInSection( feedbackSessionName, courseId, instructor.email, selectedSection, SectionDetail.EITHER); } else if (selectedSection == null && questionId != null) { bundle = logic.getFeedbackSessionResultsForInstructorFromQuestion(feedbackSessionName, courseId, instructor.email, questionId); } else { throw new InvalidHttpParameterException("Should provide either questionId or selectedSection"); } } catch (EntityDoesNotExistException e) { throw new EntityNotFoundException(e); } return new JsonResult(new SessionResultsData(bundle, instructor)); case STUDENT_RESULT: StudentAttributes student = getStudent(courseId); try { bundle = logic.getFeedbackSessionResultsForStudent(feedbackSessionName, courseId, student.email); } catch (EntityDoesNotExistException e) { throw new EntityNotFoundException(e); } if (bundle.isStudentHasSomethingNewToSee(student)) { } else { } return new JsonResult(new SessionResultsData(bundle, student)); case INSTRUCTOR_SUBMISSION: case STUDENT_SUBMISSION: throw new InvalidHttpParameterException("Invalid intent for this action"); default: throw new InvalidHttpParameterException("Unknown intent " + intent); } }

Target:
public ActionResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); String questionId = getRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_ID); String selectedSection = getRequestParamValue(Const.ParamsNames.FEEDBACK_RESULTS_GROUPBYSECTION); SessionResultsBundle bundle; Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); switch (intent) { case INSTRUCTOR_RESULT: InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.id); bundle = logic.getSessionResultsForUser(feedbackSessionName, courseId, instructor.getEmail(), UserRole.INSTRUCTOR, questionId, selectedSection); return new JsonResult(SessionResultsData.initForInstructor(bundle)); case STUDENT_RESULT: StudentAttributes student = getStudent(courseId); bundle = logic.getSessionResultsForUser(feedbackSessionName, courseId, student.getEmail(), UserRole.STUDENT, null, null); return new JsonResult(SessionResultsData.initForStudent(bundle, student)); case INSTRUCTOR_SUBMISSION: case STUDENT_SUBMISSION: throw new InvalidHttpParameterException("Invalid intent for this action"); default: throw new InvalidHttpParameterException("Unknown intent " + intent); } }