Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningAction.java,v diff -u -r1.8 -r1.9 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningAction.java 29 Jan 2006 13:45:27 -0000 1.8 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningAction.java 31 Jan 2006 16:27:04 -0000 1.9 @@ -238,7 +238,6 @@ else if (mcLearningForm.getOptionCheckBoxSelected() != null) { setContentInUse(request); - logger.debug("requested selectOptionsCheckBox..."); mcLearningForm.resetCommands(); LearningUtil.selectOptionsCheckBox(request,mcLearningForm, mcLearningForm.getQuestionIndex()); } @@ -272,6 +271,8 @@ String userID=(String) request.getSession().getAttribute(USER_ID); logger.debug("attempting to leave/complete session with toolSessionId:" + toolSessionId + " and userID:"+userID); + McUtils.cleanUpSessionAbsolute(request); + String nextUrl=null; try { @@ -280,32 +281,50 @@ } catch (DataMissingException e) { - throw new ServletException(e); + logger.debug("failure getting nextUrl: "+ e); + mcLearningForm.resetCommands(); + //throw new ServletException(e); + return (mapping.findForward(LEARNING_STARTER)); } catch (ToolException e) { - throw new ServletException(e); + logger.debug("failure getting nextUrl: "+ e); + mcLearningForm.resetCommands(); + //throw new ServletException(e); + return (mapping.findForward(LEARNING_STARTER)); } - + catch (Exception e) + { + logger.debug("unknown exception getting nextUrl: "+ e); + mcLearningForm.resetCommands(); + //throw new ServletException(e); + return (mapping.findForward(LEARNING_STARTER)); + } + logger.debug("success getting nextUrl: "+ nextUrl); mcLearningForm.resetCommands(); - LearningUtil.cleanUpLearningSession(request); /* pay attention here*/ logger.debug("redirecting to the nextUrl: "+ nextUrl); response.sendRedirect(nextUrl); - //pay attention here as well: whete to go. return null; } else if (mcLearningForm.getDonePreview() != null) { - logger.debug("request is from authoring environment. requested donePreview."); + logger.debug("requested donePreview."); mcLearningForm.resetCommands(); - LearningUtil.cleanUpLearningSession(request); - AuthoringUtil.cleanupAuthoringSession(request); + McUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(LEARNING_STARTER)); } + else if (mcLearningForm.getDoneLearnerProgress() != null) + { + logger.debug("requested doneLearnerProgress."); + mcLearningForm.resetCommands(); + McUtils.cleanUpSessionAbsolute(request); + return (mapping.findForward(LEARNING_STARTER)); + } + mcLearningForm.resetCommands(); return (mapping.findForward(LOAD_LEARNER)); } @@ -511,10 +530,33 @@ String totalQuestionCount= (String) request.getSession().getAttribute(TOTAL_QUESTION_COUNT); logger.debug("totalQuestionCount: " + totalQuestionCount); + /* this section is needed to separate learner progress view from standard attempts list. Goes from here.. */ + String learnerProgress=(String)request.getSession().getAttribute(LEARNER_PROGRESS); + logger.debug("learnerProgress: " + learnerProgress); + + String learnerProgressUserId=(String)request.getSession().getAttribute(LEARNER_PROGRESS_USERID); + logger.debug("learnerProgressUserId: " + learnerProgressUserId); + + boolean learnerProgressOn=false; + if (learnerProgressUserId != null) + { + if ((learnerProgress.equalsIgnoreCase("true")) && + (learnerProgressUserId.length() > 0)) + { + logger.debug("request is for learner progress: learnerProgress: " + learnerProgress); + logger.debug("request is for learner progress: learnerProgressUserId: " + learnerProgressUserId); + learnerProgressOn=true;; + } + } + logger.debug("final learnerProgressOn:" + learnerProgressOn); + /*..till here*/ + Long toolContentUID= (Long) request.getSession().getAttribute(TOOL_CONTENT_UID); logger.debug("toolContentUID: " + toolContentUID); McQueUsr mcQueUsr=LearningUtil.getUser(request); + logger.debug("mcQueUsr: " + mcQueUsr); + Long queUsrId=mcQueUsr.getUid(); logger.debug("queUsrId: " + queUsrId); @@ -543,15 +585,36 @@ while (attemptIterator.hasNext()) { McUsrAttempt mcUsrAttempt=(McUsrAttempt)attemptIterator.next(); - - if (mcUsrAttempt.isAttemptCorrect()) + if (learnerProgressOn == false) { - mapAttemptsCorrect.put(mapIndex.toString(), mcUsrAttempt.getMcOptionsContent().getMcQueOptionText()); + logger.debug("learnerProgressOn is false, populating map based on all the learners"); + if (mcUsrAttempt.isAttemptCorrect()) + { + mapAttemptsCorrect.put(mapIndex.toString(), mcUsrAttempt.getMcOptionsContent().getMcQueOptionText()); + } + else + { + mapAttemptsIncorrect.put(mapIndex.toString(), mcUsrAttempt.getMcOptionsContent().getMcQueOptionText()); + } } else { - mapAttemptsIncorrect.put(mapIndex.toString(), mcUsrAttempt.getMcOptionsContent().getMcQueOptionText()); + /* this section is needed to separate learner progress view from standard attempts list. */ + logger.debug("learnerProgressOn is true, populating map based on the learner id: " + learnerProgressUserId); + if (mcUsrAttempt.getQueUsrId().toString().equals(learnerProgressUserId)) + { + logger.debug("found learner progress user: " + learnerProgressUserId); + if (mcUsrAttempt.isAttemptCorrect()) + { + mapAttemptsCorrect.put(mapIndex.toString(), mcUsrAttempt.getMcOptionsContent().getMcQueOptionText()); + } + else + { + mapAttemptsIncorrect.put(mapIndex.toString(), mcUsrAttempt.getMcOptionsContent().getMcQueOptionText()); + } + } } + mapAttempts.put(mapIndex.toString(), mcUsrAttempt.getMcOptionsContent().getMcQueOptionText()); logger.debug("added attempt with order: " + mcUsrAttempt.getAttemptOrder() + " , option text is: " + mcUsrAttempt.getMcOptionsContent().getMcQueOptionText()); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningForm.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningForm.java,v diff -u -r1.10 -r1.11 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningForm.java 29 Jan 2006 11:05:53 -0000 1.10 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningForm.java 31 Jan 2006 16:27:04 -0000 1.11 @@ -24,6 +24,7 @@ protected String learnerFinished; protected String redoQuestionsOk; protected String donePreview; + protected String doneLearnerProgress; public void resetCommands() { @@ -36,6 +37,7 @@ this.setRedoQuestionsOk(null); this.setLearnerFinished(null); this.setDonePreview(null); + this.setDoneLearnerProgress(null); } public void resetParameters() @@ -217,4 +219,16 @@ public void setDonePreview(String donePreview) { this.donePreview = donePreview; } + /** + * @return Returns the doneLearnerProgress. + */ + public String getDoneLearnerProgress() { + return doneLearnerProgress; + } + /** + * @param doneLearnerProgress The doneLearnerProgress to set. + */ + public void setDoneLearnerProgress(String doneLearnerProgress) { + this.doneLearnerProgress = doneLearnerProgress; + } } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java,v diff -u -r1.28 -r1.29 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java 29 Jan 2006 13:46:03 -0000 1.28 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java 31 Jan 2006 16:27:04 -0000 1.29 @@ -24,7 +24,6 @@ import org.lamsfoundation.lams.tool.mc.McComparator; import org.lamsfoundation.lams.tool.mc.McUtils; import org.lamsfoundation.lams.tool.mc.pojos.McContent; -import org.lamsfoundation.lams.tool.mc.pojos.McQueContent; import org.lamsfoundation.lams.tool.mc.pojos.McQueUsr; import org.lamsfoundation.lams.tool.mc.pojos.McSession; import org.lamsfoundation.lams.tool.mc.service.IMcService; @@ -118,12 +117,7 @@ public class McLearningStarterAction extends Action implements McAppConstants { static Logger logger = Logger.getLogger(McLearningStarterAction.class.getName()); /* Since the toolSessionId is passed, we will derive toolContentId from the toolSessionId - * * This class is used to load the default content and initialize the presentation Map for Learner mode - * - * createToolSession will not be called once the tool is deployed. - * - * It is important that ALL the session attributes created in this action gets removed by: QaUtils.cleanupSession(request) */ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) @@ -171,9 +165,11 @@ { try { mcService.createToolSession(toolSessionID, new Long(9876)); + return (mapping.findForward(LEARNING_STARTER)); } catch(ToolException e) { + McUtils.cleanUpSessionAbsolute(request); logger.debug("tool exception" + e); } } @@ -184,9 +180,11 @@ { try { mcService.removeToolSession(toolSessionID); + return (mapping.findForward(LEARNING_STARTER)); } catch(ToolException e) { + McUtils.cleanUpSessionAbsolute(request); logger.debug("tool exception" + e); } } @@ -198,9 +196,11 @@ { String nextUrl=mcService.leaveToolSession(toolSessionID, new Long(learnerId)); logger.debug("nextUrl: "+ nextUrl); + return (mapping.findForward(LEARNING_STARTER)); } catch(ToolException e) { + McUtils.cleanUpSessionAbsolute(request); logger.debug("tool exception" + e); } } @@ -241,17 +241,31 @@ McSession mcSession=mcService.retrieveMcSession(toolSessionID); logger.debug("retrieving mcSession: " + mcSession); + if (mcSession == null) + { + logger.debug("error: The tool expects mcSession."); + persistError(request,"error.toolSession.notAvailable"); + McUtils.cleanUpSessionAbsolute(request); + return (mapping.findForward(ERROR_LIST)); + } + /* * find out what content this tool session is referring to - * get the content for this tool session (many to one mapping) - */ - - /* + * get the content for this tool session * Each passed tool session id points to a particular content. Many to one mapping. */ McContent mcContent=mcSession.getMcContent(); logger.debug("using mcContent: " + mcContent); + if (mcContent == null) + { + logger.debug("error: The tool expects mcContent."); + persistError(request,"error.toolContent.notAvailable"); + McUtils.cleanUpSessionAbsolute(request); + return (mapping.findForward(ERROR_LIST)); + } + + /* * The content we retrieved above must have been created before in Authoring time. * And the passed tool session id already refers to it. @@ -273,42 +287,56 @@ learner */ /* ? CHECK THIS: how do we determine whether preview is requested? Mode is not enough on its own.*/ - String mode= (String) request.getParameter("mode"); - logger.debug("mode: " + mode); + + /*handle PREVIEW mode*/ + String mode=(String) request.getSession().getAttribute(LEARNING_MODE); + logger.debug("mode: " + mode); if ((mode != null) && (mode.equals("author"))) { logger.debug("Author requests for a preview of the content."); logger.debug("existing mcContent:" + mcContent); - mapQuestionsContent= new TreeMap(new McComparator()); - mapQuestionsContent=LearningUtil.buildQuestionContentMap(request,mcContent); - logger.debug("mapQuestionsContent: " + mapQuestionsContent); - - request.getSession().setAttribute(MAP_QUESTION_CONTENT_LEARNER, mapQuestionsContent); - logger.debug("MAP_QUESTION_CONTENT_LEARNER: " + request.getSession().getAttribute(MAP_QUESTION_CONTENT_LEARNER)); - logger.debug("mcContent has : " + mapQuestionsContent.size() + " entries."); - request.getSession().setAttribute(TOTAL_QUESTION_COUNT, new Long(mapQuestionsContent.size()).toString()); - - request.getSession().setAttribute(CURRENT_QUESTION_INDEX, "1"); - logger.debug("CURRENT_QUESTION_INDEX: " + request.getSession().getAttribute(CURRENT_QUESTION_INDEX)); - logger.debug("final Options Map for the first question: " + request.getSession().getAttribute(MAP_OPTIONS_CONTENT)); + commonContentSetup(request, mcContent); - /*also prepare data into mapGeneralOptionsContent for combined answers view */ - Map mapGeneralOptionsContent=AuthoringUtil.generateGeneralOptionsContentMap(request, mcContent); - logger.debug("returned mapGeneralOptionsContent: " + mapGeneralOptionsContent); - request.getSession().setAttribute(MAP_GENERAL_OPTIONS_CONTENT, mapGeneralOptionsContent); - /*only allowing combined view in the preview mode. Might be improved to support sequential view as well. */ request.getSession().setAttribute(QUESTION_LISTING_MODE, QUESTION_LISTING_MODE_COMBINED); - /* to disable the buttons on the screen*/ + /* PREVIEW_ONLY for jsp*/ request.getSession().setAttribute(PREVIEW_ONLY, new Boolean(true).toString()); request.getSession().setAttribute(CURRENT_QUESTION_INDEX, "1"); McLearningAction mcLearningAction= new McLearningAction(); return mcLearningAction.redoQuestions(request, mcLearningForm, mapping); } - /* by now, we know that the mode is either teacher or learner. */ + /* by now, we know that the mode is either teacher or learner + * check if the mode is teacher and request is for Learner Progress + */ + String userId=request.getParameter(USER_ID); + logger.debug("userId: " + userId); + if ((userId != null) && (mode.equals("teacher"))) + { + logger.debug("request is for learner progress"); + commonContentSetup(request, mcContent); + + /* LEARNER_PROGRESS for jsp*/ + request.getSession().setAttribute(LEARNER_PROGRESS_USERID, userId); + request.getSession().setAttribute(LEARNER_PROGRESS, new Boolean(true).toString()); + McLearningAction mcLearningAction= new McLearningAction(); + /* pay attention that this userId is the learner's userId passed by the request parameter. + * It is differerent than USER_ID kept in the session of the current system user*/ + McQueUsr mcQueUsr=mcService.retrieveMcQueUsr(new Long(userId)); + logger.debug("mcQueUsr:" + mcQueUsr); + if (mcQueUsr == null) + { + persistError(request, "error.learner.required"); + request.setAttribute(USER_EXCEPTION_LEARNER_REQUIRED, new Boolean(true)); + McUtils.cleanUpSessionAbsolute(request); + return (mapping.findForward(ERROR_LIST)); + } + return mcLearningAction.viewAnswers(mapping, form, request, response); + } + + /* by now, we know that the mode is learner*/ /* find out if the content is set to run offline or online. If it is set to run offline , the learners are informed about that. */ boolean isRunOffline=McUtils.isRunOffline(mcContent); @@ -317,6 +345,7 @@ { logger.debug("warning to learner: the activity is offline."); persistError(request,"label.learning.runOffline"); + McUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST)); } @@ -325,8 +354,9 @@ logger.debug("isDefineLater: " + isDefineLater); if (isDefineLater == true) { - logger.debug("warning to learner: the activity is defineLater, we interpret that as content being modified."); + logger.debug("warning to learner: the activity is defineLater, we interpret that the content is being modified."); persistError(request,"error.defineLater"); + McUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST)); } @@ -406,6 +436,35 @@ /** + * sets up question and candidate answers maps + * commonContentSetup(HttpServletRequest request, McContent mcContent) + * + * @param request + * @param mcContent + */ + protected void commonContentSetup(HttpServletRequest request, McContent mcContent) + { + Map mapQuestionsContent= new TreeMap(new McComparator()); + mapQuestionsContent=LearningUtil.buildQuestionContentMap(request,mcContent); + logger.debug("mapQuestionsContent: " + mapQuestionsContent); + + request.getSession().setAttribute(MAP_QUESTION_CONTENT_LEARNER, mapQuestionsContent); + logger.debug("MAP_QUESTION_CONTENT_LEARNER: " + request.getSession().getAttribute(MAP_QUESTION_CONTENT_LEARNER)); + logger.debug("mcContent has : " + mapQuestionsContent.size() + " entries."); + request.getSession().setAttribute(TOTAL_QUESTION_COUNT, new Long(mapQuestionsContent.size()).toString()); + + request.getSession().setAttribute(CURRENT_QUESTION_INDEX, "1"); + logger.debug("CURRENT_QUESTION_INDEX: " + request.getSession().getAttribute(CURRENT_QUESTION_INDEX)); + logger.debug("final Options Map for the first question: " + request.getSession().getAttribute(MAP_OPTIONS_CONTENT)); + + /*also prepare data into mapGeneralOptionsContent for combined answers view */ + Map mapGeneralOptionsContent=AuthoringUtil.generateGeneralOptionsContentMap(request, mcContent); + logger.debug("returned mapGeneralOptionsContent: " + mapGeneralOptionsContent); + request.getSession().setAttribute(MAP_GENERAL_OPTIONS_CONTENT, mapGeneralOptionsContent); + } + + + /** * sets up session scope attributes based on content linked to the passed tool session id * setupAttributes(HttpServletRequest request, McContent mcContent) * @@ -507,7 +566,7 @@ { logger.debug("error: The tool expects userId"); persistError(request,"error.learningUser.notAvailable"); - request.setAttribute(USER_EXCEPTION_USERID_NOTAVAILABLE, new Boolean(true)); + McUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST)); }else userID = user.getUserID().toString(); @@ -524,7 +583,7 @@ if ((strToolSessionId == null) || (strToolSessionId.length() == 0)) { persistError(request, "error.toolSessionId.required"); - request.setAttribute(USER_EXCEPTION_TOOLSESSIONID_REQUIRED, new Boolean(true)); + McUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST)); } else @@ -539,7 +598,7 @@ { persistError(request, "error.sessionId.numberFormatException"); logger.debug("add error.sessionId.numberFormatException to ActionMessages."); - request.setAttribute(USER_EXCEPTION_NUMBERFORMAT, new Boolean(true)); + McUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST)); } } @@ -551,14 +610,14 @@ if ((mode == null) || (mode.length() == 0)) { persistError(request, "error.mode.required"); - request.setAttribute(USER_EXCEPTION_MODE_REQUIRED, new Boolean(true)); + McUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST)); } if ((!mode.equals("learner")) && (!mode.equals("teacher")) && (!mode.equals("author"))) { persistError(request, "error.mode.invalid"); - request.setAttribute(USER_EXCEPTION_MODE_REQUIRED, new Boolean(true)); + McUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST)); } logger.debug("session LEARNING_MODE set to:" + mode); 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.11 -r1.12 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java 24 Jan 2006 21:39:07 -0000 1.11 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java 31 Jan 2006 16:27:04 -0000 1.12 @@ -295,6 +295,7 @@ return (mapping.findForward(LOAD_MONITORING)); } + /** * switches to instructions tab of the monitoring url. * getInstructions(ActionMapping mapping, @@ -321,8 +322,7 @@ McMonitoringForm mcMonitoringForm = (McMonitoringForm) form; IMcService mcService =McUtils.getToolService(request); - request.setAttribute(CURRENT_MONITORING_TAB, "instructions"); - + request.setAttribute(CURRENT_MONITORING_TAB, "instructions"); return (mapping.findForward(LOAD_MONITORING)); } @@ -883,7 +883,7 @@ HttpServletResponse response) throws IOException, ServletException { - MonitoringUtil.cleanupMonitoringSession(request); + McUtils.cleanUpSessionAbsolute(request); /*forward outside of the app. Currently it is index.jsp */ return (mapping.findForward(LOAD_STARTER)); } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java,v diff -u -r1.10 -r1.11 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java 24 Jan 2006 21:39:07 -0000 1.10 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java 31 Jan 2006 16:27:04 -0000 1.11 @@ -105,7 +105,7 @@ if (mcContent == null) { persistError(request, "error.content.doesNotExist"); - request.setAttribute(USER_EXCEPTION_CONTENT_DOESNOTEXIST, new Boolean(true)); + McUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST)); } @@ -193,6 +193,7 @@ protected ActionForward validateParameters(HttpServletRequest request, ActionMapping mapping) { + logger.debug("start validating monitoring parameters..."); /* * obtain and setup the current user's data */ @@ -203,21 +204,22 @@ { logger.debug("error: The tool expects userId"); persistError(request,"error.learningUser.notAvailable"); - request.setAttribute(USER_EXCEPTION_USERID_NOTAVAILABLE, new Boolean(true)); - return (mapping.findForward(ERROR_LIST)); + McUtils.cleanUpSessionAbsolute(request); + return (mapping.findForward(ERROR_LIST)); }else userID = user.getUserID().toString(); logger.debug("retrieved userId: " + userID); request.getSession().setAttribute(USER_ID, userID); - String strToolContentId=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); + logger.debug("strToolContentId: " + strToolContentId); + long toolSessionId=0; if ((strToolContentId == null) || (strToolContentId.length() == 0)) { persistError(request, "error.contentId.required"); - request.setAttribute(USER_EXCEPTION_CONTENTID_REQUIRED, new Boolean(true)); + McUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST)); } else @@ -232,7 +234,7 @@ { persistError(request, "error.contentId.numberFormatException"); logger.debug("add error.contentId.numberFormatException to ActionMessages."); - request.setAttribute(USER_EXCEPTION_NUMBERFORMAT, new Boolean(true)); + McUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST)); } } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java,v diff -u -r1.58 -r1.59 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java 29 Jan 2006 13:46:03 -0000 1.58 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java 31 Jan 2006 16:27:04 -0000 1.59 @@ -219,7 +219,7 @@ if ((strToolContentId == null) || (strToolContentId.equals(""))) { persistError(request,"error.contentId.required"); - request.setAttribute(USER_EXCEPTION_CONTENTID_REQUIRED, new Boolean(true)); + McUtils.cleanUpSessionAbsolute(request); logger.debug("forwarding to: " + ERROR_LIST); return (mapping.findForward(ERROR_LIST)); } @@ -236,7 +236,7 @@ catch(NumberFormatException e) { persistError(request,"error.ids.numberFormatException"); - request.setAttribute(USER_EXCEPTION_NUMBERFORMAT, new Boolean(true)); + McUtils.cleanUpSessionAbsolute(request); logger.debug("forwarding to: " + ERROR_LIST); return (mapping.findForward(ERROR_LIST)); } @@ -267,6 +267,7 @@ } catch(ToolException e) { + McUtils.cleanUpSessionAbsolute(request); logger.debug("error copying the content: " + e); } } @@ -286,6 +287,7 @@ } catch(ToolException e) { + McUtils.cleanUpSessionAbsolute(request); logger.debug("error removing the content: " + e); } } @@ -305,6 +307,7 @@ } catch(ToolException e) { + McUtils.cleanUpSessionAbsolute(request); logger.debug("error setting the define later on the content: " + e); } } @@ -325,6 +328,7 @@ } catch(ToolException e) { + McUtils.cleanUpSessionAbsolute(request); logger.debug("error setting the run offline on the content: " + e); } } @@ -363,6 +367,7 @@ if (isContentInUse == true) { persistError(request,"error.content.inUse"); + McUtils.cleanUpSessionAbsolute(request); logger.debug("forwarding to: " + ERROR_LIST); return (mapping.findForward(ERROR_LIST)); } @@ -374,6 +379,7 @@ if (isDefineLater == true) { persistError(request,"error.content.beingModified"); + McUtils.cleanUpSessionAbsolute(request); logger.debug("forwarding to: " + ERROR_LIST); return (mapping.findForward(ERROR_LIST)); } @@ -413,16 +419,16 @@ if (contentId == 0) { logger.debug("default content id has not been setup"); - request.setAttribute(USER_EXCEPTION_DEFAULTCONTENT_NOTSETUP, new Boolean(true)); persistError(request,"error.defaultContent.notSetup"); + McUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST)); } } catch(Exception e) { logger.debug("error getting the default content id: " + e.getMessage()); - request.setAttribute(USER_EXCEPTION_DEFAULTCONTENT_NOTSETUP, new Boolean(true)); persistError(request,"error.defaultContent.notSetup"); + McUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST)); } @@ -435,8 +441,8 @@ if (mcContent == null) { logger.debug("Exception occured: No default content"); - request.setAttribute(USER_EXCEPTION_DEFAULTCONTENT_NOTSETUP, new Boolean(true)); persistError(request,"error.defaultContent.notSetup"); + McUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST)); } logger.debug("using mcContent: " + mcContent); @@ -446,8 +452,8 @@ catch(Exception e) { logger.debug("Exception occured: No default question content"); - request.setAttribute(USER_EXCEPTION_DEFAULTCONTENT_NOTSETUP, new Boolean(true)); - persistError(request,"error.defaultContent.notSetup"); + persistError(request,"error.defaultContent.notSetup"); + McUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST)); } @@ -462,8 +468,8 @@ if (mcQueContent == null) { logger.debug("Exception occured: No default question content"); - request.setAttribute(USER_EXCEPTION_DEFAULTQUESTIONCONTENT_NOT_AVAILABLE, new Boolean(true)); - persistError(request,"error.defaultQuestionContent.notAvailable"); + persistError(request,"error.defaultQuestionContent.notAvailable"); + McUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST)); } logger.debug("using mcQueContent uid: " + mcQueContent.getUid()); @@ -474,8 +480,8 @@ catch(Exception e) { logger.debug("Exception occured: No default question content"); - request.setAttribute(USER_EXCEPTION_DEFAULTQUESTIONCONTENT_NOT_AVAILABLE, new Boolean(true)); - persistError(request,"error.defaultQuestionContent.notAvailable"); + persistError(request,"error.defaultQuestionContent.notAvailable"); + McUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST)); } @@ -489,17 +495,17 @@ if (list == null) { logger.debug("Exception occured: No default options content"); - request.setAttribute(USER_EXCEPTION_DEFAULTOPTIONSCONTENT_NOT_AVAILABLE, new Boolean(true)); - persistError(request,"error.defaultOptionsContent.notAvailable"); + persistError(request,"error.defaultOptionsContent.notAvailable"); + McUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST)); } } catch(Exception e) { logger.debug("Exception occured: No default options content"); - request.setAttribute(USER_EXCEPTION_DEFAULTOPTIONSCONTENT_NOT_AVAILABLE, new Boolean(true)); - persistError(request,"error.defaultOptionsContent.notAvailable"); + persistError(request,"error.defaultOptionsContent.notAvailable"); + McUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST)); } @@ -717,10 +723,7 @@ LinkedList listUploadedOfflineFileNames= new LinkedList(); LinkedList listUploadedOnlineFileNames= new LinkedList(); - //request.getSession().setAttribute(LIST_UPLOADED_OFFLINE_FILES,listUploadedOfflineFiles); request.getSession().setAttribute(LIST_UPLOADED_OFFLINE_FILENAMES,listUploadedOfflineFileNames); - - //request.getSession().setAttribute(LIST_UPLOADED_ONLINE_FILES,listUploadedOnlineFiles); request.getSession().setAttribute(LIST_UPLOADED_ONLINE_FILENAMES,listUploadedOnlineFileNames); LinkedList listOfflineFilesMetaData= new LinkedList();