Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java =================================================================== diff -u -r2a3012f2276337d5f3b2e7eb2a30acc2d4af4176 -r6578a27494e05e43b274023060899ede28b17e59 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java (.../QaAppConstants.java) (revision 2a3012f2276337d5f3b2e7eb2a30acc2d4af4176) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java (.../QaAppConstants.java) (revision 6578a27494e05e43b274023060899ede28b17e59) @@ -253,6 +253,7 @@ public static final String RENDER_MONITORING_EDITACTIVITY = "renderMonitoringEditActivity"; public static final String NO_AVAILABLE_SESSIONS = "noAvailableSessions"; public static final String NO_TOOL_SESSIONS_AVAILABLE = "noToolSessionAvailable"; + public static final String ATTR_CONTENT = "content"; public static final String TIMEZONE = "timeZone"; public static final String TIMEZONE_ID = "timeZoneId"; Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java =================================================================== diff -u -r91f0740e75daa643981b757e49d1ed2ed7f0a528 -r6578a27494e05e43b274023060899ede28b17e59 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java (.../ExportServlet.java) (revision 91f0740e75daa643981b757e49d1ed2ed7f0a528) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java (.../ExportServlet.java) (revision 6578a27494e05e43b274023060899ede28b17e59) @@ -23,6 +23,8 @@ package org.lamsfoundation.lams.tool.qa.web; +import java.util.List; + import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -152,8 +154,6 @@ } public void teacher(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) { - logger.debug("starting teacher mode..."); - IQaService qaService = QaServiceProxy.getQaService(getServletContext()); if (toolContentID == null) { @@ -171,23 +171,21 @@ } QaMonitoringAction qaMonitoringAction = new QaMonitoringAction(); - logger.debug("start refreshSummaryData for teacher mode."); - GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(content); qaMonitoringAction.refreshSummaryData(request, content, qaService, true, false, null, null, generalLearnerFlowDTO, false, "All"); - generalLearnerFlowDTO = (GeneralLearnerFlowDTO) request.getAttribute(GENERAL_LEARNER_FLOW_DTO); request.getSession().setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); - request.getSession().setAttribute(PORTFOLIO_EXPORT_MODE, "teacher"); qaMonitoringAction.prepareReflectionData(request, content, qaService, null, true, "All"); request.setAttribute("currentMonitoredToolSession", "All"); - MonitoringUtil.generateGroupsSessionData(request, qaService, content, true); - - logger.debug("ending teacher mode: "); + + //generateGroupsSessionData + List listAllGroupsDTO = MonitoringUtil.buildGroupBasedSessionData(request, content, qaService); + request.setAttribute(LIST_ALL_GROUPS_DTO, listAllGroupsDTO); + request.getSession().setAttribute(LIST_ALL_GROUPS_DTO, listAllGroupsDTO); } } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/MonitoringUtil.java =================================================================== diff -u -r91f0740e75daa643981b757e49d1ed2ed7f0a528 -r6578a27494e05e43b274023060899ede28b17e59 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision 91f0740e75daa643981b757e49d1ed2ed7f0a528) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision 6578a27494e05e43b274023060899ede28b17e59) @@ -328,7 +328,7 @@ return false; } - public static void buildQaStatsDTO(HttpServletRequest request, IQaService qaService, QaContent qaContent) { + private static void buildQaStatsDTO(HttpServletRequest request, IQaService qaService, QaContent qaContent) { QaStatsDTO qaStatsDTO = new QaStatsDTO(); int countSessionComplete = 0; @@ -360,15 +360,19 @@ request.setAttribute(QA_STATS_DTO, qaStatsDTO); } - public static void generateGroupsSessionData(HttpServletRequest request, IQaService qaService, QaContent qaContent, - boolean forExport) { + public static void setUpMonitoring(HttpServletRequest request, IQaService qaService, QaContent qaContent) { + + // setting up the advanced summary for LDEV-1662 + request.setAttribute(QaAppConstants.ATTR_CONTENT, qaContent); + + boolean isGroupedActivity = qaService.isGroupedActivity(qaContent.getQaContentId()); + request.setAttribute("isGroupedActivity", isGroupedActivity); + buildQaStatsDTO(request, qaService, qaContent); + + //generateGroupsSessionData List listAllGroupsDTO = buildGroupBasedSessionData(request, qaContent, qaService); - request.setAttribute(LIST_ALL_GROUPS_DTO, listAllGroupsDTO); - - if (forExport) - request.getSession().setAttribute(LIST_ALL_GROUPS_DTO, listAllGroupsDTO); } public static List buildGroupBasedSessionData(HttpServletRequest request, QaContent qaContent, IQaService qaService) { Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java =================================================================== diff -u -r91f0740e75daa643981b757e49d1ed2ed7f0a528 -r6578a27494e05e43b274023060899ede28b17e59 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java (.../QaMonitoringAction.java) (revision 91f0740e75daa643981b757e49d1ed2ed7f0a528) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java (.../QaMonitoringAction.java) (revision 6578a27494e05e43b274023060899ede28b17e59) @@ -236,8 +236,7 @@ request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO); QaMonitoringAction.logger.debug("ending initStatsContent..."); - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); } @@ -351,9 +350,7 @@ request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO); - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); - - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); } @@ -435,7 +432,6 @@ EditActivityDTO editActivityDTO = new EditActivityDTO(); boolean isContentInUse = qaContent.isContentLocked(); - QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } @@ -469,10 +465,8 @@ } /* ... till here */ - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); - /* note that we are casting monitoring form subclass into Authoring form */ QaMonitoringAction.logger .debug("watch here: note that we are casting monitoring form subclass into Authoring form"); @@ -568,8 +562,6 @@ /* find out if there are any reflection entries, from here */ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent); - QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist); - if (notebookEntriesExist) { request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); } else { @@ -587,22 +579,9 @@ generalMonitoringDTO.setDeletedAttachmentList(new ArrayList()); /* ...till here */ - // setting up the advanced summary for LDEV-1662 - request.setAttribute("showOtherAnswers", qaContent.isShowOtherAnswers()); - request.setAttribute("usernameVisible", qaContent.isUsernameVisible()); - request.setAttribute("allowRateAnswers", qaContent.isAllowRateAnswers()); - request.setAttribute("questionsSequenced", qaContent.isQuestionsSequenced()); - request.setAttribute("lockWhenFinished", qaContent.isLockWhenFinished()); - request.setAttribute("reflect", qaContent.isReflect()); - request.setAttribute("reflectionSubject", qaContent.getReflectionSubject()); - - request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO); - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); - - QaMonitoringAction.logger.debug("end initSummaryContent..."); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); } public ActionForward editActivityQuestions(ActionMapping mapping, ActionForm form, HttpServletRequest request, @@ -715,8 +694,7 @@ } /* ... till here */ - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); return mapping.findForward(QaAppConstants.LOAD_MONITORING); } @@ -725,10 +703,6 @@ * gets called when the user selects a group from dropdown box in the * summary tab * - * submitSession(ActionMapping mapping, ActionForm form, HttpServletRequest - * request, HttpServletResponse response) throws IOException, - * ServletException - * * @param mapping * @param form * @param request @@ -814,11 +788,7 @@ } /* ... till here */ - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); - - boolean isGroupedActivity = qaService.isGroupedActivity(new Long(strToolContentID)); - request.setAttribute("isGroupedActivity", isGroupedActivity); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); return mapping.findForward(QaAppConstants.LOAD_MONITORING); } @@ -923,8 +893,7 @@ } /* ... till here */ - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); return mapping.findForward(QaAppConstants.LOAD_MONITORING); } @@ -1013,8 +982,7 @@ } /* ... till here */ - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); request.setAttribute("currentMonitoredToolSession", "All"); return mapping.findForward(QaAppConstants.LOAD_MONITORING); @@ -1131,8 +1099,7 @@ } /* ... till here */ - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); return mapping.findForward(QaAppConstants.LOAD_MONITORING); } @@ -1228,8 +1195,7 @@ } /* ... till here */ - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); request.setAttribute("currentMonitoredToolSession", "All"); return mapping.findForward(QaAppConstants.LOAD_MONITORING); @@ -1326,8 +1292,7 @@ } /* ... till here */ - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); return mapping.findForward(QaAppConstants.LOAD_MONITORING); } @@ -1390,8 +1355,7 @@ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId); - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); } /** @@ -1525,8 +1489,7 @@ request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO); - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); } /** @@ -1601,8 +1564,7 @@ } /* ... till here */ - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); } public ActionForward showResponse(ActionMapping mapping, ActionForm form, HttpServletRequest request, @@ -1695,8 +1657,7 @@ } /* ... till here */ - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); QaMonitoringAction.logger.debug("submitting session to refresh the data from the database: "); return mapping.findForward(QaAppConstants.LOAD_MONITORING); @@ -1783,8 +1744,7 @@ } /* ... till here */ - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); request.setAttribute("currentMonitoredToolSession", "All"); QaMonitoringAction.logger.debug("submitting session to refresh the data from the database: "); @@ -1873,8 +1833,7 @@ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString()); } - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); QaMonitoringAction.logger.debug("submitting session to refresh the data from the database: "); return mapping.findForward(QaAppConstants.LOAD_MONITORING); @@ -1959,8 +1918,7 @@ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString()); } - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); request.setAttribute("currentMonitoredToolSession", "All"); QaMonitoringAction.logger.debug("submitting session to refresh the data from the database: "); @@ -2049,8 +2007,7 @@ } /* ... till here */ - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); return mapping.findForward(QaAppConstants.LEARNER_NOTEBOOK); } @@ -2257,8 +2214,7 @@ } /* ... till here */ - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); return mapping.findForward(QaAppConstants.LOAD_MONITORING); } @@ -2486,8 +2442,7 @@ } /* ... till here */ - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); return mapping.findForward(QaAppConstants.LOAD_MONITORING); } @@ -2657,8 +2612,7 @@ } /* ... till here */ - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); return mapping.findForward(QaAppConstants.LOAD_MONITORING); } @@ -2769,10 +2723,8 @@ } /* ... till here */ - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); - QaMonitoringAction.logger.debug("fwd ing to newQuestionBox: "); return mapping.findForward("newQuestionBox"); } @@ -2918,10 +2870,8 @@ } /* ... till here */ - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); - QaMonitoringAction.logger.debug("fwd ing to editQuestionBox: "); return mapping.findForward("editQuestionBox"); } @@ -3089,8 +3039,7 @@ } /* ... till here */ - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); return mapping.findForward(QaAppConstants.LOAD_MONITORING); } @@ -3237,8 +3186,7 @@ } /* ... till here */ - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); return mapping.findForward(QaAppConstants.LOAD_MONITORING); @@ -3386,8 +3334,7 @@ } /* ... till here */ - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); return mapping.findForward(QaAppConstants.LOAD_MONITORING); } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java =================================================================== diff -u -r91f0740e75daa643981b757e49d1ed2ed7f0a528 -r6578a27494e05e43b274023060899ede28b17e59 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java (.../QaMonitoringStarterAction.java) (revision 91f0740e75daa643981b757e49d1ed2ed7f0a528) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java (.../QaMonitoringStarterAction.java) (revision 6578a27494e05e43b274023060899ede28b17e59) @@ -118,17 +118,11 @@ generalMonitoringDTO.setContentFolderID(contentFolderID); QaMonitoringAction qaMonitoringAction = new QaMonitoringAction(); - logger.debug("calling initSummaryContent."); qaMonitoringAction.initSummaryContent(mapping, form, request, response); - logger.debug("calling initInstructionsContent."); qaMonitoringAction.initInstructionsContent(mapping, form, request, response); - logger.debug("calling initStatsContent."); qaMonitoringAction.initStatsContent(mapping, form, request, response, generalMonitoringDTO); - String toolContentID = qaMonitoringForm.getToolContentID(); - logger.debug("toolContentID: " + toolContentID); - QaContent qaContent = qaService.getQa(new Long(toolContentID).longValue()); /*true means there is at least 1 response*/ @@ -217,15 +211,9 @@ request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString()); } - MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); - - boolean isGroupedActivity = qaService.isGroupedActivity(new Long(toolContentID)); - request.setAttribute("isGroupedActivity", isGroupedActivity); - request.setAttribute("currentMonitoredToolSession", "All"); - MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); + MonitoringUtil.setUpMonitoring(request, qaService, qaContent); - logger.debug("fwding to : " + LOAD_MONITORING); return (mapping.findForward(LOAD_MONITORING)); } @@ -243,33 +231,22 @@ public boolean initialiseMonitoringData(ActionMapping mapping, QaMonitoringForm qaMonitoringForm, HttpServletRequest request, HttpServletResponse response, IQaService qaService, GeneralMonitoringDTO generalMonitoringDTO) { - logger.debug("start initializing monitoring data..."); generalMonitoringDTO.setEditResponse(new Boolean(false).toString()); generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); String toolContentID = qaMonitoringForm.getToolContentID(); - logger.debug("toolContentID:" + toolContentID); - QaContent qaContent = qaService.getQa(new Long(toolContentID).longValue()); - if (qaContent == null) { QaUtils.cleanUpSessionAbsolute(request); return false; } QaMonitoringAction qaMonitoringAction = new QaMonitoringAction(); - logger.debug("refreshing summary data..."); - GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent); - - qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, false, "All"); - - logger.debug("refreshing stats data..."); qaMonitoringAction.refreshStatsData(request, qaMonitoringForm, qaService, generalMonitoringDTO); - logger.debug("end initialising monitoring data..."); return true; } Index: lams_tool_laqa/web/monitoring/SummaryContent.jsp =================================================================== diff -u -r48f807cbe83245d928d63f63aeed0d7821132b32 -r6578a27494e05e43b274023060899ede28b17e59 --- lams_tool_laqa/web/monitoring/SummaryContent.jsp (.../SummaryContent.jsp) (revision 48f807cbe83245d928d63f63aeed0d7821132b32) +++ lams_tool_laqa/web/monitoring/SummaryContent.jsp (.../SummaryContent.jsp) (revision 6578a27494e05e43b274023060899ede28b17e59) @@ -21,14 +21,6 @@ <%@ include file="/common/taglibs.jsp"%> - -