Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java =================================================================== diff -u -r14e58bcc3bb8b0639bd32c4e5cf2467bb276c3d5 -r2422ef6cbe87acd7830e1d1da524fe062bc912a6 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java (.../VoteAction.java) (revision 14e58bcc3bb8b0639bd32c4e5cf2467bb276c3d5) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java (.../VoteAction.java) (revision 2422ef6cbe87acd7830e1d1da524fe062bc912a6) @@ -124,28 +124,21 @@ voteAuthoringForm.setExceptionMaxNominationInvalid(new Boolean(false).toString()); request.getSession().setAttribute(VALIDATION_ERROR, new Boolean(false).toString()); - request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); + voteAuthoringForm.setSbmtSuccess(new Boolean(false).toString()); return null; } - public ActionForward addNewOption(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) - throws IOException, ServletException + public boolean isNewOptionAdded(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { - logger.debug("dispathcing addNewOption"); + logger.debug("doing isNewOptionAdded"); VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; logger.debug("voteAuthoringForm :" +voteAuthoringForm); voteAuthoringForm.setExceptionMaxNominationInvalid(new Boolean(false).toString()); voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); request.getSession().setAttribute(VALIDATION_ERROR, new Boolean(false).toString()); + voteAuthoringForm.setSbmtSuccess(new Boolean(false).toString()); - /* determine whether the request is from Monitoring url Edit Activity*/ - String sourceVoteStarter = (String) request.getAttribute(SOURCE_VOTE_STARTER); - logger.debug("sourceVoteStarter: " + sourceVoteStarter); - String destination=VoteUtils.getDestination(sourceVoteStarter); - logger.debug("destination: " + destination); - - request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); AuthoringUtil authoringUtil= new AuthoringUtil(); Map mapOptionsContent=(Map)request.getSession().getAttribute(MAP_OPTIONS_CONTENT); @@ -194,29 +187,37 @@ } } + return true; + + } + + public ActionForward addNewOption(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException + { + logger.debug("dispathcing addNewOption"); + boolean isNewOptionAdded=isNewOptionAdded(mapping, form, request, response); + logger.debug("isNewOptionAdded:" + isNewOptionAdded); + + /* determine whether the request is from Monitoring url Edit Activity*/ + String sourceVoteStarter = (String) request.getAttribute(SOURCE_VOTE_STARTER); + logger.debug("sourceVoteStarter: " + sourceVoteStarter); + String destination=VoteUtils.getDestination(sourceVoteStarter); + logger.debug("destination: " + destination); return (mapping.findForward(destination)); } - public ActionForward removeOption(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) - throws IOException, ServletException + public boolean isOptionRemoved(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { - logger.debug("doing removeOption "); + logger.debug("starting isOptionRemoved "); VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; logger.debug("voteAuthoringForm :" +voteAuthoringForm); voteAuthoringForm.setExceptionMaxNominationInvalid(new Boolean(false).toString()); voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); request.getSession().setAttribute(VALIDATION_ERROR, new Boolean(false).toString()); + voteAuthoringForm.setSbmtSuccess(new Boolean(false).toString()); - request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); - - /* determine whether the request is from Monitoring url Edit Activity*/ - String sourceVoteStarter = (String) request.getAttribute(SOURCE_VOTE_STARTER); - logger.debug("sourceVoteStarter: " + sourceVoteStarter); - String destination=VoteUtils.getDestination(sourceVoteStarter); - logger.debug("destination: " + destination); - VoteUtils.persistRichText(request); AuthoringUtil authoringUtil= new AuthoringUtil(); @@ -260,28 +261,39 @@ } } - return (mapping.findForward(destination)); + return true; } - public ActionForward submitAllContent(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) - throws IOException, ServletException { - - logger.debug("starting submitAllContent :" +form); - request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); + public ActionForward removeOption(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException + { + logger.debug("doing removeOption "); + boolean isOptionRemoved=isOptionRemoved(mapping, form, request, response); + logger.debug("isOptionRemoved:" + isOptionRemoved); + + /* determine whether the request is from Monitoring url Edit Activity*/ + String sourceVoteStarter = (String) request.getAttribute(SOURCE_VOTE_STARTER); + logger.debug("sourceVoteStarter: " + sourceVoteStarter); + String destination=VoteUtils.getDestination(sourceVoteStarter); + logger.debug("destination: " + destination); + + return (mapping.findForward(destination)); + } + + + public boolean submitContent(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) + { + logger.debug("doing submitContent.."); + VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; logger.debug("voteAuthoringForm :" +voteAuthoringForm); voteAuthoringForm.setExceptionMaxNominationInvalid(new Boolean(false).toString()); voteAuthoringForm.setSubmissionAttempt(new Boolean(true).toString()); request.getSession().setAttribute(VALIDATION_ERROR, new Boolean(false).toString()); + voteAuthoringForm.setSbmtSuccess(new Boolean(false).toString()); - /* determine whether the request is from Monitoring url Edit Activity*/ - String sourceVoteStarter = (String) request.getAttribute(SOURCE_VOTE_STARTER); - logger.debug("sourceVoteStarter: " + sourceVoteStarter); - String destination=VoteUtils.getDestination(sourceVoteStarter); - logger.debug("destination: " + destination); - IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); if (voteService == null) voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); @@ -317,7 +329,8 @@ logger.debug("returning back to from to fix errors:"); request.getSession().setAttribute(EDITACTIVITY_EDITMODE, new Boolean(true)); request.getSession().setAttribute(VALIDATION_ERROR, new Boolean(true).toString()); - return mapping.findForward(destination); + //return mapping.findForward(destination); + return false; } List attachmentList = (List) request.getSession().getAttribute(ATTACHMENT_LIST); @@ -346,16 +359,17 @@ boolean verifyDuplicatesOptionsMap=AuthoringUtil.verifyDuplicatesOptionsMap(mapOptionsContent); logger.debug("verifyDuplicatesOptionsMap: " + verifyDuplicatesOptionsMap); request.getSession().removeAttribute(USER_EXCEPTION_OPTIONS_DUPLICATE); + if (verifyDuplicatesOptionsMap == false) { request.getSession().setAttribute(USER_EXCEPTION_OPTIONS_DUPLICATE, new Boolean(true).toString()); logger.debug("add error.options.duplicate to ActionMessages"); persistError(request,"error.options.duplicate"); voteAuthoringForm.resetUserAction(); - return mapping.findForward(destination); + //return mapping.findForward(destination); + return false; } - logger.debug("submitting mapOptionsContent:" + mapOptionsContent); /*to remove deleted entries in the questions table based on mapQuestionContent */ @@ -368,7 +382,6 @@ String maxNomCount=voteAuthoringForm.getMaxNominationCount(); logger.debug("maxNomCount:" + maxNomCount); - String activeModule=voteAuthoringForm.getActiveModule(); logger.debug("activeModule:" + activeModule); @@ -382,7 +395,8 @@ { voteAuthoringForm.setExceptionMaxNominationInvalid(new Boolean(true).toString()); persistError(request,"error.maxNominationCount.invalid"); - return (mapping.findForward(LOAD_QUESTIONS)); + //return (mapping.findForward(LOAD_QUESTIONS)); + return false; } try @@ -394,7 +408,8 @@ { persistError(request,"error.maxNominationCount.invalid"); voteAuthoringForm.setExceptionMaxNominationInvalid(new Boolean(true).toString()); - return (mapping.findForward(LOAD_QUESTIONS)); + //return (mapping.findForward(LOAD_QUESTIONS)); + return false; } } @@ -418,7 +433,8 @@ errors.clear(); errors.add(Globals.ERROR_KEY, new ActionMessage("sbmt.successful")); - request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(1)); + //request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(1)); + voteAuthoringForm.setSbmtSuccess(new Boolean(true).toString()); logger.debug("setting SUBMIT_SUCCESS to 1."); Long strToolContentId=(Long)request.getSession().getAttribute(AttributeNames.PARAM_TOOL_CONTENT_ID); @@ -431,33 +447,56 @@ logger.debug("define later set to false"); voteAuthoringForm.resetUserAction(); - return mapping.findForward(destination); + return true; } - - public ActionForward moveOptionDown(ActionMapping mapping, + + public ActionForward submitAllContent(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException { + + logger.debug("starting submitAllContent :" +form); + + VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; + logger.debug("voteAuthoringForm :" +voteAuthoringForm); + voteAuthoringForm.setSbmtSuccess(new Boolean(false).toString()); + + + /* determine whether the request is from Monitoring url Edit Activity*/ + String sourceVoteStarter = (String) request.getAttribute(SOURCE_VOTE_STARTER); + logger.debug("sourceVoteStarter: " + sourceVoteStarter); + String destination=VoteUtils.getDestination(sourceVoteStarter); + logger.debug("destination: " + destination); + + + boolean isContentSubmitted=submitContent(mapping, form, request, response); + logger.debug("isContentSubmitted :" +isContentSubmitted); + + if (isContentSubmitted == true) + voteAuthoringForm.setSbmtSuccess(new Boolean(true).toString()); + + logger.debug("final submit status :" +voteAuthoringForm.getSbmtSuccess()); + return (mapping.findForward(destination)); + } + + + public boolean isMoveOptionDown(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, - ServletException + HttpServletResponse response) { + logger.debug("starting isMoveOptionDown..."); VoteUtils.cleanUpUserExceptions(request); logger.debug("dispatching moveOptionDown..."); VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; logger.debug("voteAuthoringForm :" +voteAuthoringForm); voteAuthoringForm.setExceptionMaxNominationInvalid(new Boolean(false).toString()); voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); request.getSession().setAttribute(VALIDATION_ERROR, new Boolean(false).toString()); - - request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); + voteAuthoringForm.setSbmtSuccess(new Boolean(false).toString()); + + //request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); IVoteService voteService =VoteUtils.getToolService(request); - /* determine whether the request is from Monitoring url Edit Activity*/ - String sourceVoteStarter = (String) request.getAttribute(SOURCE_VOTE_STARTER); - logger.debug("sourceVoteStarter: " + sourceVoteStarter); - String destination=VoteUtils.getDestination(sourceVoteStarter); - logger.debug("destination: " + destination); - VoteUtils.persistRichText(request); Map mapOptionsContent=AuthoringUtil.repopulateMap(request, "optionContent"); @@ -512,28 +551,45 @@ } } + return true; + } + + + public ActionForward moveOptionDown(ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws IOException, + ServletException + { + /* determine whether the request is from Monitoring url Edit Activity*/ + String sourceVoteStarter = (String) request.getAttribute(SOURCE_VOTE_STARTER); + logger.debug("sourceVoteStarter: " + sourceVoteStarter); + String destination=VoteUtils.getDestination(sourceVoteStarter); + logger.debug("destination: " + destination); + boolean isMoveOptionDown=isMoveOptionDown(mapping, form, request, response); + logger.debug("isMoveOptionDown:" + isMoveOptionDown); + return (mapping.findForward(destination)); } - - public ActionForward moveOptionUp(ActionMapping mapping, + public boolean isMoveOptionUp(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, - ServletException + HttpServletResponse response) { + logger.debug("starting isMoveOptionUp..."); VoteUtils.cleanUpUserExceptions(request); - logger.debug("dispatching moveOptionUp..."); + VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; - request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); + voteAuthoringForm.setSbmtSuccess(new Boolean(false).toString()); logger.debug("voteAuthoringForm :" +voteAuthoringForm); voteAuthoringForm.setExceptionMaxNominationInvalid(new Boolean(false).toString()); voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); request.getSession().setAttribute(VALIDATION_ERROR, new Boolean(false).toString()); - IVoteService voteService =VoteUtils.getToolService(request); + IVoteService voteService =VoteUtils.getToolService(request); /* determine whether the request is from Monitoring url Edit Activity*/ String sourceVoteStarter = (String) request.getAttribute(SOURCE_VOTE_STARTER); @@ -595,15 +651,33 @@ } } - - return (mapping.findForward(destination)); + return true; } + public ActionForward moveOptionUp(ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws IOException, + ServletException + { + /* determine whether the request is from Monitoring url Edit Activity*/ + String sourceVoteStarter = (String) request.getAttribute(SOURCE_VOTE_STARTER); + logger.debug("sourceVoteStarter: " + sourceVoteStarter); + String destination=VoteUtils.getDestination(sourceVoteStarter); + logger.debug("destination: " + destination); + + boolean isMoveOptionUp=isMoveOptionUp(mapping, form, request, response); + logger.debug("isMoveOptionUp:" + isMoveOptionUp); + + return (mapping.findForward(destination)); + } + protected ActionMessages validateSubmit(HttpServletRequest request, ActionMessages errors, VoteAuthoringForm voteAuthoringForm) { - request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); + //request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); + voteAuthoringForm.setSbmtSuccess(new Boolean(false).toString()); String title = voteAuthoringForm.getTitle(); logger.debug("title: " + title); @@ -655,7 +729,8 @@ voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); request.getSession().setAttribute(VALIDATION_ERROR, new Boolean(false).toString()); - request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); + //request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); + voteAuthoringForm.setSbmtSuccess(new Boolean(false).toString()); IVoteService voteService =VoteUtils.getToolService(request); /* determine whether the request is from Monitoring url Edit Activity*/ @@ -709,7 +784,8 @@ voteAuthoringForm.setExceptionMaxNominationInvalid(new Boolean(false).toString()); voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); request.getSession().setAttribute(VALIDATION_ERROR, new Boolean(false).toString()); - request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); + //request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); + voteAuthoringForm.setSbmtSuccess(new Boolean(false).toString()); IVoteService voteService =VoteUtils.getToolService(request); @@ -763,7 +839,8 @@ voteAuthoringForm.setExceptionMaxNominationInvalid(new Boolean(false).toString()); voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); request.getSession().setAttribute(VALIDATION_ERROR, new Boolean(false).toString()); - request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); + //request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); + voteAuthoringForm.setSbmtSuccess(new Boolean(false).toString()); IVoteService voteService =VoteUtils.getToolService(request); @@ -804,7 +881,8 @@ voteAuthoringForm.setExceptionMaxNominationInvalid(new Boolean(false).toString()); voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); request.getSession().setAttribute(VALIDATION_ERROR, new Boolean(false).toString()); - request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); + //request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); + voteAuthoringForm.setSbmtSuccess(new Boolean(false).toString()); IVoteService voteService =VoteUtils.getToolService(request); @@ -844,6 +922,7 @@ voteAuthoringForm.setExceptionMaxNominationInvalid(new Boolean(false).toString()); voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); request.getSession().setAttribute(VALIDATION_ERROR, new Boolean(false).toString()); + voteAuthoringForm.setSbmtSuccess(new Boolean(false).toString()); IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); logger.debug("voteService: " + voteService); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAuthoringForm.java =================================================================== diff -u -r14e58bcc3bb8b0639bd32c4e5cf2467bb276c3d5 -r2422ef6cbe87acd7830e1d1da524fe062bc912a6 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAuthoringForm.java (.../VoteAuthoringForm.java) (revision 14e58bcc3bb8b0639bd32c4e5cf2467bb276c3d5) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAuthoringForm.java (.../VoteAuthoringForm.java) (revision 2422ef6cbe87acd7830e1d1da524fe062bc912a6) @@ -181,6 +181,7 @@ this.edit=null; this.submit=null; this.submissionAttempt=null; + this.sbmtSuccess=null; } public void resetRadioBoxes() @@ -771,4 +772,5 @@ public void setSubmissionAttempt(String submissionAttempt) { this.submissionAttempt = submissionAttempt; } + } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningForm.java =================================================================== diff -u -r2be43d0e5d701ff9c00b32c85e0d35f3367d52cb -r2422ef6cbe87acd7830e1d1da524fe062bc912a6 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningForm.java (.../VoteLearningForm.java) (revision 2be43d0e5d701ff9c00b32c85e0d35f3367d52cb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningForm.java (.../VoteLearningForm.java) (revision 2422ef6cbe87acd7830e1d1da524fe062bc912a6) @@ -37,6 +37,8 @@ protected String optionValue; protected String checked; + protected String sbmtSuccess; + protected String userEntry; protected String dispatch; protected String toolContentID; @@ -605,4 +607,18 @@ public void setMaxNominationCountReached(String maxNominationCountReached) { this.maxNominationCountReached = maxNominationCountReached; } + + /** + * @return Returns the sbmtSuccess. + */ + public String getSbmtSuccess() { + return sbmtSuccess; + } + /** + * @param sbmtSuccess The sbmtSuccess to set. + */ + public void setSbmtSuccess(String sbmtSuccess) { + this.sbmtSuccess = sbmtSuccess; + } + } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java =================================================================== diff -u -r14e58bcc3bb8b0639bd32c4e5cf2467bb276c3d5 -r2422ef6cbe87acd7830e1d1da524fe062bc912a6 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java (.../VoteMonitoringAction.java) (revision 14e58bcc3bb8b0639bd32c4e5cf2467bb276c3d5) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java (.../VoteMonitoringAction.java) (revision 2422ef6cbe87acd7830e1d1da524fe062bc912a6) @@ -586,15 +586,36 @@ throws IOException, ServletException { logger.debug("dispatching proxy submitAllContent..."); request.getSession().setAttribute(ACTIVE_MODULE, DEFINE_LATER); - + request.setAttribute(SOURCE_VOTE_STARTER, "monitoring"); logger.debug("SOURCE_VOTE_STARTER: monitoring"); VoteAction voteAction= new VoteAction(); - return voteAction.submitAllContent(mapping, form, request, response); + VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; + logger.debug("voteMonitoringForm :" +voteMonitoringForm); + voteMonitoringForm.setSbmtSuccess(new Boolean(false).toString()); + voteMonitoringForm.setActiveModule(DEFINE_LATER); + + + /* determine whether the request is from Monitoring url Edit Activity*/ + String sourceVoteStarter = (String) request.getAttribute(SOURCE_VOTE_STARTER); + logger.debug("sourceVoteStarter: " + sourceVoteStarter); + String destination=VoteUtils.getDestination(sourceVoteStarter); + logger.debug("destination: " + destination); + + + boolean isContentSubmitted=voteAction.submitContent(mapping, form, request, response); + logger.debug("isContentSubmitted :" +isContentSubmitted); + + if (isContentSubmitted == true) + voteMonitoringForm.setSbmtSuccess(new Boolean(true).toString()); + + logger.debug("final submit status :" +voteMonitoringForm.getSbmtSuccess()); + return (mapping.findForward(destination)); } + public ActionForward addNewOption(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { @@ -603,8 +624,20 @@ request.setAttribute(SOURCE_VOTE_STARTER, "monitoring"); logger.debug("SOURCE_VOTE_STARTER: monitoring"); + VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; + voteMonitoringForm.setSbmtSuccess(new Boolean(false).toString()); + + /* determine whether the request is from Monitoring url Edit Activity*/ + String sourceVoteStarter = (String) request.getAttribute(SOURCE_VOTE_STARTER); + logger.debug("sourceVoteStarter: " + sourceVoteStarter); + String destination=VoteUtils.getDestination(sourceVoteStarter); + logger.debug("destination: " + destination); + VoteAction voteAction= new VoteAction(); - return voteAction.addNewOption(mapping, form, request, response); + + boolean isNewOptionAdded=voteAction.isNewOptionAdded(mapping, form, request, response); + logger.debug("isNewOptionAdded:" + isNewOptionAdded); + return (mapping.findForward(destination)); } @@ -622,7 +655,17 @@ logger.debug("SOURCE_VOTE_STARTER: monitoring"); VoteAction voteAction= new VoteAction(); - return voteAction.removeOption(mapping, form, request, response); + + /* determine whether the request is from Monitoring url Edit Activity*/ + String sourceVoteStarter = (String) request.getAttribute(SOURCE_VOTE_STARTER); + logger.debug("sourceVoteStarter: " + sourceVoteStarter); + String destination=VoteUtils.getDestination(sourceVoteStarter); + logger.debug("destination: " + destination); + + boolean isOptionRemoved=voteAction.isOptionRemoved(mapping, form, request, response); + logger.debug("isOptionRemoved :" +isOptionRemoved); + + return (mapping.findForward(destination)); } @@ -638,9 +681,20 @@ logger.debug("SOURCE_VOTE_STARTER: monitoring"); VoteAction voteAction= new VoteAction(); - return voteAction.moveOptionDown(mapping, form, request, response); + + /* determine whether the request is from Monitoring url Edit Activity*/ + String sourceVoteStarter = (String) request.getAttribute(SOURCE_VOTE_STARTER); + logger.debug("sourceVoteStarter: " + sourceVoteStarter); + String destination=VoteUtils.getDestination(sourceVoteStarter); + logger.debug("destination: " + destination); + + boolean isMoveOptionDown=voteAction.isMoveOptionDown(mapping, form, request, response); + logger.debug("isMoveOptionDown :" +isMoveOptionDown); + + return (mapping.findForward(destination)); } + public ActionForward moveOptionUp(ActionMapping mapping, ActionForm form, HttpServletRequest request, @@ -651,9 +705,19 @@ request.setAttribute(SOURCE_VOTE_STARTER, "monitoring"); logger.debug("SOURCE_VOTE_STARTER: monitoring"); - + + /* determine whether the request is from Monitoring url Edit Activity*/ + String sourceVoteStarter = (String) request.getAttribute(SOURCE_VOTE_STARTER); + logger.debug("sourceVoteStarter: " + sourceVoteStarter); + String destination=VoteUtils.getDestination(sourceVoteStarter); + logger.debug("destination: " + destination); + VoteAction voteAction= new VoteAction(); - return voteAction.moveOptionUp(mapping, form, request, response); + boolean isMoveOptionUp=voteAction.isMoveOptionUp(mapping, form, request, response); + logger.debug("isMoveOptionUp:" + isMoveOptionUp); + + return (mapping.findForward(destination)); + } /** Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringForm.java =================================================================== diff -u -rafd9f8463f033997ae0deaa55116a875d9da776f -r2422ef6cbe87acd7830e1d1da524fe062bc912a6 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringForm.java (.../VoteMonitoringForm.java) (revision afd9f8463f033997ae0deaa55116a875d9da776f) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringForm.java (.../VoteMonitoringForm.java) (revision 2422ef6cbe87acd7830e1d1da524fe062bc912a6) @@ -31,6 +31,7 @@ */ public class VoteMonitoringForm extends VoteAuthoringForm implements VoteAppConstants { // controls which method is called by the Lookup map */ + protected String method; protected String selectedToolSessionId; @@ -75,4 +76,5 @@ public void setMethod(String method) { this.method = method; } + } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java =================================================================== diff -u -r14e58bcc3bb8b0639bd32c4e5cf2467bb276c3d5 -r2422ef6cbe87acd7830e1d1da524fe062bc912a6 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java (.../VoteMonitoringStarterAction.java) (revision 14e58bcc3bb8b0639bd32c4e5cf2467bb276c3d5) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java (.../VoteMonitoringStarterAction.java) (revision 2422ef6cbe87acd7830e1d1da524fe062bc912a6) @@ -118,19 +118,25 @@ request.getSession().setAttribute(ACTIVE_MODULE, MONITORING); + voteMonitoringForm.setActiveModule(MONITORING); voteMonitoringForm.setSelectedToolSessionId("All"); + voteMonitoringForm.setSbmtSuccess(new Boolean(false).toString()); return voteMonitoringAction.submitSession(mapping, form, request, response); } public boolean initialiseMonitoringData(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { logger.debug("start initializing monitoring data..."); + + VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); request.getSession().setAttribute(TOOL_SERVICE, voteService); request.getSession().setAttribute(CURRENT_MONITORING_TAB, "summary"); - request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); + //request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); + voteMonitoringForm.setSbmtSuccess(new Boolean(false).toString()); request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(false)); request.getSession().setAttribute(REQUEST_LEARNING_REPORT, new Boolean(false).toString()); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java =================================================================== diff -u -r14e58bcc3bb8b0639bd32c4e5cf2467bb276c3d5 -r2422ef6cbe87acd7830e1d1da524fe062bc912a6 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java (.../VoteStarterAction.java) (revision 14e58bcc3bb8b0639bd32c4e5cf2467bb276c3d5) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java (.../VoteStarterAction.java) (revision 2422ef6cbe87acd7830e1d1da524fe062bc912a6) @@ -127,9 +127,9 @@ logger.debug("retrieving voteService from cache: " + voteService); } request.getSession().setAttribute(TOOL_SERVICE, voteService); - request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); - + voteAuthoringForm.setSbmtSuccess(new Boolean(false).toString()); + String servletPath=request.getServletPath(); logger.debug("getServletPath: "+ servletPath); if (servletPath.indexOf("authoringStarter") > 0) @@ -138,15 +138,13 @@ 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()); } initialiseAttributes(request); Index: lams_tool_vote/web/authoring/BasicContent.jsp =================================================================== diff -u -r14e58bcc3bb8b0639bd32c4e5cf2467bb276c3d5 -r2422ef6cbe87acd7830e1d1da524fe062bc912a6 --- lams_tool_vote/web/authoring/BasicContent.jsp (.../BasicContent.jsp) (revision 14e58bcc3bb8b0639bd32c4e5cf2467bb276c3d5) +++ lams_tool_vote/web/authoring/BasicContent.jsp (.../BasicContent.jsp) (revision 2422ef6cbe87acd7830e1d1da524fe062bc912a6) @@ -37,7 +37,7 @@
- + images/success.gif" align="left" width=20 height=20> Index: lams_tool_vote/web/authoring/InstructionsContent.jsp =================================================================== diff -u -rc5172424555b18ee103dd5609fd36e2d886d035a -r2422ef6cbe87acd7830e1d1da524fe062bc912a6 --- lams_tool_vote/web/authoring/InstructionsContent.jsp (.../InstructionsContent.jsp) (revision c5172424555b18ee103dd5609fd36e2d886d035a) +++ lams_tool_vote/web/authoring/InstructionsContent.jsp (.../InstructionsContent.jsp) (revision 2422ef6cbe87acd7830e1d1da524fe062bc912a6) @@ -32,12 +32,6 @@ - - -
- -
-