Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java =================================================================== diff -u -rc9531327d15636b54f293077ee1cd9f60195381b -r2e1913a4770c9bc154693d8c35f6e7a6b6e0e3fd --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision c9531327d15636b54f293077ee1cd9f60195381b) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision 2e1913a4770c9bc154693d8c35f6e7a6b6e0e3fd) @@ -75,6 +75,7 @@ public static void readData(HttpServletRequest request, McAuthoringForm mcAuthoringForm) { /** define the next tab as Basic tab by default*/ + mcAuthoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); McUtils.persistRichText(request); @@ -1093,8 +1094,20 @@ { McQueContent mcQueContent=(McQueContent)listIterator.next(); logger.debug("mcQueContent:" + mcQueContent); - map.put(mapIndex.toString(),mcQueContent.getFeedbackIncorrect().toString()); - mapIndex=new Long(mapIndex.longValue()+1); + + if (mcQueContent != null) + { + String incorrectFeedback=mcQueContent.getFeedbackIncorrect(); + if (incorrectFeedback != null) + { + map.put(mapIndex.toString(),incorrectFeedback.toString()); + } + else + { + map.put(mapIndex.toString(),""); + } + mapIndex=new Long(mapIndex.longValue()+1); + } } logger.debug("refreshed Map:" + map); @@ -1121,7 +1134,21 @@ { McQueContent mcQueContent=(McQueContent)listIterator.next(); logger.debug("mcQueContent:" + mcQueContent); - map.put(mapIndex.toString(),mcQueContent.getFeedbackCorrect().toString()); + + if (mcQueContent != null) + { + String correctFeedback=mcQueContent.getFeedbackCorrect(); + logger.debug("correctFeedback:" + correctFeedback); + + if (correctFeedback != null) + { + map.put(mapIndex.toString(),correctFeedback.toString()); + } + else + { + map.put(mapIndex.toString(),""); + } + } mapIndex=new Long(mapIndex.longValue()+1); } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java =================================================================== diff -u -rbe0f74b3d01318467107b6a074df9a097ca56fc1 -r2e1913a4770c9bc154693d8c35f6e7a6b6e0e3fd --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java (.../McAction.java) (revision be0f74b3d01318467107b6a074df9a097ca56fc1) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java (.../McAction.java) (revision 2e1913a4770c9bc154693d8c35f6e7a6b6e0e3fd) @@ -299,6 +299,7 @@ AuthoringUtil.addQuestionMemory(request, mcAuthoringForm, mapQuestionsContent, true); logger.debug("after addQuestionMemory"); + mcAuthoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); logger.debug("resetting EDIT_OPTIONS_MODE to 0"); mcAuthoringForm.resetUserAction(); @@ -422,6 +423,7 @@ request.getSession().setAttribute(MAP_WEIGHTS, mapWeights); } + mcAuthoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); logger.debug("resetting EDIT_OPTIONS_MODE to 0"); mcAuthoringForm.resetUserAction(); @@ -488,6 +490,7 @@ Map mapGeneralOptionsContent=(Map)request.getSession().getAttribute(MAP_GENERAL_OPTIONS_CONTENT); logger.debug("initial test: current mapGeneralOptionsContent: " + mapGeneralOptionsContent); + mcAuthoringForm.setEditOptionsMode(new Integer(1).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(1)); logger.debug("setting EDIT_OPTIONS_MODE to 1"); @@ -544,6 +547,7 @@ mcAuthoringForm.resetUserAction(); logger.debug("return to destination to fix error."); + mcAuthoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); logger.debug("setting EDIT_OPTIONS_MODE to 0"); @@ -564,6 +568,7 @@ mcAuthoringForm.resetUserAction(); logger.debug("return to destination to fix error."); + mcAuthoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); logger.debug("setting EDIT_OPTIONS_MODE to 0"); @@ -793,7 +798,7 @@ request.getSession().setAttribute(MAP_GENERAL_SELECTED_OPTIONS_CONTENT, mapGeneralSelectedOptionsContent); } - + mcAuthoringForm.setEditOptionsMode(new Integer(1).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(1)); logger.debug("resetting EDIT_OPTIONS_MODE to 1"); mcAuthoringForm.resetUserAction(); @@ -853,6 +858,7 @@ AuthoringUtil.readData(request, mcAuthoringForm); + mcAuthoringForm.setEditOptionsMode(new Integer(1).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(1)); logger.debug("setting EDIT_OPTIONS_MODE to 1"); @@ -872,6 +878,7 @@ mcAuthoringForm.resetUserAction(); logger.debug("return to destination to fix error."); + mcAuthoringForm.setEditOptionsMode(new Integer(1).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(1)); logger.debug("setting EDIT_OPTIONS_MODE to 1"); @@ -891,6 +898,7 @@ mcAuthoringForm.resetUserAction(); logger.debug("return to destination to fix error."); + mcAuthoringForm.setEditOptionsMode(new Integer(1).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(1)); logger.debug("setting EDIT_OPTIONS_MODE to 1"); @@ -928,6 +936,7 @@ request.getSession().setAttribute(MAP_GENERAL_SELECTED_OPTIONS_CONTENT, mapGeneralSelectedOptionsContent); logger.debug("updated MAP_GENERAL_SELECTED_OPTIONS_CONTENT after add: " + mapGeneralSelectedOptionsContent); + mcAuthoringForm.setEditOptionsMode(new Integer(1).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(1)); logger.debug("resetting EDIT_OPTIONS_MODE to 1"); mcAuthoringForm.resetUserAction(); @@ -987,6 +996,7 @@ AuthoringUtil.readData(request, mcAuthoringForm); + mcAuthoringForm.setEditOptionsMode(new Integer(1).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(1)); logger.debug("setting EDIT_OPTIONS_MODE to 1"); @@ -1007,6 +1017,7 @@ mcAuthoringForm.resetUserAction(); persistError(request,"options.count.zero"); + mcAuthoringForm.setEditOptionsMode(new Integer(1).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(1)); logger.debug("setting EDIT_OPTIONS_MODE :" + 1); @@ -1052,6 +1063,7 @@ logger.debug("updated MAP_GENERAL_SELECTED_OPTIONS_CONTENT after add: " + mapGeneralSelectedOptionsContent); /* update feedback Maps*/ + mcAuthoringForm.setEditOptionsMode(new Integer(1).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(1)); logger.debug("resetting EDIT_OPTIONS_MODE to 1"); mcAuthoringForm.resetUserAction(); @@ -1178,6 +1190,7 @@ } mcAuthoringForm.resetUserAction(); + mcAuthoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); logger.debug("resetting EDIT_OPTIONS_MODE to 0"); @@ -1309,6 +1322,7 @@ } mcAuthoringForm.resetUserAction(); + mcAuthoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); logger.debug("resetting EDIT_OPTIONS_MODE to 0"); @@ -1371,6 +1385,7 @@ AuthoringUtil.readData(request, mcAuthoringForm); + mcAuthoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); logger.debug("setting EDIT_OPTIONS_MODE to 0"); @@ -1387,6 +1402,7 @@ mcAuthoringForm.resetUserAction(); logger.debug("return to destination to fix error."); + mcAuthoringForm.setEditOptionsMode(new Integer(1).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(1)); logger.debug("setting EDIT_OPTIONS_MODE to 1"); @@ -1408,6 +1424,7 @@ mcAuthoringForm.resetUserAction(); logger.debug("return to destination to fix error."); + mcAuthoringForm.setEditOptionsMode(new Integer(1).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(1)); logger.debug("setting EDIT_OPTIONS_MODE to 1"); @@ -1479,6 +1496,7 @@ request.getSession().setAttribute(MAP_GENERAL_OPTIONS_CONTENT, mapGeneralOptionsContent); logger.debug("updated MAP_GENERAL_OPTIONS_CONTENT after done: " + mapGeneralOptionsContent); + mcAuthoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); logger.debug("setting EDIT_OPTIONS_MODE to 0"); mcAuthoringForm.resetUserAction(); @@ -1533,6 +1551,8 @@ { McUtils.cleanUpUserExceptions(request); logger.debug("dispatching editActivityQuestions..."); + + McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); McUtils.debugMaps(request); @@ -1547,6 +1567,7 @@ request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(true)); McUtils.setDefineLater(request, true); + mcAuthoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); logger.debug("setting EDIT_OPTIONS_MODE to 0"); @@ -1590,6 +1611,7 @@ AuthoringUtil.readData(request, mcAuthoringForm); + mcAuthoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); logger.debug("setting EDIT_OPTIONS_MODE to 0"); @@ -1688,6 +1710,7 @@ mcAuthoringForm.resetUserAction(); persistError(request,"error.weights.total.invalid"); + mcAuthoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); logger.debug("setting EDIT_OPTIONS_MODE to 0"); @@ -1770,6 +1793,7 @@ mcAuthoringForm.resetUserAction(); persistError(request,"error.passmark.notInteger"); + mcAuthoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); logger.debug("setting EDIT_OPTIONS_MODE to 0"); @@ -1797,6 +1821,7 @@ mcAuthoringForm.resetUserAction(); logger.debug("return to destination to fix error."); + mcAuthoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); logger.debug("setting EDIT_OPTIONS_MODE to 0"); @@ -1820,6 +1845,7 @@ mcAuthoringForm.resetUserAction(); logger.debug("return to destination to fix error."); + mcAuthoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); logger.debug("setting EDIT_OPTIONS_MODE to 0"); @@ -1861,6 +1887,7 @@ if (errors.size() > 0) { logger.debug("either title or instructions or both is missing. Returning back to from to fix errors:"); + mcAuthoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); logger.debug("setting EDIT_OPTIONS_MODE to 0"); @@ -2006,6 +2033,7 @@ request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(1)); logger.debug("set SUBMIT_SUCCESS to 1"); + mcAuthoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); logger.debug("setting EDIT_OPTIONS_MODE to 0"); @@ -2206,6 +2234,7 @@ mcAuthoringForm.resetUserAction(); persistError(request,"error.fileName.empty"); + mcAuthoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); logger.debug("setting EDIT_OPTIONS_MODE :" + 0); @@ -2221,6 +2250,7 @@ request.getSession().setAttribute(LIST_OFFLINEFILES_METADATA, listOfflineFilesMetaData); mcAuthoringForm.resetUserAction(); + mcAuthoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); logger.debug("setting EDIT_OPTIONS_MODE :" + 0); @@ -2278,6 +2308,7 @@ mcAuthoringForm.resetUserAction(); persistError(request,"error.fileName.empty"); + mcAuthoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); logger.debug("setting EDIT_OPTIONS_MODE :" + 0); McUtils.debugMaps(request); @@ -2291,8 +2322,9 @@ request.getSession().setAttribute(LIST_ONLINEFILES_METADATA, listOnlineFilesMetaData); mcAuthoringForm.resetUserAction(); + mcAuthoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); - logger.debug("setting EDIT_OPTIONS_MODE :" + 0); + logger.debug("setting ` :" + 0); McUtils.debugMaps(request); return (mapping.findForward(destination)); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAuthoringForm.java =================================================================== diff -u -rc9531327d15636b54f293077ee1cd9f60195381b -r2e1913a4770c9bc154693d8c35f6e7a6b6e0e3fd --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAuthoringForm.java (.../McAuthoringForm.java) (revision c9531327d15636b54f293077ee1cd9f60195381b) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAuthoringForm.java (.../McAuthoringForm.java) (revision 2e1913a4770c9bc154693d8c35f6e7a6b6e0e3fd) @@ -44,6 +44,9 @@ protected String editDefaultQuestion; protected String removeOptionContent; + protected String activeModule; + protected String editOptionsMode; + protected String fileItem; protected String uuid; @@ -822,4 +825,28 @@ this.submit = submit; } + /** + * @return Returns the activeModule. + */ + public String getActiveModule() { + return activeModule; + } + /** + * @param activeModule The activeModule to set. + */ + public void setActiveModule(String activeModule) { + this.activeModule = activeModule; + } + /** + * @return Returns the editOptionsMode. + */ + public String getEditOptionsMode() { + return editOptionsMode; + } + /** + * @param editOptionsMode The editOptionsMode to set. + */ + public void setEditOptionsMode(String editOptionsMode) { + this.editOptionsMode = editOptionsMode; + } } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java =================================================================== diff -u -rc9531327d15636b54f293077ee1cd9f60195381b -r2e1913a4770c9bc154693d8c35f6e7a6b6e0e3fd --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java (.../McMonitoringAction.java) (revision c9531327d15636b54f293077ee1cd9f60195381b) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java (.../McMonitoringAction.java) (revision 2e1913a4770c9bc154693d8c35f6e7a6b6e0e3fd) @@ -312,6 +312,8 @@ logger.debug("dispatching editActivityQuestions.."); request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(false).toString()); IMcService mcService =McUtils.getToolService(request); + + if (mcService == null) { logger.debug("will retrieve mcService"); @@ -325,6 +327,8 @@ request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(true)); McUtils.setDefineLater(request, true); + McMonitoringForm mcMonitoringForm = (McMonitoringForm) form; + mcMonitoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); logger.debug("setting EDIT_OPTIONS_MODE to 0"); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java =================================================================== diff -u -rb6388cf4dc60bc441229fd1bfbd66ac0fb8e99c7 -r2e1913a4770c9bc154693d8c35f6e7a6b6e0e3fd --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java (.../McMonitoringStarterAction.java) (revision b6388cf4dc60bc441229fd1bfbd66ac0fb8e99c7) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java (.../McMonitoringStarterAction.java) (revision 2e1913a4770c9bc154693d8c35f6e7a6b6e0e3fd) @@ -125,6 +125,8 @@ return (mapping.findForward(ERROR_LIST)); request.getSession().setAttribute(CURRENT_MONITORING_TAB, "summary"); + McMonitoringForm mcMonitoringForm = (McMonitoringForm) form; + mcMonitoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); request.getSession().setAttribute(ACTIVE_MODULE, DEFINE_LATER); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java =================================================================== diff -u -rc9531327d15636b54f293077ee1cd9f60195381b -r2e1913a4770c9bc154693d8c35f6e7a6b6e0e3fd --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java (.../McStarterAction.java) (revision c9531327d15636b54f293077ee1cd9f60195381b) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java (.../McStarterAction.java) (revision 2e1913a4770c9bc154693d8c35f6e7a6b6e0e3fd) @@ -179,6 +179,8 @@ McUtils.cleanUpSessionAbsolute(request); logger.debug("init authoring mode. removed attributes..."); + McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; + IMcService mcService = (IMcService)request.getSession().getAttribute(TOOL_SERVICE); logger.debug("mcService: " + mcService); if (mcService == null) @@ -206,16 +208,14 @@ request.getSession().setAttribute(SHOW_AUTHORING_TABS,new Boolean(false).toString()); } - initialiseAttributes(request); + initialiseAttributes(request, mcAuthoringForm); /* determine whether the request is from Monitoring url Edit Activity. * null sourceMcStarter indicates that the request is from authoring url. * */ String sourceMcStarter = (String) request.getAttribute(SOURCE_MC_STARTER); logger.debug("sourceMcStarter: " + sourceMcStarter); - - McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; mcAuthoringForm.resetRadioBoxes(); ActionForward validateSignature=readSignature(request,mapping); @@ -801,9 +801,10 @@ * * @param request */ - protected void initialiseAttributes(HttpServletRequest request) + protected void initialiseAttributes(HttpServletRequest request, McAuthoringForm mcAuthoringForm) { logger.debug("starting initialiseAttributes..."); + mcAuthoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); /* needs to run only once per tool*/ @@ -853,6 +854,7 @@ Map mapCorrectFeedback= new TreeMap(new McComparator()); request.getSession().setAttribute(MAP_CORRECT_FEEDBACK, mapCorrectFeedback); + mcAuthoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); logger.debug("resetting EDIT_OPTIONS_MODE to 0"); } Index: lams_tool_lamc/web/authoring/AuthoringMaincontent.jsp =================================================================== diff -u -rf536379d9c4072abeffb63d0cd140b819122cb8e -r2e1913a4770c9bc154693d8c35f6e7a6b6e0e3fd --- lams_tool_lamc/web/authoring/AuthoringMaincontent.jsp (.../AuthoringMaincontent.jsp) (revision f536379d9c4072abeffb63d0cd140b819122cb8e) +++ lams_tool_lamc/web/authoring/AuthoringMaincontent.jsp (.../AuthoringMaincontent.jsp) (revision 2e1913a4770c9bc154693d8c35f6e7a6b6e0e3fd) @@ -102,7 +102,13 @@ initEditor("richTextTitle"); initEditor("richTextInstructions"); - } + initEditor("richTextReportTitle"); + initEditor("richTextEndLearningMsg"); + initEditor("richTextOfflineInstructions"); + initEditor("richTextOnlineInstructions"); + initEditor("richTextIncorrectFeedback"); + initEditor("richTextCorrectFeedback"); + } function doSelectTab(tabId) { // start optional tab controller stuff