Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/controller/McLearningController.java =================================================================== diff -u -r424f8d213bbff9badfb9b913fd7c68d5cc1d5c3d -r5cc2f28c0fd508cf034496ad94d4892c373431f1 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/controller/McLearningController.java (.../McLearningController.java) (revision 424f8d213bbff9badfb9b913fd7c68d5cc1d5c3d) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/controller/McLearningController.java (.../McLearningController.java) (revision 5cc2f28c0fd508cf034496ad94d4892c373431f1) @@ -65,6 +65,7 @@ import org.lamsfoundation.lams.web.util.SessionMap; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.http.MediaType; import org.springframework.stereotype.Controller; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; @@ -118,7 +119,7 @@ */ McSession mcSession = mcService.getMcSessionById(new Long(toolSessionID)); if (mcSession == null) { - return "McErrorBox"; + return "error"; } /* @@ -130,7 +131,7 @@ MultiValueMap errorMap = new LinkedMultiValueMap<>(); errorMap.add("GLOBAL", messageService.getMessage("error.content.doesNotExist")); request.setAttribute("errorMap", errorMap); - return "McErrorBox"; + return "error"; } String mode = request.getParameter(McAppConstants.MODE); @@ -248,58 +249,8 @@ return "learning/AnswersContent"; } + /** - * main content/question content management and workflow logic - * - * if the passed toolContentId exists in the db, we need to get the relevant data into the Map if not, create the - * default Map - */ - public String unspecified(@ModelAttribute McLearningForm mcLearningForm, HttpServletRequest request) { - LearningUtil.saveFormRequestData(request, mcLearningForm); - return null; - } - - /** - * responds to learner activity in learner mode. - */ - @RequestMapping("/displayMc") - public String displayMc(@ModelAttribute McLearningForm mcLearningForm, HttpServletRequest request, - HttpServletResponse response) throws IOException { - - String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); - mcLearningForm.setToolSessionID(toolSessionID); - - McSession mcSession = mcService.getMcSessionById(new Long(toolSessionID)); - - String toolContentId = mcSession.getMcContent().getMcContentId().toString(); - mcLearningForm.setToolContentID(toolContentId); - - LearningUtil.saveFormRequestData(request, mcLearningForm); - - if (mcLearningForm.getNextQuestionSelected() != null && !mcLearningForm.getNextQuestionSelected().equals("")) { - mcLearningForm.resetParameters(); - return getNextOptions(mcLearningForm, request); - } - if (mcLearningForm.getContinueOptionsCombined() != null) { - return continueOptionsCombined(mcLearningForm, request); - } else if (mcLearningForm.getNextOptions() != null) { - return getNextOptions(mcLearningForm, request); - } else if (mcLearningForm.getRedoQuestions() != null) { - return redoQuestions(mcLearningForm, request); - } else if (mcLearningForm.getViewAnswers() != null) { - return viewAnswers(mcLearningForm, request); - } else if (mcLearningForm.getSubmitReflection() != null) { - return submitReflection(mcLearningForm, request, response); - } else if (mcLearningForm.getForwardtoReflection() != null) { - return forwardtoReflection(mcLearningForm, request); - } else if (mcLearningForm.getLearnerFinished() != null) { - return endLearning(mcLearningForm, request, response); - } - - return "learning/AnswersContent"; - } - - /** * ActionForward endLearning(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse * response) */ @@ -689,7 +640,7 @@ /** * checks Leader Progress */ - @RequestMapping("/checkLeaderProgress") + @RequestMapping(path = "/checkLeaderProgress", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @ResponseBody public String checkLeaderProgress(HttpServletRequest request, HttpServletResponse response) throws IOException { @@ -702,9 +653,7 @@ ObjectNode ObjectNode = JsonNodeFactory.instance.objectNode(); ObjectNode.put("isLeaderResponseFinalized", isLeaderResponseFinalized); - response.setContentType("application/x-json;charset=utf-8"); - response.getWriter().print(ObjectNode); - return null; + return ObjectNode.toString(); } @RequestMapping("/submitReflection") Index: lams_tool_lamc/web/authoring/AuthoringTabsHolder.jsp =================================================================== diff -u -rc1bde51a17e35ed781d2bb7f4123b2012f30f5a3 -r5cc2f28c0fd508cf034496ad94d4892c373431f1 --- lams_tool_lamc/web/authoring/AuthoringTabsHolder.jsp (.../AuthoringTabsHolder.jsp) (revision c1bde51a17e35ed781d2bb7f4123b2012f30f5a3) +++ lams_tool_lamc/web/authoring/AuthoringTabsHolder.jsp (.../AuthoringTabsHolder.jsp) (revision 5cc2f28c0fd508cf034496ad94d4892c373431f1) @@ -21,14 +21,14 @@ }); function submitMethod(actionMethod) { - document.forms.McAuthoringForm.action=actionMethod+".do"; - document.forms.McAuthoringForm.submit(); + document.forms.mcAuthoringForm.action=actionMethod+".do"; + document.forms.mcAuthoringForm.submit(); } function submitModifyAuthoringQuestion(questionIndexValue, actionMethod) { - document.forms.McAuthoringForm.questionIndex.value=questionIndexValue; - document.forms.McAuthoringForm.action=actionMethod+".do"; + document.forms.mcAuthoringForm.questionIndex.value=questionIndexValue; + document.forms.mcAuthoringForm.action=actionMethod+".do"; $('#mcAuthoringForm').ajaxSubmit({ data: { @@ -37,7 +37,7 @@ target: $('#resourceListArea'), iframe: true, success: function() { - document.forms.McAuthoringForm.action="submitAllContent.do"; + document.forms.mcAuthoringForm.action="submitAllContent.do"; refreshThickbox(); } }); @@ -68,8 +68,8 @@ } function doSubmit(method) { - document.forms.McAuthoringForm.action=method+".do"; - document.forms.McAuthoringForm.submit(); + document.forms.mcAuthoringForm.action=method+".do"; + document.forms.mcAuthoringForm.submit(); } Index: lams_tool_lamc/web/authoring/BasicContent.jsp =================================================================== diff -u -rc1bde51a17e35ed781d2bb7f4123b2012f30f5a3 -r5cc2f28c0fd508cf034496ad94d4892c373431f1 --- lams_tool_lamc/web/authoring/BasicContent.jsp (.../BasicContent.jsp) (revision c1bde51a17e35ed781d2bb7f4123b2012f30f5a3) +++ lams_tool_lamc/web/authoring/BasicContent.jsp (.../BasicContent.jsp) (revision 5cc2f28c0fd508cf034496ad94d4892c373431f1) @@ -3,8 +3,8 @@ @@ -28,10 +28,10 @@ - + + modelAttribute="mcLearningForm" id="mcLearningForm">