Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java =================================================================== diff -u -r79aa6d305d1c62b1aed8e0f8dfdedcc8e5c4bedb -r1453bf6403ce02c29d691fe34e65a049d3285c26 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java (.../QaAction.java) (revision 79aa6d305d1c62b1aed8e0f8dfdedcc8e5c4bedb) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java (.../QaAction.java) (revision 1453bf6403ce02c29d691fe34e65a049d3285c26) @@ -240,6 +240,8 @@ authoringUtil.removeRedundantQuestions(mapQuestionContent, qaService, qaAuthoringForm, request); logger.debug("end of removing unused entries... "); + + QaContent qaContent=authoringUtil.saveOrUpdateQaContent(mapQuestionContent, qaService, qaAuthoringForm, request); logger.debug("qaContent: " + qaContent); @@ -258,11 +260,15 @@ request.getSession().setAttribute(ACTIVITY_INSTRUCTIONS, richTextInstructions); } - authoringUtil.reOrganizeDisplayOrder(mapQuestionContent, qaService, qaAuthoringForm, qaContent); - List attacments=saveAttachments(qaContent, attachmentList, deletedAttachmentList, mapping, request); - logger.debug("attacments: " + attacments); + String activeModule=qaAuthoringForm.getActiveModule(); + logger.debug("activeModule: " + activeModule); + if (activeModule.equals(AUTHORING)) + { + List attacments=saveAttachments(qaContent, attachmentList, deletedAttachmentList, mapping, request); + logger.debug("attacments: " + attacments); + } errors.clear(); @@ -424,7 +430,7 @@ String sourceMcStarter = (String) request.getAttribute(SOURCE_MC_STARTER); logger.debug("sourceMcStarter: " + sourceMcStarter); - request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(true)); + request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(true).toString()); request.getSession().setAttribute(SHOW_AUTHORING_TABS,new Boolean(false).toString()); String toolContentId=qaAuthoringForm.getToolContentId(); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAuthoringForm.java =================================================================== diff -u -r65166da92a6f0f4ff73acb92b95672e237b25742 -r1453bf6403ce02c29d691fe34e65a049d3285c26 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAuthoringForm.java (.../QaAuthoringForm.java) (revision 65166da92a6f0f4ff73acb92b95672e237b25742) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAuthoringForm.java (.../QaAuthoringForm.java) (revision 1453bf6403ce02c29d691fe34e65a049d3285c26) @@ -47,6 +47,8 @@ protected String choiceBasic; protected String choiceAdvanced; protected String choiceInstructions; + + protected String activeModule; /* basic content */ protected String title; @@ -558,4 +560,17 @@ public void setCurrentTab(String currentTab) { this.currentTab = currentTab; } + + /** + * @return Returns the activeModule. + */ + public String getActiveModule() { + return activeModule; + } + /** + * @param activeModule The activeModule to set. + */ + public void setActiveModule(String activeModule) { + this.activeModule = activeModule; + } } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java =================================================================== diff -u -rab1fbeffaf558570ec5d2b3e379e26cecbd9a618 -r1453bf6403ce02c29d691fe34e65a049d3285c26 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java (.../QaMonitoringAction.java) (revision ab1fbeffaf558570ec5d2b3e379e26cecbd9a618) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java (.../QaMonitoringAction.java) (revision 1453bf6403ce02c29d691fe34e65a049d3285c26) @@ -425,7 +425,7 @@ logger.debug("dispatching editActivityQuestions..."); request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(false).toString()); - request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(true)); + request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(true).toString()); QaUtils.setDefineLater(request, true); return (mapping.findForward(LOAD_MONITORING)); } @@ -456,6 +456,7 @@ throws IOException, ServletException { logger.debug("dispatching proxy submitAllContent..."); request.getSession().setAttribute(ACTIVE_MODULE, DEFINE_LATER); + request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(false).toString()); QaAction qaAction= new QaAction(); return qaAction.submitAllContent(mapping, form, request, response); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java =================================================================== diff -u -r65166da92a6f0f4ff73acb92b95672e237b25742 -r1453bf6403ce02c29d691fe34e65a049d3285c26 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java (.../QaMonitoringStarterAction.java) (revision 65166da92a6f0f4ff73acb92b95672e237b25742) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java (.../QaMonitoringStarterAction.java) (revision 1453bf6403ce02c29d691fe34e65a049d3285c26) @@ -190,6 +190,7 @@ request.getSession().setAttribute(ACTIVE_MODULE, MONITORING); + qaMonitoringForm.setActiveModule(MONITORING); return (mapping.findForward(LOAD_MONITORING)); } @@ -235,19 +236,7 @@ } - boolean isContentInUse=QaUtils.isContentInUse(qaContent); - logger.debug("isContentInUse:" + isContentInUse); - - request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(false).toString()); - if (isContentInUse == true) - { - logger.debug("monitoring url does not allow editActivity since the content is in use."); - persistError(request,"error.content.inUse"); - request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(true).toString()); - } - - if (qaContent.getTitle() == null) { request.getSession().setAttribute(ACTIVITY_TITLE, "Questions and Answers"); @@ -277,9 +266,22 @@ logger.debug("refreshing instructions data..."); qaMonitoringAction.refreshInstructionsData(request, qaContent); - /* this section is related to instructions tab. Starts here. */ - /* ends here. */ - + logger.debug("populating online and ofline files data for intructions tab"); + QaUtils.populateUploadedFilesData(request, qaContent, qaService); + + + boolean isContentInUse=QaUtils.isContentInUse(qaContent); + logger.debug("isContentInUse:" + isContentInUse); + + request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(false).toString()); + if (isContentInUse == true) + { + logger.debug("monitoring url does not allow editActivity since the content is in use."); + persistError(request,"error.content.inUse"); + request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(true).toString()); + } + + logger.debug("final IS_MONITORED_CONTENT_IN_USE: " + request.getSession().getAttribute(IS_MONITORED_CONTENT_IN_USE)); logger.debug("end initializing monitoring data..."); return true; } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java =================================================================== diff -u -r65166da92a6f0f4ff73acb92b95672e237b25742 -r1453bf6403ce02c29d691fe34e65a049d3285c26 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java (.../QaStarterAction.java) (revision 65166da92a6f0f4ff73acb92b95672e237b25742) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java (.../QaStarterAction.java) (revision 1453bf6403ce02c29d691fe34e65a049d3285c26) @@ -214,16 +214,18 @@ { logger.debug("request is for authoring module"); request.getSession().setAttribute(ACTIVE_MODULE, AUTHORING); - request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(true)); + request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(true).toString()); request.getSession().setAttribute(SHOW_AUTHORING_TABS,new Boolean(true).toString()); + qaAuthoringForm.setActiveModule(AUTHORING); requestedModule=AUTHORING; } else { logger.debug("request is for define later module either direcly from define later url or monitoring url"); request.getSession().setAttribute(ACTIVE_MODULE, DEFINE_LATER); - request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(false)); + request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(false).toString()); request.getSession().setAttribute(SHOW_AUTHORING_TABS,new Boolean(false).toString()); + qaAuthoringForm.setActiveModule(DEFINE_LATER); requestedModule=DEFINE_LATER; if (servletPath.indexOf("monitoring") > 0) Index: lams_tool_laqa/web/authoring/AuthoringTabsHolder.jsp =================================================================== diff -u -r35b9d9a191a324d1437ef51181c8ab8f12e2d6d7 -r1453bf6403ce02c29d691fe34e65a049d3285c26 --- lams_tool_laqa/web/authoring/AuthoringTabsHolder.jsp (.../AuthoringTabsHolder.jsp) (revision 35b9d9a191a324d1437ef51181c8ab8f12e2d6d7) +++ lams_tool_laqa/web/authoring/AuthoringTabsHolder.jsp (.../AuthoringTabsHolder.jsp) (revision 1453bf6403ce02c29d691fe34e65a049d3285c26) @@ -65,27 +65,42 @@ var themeName="aqua"; function init(){ - - initTabSize(3); - - var tag = document.getElementById("currentTab"); - if(tag.value != "") - selectTab(tag.value); - else - selectTab(1); //select the default tab; - - initEditor("title"); - initEditor("instructions"); - initEditor("questionContent0"); - - - - - initEditor(""); - - + if (document.QaAuthoringForm.activeModule.value != 'defineLater') + { + initTabSize(3); + + var tag = document.getElementById("currentTab"); + if(tag.value != "") + selectTab(tag.value); + else + selectTab(1); //select the default tab; + + initEditor("onlineInstructions"); + initEditor("offlineInstructions"); + } + else + { + initTabSize(1); + + var tag = document.getElementById("currentTab"); + if(tag.value != "") + selectTab(tag.value); + else + selectTab(1); //select the default tab; + } + + initEditor("title"); + initEditor("instructions"); + + initEditor("questionContent0"); + + + + initEditor(""); + } + function doSelectTab(tabId) { // start optional tab controller stuff var tag = document.getElementById("currentTab"); @@ -110,6 +125,7 @@ + @@ -130,6 +146,7 @@ + Index: lams_tool_laqa/web/monitoring/Instructions.jsp =================================================================== diff -u -r65166da92a6f0f4ff73acb92b95672e237b25742 -r1453bf6403ce02c29d691fe34e65a049d3285c26 --- lams_tool_laqa/web/monitoring/Instructions.jsp (.../Instructions.jsp) (revision 65166da92a6f0f4ff73acb92b95672e237b25742) +++ lams_tool_laqa/web/monitoring/Instructions.jsp (.../Instructions.jsp) (revision 1453bf6403ce02c29d691fe34e65a049d3285c26) @@ -35,28 +35,104 @@ + - + - + - +     - + + - + - + + + + + + + + + + + + + + + + + + + + + + /download/?uuid=&preferDownload=false + /download/?uuid=&preferDownload=true + + + + + + + + + + + + + + + + + + + + + + '/>")' class="button"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file