Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralAuthoringDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralAuthoringDTO.java,v diff -u -r1.4 -r1.5 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralAuthoringDTO.java 17 Nov 2006 11:13:04 -0000 1.4 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralAuthoringDTO.java 3 Dec 2006 10:19:21 -0000 1.5 @@ -95,6 +95,7 @@ .append("toolContentID: ", toolContentID) .append("contentFolderID: ", contentFolderID) .append("httpSessionID: ", httpSessionID) + .append("editableQuestionText: ", editableQuestionText) .append("passMarksMap: ", passMarksMap) .append("totalMarks: ", totalMarks) .append("marksMap: ", marksMap) Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java,v diff -u -r1.128 -r1.129 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java 13 Nov 2006 00:31:22 -0000 1.128 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java 3 Dec 2006 10:19:20 -0000 1.129 @@ -736,8 +736,10 @@ sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO); logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO); + request.setAttribute("requestNewEditableQuestionBox",new Boolean(true).toString()); + logger.debug("forwarding using newEditableQuestionBox"); - return newEditableQuestionBox(mapping, form, request, response); + return newEditableQuestionBox(mapping, form, request, response); } } @@ -1383,8 +1385,12 @@ logger.debug("mcContent: " + mcContent); - McGeneralAuthoringDTO mcGeneralAuthoringDTO= new McGeneralAuthoringDTO(); + McGeneralAuthoringDTO mcGeneralAuthoringDTO = (McGeneralAuthoringDTO) request.getAttribute(MC_GENERAL_AUTHORING_DTO); + logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO); + if (mcGeneralAuthoringDTO == null) + mcGeneralAuthoringDTO= new McGeneralAuthoringDTO(); + mcGeneralAuthoringDTO.setMarkValue(editableMark); logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO); @@ -1449,6 +1455,29 @@ mcGeneralAuthoringDTO.setTotalMarks(totalMark); + String requestNewEditableQuestionBox=(String )request.getAttribute("requestNewEditableQuestionBox"); + logger.debug("requestNewEditableQuestionBox: " + requestNewEditableQuestionBox); + + String editQuestionBoxRequest=request.getParameter("editQuestionBoxRequest"); + logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest); + + String newQuestion=request.getParameter("newQuestion"); + logger.debug("newQuestion: " + newQuestion); + + //if ((editQuestionBoxRequest != null) && (editQuestionBoxRequest.equals("false"))) + if ( (requestNewEditableQuestionBox != null) && requestNewEditableQuestionBox.equals("true")) + { + //String newQuestion=request.getParameter("newQuestion"); + //logger.debug("newQuestion: " + newQuestion); + mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion); + + String feedback=request.getParameter("feedback"); + logger.debug("feedback: " + feedback); + mcAuthoringForm.setFeedback(feedback); + } + + + logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO); request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO); @@ -2953,6 +2982,7 @@ String editQuestionBoxRequest=request.getParameter("editQuestionBoxRequest"); logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest); + request.setAttribute("requestNewEditableQuestionBox",new Boolean(true).toString()); return newEditableQuestionBox(mapping, form, request, response); } @@ -3201,8 +3231,8 @@ String editQuestionBoxRequest=request.getParameter("editQuestionBoxRequest"); logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest); + request.setAttribute("requestNewEditableQuestionBox",new Boolean(true).toString()); return newEditableQuestionBox(mapping, form, request, response); - } @@ -3453,8 +3483,8 @@ String editQuestionBoxRequest=request.getParameter("editQuestionBoxRequest"); logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest); + request.setAttribute("requestNewEditableQuestionBox",new Boolean(true).toString()); return newEditableQuestionBox(mapping, form, request, response); - } @@ -3691,9 +3721,9 @@ request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size())); logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest); - + + request.setAttribute("requestNewEditableQuestionBox",new Boolean(true).toString()); return newEditableQuestionBox(mapping, form, request, response); - } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java,v diff -u -r1.34 -r1.35 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java 16 Nov 2006 01:17:05 -0000 1.34 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java 3 Dec 2006 10:19:20 -0000 1.35 @@ -1446,7 +1446,8 @@ setupCommonScreenData(mcContent, mcService,request); MonitoringUtil.setupAllSessionsData(request, mcContent,mcService); - + request.setAttribute("requestNewEditableQuestionBox",new Boolean(true).toString()); + logger.debug("forwarding using newEditableQuestionBox"); return newEditableQuestionBox(mapping, form, request, response); } @@ -2045,8 +2046,13 @@ logger.debug("mcContent: " + mcContent); - McGeneralAuthoringDTO mcGeneralAuthoringDTO= new McGeneralAuthoringDTO(); + McGeneralAuthoringDTO mcGeneralAuthoringDTO = (McGeneralAuthoringDTO) request.getAttribute(MC_GENERAL_AUTHORING_DTO); + logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO); + if (mcGeneralAuthoringDTO == null) + mcGeneralAuthoringDTO= new McGeneralAuthoringDTO(); + + mcGeneralAuthoringDTO.setMarkValue(editableMark); logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO); @@ -2098,19 +2104,23 @@ mcAuthoringForm.setTotalMarks(totalMark); mcGeneralAuthoringDTO.setTotalMarks(totalMark); - /* + String requestNewEditableQuestionBox=(String )request.getAttribute("requestNewEditableQuestionBox"); + logger.debug("requestNewEditableQuestionBox: " + requestNewEditableQuestionBox); + + String editQuestionBoxRequest=request.getParameter("editQuestionBoxRequest"); + logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest); + String newQuestion=request.getParameter("newQuestion"); logger.debug("newQuestion: " + newQuestion); - mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion); - - String feedback=request.getParameter("feedback"); - logger.debug("feedback: " + feedback); - mcAuthoringForm.setFeedback(feedback); - - String mark=request.getParameter("mark"); - logger.debug("mark: " + mark); - mcGeneralAuthoringDTO.setMarkValue(mark); - */ + + if ( (requestNewEditableQuestionBox != null) && requestNewEditableQuestionBox.equals("true")) + { + mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion); + + String feedback=request.getParameter("feedback"); + logger.debug("feedback: " + feedback); + mcAuthoringForm.setFeedback(feedback); + } logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO); @@ -2821,7 +2831,8 @@ setupCommonScreenData(mcContent, mcService,request); MonitoringUtil.setupAllSessionsData(request, mcContent,mcService); - + request.setAttribute("requestNewEditableQuestionBox",new Boolean(true).toString()); + return newEditableQuestionBox(mapping, form, request, response); } @@ -3046,6 +3057,7 @@ setupCommonScreenData(mcContent, mcService,request); MonitoringUtil.setupAllSessionsData(request, mcContent,mcService); + request.setAttribute("requestNewEditableQuestionBox",new Boolean(true).toString()); return newEditableQuestionBox(mapping, form, request, response); @@ -3272,6 +3284,7 @@ setupCommonScreenData(mcContent, mcService,request); MonitoringUtil.setupAllSessionsData(request, mcContent,mcService); + request.setAttribute("requestNewEditableQuestionBox",new Boolean(true).toString()); return newEditableQuestionBox(mapping, form, request, response); @@ -3487,6 +3500,8 @@ setupCommonScreenData(mcContent, mcService,request); MonitoringUtil.setupAllSessionsData(request, mcContent,mcService); + request.setAttribute("requestNewEditableQuestionBox",new Boolean(true).toString()); + return newEditableQuestionBox(mapping, form, request, response); }