Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java =================================================================== diff -u -rb31ec6e6d35cd7a66c2560b16a2943c643fb46aa -rb981d563ace42f1c943a2e847aa2f725249b82a8 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java (.../VoteAction.java) (revision b31ec6e6d35cd7a66c2560b16a2943c643fb46aa) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java (.../VoteAction.java) (revision b981d563ace42f1c943a2e847aa2f725249b82a8) @@ -291,39 +291,54 @@ String maxNomCount=voteAuthoringForm.getMaxNominationCount(); logger.debug("maxNomCount:" + maxNomCount); - if (maxNomCount.equals("0")) - { - voteAuthoringForm.setExceptionMaxNominationInvalid(new Boolean(true).toString()); - persistError(request,"error.maxNominationCount.invalid"); - return (mapping.findForward(LOAD_QUESTIONS)); - } - try - { - int intMaxNomCount=new Integer(maxNomCount).intValue(); - logger.debug("intMaxNomCount : " +intMaxNomCount); - } - catch(NumberFormatException e) - { - persistError(request,"error.maxNominationCount.invalid"); - voteAuthoringForm.setExceptionMaxNominationInvalid(new Boolean(true).toString()); - return (mapping.findForward(LOAD_QUESTIONS)); - } + String activeModule=voteAuthoringForm.getActiveModule(); + logger.debug("activeModule:" + activeModule); + + if (activeModule != null) + { + if (activeModule.equals(AUTHORING)) + { + if (maxNomCount != null) + { + if (maxNomCount.equals("0")) + { + voteAuthoringForm.setExceptionMaxNominationInvalid(new Boolean(true).toString()); + persistError(request,"error.maxNominationCount.invalid"); + return (mapping.findForward(LOAD_QUESTIONS)); + } + + try + { + int intMaxNomCount=new Integer(maxNomCount).intValue(); + logger.debug("intMaxNomCount : " +intMaxNomCount); + } + catch(NumberFormatException e) + { + persistError(request,"error.maxNominationCount.invalid"); + voteAuthoringForm.setExceptionMaxNominationInvalid(new Boolean(true).toString()); + return (mapping.findForward(LOAD_QUESTIONS)); + } + } + + logger.debug("start persisting offline files metadata"); + AuthoringUtil.persistFilesMetaData(request, true, voteContent); + logger.debug("start persisting online files metadata"); + AuthoringUtil.persistFilesMetaData(request, false, voteContent); + + + /* making sure only the filenames in the session cache are persisted and the others in the db are removed*/ + logger.debug("start removing redundant offline files metadata"); + AuthoringUtil.removeRedundantOfflineFileItems(request, voteContent); + + logger.debug("start removing redundant online files metadata"); + AuthoringUtil.removeRedundantOnlineFileItems(request, voteContent); + logger.debug("done removing redundant files"); + + } + } - logger.debug("start persisting offline files metadata"); - AuthoringUtil.persistFilesMetaData(request, true, voteContent); - logger.debug("start persisting online files metadata"); - AuthoringUtil.persistFilesMetaData(request, false, voteContent); - - /* making sure only the filenames in the session cache are persisted and the others in the db are removed*/ - logger.debug("start removing redundant offline files metadata"); - AuthoringUtil.removeRedundantOfflineFileItems(request, voteContent); - - logger.debug("start removing redundant online files metadata"); - AuthoringUtil.removeRedundantOnlineFileItems(request, voteContent); - logger.debug("done removing redundant files"); - errors.clear(); errors.add(Globals.ERROR_KEY, new ActionMessage("sbmt.successful")); request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(1)); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAuthoringForm.java =================================================================== diff -u -rb31ec6e6d35cd7a66c2560b16a2943c643fb46aa -rb981d563ace42f1c943a2e847aa2f725249b82a8 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAuthoringForm.java (.../VoteAuthoringForm.java) (revision b31ec6e6d35cd7a66c2560b16a2943c643fb46aa) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAuthoringForm.java (.../VoteAuthoringForm.java) (revision b981d563ace42f1c943a2e847aa2f725249b82a8) @@ -48,6 +48,8 @@ protected String lockOnFinish; protected String allowText; + protected String activeModule; + protected String maxNominationCount; protected String fileItem; @@ -742,4 +744,16 @@ String exceptionMaxNominationInvalid) { this.exceptionMaxNominationInvalid = exceptionMaxNominationInvalid; } + /** + * @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_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java =================================================================== diff -u -r277d8412bc03b9c73992a0e6f3ad845cd0a4eba6 -rb981d563ace42f1c943a2e847aa2f725249b82a8 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java (.../VoteMonitoringAction.java) (revision 277d8412bc03b9c73992a0e6f3ad845cd0a4eba6) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java (.../VoteMonitoringAction.java) (revision b981d563ace42f1c943a2e847aa2f725249b82a8) @@ -113,6 +113,38 @@ return null; } + + public ActionForward submitSession(ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws IOException, + ServletException + { + logger.debug("dispatching submitSession..."); + + VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; + String currentMonitoredToolSession=voteMonitoringForm.getSelectedToolSessionId(); + logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession); + + if (currentMonitoredToolSession.equals("All")) + { + request.getSession().setAttribute(SELECTION_CASE, new Long(2)); + } + else + { + /* SELECTION_CASE == 1 indicates a selected group other than "All" */ + request.getSession().setAttribute(SELECTION_CASE, new Long(1)); + } + logger.debug("SELECTION_CASE: " + request.getSession().getAttribute(SELECTION_CASE)); + + + request.getSession().setAttribute(CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession); + logger.debug("CURRENT_MONITORED_TOOL_SESSION: " + request.getSession().getAttribute(CURRENT_MONITORED_TOOL_SESSION)); + + return (mapping.findForward(LOAD_MONITORING)); + } + + public void refreshSummaryData(HttpServletRequest request, VoteContent voteContent, IVoteService voteService, boolean isUserNamesVisible, boolean isLearnerRequest, String currentSessionId, String userId, boolean showUserEntriesBySession) { @@ -193,7 +225,7 @@ String userEntry =(String)itListQuestions.next(); logger.debug("userEntry:..." + userEntry); - if (userEntry != null) + if ((userEntry != null) && (userEntry.length() > 0)) { VoteMonitoredAnswersDTO voteMonitoredAnswersDTO= new VoteMonitoredAnswersDTO(); logger.debug("adding user entry : " + userEntry); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java =================================================================== diff -u -r277d8412bc03b9c73992a0e6f3ad845cd0a4eba6 -rb981d563ace42f1c943a2e847aa2f725249b82a8 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java (.../VoteMonitoringStarterAction.java) (revision 277d8412bc03b9c73992a0e6f3ad845cd0a4eba6) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java (.../VoteMonitoringStarterAction.java) (revision b981d563ace42f1c943a2e847aa2f725249b82a8) @@ -65,6 +65,7 @@ logger.debug("init VoteMonitoringStarterAction..."); VoteUtils.cleanUpSessionAbsolute(request); + ActionForward validateParameters=validateParameters(request, mapping); logger.debug("validateParamaters: " + validateParameters); if (validateParameters != null) @@ -161,6 +162,7 @@ request.getSession().setAttribute(CURRENT_MONITORING_TAB, "summary"); request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(false)); + request.getSession().setAttribute(REQUEST_LEARNING_REPORT, new Boolean(false).toString()); request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString()); /* Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java =================================================================== diff -u -rb31ec6e6d35cd7a66c2560b16a2943c643fb46aa -rb981d563ace42f1c943a2e847aa2f725249b82a8 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java (.../VoteStarterAction.java) (revision b31ec6e6d35cd7a66c2560b16a2943c643fb46aa) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java (.../VoteStarterAction.java) (revision b981d563ace42f1c943a2e847aa2f725249b82a8) @@ -115,8 +115,11 @@ VoteUtils.cleanUpSessionAbsolute(request); logger.debug("init authoring mode. removed attributes..."); + VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; + IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); logger.debug("voteService: " + voteService); + if (voteService == null) { logger.debug("will retrieve voteService"); @@ -132,13 +135,15 @@ { logger.debug("request is for authoring module"); request.getSession().setAttribute(ACTIVE_MODULE, AUTHORING); + voteAuthoringForm.setActiveModule(AUTHORING); request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(true)); request.getSession().setAttribute(SHOW_AUTHORING_TABS,new Boolean(true).toString()); } else { logger.debug("request is for define later module. either direct or by monitoring module"); request.getSession().setAttribute(ACTIVE_MODULE, DEFINE_LATER); + voteAuthoringForm.setActiveModule(DEFINE_LATER); request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(false)); request.getSession().setAttribute(SHOW_AUTHORING_TABS,new Boolean(false).toString()); } @@ -152,7 +157,7 @@ logger.debug("sourceVoteStarter: " + sourceVoteStarter); - VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; + voteAuthoringForm.resetRadioBoxes(); voteAuthoringForm.setExceptionMaxNominationInvalid(new Boolean(false).toString()); @@ -375,6 +380,8 @@ logger.debug("will return to jsp with: " + sourceVoteStarter); String destination=VoteUtils.getDestination(sourceVoteStarter); logger.debug("destination: " + destination); + + logger.debug("active module is: " + voteAuthoringForm.getActiveModule()); return (mapping.findForward(destination)); } Index: lams_tool_vote/web/authoring/AuthoringMaincontent.jsp =================================================================== diff -u -rb31ec6e6d35cd7a66c2560b16a2943c643fb46aa -rb981d563ace42f1c943a2e847aa2f725249b82a8 --- lams_tool_vote/web/authoring/AuthoringMaincontent.jsp (.../AuthoringMaincontent.jsp) (revision b31ec6e6d35cd7a66c2560b16a2943c643fb46aa) +++ lams_tool_vote/web/authoring/AuthoringMaincontent.jsp (.../AuthoringMaincontent.jsp) (revision b981d563ace42f1c943a2e847aa2f725249b82a8) @@ -86,12 +86,6 @@ submitMethod(actionMethod); } - function MM_reloadPage(init) { //reloads the window if Nav4 resized - if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { - document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} - else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); - } - var imgRoot="${lams}images/"; var themeName="aqua"; @@ -105,8 +99,10 @@ else selectTab(1); //select the default tab; + initEditor("richTextOfflineInstructions"); - initEditor("richTextOnlineInstructions"); + initEditor("richTextOnlineInstructions"); + initEditor("title"); initEditor("instructions"); @@ -146,6 +142,7 @@ + Index: lams_tool_vote/web/authoring/BasicContent.jsp =================================================================== diff -u -rb31ec6e6d35cd7a66c2560b16a2943c643fb46aa -rb981d563ace42f1c943a2e847aa2f725249b82a8 --- lams_tool_vote/web/authoring/BasicContent.jsp (.../BasicContent.jsp) (revision b31ec6e6d35cd7a66c2560b16a2943c643fb46aa) +++ lams_tool_vote/web/authoring/BasicContent.jsp (.../BasicContent.jsp) (revision b981d563ace42f1c943a2e847aa2f725249b82a8) @@ -101,6 +101,7 @@ + : - - : - - @@ -52,9 +48,7 @@ : - - @@ -64,7 +58,7 @@ - : + :