Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McQueContentDAO.java =================================================================== diff -u -rf931ace3d9f38ea25225bd0cd55adfdcb3dfc376 -rff60206f498b016a282bba4630b2cc4e4324ab21 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McQueContentDAO.java (.../McQueContentDAO.java) (revision f931ace3d9f38ea25225bd0cd55adfdcb3dfc376) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McQueContentDAO.java (.../McQueContentDAO.java) (revision ff60206f498b016a282bba4630b2cc4e4324ab21) @@ -246,8 +246,12 @@ public void removeMcQueContent(McQueContent mcQueContent) { - this.getSession().setFlushMode(FlushMode.AUTO); - this.getHibernateTemplate().delete(mcQueContent); + if ((mcQueContent != null) && (mcQueContent.getUid() != null)) + { + this.getSession().setFlushMode(FlushMode.AUTO); + this.getHibernateTemplate().delete(mcQueContent); + + } } public void flush() Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java =================================================================== diff -u -rc36f34d5556026f8ca36362eb3f22053a2d91ce0 -rff60206f498b016a282bba4630b2cc4e4324ab21 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision c36f34d5556026f8ca36362eb3f22053a2d91ce0) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision ff60206f498b016a282bba4630b2cc4e4324ab21) @@ -1766,6 +1766,10 @@ public static void cleanupRedundantQuestions(HttpServletRequest request, List existingQuestions, Map mapQuestionsContent, McContent mcContent) { logger.debug("doing cleanupRedundantQuestions..."); + logger.debug("using existingQuestions: " + existingQuestions); + logger.debug("using mapQuestionsContent: " + mapQuestionsContent); + logger.debug("using mcContent: " + mcContent); + IMcService mcService =McUtils.getToolService(request); /*remove ununsed question entries from the db */ @@ -1797,9 +1801,14 @@ String deletableQuestion=mcQueContent.getQuestion(); logger.debug("found is false, delete this question " + deletableQuestion); mcQueContent=mcService.getQuestionContentByQuestionText(deletableQuestion, mcContent.getUid()); + logger.debug("found is false, delete this question " + mcQueContent); if (mcQueContent != null) { + logger.debug("first removing from collection " + mcQueContent); + mcContent.getMcQueContents().remove(mcQueContent); + logger.debug("removed from collection "); + mcService.removeMcQueContent(mcQueContent); logger.debug("removed mcQueContent from the db: " + mcQueContent); } @@ -2161,38 +2170,41 @@ { Long mcQueContentUid=mcQueContent.getUid(); logger.debug("mcQueContentUid:" + mcQueContentUid); - - Iterator itPQ = pendingOptions.entrySet().iterator(); - boolean isOptionSelected=false; - while (itPQ.hasNext()) - { - Map.Entry pairsPQ = (Map.Entry)itPQ.next(); - String optionText=pairsPQ.getValue().toString() ; - logger.debug("optionText: " + optionText); - - if ((optionText != null) && (!optionText.equals(""))) - { - isOptionSelected=false; - isOptionSelected=isOptionSelected(mapGeneralSelectedOptionsContent, optionText, questionIndex); - logger.debug("isOptionSelected: " + isOptionSelected); - - McOptsContent mcOptsContent = mcService.getOptionContentByOptionText(optionText, mcQueContentUid); - logger.debug("mcOptsContent: " + mcOptsContent); - - if (mcOptsContent == null) - { - mcOptsContent = new McOptsContent(isOptionSelected, pairsPQ.getValue().toString(),mcQueContent , new TreeSet()); - logger.debug("created new mcOptsContent:" + mcOptsContent); - } - else + + if (pendingOptions != null) + { + Iterator itPQ = pendingOptions.entrySet().iterator(); + boolean isOptionSelected=false; + while (itPQ.hasNext()) + { + Map.Entry pairsPQ = (Map.Entry)itPQ.next(); + String optionText=pairsPQ.getValue().toString() ; + logger.debug("optionText: " + optionText); + + if ((optionText != null) && (!optionText.equals(""))) { - logger.debug("this option is already persisted mcQueContent, just look after isOptionSelected:" + mcQueContent); - mcOptsContent.setCorrectOption(isOptionSelected); + isOptionSelected=false; + isOptionSelected=isOptionSelected(mapGeneralSelectedOptionsContent, optionText, questionIndex); + logger.debug("isOptionSelected: " + isOptionSelected); + + McOptsContent mcOptsContent = mcService.getOptionContentByOptionText(optionText, mcQueContentUid); + logger.debug("mcOptsContent: " + mcOptsContent); + + if (mcOptsContent == null) + { + mcOptsContent = new McOptsContent(isOptionSelected, pairsPQ.getValue().toString(),mcQueContent , new TreeSet()); + logger.debug("created new mcOptsContent:" + mcOptsContent); + } + else + { + logger.debug("this option is already persisted mcQueContent, just look after isOptionSelected:" + mcQueContent); + mcOptsContent.setCorrectOption(isOptionSelected); + } + mcService.saveMcOptionsContent(mcOptsContent); + logger.debug("persisted mcQueContent: " + mcQueContent); } - mcService.saveMcOptionsContent(mcOptsContent); - logger.debug("persisted mcQueContent: " + mcQueContent); - } - } + } + } } } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ClearSessionAction.java =================================================================== diff -u -r7c258915bf9d46f8fe8dd192a2b1a77c024d1cad -rff60206f498b016a282bba4630b2cc4e4324ab21 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ClearSessionAction.java (.../ClearSessionAction.java) (revision 7c258915bf9d46f8fe8dd192a2b1a77c024d1cad) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ClearSessionAction.java (.../ClearSessionAction.java) (revision ff60206f498b016a282bba4630b2cc4e4324ab21) @@ -60,6 +60,7 @@ session.removeAttribute(McAction.DEFAULT_QUESTION_UID); session.removeAttribute(McAction.USER_EXCEPTION_ANSWERS_DUPLICATE); session.removeAttribute(McAction.USER_EXCEPTION_ANSWER_EMPTY); + session.removeAttribute(McAction.USER_EXCEPTION_NO_TOOL_SESSIONS); session.removeAttribute(McAction.LIST_UPLOADED_OFFLINE_FILENAMES); session.removeAttribute(McAction.LIST_UPLOADED_ONLINE_FILENAMES); session.removeAttribute(McAction.CREATION_DATE); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java =================================================================== diff -u -r491f874f375c6f90b6659f9dc1fc7408c25613d1 -rff60206f498b016a282bba4630b2cc4e4324ab21 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java (.../McAction.java) (revision 491f874f375c6f90b6659f9dc1fc7408c25613d1) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java (.../McAction.java) (revision ff60206f498b016a282bba4630b2cc4e4324ab21) @@ -1,5 +1,4 @@ -/*************************************************************************** - * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) +/* Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) * ============================================================= * License Information: http://lamsfoundation.org/licensing/lams/2.0/ * @@ -52,6 +51,7 @@ import org.lamsfoundation.lams.tool.mc.pojos.McOptsContent; import org.lamsfoundation.lams.tool.mc.pojos.McQueContent; import org.lamsfoundation.lams.tool.mc.service.IMcService; +import org.lamsfoundation.lams.tool.mc.service.McServiceProxy; import org.lamsfoundation.lams.web.action.LamsDispatchAction; /** @@ -188,7 +188,6 @@ AuthoringUtil.readData(request, mcAuthoringForm); mcAuthoringForm.resetUserAction(); - request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); return null; } @@ -325,8 +324,17 @@ logger.debug("sequenced mapGeneralSelectedOptionsContent:"+ mapGeneralSelectedOptionsContent); request.getSession().setAttribute(MAP_GENERAL_SELECTED_OPTIONS_CONTENT, mapGeneralSelectedOptionsContent); + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent: " + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + McUtils.debugMaps(request); logger.debug("final EDIT_OPTIONS_MODE: " + request.getSession().getAttribute(EDIT_OPTIONS_MODE)); + return (mapping.findForward(destination)); } @@ -449,8 +457,19 @@ logger.debug("sequenced mapGeneralSelectedOptionsContent:"+ mapGeneralSelectedOptionsContent); request.getSession().setAttribute(MAP_GENERAL_SELECTED_OPTIONS_CONTENT, mapGeneralSelectedOptionsContent); + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent: " + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + McUtils.debugMaps(request); logger.debug("final EDIT_OPTIONS_MODE: " + request.getSession().getAttribute(EDIT_OPTIONS_MODE)); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + return (mapping.findForward(destination)); } @@ -467,8 +486,27 @@ String destination=McUtils.getDestination(sourceMcStarter); logger.debug("destination: " + destination); + IMcService mcService =McUtils.getToolService(request); + if (mcService == null) + { + logger.debug("will retrieve mcService"); + mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + logger.debug("retrieving mcService from cache: " + mcService); + } + request.getSession().setAttribute(TOOL_SERVICE, mcService); + logger.debug("mcService : " + mcService); + + boolean performEditOptions=performEditOptions(mapping, form, request, response, false); logger.debug("performEditOptions: " + performEditOptions); + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); return (mapping.findForward(destination)); } @@ -895,6 +933,7 @@ { request.getSession().setAttribute(RICHTEXT_CORRECT_FEEDBACK,DEFAULT_FEEDBACK_CORRECT); } + return true; } @@ -1035,6 +1074,15 @@ McUtils.debugMaps(request); logger.debug("final EDIT_OPTIONS_MODE: " + request.getSession().getAttribute(EDIT_OPTIONS_MODE)); + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + return (mapping.findForward(destination)); } @@ -1163,6 +1211,15 @@ McUtils.debugMaps(request); logger.debug("final EDIT_OPTIONS_MODE: " + request.getSession().getAttribute(EDIT_OPTIONS_MODE)); + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + return (mapping.findForward(destination)); } @@ -1309,9 +1366,19 @@ mapGeneralSelectedOptionsContent=AuthoringUtil.sequenceMap(mapGeneralSelectedOptionsContent); logger.debug("sequenced mapGeneralSelectedOptionsContent:"+ mapGeneralSelectedOptionsContent); request.getSession().setAttribute(MAP_GENERAL_SELECTED_OPTIONS_CONTENT, mapGeneralSelectedOptionsContent); + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + McUtils.debugMaps(request); logger.debug("final EDIT_OPTIONS_MODE: " + request.getSession().getAttribute(EDIT_OPTIONS_MODE)); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + return (mapping.findForward(destination)); } @@ -1461,8 +1528,17 @@ logger.debug("sequenced mapGeneralSelectedOptionsContent:"+ mapGeneralSelectedOptionsContent); request.getSession().setAttribute(MAP_GENERAL_SELECTED_OPTIONS_CONTENT, mapGeneralSelectedOptionsContent); + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + McUtils.debugMaps(request); logger.debug("final EDIT_OPTIONS_MODE: " + request.getSession().getAttribute(EDIT_OPTIONS_MODE)); + return (mapping.findForward(destination)); } @@ -1478,9 +1554,28 @@ logger.debug("sourceMcStarter: " + sourceMcStarter); String destination=McUtils.getDestination(sourceMcStarter); logger.debug("destination: " + destination); + + IMcService mcService =McUtils.getToolService(request); + if (mcService == null) + { + logger.debug("will retrieve mcService"); + mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + logger.debug("retrieving mcService from cache: " + mcService); + } + request.getSession().setAttribute(TOOL_SERVICE, mcService); + logger.debug("mcService : " + mcService); + boolean performDoneOptions=performDoneOptions(mapping, form, request, response, false); logger.debug("performDoneOptions: " + performDoneOptions); + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); return (mapping.findForward(destination)); } @@ -1733,6 +1828,16 @@ McUtils.debugMaps(request); logger.debug("final EDIT_OPTIONS_MODE: " + request.getSession().getAttribute(EDIT_OPTIONS_MODE)); + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + return (mapping.findForward(destination)); } @@ -1784,7 +1889,11 @@ Long toolContentId=(Long)request.getSession().getAttribute(TOOL_CONTENT_ID); logger.debug("toolContentId:" + toolContentId); - AuthoringUtil.refreshMaps(request, toolContentId.longValue()); + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent: " + mcContent); + + AuthoringUtil.refreshMaps(request, toolContentId.longValue()); logger.debug("refreshed maps..."); Map mapStartupGeneralOptionsContent= (Map) request.getSession().getAttribute(MAP_STARTUP_GENERAL_OPTIONS_CONTENT); @@ -2089,7 +2198,6 @@ String richTextEndLearningMessage=(String)request.getSession().getAttribute(RICHTEXT_END_LEARNING_MSG); logger.debug("richTextEndLearningMessage: " + richTextEndLearningMessage); - McContent mcContent=mcService.retrieveMc(toolContentId); logger.debug("existing mcContent:" + mcContent); String activeModule=(String)request.getSession().getAttribute(ACTIVE_MODULE); @@ -2254,6 +2362,8 @@ /*because button (and javascript) will display in LamsTag tab, so put it into session instead of request it will be remove immediately in clearSessionAction.*/ request.getSession().setAttribute(AuthoringConstants.LAMS_AUTHORING_SUCCESS_FLAG,Boolean.TRUE); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); logger.debug("final EDIT_OPTIONS_MODE: " + request.getSession().getAttribute(EDIT_OPTIONS_MODE)); return (mapping.findForward(destination)); @@ -2308,6 +2418,15 @@ McUtils.debugMaps(request); logger.debug("final EDIT_OPTIONS_MODE: " + request.getSession().getAttribute(EDIT_OPTIONS_MODE)); + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + return (mapping.findForward(destination)); } @@ -2361,6 +2480,15 @@ McUtils.debugMaps(request); logger.debug("final EDIT_OPTIONS_MODE: " + request.getSession().getAttribute(EDIT_OPTIONS_MODE)); + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + return (mapping.findForward(destination)); } @@ -2436,6 +2564,15 @@ McUtils.debugMaps(request); logger.debug("final EDIT_OPTIONS_MODE: " + request.getSession().getAttribute(EDIT_OPTIONS_MODE)); + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + return (mapping.findForward(destination)); } @@ -2509,6 +2646,15 @@ McUtils.debugMaps(request); logger.debug("final EDIT_OPTIONS_MODE: " + request.getSession().getAttribute(EDIT_OPTIONS_MODE)); + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + return (mapping.findForward(destination)); } @@ -2551,6 +2697,15 @@ McUtils.debugMaps(request); logger.debug("final EDIT_OPTIONS_MODE: " + request.getSession().getAttribute(EDIT_OPTIONS_MODE)); + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + return (mapping.findForward(destination)); } @@ -2593,6 +2748,15 @@ McUtils.debugMaps(request); logger.debug("final EDIT_OPTIONS_MODE: " + request.getSession().getAttribute(EDIT_OPTIONS_MODE)); + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + return (mapping.findForward(destination)); } @@ -2641,6 +2805,26 @@ /* Check this: find out where to forward to*/ McUtils.debugMaps(request); logger.debug("final EDIT_OPTIONS_MODE: " + request.getSession().getAttribute(EDIT_OPTIONS_MODE)); + + IMcService mcService =McUtils.getToolService(request); + if (mcService == null) + { + logger.debug("will retrieve mcService"); + mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + logger.debug("retrieving mcService from cache: " + mcService); + } + request.getSession().setAttribute(TOOL_SERVICE, mcService); + logger.debug("mcService : " + mcService); + + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + return (mapping.findForward(AUTHORING_STARTER)); } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java =================================================================== diff -u -r29f3aacca489abf02e7d05620daf773e0af9776d -rff60206f498b016a282bba4630b2cc4e4324ab21 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java (.../McLearningStarterAction.java) (revision 29f3aacca489abf02e7d05620daf773e0af9776d) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java (.../McLearningStarterAction.java) (revision ff60206f498b016a282bba4630b2cc4e4324ab21) @@ -276,8 +276,6 @@ { McUtils.cleanUpSessionAbsolute(request); logger.debug("error: The tool expects mcSession."); - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString()); - persistError(request,"error.toolSession.notAvailable"); return (mapping.findForward(ERROR_LIST)); } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java =================================================================== diff -u -r4a1085fc82d8e6273b9b800fb6852bcbd2c7baea -rff60206f498b016a282bba4630b2cc4e4324ab21 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java (.../McMonitoringAction.java) (revision 4a1085fc82d8e6273b9b800fb6852bcbd2c7baea) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java (.../McMonitoringAction.java) (revision ff60206f498b016a282bba4630b2cc4e4324ab21) @@ -216,7 +216,14 @@ logger.debug("CURRENT_MONITORED_TOOL_SESSION: " + request.getSession().getAttribute(CURRENT_MONITORED_TOOL_SESSION)); logger.debug("CURRENT_MONITORED_TOOL_SESSION_NAME: " + request.getSession().getAttribute(CURRENT_MONITORED_TOOL_SESSION_NAME)); + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + return (mapping.findForward(LOAD_MONITORING_CONTENT)); } @@ -284,6 +291,9 @@ logger.debug("forwarding to: " + LOAD_MONITORING_CONTENT); return (mapping.findForward(LOAD_MONITORING_CONTENT)); } + + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); return mcStarterAction.executeDefineLater(mapping, form, request, response, mcService); } @@ -343,6 +353,9 @@ McContent mcContent=mcService.retrieveMc(toolContentId); logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + request.getSession().setAttribute(RICHTEXT_TITLE, mcContent.getTitle()); request.getSession().setAttribute(RICHTEXT_INSTRUCTIONS, mcContent.getInstructions()); @@ -401,8 +414,16 @@ request.getSession().setAttribute(TOOL_SERVICE, mcService); request.getSession().setAttribute(CURRENT_MONITORING_TAB, "summary"); - - McStarterAction mcStarterAction= new McStarterAction(); + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + + McStarterAction mcStarterAction= new McStarterAction(); return mcStarterAction.executeGetMonitoringTab(mapping, form, request, response); } @@ -450,7 +471,15 @@ } request.getSession().setAttribute(TOOL_SERVICE, mcService); request.getSession().setAttribute(CURRENT_MONITORING_TAB, "instructions"); - + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + McStarterAction mcStarterAction= new McStarterAction(); return mcStarterAction.executeGetMonitoringTab(mapping, form, request, response); } @@ -499,7 +528,16 @@ logger.debug("mcService : " + mcService); request.getSession().setAttribute(CURRENT_MONITORING_TAB, "stats"); - + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + McStarterAction mcStarterAction= new McStarterAction(); return mcStarterAction.executeGetMonitoringTab(mapping, form, request, response); } @@ -533,8 +571,27 @@ request.setAttribute(SOURCE_MC_STARTER, "monitoring"); logger.debug("SOURCE_MC_STARTER: monitoring"); + IMcService mcService =McUtils.getToolService(request); + if (mcService == null) + { + logger.debug("will retrieve mcService"); + mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + logger.debug("retrieving mcService from cache: " + mcService); + } + request.getSession().setAttribute(TOOL_SERVICE, mcService); + logger.debug("mcService : " + mcService); + + request.getSession().setAttribute(CURRENT_MONITORING_TAB, "editActivity"); + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + McAction mcAction = new McAction(); return mcAction.addNewQuestion(mapping, form, request, response); } @@ -568,8 +625,26 @@ request.setAttribute(SOURCE_MC_STARTER, "monitoring"); logger.debug("SOURCE_MC_STARTER: monitoring"); + IMcService mcService =McUtils.getToolService(request); + if (mcService == null) + { + logger.debug("will retrieve mcService"); + mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + logger.debug("retrieving mcService from cache: " + mcService); + } + request.getSession().setAttribute(TOOL_SERVICE, mcService); + logger.debug("mcService : " + mcService); + request.getSession().setAttribute(CURRENT_MONITORING_TAB, "editActivity"); - + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + McAction mcAction = new McAction(); return mcAction.removeQuestion(mapping, form, request, response); } @@ -602,9 +677,28 @@ request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(false).toString()); request.setAttribute(SOURCE_MC_STARTER, "monitoring"); logger.debug("SOURCE_MC_STARTER: monitoring"); + + IMcService mcService =McUtils.getToolService(request); + if (mcService == null) + { + logger.debug("will retrieve mcService"); + mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + logger.debug("retrieving mcService from cache: " + mcService); + } + request.getSession().setAttribute(TOOL_SERVICE, mcService); + logger.debug("mcService : " + mcService); + request.getSession().setAttribute(CURRENT_MONITORING_TAB, "editActivity"); + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + McAction mcAction = new McAction(); return mcAction.editOptions(mapping, form, request, response); } @@ -638,8 +732,27 @@ request.setAttribute(SOURCE_MC_STARTER, "monitoring"); logger.debug("SOURCE_MC_STARTER: monitoring"); + IMcService mcService =McUtils.getToolService(request); + if (mcService == null) + { + logger.debug("will retrieve mcService"); + mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + logger.debug("retrieving mcService from cache: " + mcService); + } + request.getSession().setAttribute(TOOL_SERVICE, mcService); + logger.debug("mcService : " + mcService); + + request.getSession().setAttribute(CURRENT_MONITORING_TAB, "editActivity"); + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + McAction mcAction = new McAction(); return mcAction.addOption(mapping, form, request, response); } @@ -671,9 +784,28 @@ request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(false).toString()); request.setAttribute(SOURCE_MC_STARTER, "monitoring"); logger.debug("SOURCE_MC_STARTER: monitoring"); + + IMcService mcService =McUtils.getToolService(request); + if (mcService == null) + { + logger.debug("will retrieve mcService"); + mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + logger.debug("retrieving mcService from cache: " + mcService); + } + request.getSession().setAttribute(TOOL_SERVICE, mcService); + logger.debug("mcService : " + mcService); + request.getSession().setAttribute(CURRENT_MONITORING_TAB, "editActivity"); + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + McAction mcAction = new McAction(); return mcAction.removeOption(mapping, form, request, response); } @@ -707,9 +839,28 @@ request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(false).toString()); request.setAttribute(SOURCE_MC_STARTER, "monitoring"); logger.debug("SOURCE_MC_STARTER: monitoring"); + + IMcService mcService =McUtils.getToolService(request); + if (mcService == null) + { + logger.debug("will retrieve mcService"); + mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + logger.debug("retrieving mcService from cache: " + mcService); + } + request.getSession().setAttribute(TOOL_SERVICE, mcService); + logger.debug("mcService : " + mcService); + request.getSession().setAttribute(CURRENT_MONITORING_TAB, "editActivity"); + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + McAction mcAction = new McAction(); return mcAction.moveQuestionDown(mapping, form, request, response); } @@ -742,9 +893,28 @@ request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(false).toString()); request.setAttribute(SOURCE_MC_STARTER, "monitoring"); logger.debug("SOURCE_MC_STARTER: monitoring"); + + IMcService mcService =McUtils.getToolService(request); + if (mcService == null) + { + logger.debug("will retrieve mcService"); + mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + logger.debug("retrieving mcService from cache: " + mcService); + } + request.getSession().setAttribute(TOOL_SERVICE, mcService); + logger.debug("mcService : " + mcService); + request.getSession().setAttribute(CURRENT_MONITORING_TAB, "editActivity"); + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + McAction mcAction = new McAction(); return mcAction.moveQuestionUp(mapping, form, request, response); } @@ -776,9 +946,28 @@ request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(false).toString()); request.setAttribute(SOURCE_MC_STARTER, "monitoring"); logger.debug("SOURCE_MC_STARTER: monitoring"); + + IMcService mcService =McUtils.getToolService(request); + if (mcService == null) + { + logger.debug("will retrieve mcService"); + mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + logger.debug("retrieving mcService from cache: " + mcService); + } + request.getSession().setAttribute(TOOL_SERVICE, mcService); + logger.debug("mcService : " + mcService); + request.getSession().setAttribute(CURRENT_MONITORING_TAB, "editActivity"); + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + McAction mcAction = new McAction(); return mcAction.doneOptions(mapping, form, request, response); } @@ -812,14 +1001,33 @@ request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(false).toString()); request.setAttribute(SOURCE_MC_STARTER, "monitoring"); logger.debug("SOURCE_MC_STARTER: monitoring"); + + IMcService mcService =McUtils.getToolService(request); + if (mcService == null) + { + logger.debug("will retrieve mcService"); + mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + logger.debug("retrieving mcService from cache: " + mcService); + } + request.getSession().setAttribute(TOOL_SERVICE, mcService); + logger.debug("mcService : " + mcService); + /*set the current tab*/ request.getSession().setAttribute(CURRENT_MONITORING_TAB, "editActivity"); /* present the view-only screen first */ request.getSession().setAttribute(ACTIVE_MODULE, DEFINE_LATER); request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(false)); - + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + McAction mcAction = new McAction(); return mcAction.submitQuestions(mapping, form, request, response); } @@ -852,9 +1060,27 @@ request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(false).toString()); request.setAttribute(SOURCE_MC_STARTER, "monitoring"); logger.debug("SOURCE_MC_STARTER: monitoring"); - + + IMcService mcService =McUtils.getToolService(request); + if (mcService == null) + { + logger.debug("will retrieve mcService"); + mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + logger.debug("retrieving mcService from cache: " + mcService); + } + request.getSession().setAttribute(TOOL_SERVICE, mcService); + logger.debug("mcService : " + mcService); + request.getSession().setAttribute(CURRENT_MONITORING_TAB, "editActivity"); + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + McAction mcAction = new McAction(); return mcAction.deleteOfflineFile(mapping, form, request, response); } @@ -887,9 +1113,28 @@ request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(false).toString()); request.setAttribute(SOURCE_MC_STARTER, "monitoring"); logger.debug("SOURCE_MC_STARTER: monitoring"); + + IMcService mcService =McUtils.getToolService(request); + if (mcService == null) + { + logger.debug("will retrieve mcService"); + mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + logger.debug("retrieving mcService from cache: " + mcService); + } + request.getSession().setAttribute(TOOL_SERVICE, mcService); + logger.debug("mcService : " + mcService); + request.getSession().setAttribute(CURRENT_MONITORING_TAB, "editActivity"); + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + McAction mcAction = new McAction(); return mcAction.deleteOnlineFile(mapping, form, request, response); } @@ -925,9 +1170,28 @@ request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(false).toString()); request.setAttribute(SOURCE_MC_STARTER, "monitoring"); logger.debug("SOURCE_MC_STARTER: monitoring"); + + IMcService mcService =McUtils.getToolService(request); + if (mcService == null) + { + logger.debug("will retrieve mcService"); + mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + logger.debug("retrieving mcService from cache: " + mcService); + } + request.getSession().setAttribute(TOOL_SERVICE, mcService); + logger.debug("mcService : " + mcService); + request.getSession().setAttribute(CURRENT_MONITORING_TAB, "editActivity"); + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + McAction mcAction = new McAction(); return mcAction.submitOfflineFiles(mapping, form, request, response); } @@ -962,9 +1226,28 @@ request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(false).toString()); request.setAttribute(SOURCE_MC_STARTER, "monitoring"); logger.debug("SOURCE_MC_STARTER: monitoring"); + + IMcService mcService =McUtils.getToolService(request); + if (mcService == null) + { + logger.debug("will retrieve mcService"); + mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + logger.debug("retrieving mcService from cache: " + mcService); + } + request.getSession().setAttribute(TOOL_SERVICE, mcService); + logger.debug("mcService : " + mcService); + request.getSession().setAttribute(CURRENT_MONITORING_TAB, "editActivity"); + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + McAction mcAction = new McAction(); return mcAction.submitOnlineFiles(mapping, form, request, response); } @@ -996,9 +1279,28 @@ request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(false).toString()); request.setAttribute(SOURCE_MC_STARTER, "monitoring"); logger.debug("SOURCE_MC_STARTER: monitoring"); + + IMcService mcService =McUtils.getToolService(request); + if (mcService == null) + { + logger.debug("will retrieve mcService"); + mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + logger.debug("retrieving mcService from cache: " + mcService); + } + request.getSession().setAttribute(TOOL_SERVICE, mcService); + logger.debug("mcService : " + mcService); + request.getSession().setAttribute(CURRENT_MONITORING_TAB, "editActivity"); + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + McAction mcAction = new McAction(); return mcAction.doneAdvancedTab(mapping, form, request, response); } @@ -1031,9 +1333,28 @@ request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(false).toString()); request.setAttribute(SOURCE_MC_STARTER, "monitoring"); logger.debug("SOURCE_MC_STARTER: monitoring"); + + IMcService mcService =McUtils.getToolService(request); + if (mcService == null) + { + logger.debug("will retrieve mcService"); + mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + logger.debug("retrieving mcService from cache: " + mcService); + } + request.getSession().setAttribute(TOOL_SERVICE, mcService); + logger.debug("mcService : " + mcService); + request.getSession().setAttribute(CURRENT_MONITORING_TAB, "editActivity"); + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + McAction mcAction = new McAction(); return mcAction.doneInstructionsTab(mapping, form, request, response); } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java =================================================================== diff -u -r4a1085fc82d8e6273b9b800fb6852bcbd2c7baea -rff60206f498b016a282bba4630b2cc4e4324ab21 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java (.../McMonitoringStarterAction.java) (revision 4a1085fc82d8e6273b9b800fb6852bcbd2c7baea) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java (.../McMonitoringStarterAction.java) (revision ff60206f498b016a282bba4630b2cc4e4324ab21) @@ -128,6 +128,7 @@ McMonitoringForm mcMonitoringForm = (McMonitoringForm) form; mcMonitoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); + request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString()); request.getSession().setAttribute(ACTIVE_MODULE, DEFINE_LATER); request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(false)); @@ -272,6 +273,8 @@ mapCorrectFeedback = AuthoringUtil.rebuildCorrectFeedbackMapfromDB(request, toolContentId); logger.debug("existing mapCorrectFeedback:" + mapCorrectFeedback); request.getSession().setAttribute(MAP_CORRECT_FEEDBACK, mapCorrectFeedback); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); return (mapping.findForward(LOAD_MONITORING_CONTENT)); } @@ -302,6 +305,8 @@ request.getSession().setAttribute(TOOL_SERVICE, mcService); McMonitoringForm mcMonitoringForm = (McMonitoringForm) form; + /* setting active tab to summary*/ + mcMonitoringForm.setCurrentTab("1"); /* * persist time zone information to session scope. @@ -325,12 +330,8 @@ Map summaryToolSessions=MonitoringUtil.populateToolSessions(request, mcContent, mcService); logger.debug("summaryToolSessions: " + summaryToolSessions); - if (summaryToolSessions.isEmpty()) - { - /* inform in the Summary tab that the tool has no active sessions */ - request.setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true)); - } + Map summaryToolSessionsId=MonitoringUtil.populateToolSessionsId(request, mcContent, mcService); logger.debug("summaryToolSessionsId: " + summaryToolSessionsId); request.getSession().setAttribute(SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId); @@ -410,6 +411,7 @@ logger.debug("SUMMARY_TOOL_SESSIONS: " + request.getSession().getAttribute(SUMMARY_TOOL_SESSIONS)); logger.debug("SELECTION_CASE: " + request.getSession().getAttribute(SELECTION_CASE)); logger.debug("LIST_MONITORED_ANSWERS_CONTAINER_DTO: " + request.getSession().getAttribute(LIST_MONITORED_ANSWERS_CONTAINER_DTO)); + return true; } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java =================================================================== diff -u -r491f874f375c6f90b6659f9dc1fc7408c25613d1 -rff60206f498b016a282bba4630b2cc4e4324ab21 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java (.../McStarterAction.java) (revision 491f874f375c6f90b6659f9dc1fc7408c25613d1) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java (.../McStarterAction.java) (revision ff60206f498b016a282bba4630b2cc4e4324ab21) @@ -352,7 +352,16 @@ } } mcAuthoringForm.resetUserAction(); + + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + + MonitoringUtil.setAttributeNoToolSessions(request, mcService, mcContent); + logger.debug("will return to jsp with: " + sourceMcStarter); String destination=McUtils.getDestination(sourceMcStarter); logger.debug("destination: " + destination); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/MonitoringUtil.java =================================================================== diff -u -r4a1085fc82d8e6273b9b800fb6852bcbd2c7baea -rff60206f498b016a282bba4630b2cc4e4324ab21 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision 4a1085fc82d8e6273b9b800fb6852bcbd2c7baea) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision ff60206f498b016a282bba4630b2cc4e4324ab21) @@ -999,6 +999,25 @@ return map; } + + public static void setAttributeNoToolSessions(HttpServletRequest request, IMcService mcService, McContent mcContent) + { + logger.debug("using mcContent: " + mcContent); + /*true means there is at least 1 response*/ + if ((mcContent != null) && (mcService.studentActivityOccurredGlobal(mcContent))) + { + request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(false).toString()); + logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); + } + else + { + request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString()); + logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); + } + } + + + /** * cleans up the monitoring session * cleanupMonitoringSession(HttpServletRequest request) Index: lams_tool_lamc/web/McErrorBox.jsp =================================================================== diff -u -r19a29403fc93cf19766bf830abc518250811010f -rff60206f498b016a282bba4630b2cc4e4324ab21 --- lams_tool_lamc/web/McErrorBox.jsp (.../McErrorBox.jsp) (revision 19a29403fc93cf19766bf830abc518250811010f) +++ lams_tool_lamc/web/McErrorBox.jsp (.../McErrorBox.jsp) (revision ff60206f498b016a282bba4630b2cc4e4324ab21) @@ -105,12 +105,6 @@ - - - - - - Index: lams_tool_lamc/web/monitoring/Edit.jsp =================================================================== diff -u -r65166da92a6f0f4ff73acb92b95672e237b25742 -rff60206f498b016a282bba4630b2cc4e4324ab21 --- lams_tool_lamc/web/monitoring/Edit.jsp (.../Edit.jsp) (revision 65166da92a6f0f4ff73acb92b95672e237b25742) +++ lams_tool_lamc/web/monitoring/Edit.jsp (.../Edit.jsp) (revision ff60206f498b016a282bba4630b2cc4e4324ab21) @@ -30,15 +30,15 @@ - + - +
Index: lams_tool_lamc/web/monitoring/MonitoringMaincontent.jsp =================================================================== diff -u -rcaa7d3d855db20f8bb1b534ce5dc75a1d28474ea -rff60206f498b016a282bba4630b2cc4e4324ab21 --- lams_tool_lamc/web/monitoring/MonitoringMaincontent.jsp (.../MonitoringMaincontent.jsp) (revision caa7d3d855db20f8bb1b534ce5dc75a1d28474ea) +++ lams_tool_lamc/web/monitoring/MonitoringMaincontent.jsp (.../MonitoringMaincontent.jsp) (revision ff60206f498b016a282bba4630b2cc4e4324ab21) @@ -151,7 +151,6 @@ <%-- chooses which tab to highlight --%> - Index: lams_tool_lamc/web/monitoring/Stats.jsp =================================================================== diff -u -r65166da92a6f0f4ff73acb92b95672e237b25742 -rff60206f498b016a282bba4630b2cc4e4324ab21 --- lams_tool_lamc/web/monitoring/Stats.jsp (.../Stats.jsp) (revision 65166da92a6f0f4ff73acb92b95672e237b25742) +++ lams_tool_lamc/web/monitoring/Stats.jsp (.../Stats.jsp) (revision ff60206f498b016a282bba4630b2cc4e4324ab21) @@ -31,8 +31,7 @@ -
- +
@@ -85,6 +84,5 @@
- Index: lams_tool_lamc/web/monitoring/Summary.jsp =================================================================== diff -u -r4a1085fc82d8e6273b9b800fb6852bcbd2c7baea -rff60206f498b016a282bba4630b2cc4e4324ab21 --- lams_tool_lamc/web/monitoring/Summary.jsp (.../Summary.jsp) (revision 4a1085fc82d8e6273b9b800fb6852bcbd2c7baea) +++ lams_tool_lamc/web/monitoring/Summary.jsp (.../Summary.jsp) (revision ff60206f498b016a282bba4630b2cc4e4324ab21) @@ -30,7 +30,7 @@ - +
@@ -40,7 +40,7 @@
- +