Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java =================================================================== diff -u -rdd4087c8c38ddcf2e97af7fc2dda25a8c948bcf0 -r40937c574021c496d91487979b905b23a193b766 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java (.../QaAppConstants.java) (revision dd4087c8c38ddcf2e97af7fc2dda25a8c948bcf0) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java (.../QaAppConstants.java) (revision 40937c574021c496d91487979b905b23a193b766) @@ -193,7 +193,7 @@ public static final String FROM_TOOL_CONTENT_ID = "fromToolContentId"; public static final String TO_TOOL_CONTENT_ID = "toToolContentId"; public static final String LEARNER_REPORT = "learnerRep"; - public static final String INDIVIDUAL_LEARNER_REPORT = "individualLearnerRep"; + public static final String LEARNER_REP = "individualLearnerRep"; public static final String REQUEST_LEARNING_REPORT = "requestLearningReport"; public static final String REQUEST_LEARNING_REPORT_PROGRESS = "requestLearningReportProgress"; public static final String REQUEST_PREVIEW = "requestPreview"; Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java =================================================================== diff -u -r038a82507a043a33ef067b527f193eba54705e8f -r40937c574021c496d91487979b905b23a193b766 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java (.../QaLearningAction.java) (revision 038a82507a043a33ef067b527f193eba54705e8f) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java (.../QaLearningAction.java) (revision 40937c574021c496d91487979b905b23a193b766) @@ -49,6 +49,7 @@ import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionMessage; import org.apache.struts.action.ActionMessages; +import org.apache.struts.action.ActionRedirect; import org.apache.tomcat.util.json.JSONArray; import org.apache.tomcat.util.json.JSONException; import org.apache.tomcat.util.json.JSONObject; @@ -116,6 +117,15 @@ QaSession qaSession = QaLearningAction.qaService.getSessionById(new Long(toolSessionID).longValue()); QaContent qaContent = qaSession.getQaContent(); + + QaQueUsr qaQueUsr = getCurrentUser(toolSessionID); + //prohibit users from submitting answers after response is finalized but Resubmit button is not pressed (e.g. using 2 browsers) + if (qaQueUsr.isResponseFinalized()) { + ActionRedirect redirect = new ActionRedirect(mapping.findForwardConfig("learningStarter")); + redirect.addParameter(AttributeNames.PARAM_TOOL_SESSION_ID, toolSessionID); + redirect.addParameter(MODE, "learner"); + return redirect; + } GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent); @@ -179,7 +189,6 @@ //in case noReeditAllowed finalize response so user can't refresh the page and post answers again if (errors.isEmpty() && qaContent.isNoReeditAllowed()) { - QaQueUsr qaQueUsr = getCurrentUser(toolSessionID); qaQueUsr.setResponseFinalized(true); QaLearningAction.qaService.updateUser(qaQueUsr); } @@ -245,9 +254,15 @@ HttpServletResponse response) throws IOException, ServletException { initializeQAService(); QaLearningForm qaLearningForm = (QaLearningForm) form; + String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); + + QaQueUsr qaQueUsr = getCurrentUser(toolSessionID); + //prohibit users from autosaving answers after response is finalized but Resubmit button is not pressed (e.g. using 2 browsers) + if (qaQueUsr.isResponseFinalized()) { + return null; + } LearningUtil.saveFormRequestData(request, qaLearningForm); - String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); QaSession qaSession = QaLearningAction.qaService.getSessionById(new Long(toolSessionID).longValue()); QaContent qaContent = qaSession.getQaContent(); int intTotalQuestionCount = qaContent.getQaQueContents().size(); @@ -320,6 +335,10 @@ QaQueUsr qaQueUsr = getCurrentUser(toolSessionID); LearningUtil.populateAnswers(sessionMap, qaContent, qaQueUsr, mapQuestions, generalLearnerFlowDTO, QaLearningAction.qaService); + + //in order to track whether redo button is pressed store this info + qaQueUsr.setResponseFinalized(false); + QaLearningAction.qaService.updateUser(qaQueUsr); request.setAttribute(QaAppConstants.GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); qaLearningForm.resetAll(); @@ -409,7 +428,7 @@ } request.setAttribute(QaAppConstants.GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); - return (mapping.findForward(QaAppConstants.INDIVIDUAL_LEARNER_REPORT)); + return (mapping.findForward(QaAppConstants.LEARNER_REP)); } else if (qaContent.isReflect()) { return forwardtoReflection(mapping, request, qaContent, toolSessionID, userID, qaLearningForm); @@ -496,7 +515,7 @@ request.setAttribute(QaAppConstants.GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); - return (mapping.findForward(QaAppConstants.INDIVIDUAL_LEARNER_REPORT)); + return (mapping.findForward(QaAppConstants.LEARNER_REP)); } /** @@ -525,6 +544,15 @@ QaSession qaSession = QaLearningAction.qaService.getSessionById(new Long(toolSessionID).longValue()); QaContent qaContent = qaSession.getQaContent(); + + QaQueUsr qaQueUsr = getCurrentUser(toolSessionID); + //prohibit users from submitting answers after response is finalized but Resubmit button is not pressed (e.g. using 2 browsers) + if (qaQueUsr.isResponseFinalized()) { + ActionRedirect redirect = new ActionRedirect(mapping.findForwardConfig("learningStarter")); + redirect.addParameter(AttributeNames.PARAM_TOOL_SESSION_ID, toolSessionID); + redirect.addParameter(MODE, "learner"); + return redirect; + } GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent); @@ -663,6 +691,15 @@ qaLearningForm.setToolSessionID(toolSessionID); QaSession qaSession = QaLearningAction.qaService.getSessionById(new Long(toolSessionID).longValue()); QaContent qaContent = qaSession.getQaContent(); + + QaQueUsr qaQueUsr = getCurrentUser(toolSessionID); + //prohibit users from submitting answers after response is finalized but Resubmit button is not pressed (e.g. using 2 browsers) + if (qaQueUsr.isResponseFinalized()) { + ActionRedirect redirect = new ActionRedirect(mapping.findForwardConfig("learningStarter")); + redirect.addParameter(AttributeNames.PARAM_TOOL_SESSION_ID, toolSessionID); + redirect.addParameter(MODE, "learner"); + return redirect; + } GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java =================================================================== diff -u -rc625cc6ab9f7ecf8b52d200e78e865d4eddb257e -r40937c574021c496d91487979b905b23a193b766 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java (.../QaLearningStarterAction.java) (revision c625cc6ab9f7ecf8b52d200e78e865d4eddb257e) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java (.../QaLearningStarterAction.java) (revision 40937c574021c496d91487979b905b23a193b766) @@ -286,7 +286,7 @@ generalLearnerFlowDTO); request.setAttribute(QaAppConstants.GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); - return (mapping.findForward(INDIVIDUAL_LEARNER_REPORT)); + return (mapping.findForward(LEARNER_REP)); } //check if there is submission deadline @@ -344,7 +344,7 @@ return (mapping.findForward(REVISITED_LEARNER_REP)); } else { generalLearnerFlowDTO.setRequestLearningReportViewOnly(new Boolean(false).toString()); - return (mapping.findForward(INDIVIDUAL_LEARNER_REPORT)); + return (mapping.findForward(LEARNER_REP)); } } } Index: lams_tool_laqa/web/WEB-INF/struts-config.xml =================================================================== diff -u -ra7661f206a3f21114f1c05f9a29f56e20f5e35f0 -r40937c574021c496d91487979b905b23a193b766 --- lams_tool_laqa/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision a7661f206a3f21114f1c05f9a29f56e20f5e35f0) +++ lams_tool_laqa/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 40937c574021c496d91487979b905b23a193b766) @@ -186,14 +186,7 @@ path="/learning/LearnerRep.jsp" redirect="false" /> - - - -
+
-
+
Index: lams_tool_laqa/web/authoring/newQuestionBox.jsp =================================================================== diff -u -rdd4087c8c38ddcf2e97af7fc2dda25a8c948bcf0 -r40937c574021c496d91487979b905b23a193b766 --- lams_tool_laqa/web/authoring/newQuestionBox.jsp (.../newQuestionBox.jsp) (revision dd4087c8c38ddcf2e97af7fc2dda25a8c948bcf0) +++ lams_tool_laqa/web/authoring/newQuestionBox.jsp (.../newQuestionBox.jsp) (revision 40937c574021c496d91487979b905b23a193b766) @@ -209,7 +209,7 @@
-
+
-
+