Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/GeneralLearnerFlowDTO.java =================================================================== diff -u -r3733f9f2d907c3e4b498ee5890b36d93a64814ce -r97ebe40dad2731256147d74073b541245be53871 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/GeneralLearnerFlowDTO.java (.../GeneralLearnerFlowDTO.java) (revision 3733f9f2d907c3e4b498ee5890b36d93a64814ce) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/GeneralLearnerFlowDTO.java (.../GeneralLearnerFlowDTO.java) (revision 97ebe40dad2731256147d74073b541245be53871) @@ -22,6 +22,7 @@ /* $$Id$$ */ package org.lamsfoundation.lams.tool.qa; +import java.util.List; import java.util.Map; import org.apache.commons.lang.builder.ToStringBuilder; @@ -65,13 +66,22 @@ protected String userNameVisible; + protected String requestLearningReport; + + protected String requestLearningReportProgress; + + protected String requestLearningReportViewOnly; + protected Map mapAnswers; protected Map mapQuestions; protected Map mapQuestionContentLearner; + protected List listMonitoredAnswersContainerDTO; + + /** * @return Returns the currentAnswer. */ @@ -184,6 +194,7 @@ return 0; } + public String toString() { return new ToStringBuilder(this) .append("activityOffline: ", activityOffline) @@ -194,6 +205,15 @@ .append("toolSessionID: ", toolSessionID) .append("currentQuestionIndex: ", currentQuestionIndex) .append("questionListingMode: ", questionListingMode) + .append("reportTitleLearner: ", reportTitleLearner) + .append("userNameVisible: ", userNameVisible) + .append("requestLearningReport: ", requestLearningReport) + .append("requestLearningReportProgress: ", requestLearningReportProgress) + .append("requestLearningReportViewOnly: ", requestLearningReportViewOnly) + .append("mapAnswers: ", mapAnswers) + .append("mapQuestions: ", mapQuestions) + .append("mapQuestionContentLearner: ", mapQuestionContentLearner) + .append("listMonitoredAnswersContainerDTO: ", listMonitoredAnswersContainerDTO) .toString(); } @@ -319,4 +339,58 @@ public void setHttpSessionID(String httpSessionID) { this.httpSessionID = httpSessionID; } + /** + * @return Returns the requestLearningReport. + */ + public String getRequestLearningReport() { + return requestLearningReport; + } + /** + * @param requestLearningReport The requestLearningReport to set. + */ + public void setRequestLearningReport(String requestLearningReport) { + this.requestLearningReport = requestLearningReport; + } + /** + * @return Returns the requestLearningReportProgress. + */ + public String getRequestLearningReportProgress() { + return requestLearningReportProgress; + } + /** + * @param requestLearningReportProgress The requestLearningReportProgress to set. + */ + public void setRequestLearningReportProgress( + String requestLearningReportProgress) { + this.requestLearningReportProgress = requestLearningReportProgress; + } + + /** + * @return Returns the requestLearningReportViewOnly. + */ + public String getRequestLearningReportViewOnly() { + return requestLearningReportViewOnly; + } + /** + * @param requestLearningReportViewOnly The requestLearningReportViewOnly to set. + */ + public void setRequestLearningReportViewOnly( + String requestLearningReportViewOnly) { + this.requestLearningReportViewOnly = requestLearningReportViewOnly; + } + + /** + * @return Returns the listMonitoredAnswersContainerDTO. + */ + public List getListMonitoredAnswersContainerDTO() { + return listMonitoredAnswersContainerDTO; + } + /** + * @param listMonitoredAnswersContainerDTO The listMonitoredAnswersContainerDTO to set. + */ + public void setListMonitoredAnswersContainerDTO( + List listMonitoredAnswersContainerDTO) { + this.listMonitoredAnswersContainerDTO = listMonitoredAnswersContainerDTO; + } + } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java =================================================================== diff -u -r3733f9f2d907c3e4b498ee5890b36d93a64814ce -r97ebe40dad2731256147d74073b541245be53871 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java (.../QaAppConstants.java) (revision 3733f9f2d907c3e4b498ee5890b36d93a64814ce) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java (.../QaAppConstants.java) (revision 97ebe40dad2731256147d74073b541245be53871) @@ -47,6 +47,7 @@ public static final String EXPORT_PORTFOLIO ="exportPortfolio"; public static final String VIEW_ALL_RESULTS ="viewAllResults"; public static final String INDIVIDUAL_LEARNER_RESULTS ="individualLearnerResults"; + public static final String MAP_ALL_RESULTS_KEY ="mapAllResultsKey"; public static final String LOAD_MONITORING ="refreshMonitoring"; public static final String LOAD_VIEW_ONLY ="loadViewOnly"; public static final String EDIT_RESPONSE ="editResponse"; Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java =================================================================== diff -u -r9393c098e5dfd603e2d37347cd1e531a25aa424a -r97ebe40dad2731256147d74073b541245be53871 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java (.../QaUtils.java) (revision 9393c098e5dfd603e2d37347cd1e531a25aa424a) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java (.../QaUtils.java) (revision 97ebe40dad2731256147d74073b541245be53871) @@ -630,7 +630,26 @@ } } + + public static String getCurrentLearnerID() + { + String userID = ""; + HttpSession ss = SessionManager.getSession(); + logger.debug("ss: " + ss); + + if (ss != null) + { + UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + if ((user != null) && (user.getUserID() != null)) + { + userID = user.getUserID().toString(); + logger.debug("retrieved userId: " + userID); + } + } + return userID; + } + public static UserDTO getToolUser() { /*obtain user object from the session*/ Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java =================================================================== diff -u -r7d183ae944a200f343d6be1cdac2fa3f8b2815ef -r97ebe40dad2731256147d74073b541245be53871 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java (.../ExportServlet.java) (revision 7d183ae944a200f343d6be1cdac2fa3f8b2815ef) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java (.../ExportServlet.java) (revision 97ebe40dad2731256147d74073b541245be53871) @@ -112,7 +112,7 @@ logger.debug("calling learning mode toolSessionID:" + toolSessionID + " userID: " + userID ); QaMonitoringAction qaMonitoringAction= new QaMonitoringAction(); logger.debug("start refreshSummaryData for learner mode."); - qaMonitoringAction.refreshSummaryData(request, content, qaService, true, true, toolSessionID.toString(), userID.toString()); + qaMonitoringAction.refreshSummaryData(request, content, qaService, true, true, toolSessionID.toString(), userID.toString(), null); logger.debug("end refreshSummaryData for learner mode."); logger.debug("ending learner mode: "); } @@ -143,7 +143,7 @@ QaMonitoringAction qaMonitoringAction= new QaMonitoringAction(); logger.debug("start refreshSummaryData for teacher mode."); - qaMonitoringAction.refreshSummaryData(request, content, qaService, true, false, null, null); + qaMonitoringAction.refreshSummaryData(request, content, qaService, true, false, null, null, null); logger.debug("end refreshSummaryData for teacher mode."); logger.debug("teacher uses content id: " + content.getQaContentId()); logger.debug("ending teacher mode: "); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/LearningUtil.java =================================================================== diff -u -r3733f9f2d907c3e4b498ee5890b36d93a64814ce -r97ebe40dad2731256147d74073b541245be53871 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/LearningUtil.java (.../LearningUtil.java) (revision 3733f9f2d907c3e4b498ee5890b36d93a64814ce) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/LearningUtil.java (.../LearningUtil.java) (revision 97ebe40dad2731256147d74073b541245be53871) @@ -82,14 +82,14 @@ generalLearnerFlowDTO.setActivityTitle(qaContent.getTitle()); generalLearnerFlowDTO.setActivityInstructions(qaContent.getInstructions()); generalLearnerFlowDTO.setReportTitleLearner(qaContent.getReportTitle()); - //generalLearnerFlowDTO.setLearnerProgress(new Boolean(false).toString()); if (qaContent.isQuestionsSequenced()) generalLearnerFlowDTO.setQuestionListingMode(QUESTION_LISTING_MODE_SEQUENTIAL); else generalLearnerFlowDTO.setQuestionListingMode(QUESTION_LISTING_MODE_COMBINED); - + + generalLearnerFlowDTO.setUserNameVisible(new Boolean(qaContent.isUsernameVisible()).toString()); generalLearnerFlowDTO.setActivityOffline(new Boolean(qaContent.isRunOffline()).toString()); logger.debug("continue buildGeneralLearnerFlowDTO: " + qaContent); @@ -126,9 +126,13 @@ * return void * */ - protected void createUsersAndResponses(Map mapAnswers, HttpServletRequest request, IQaService qaService) + protected void createUsersAndResponses(Map mapAnswers, HttpServletRequest request, IQaService qaService, + Long toolContentID, Long toolSessionID) { logger.debug("createUsers-retrieving qaService: " + qaService); + logger.debug("mapAnswers: " + mapAnswers); + logger.debug("toolContentID: " + toolContentID); + logger.debug("toolSessionID: " + toolSessionID); HttpSession ss = SessionManager.getSession(); /* get back login user DTO */ @@ -144,22 +148,12 @@ Long userId=new Long(toolUser.getUserID().longValue()); /* - * retrive contentId from the http session - */ - logger.debug("createUsers-attempt retrieving toolContentId: " + request.getSession().getAttribute(AttributeNames.PARAM_TOOL_CONTENT_ID)); - Long toolContentId=(Long)request.getSession().getAttribute(AttributeNames.PARAM_TOOL_CONTENT_ID); - /* * obtain QaContent to be used in creating QaQueUsr */ - QaContent qaContent=qaService.retrieveQa(toolContentId.longValue()); + QaContent qaContent=qaService.retrieveQa(toolContentID.longValue()); logger.debug("createUsers-retrieving qaContent: " + qaContent); - /* - * get QaSession to be used in creating QaQueUsr - */ - Long toolSessionId=(Long)request.getSession().getAttribute(AttributeNames.PARAM_TOOL_SESSION_ID); - logger.debug("createUsers-retrieving toolSessionId: " + toolSessionId); - QaSession qaSession = qaService.retrieveQaSessionOrNullById(toolSessionId.longValue()); + QaSession qaSession = qaService.retrieveQaSessionOrNullById(toolSessionID.longValue()); logger.debug("createUsers-retrieving qaSession: " + qaSession); Iterator contentIterator=qaContent.getQaQueContents().iterator(); @@ -181,7 +175,7 @@ if ((qaQueUsr != null) && (qaQueUsrLocal == null)) { - qaQueUsr=createUser(request); + qaQueUsr=createUser(request, toolSessionID, qaService); logger.debug("created qaQueUsr: " + qaQueUsr); } else @@ -213,8 +207,7 @@ logger.debug("iterationg question-answers: displayOrder: " + displayOrder + " question: " + question + " answer: " + answer); - String timezoneId=(String)request.getSession().getAttribute(TIMEZONE_ID); - if (timezoneId == null) timezoneId=""; + String timezoneId=""; List attempts=qaService.getAttemptsForUserAndQuestionContent(qaQueUsr.getUid(), qaQueContent.getUid()); logger.debug("attempts:" + attempts); @@ -255,16 +248,16 @@ } - public static QaQueUsr createUser(HttpServletRequest request) + public static QaQueUsr createUser(HttpServletRequest request, Long toolSessionID, IQaService qaService) { - logger.debug("creating a new user in the tool db"); - IQaService qaService =QaUtils.getToolService(request); + logger.debug("creating a new user in the tool db, toolSessionID: " + toolSessionID); + logger.debug("qaService: " + qaService); + Long queUsrId=QaUtils.getUserId(); String username=QaUtils.getUserName(); String fullname=QaUtils.getUserFullName(); - Long toolSessionId=(Long) request.getSession().getAttribute(TOOL_SESSION_ID); - QaSession qaSession=qaService.retrieveQaSessionOrNullById(toolSessionId.longValue()); + QaSession qaSession=qaService.retrieveQaSessionOrNullById(toolSessionID.longValue()); logger.debug("qaSession: " + qaSession); QaQueUsr qaQueUsr= new QaQueUsr(queUsrId, @@ -297,7 +290,6 @@ else userFeedback= "End of the questions."; - //request.getSession().setAttribute(USER_FEEDBACK, userFeedback); return userFeedback; } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/MonitoringUtil.java =================================================================== diff -u -rc277bb1c30c1283b5f66c6f651855c51a5f87bc5 -r97ebe40dad2731256147d74073b541245be53871 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision c277bb1c30c1283b5f66c6f651855c51a5f87bc5) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision 97ebe40dad2731256147d74073b541245be53871) @@ -29,6 +29,7 @@ import java.util.TreeMap; import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; import org.apache.log4j.Logger; import org.lamsfoundation.lams.tool.qa.QaAppConstants; @@ -42,6 +43,9 @@ import org.lamsfoundation.lams.tool.qa.QaUsrResp; import org.lamsfoundation.lams.tool.qa.QaUtils; import org.lamsfoundation.lams.tool.qa.service.IQaService; +import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.web.session.SessionManager; +import org.lamsfoundation.lams.web.util.AttributeNames; /** * @@ -331,8 +335,8 @@ * @param listUsers * @return List */ - public static Map populateSessionUsersAttempts(HttpServletRequest request,IQaService qaService, Long sessionId, List listUsers, String questionUid, - boolean isUserNamesVisible, boolean isLearnerRequest, String userId) + public static Map populateSessionUsersAttempts(HttpServletRequest request,IQaService qaService, Long sessionId, + List listUsers, String questionUid, boolean isUserNamesVisible, boolean isLearnerRequest, String userId) { logger.debug("isUserNamesVisible: " + isUserNamesVisible); logger.debug("isLearnerRequest: " + isLearnerRequest); @@ -392,7 +396,8 @@ { logger.debug("just populating data normally just like monitoring summary, except that the data is ony for a specific session" ); logger.debug("isUserNamesVisible true, isLearnerRequest true" ); - String userID= (String)request.getSession().getAttribute(USER_ID); + //String userID= (String)request.getSession().getAttribute(USER_ID); + String userID = QaUtils.getCurrentLearnerID(); logger.debug("userID: " + userID); QaQueUsr qaQueUsr=qaService.getQaQueUsrById(new Long(userID).longValue()); logger.debug("the current user qaQueUsr " + qaQueUsr + " and username: " + qaQueUsr.getUsername()); @@ -437,7 +442,8 @@ logger.debug("populating data normally exception are for a specific session and other user names are not visible."); logger.debug("isUserNamesVisible false, isLearnerRequest true" ); logger.debug("getting only current user's data" ); - String userID= (String)request.getSession().getAttribute(USER_ID); + //String userID= (String)request.getSession().getAttribute(USER_ID); + String userID = QaUtils.getCurrentLearnerID(); logger.debug("userID: " + userID); while (itUsers.hasNext()) Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java =================================================================== diff -u -r135102e895f31529ad0156d0e17c81b2bf430ea0 -r97ebe40dad2731256147d74073b541245be53871 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java (.../QaLearningAction.java) (revision 135102e895f31529ad0156d0e17c81b2bf430ea0) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java (.../QaLearningAction.java) (revision 97ebe40dad2731256147d74073b541245be53871) @@ -87,7 +87,6 @@ import java.io.IOException; import java.util.Date; -import java.util.Iterator; import java.util.Map; import java.util.TreeMap; @@ -105,7 +104,6 @@ import org.lamsfoundation.lams.tool.qa.QaAppConstants; import org.lamsfoundation.lams.tool.qa.QaComparator; import org.lamsfoundation.lams.tool.qa.QaContent; -import org.lamsfoundation.lams.tool.qa.QaQueContent; import org.lamsfoundation.lams.tool.qa.QaSession; import org.lamsfoundation.lams.tool.qa.service.IQaService; import org.lamsfoundation.lams.tool.qa.service.QaServiceProxy; @@ -173,9 +171,6 @@ LearningUtil.saveFormRequestData(request, qaLearningForm); - String httpSessionID=qaLearningForm.getHttpSessionID(); - logger.debug("httpSessionID: " + httpSessionID); - String totalQuestionCount=generalLearnerFlowDTO.getTotalQuestionCount().toString(); logger.debug("totalQuestionCount: " + totalQuestionCount); int intTotalQuestionCount= new Integer(totalQuestionCount).intValue(); @@ -207,14 +202,22 @@ else { logger.debug("populating mapAnswers..."); - mapAnswers=populateAnswersMap(qaLearningForm, request, generalLearnerFlowDTO, true); + mapAnswers=populateAnswersMap(qaLearningForm, request, generalLearnerFlowDTO, true, true); logger.debug("mapAnswers: " + mapAnswers); } logger.debug("final mapAnswers for the sequential mode:" + mapAnswers); } logger.debug("using mapAnswers:" + mapAnswers); generalLearnerFlowDTO.setMapAnswers(mapAnswers); + + /*mapAnswers will be used in the viewAllAnswers screen*/ + SessionMap sessionMap = new SessionMap(); + sessionMap.put(MAP_ALL_RESULTS_KEY, mapAnswers); + request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); + qaLearningForm.setHttpSessionID(sessionMap.getSessionID()); + generalLearnerFlowDTO.setHttpSessionID(sessionMap.getSessionID()); + request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); logger.debug("fwd'ing to." + INDIVIDUAL_LEARNER_RESULTS); @@ -246,54 +249,65 @@ { logger.debug("dispatching viewAllResults..."); QaLearningForm qaLearningForm = (QaLearningForm) form; - - IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); + IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); logger.debug("qaService: " + qaService); - if (qaService == null) - { - logger.debug("will retrieve qaService"); - qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - logger.debug("retrieving qaService from session: " + qaService); - } - Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentId: " + toolContentId); - - QaContent qaContent=qaService.loadQa(toolContentId.longValue()); - logger.debug("existing qaContent:" + qaContent); - - Long toolSessionId=(Long)request.getSession().getAttribute(AttributeNames.PARAM_TOOL_SESSION_ID); - QaSession qaSession=qaService.retrieveQaSessionOrNullById(toolSessionId.longValue()); + String toolSessionID=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); + logger.debug("toolSessionID: " + toolSessionID); + qaLearningForm.setToolSessionID(toolSessionID); + + QaSession qaSession=qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue()); logger.debug("retrieving qaSession: " + qaSession); - + + String toolContentID=qaSession.getQaContent().getQaContentId().toString(); + logger.debug("toolContentID: " + toolContentID); + + QaContent qaContent=qaSession.getQaContent(); + logger.debug("using qaContent: " + qaContent); + + GeneralLearnerFlowDTO generalLearnerFlowDTO= LearningUtil.buildGeneralLearnerFlowDTO(qaContent); + logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); + + LearningUtil.saveFormRequestData(request, qaLearningForm); - Boolean isUserNamesVisibleBoolean=(Boolean)request.getSession().getAttribute(IS_USERNAME_VISIBLE); - boolean isUserNamesVisible=isUserNamesVisibleBoolean.booleanValue(); + String isUserNamesVisibleBoolean=generalLearnerFlowDTO.getUserNameVisible(); + boolean isUserNamesVisible=new Boolean(isUserNamesVisibleBoolean).booleanValue(); logger.debug("isUserNamesVisible: " + isUserNamesVisible); - - Map mapAnswers=(Map)request.getSession().getAttribute(MAP_ANSWERS); - logger.debug("mapAnswers: " + mapAnswers); - + String httpSessionID=qaLearningForm.getHttpSessionID(); + logger.debug("httpSessionID: " + httpSessionID); + + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); + logger.debug("sessionMap: " + sessionMap); + + Map mapAnswers=(Map)sessionMap.get(MAP_ALL_RESULTS_KEY); + logger.debug("mapAnswers retrieved: " + mapAnswers); + /*recreate the users and responses*/ LearningUtil learningUtil= new LearningUtil(); - learningUtil.createUsersAndResponses(mapAnswers, request, qaService); + learningUtil.createUsersAndResponses(mapAnswers, request, qaService, new Long(toolContentID), new Long(toolSessionID)); qaLearningForm.resetUserActions(); qaLearningForm.setSubmitAnswersContent(null); - learningUtil.setContentInUse(toolContentId.longValue(), qaService); + learningUtil.setContentInUse(new Long(toolContentID).longValue(), qaService); logger.debug("content has been set in use"); logger.debug("start generating learning report..."); - Long toolContentID=(Long) request.getSession().getAttribute(AttributeNames.PARAM_TOOL_CONTENT_ID); - logger.debug("toolContentID: " + toolContentID); - + logger.debug("toolContentID: " + toolContentID); + + QaMonitoringAction qaMonitoringAction= new QaMonitoringAction(); - qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, isUserNamesVisible, true, toolSessionId.toString(), null); + qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, isUserNamesVisible, true, toolSessionID, null, generalLearnerFlowDTO); - request.getSession().setAttribute(REQUEST_LEARNING_REPORT, new Boolean(true).toString()); - request.getSession().setAttribute(REQUEST_LEARNING_REPORT_PROGRESS, new Boolean(false).toString()); + generalLearnerFlowDTO.setRequestLearningReport(new Boolean(true).toString()); + generalLearnerFlowDTO.setRequestLearningReportProgress(new Boolean(false).toString()); + + request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); + + logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO); logger.debug("fwd'ing to: " + INDIVIDUAL_LEARNER_REPORT); + + logger.debug("remove map holding MAP_ALL_RESULTS_KEY, httpSessionID: " + httpSessionID); return (mapping.findForward(INDIVIDUAL_LEARNER_REPORT)); } @@ -340,14 +354,17 @@ LearningUtil.saveFormRequestData(request, qaLearningForm); - populateAnswersMap(qaLearningForm, request, generalLearnerFlowDTO, true); + populateAnswersMap(qaLearningForm, request, generalLearnerFlowDTO, true, false); return (mapping.findForward(LOAD_LEARNER)); } - public Map populateAnswersMap(ActionForm form, HttpServletRequest request, GeneralLearnerFlowDTO generalLearnerFlowDTO, boolean getNextQuestion) + public Map populateAnswersMap(ActionForm form, HttpServletRequest request, GeneralLearnerFlowDTO generalLearnerFlowDTO, + boolean getNextQuestion, boolean learnerDone) { + logger.debug("learnerDone: " + learnerDone); + logger.debug("getNextQuestion: " + getNextQuestion); QaLearningForm qaLearningForm = (QaLearningForm) form; @@ -415,7 +432,8 @@ qaLearningForm.setHttpSessionID(sessionMap.getSessionID()); generalLearnerFlowDTO.setHttpSessionID(sessionMap.getSessionID()); - request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); + request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); + return mapSequentialAnswers; } @@ -459,9 +477,8 @@ GeneralLearnerFlowDTO generalLearnerFlowDTO= LearningUtil.buildGeneralLearnerFlowDTO(qaContent); logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); - LearningUtil.saveFormRequestData(request, qaLearningForm); - populateAnswersMap(qaLearningForm, request, generalLearnerFlowDTO, false); + populateAnswersMap(qaLearningForm, request, generalLearnerFlowDTO, false, false); return (mapping.findForward(LOAD_LEARNER)); } @@ -478,29 +495,55 @@ * @throws IOException * @throws ToolException */ - public void endLearning(HttpServletRequest request, IQaService qaService, HttpServletResponse response) - throws IOException, ToolException - { - logger.debug("dispatching endLearning..."); + public ActionForward endLearning(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException, ToolException + { + logger.debug("dispatching endLearning..."); + QaLearningForm qaLearningForm = (QaLearningForm) form; + + + IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); + logger.debug("qaService: " + qaService); + + String toolSessionID=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); + logger.debug("toolSessionID: " + toolSessionID); + qaLearningForm.setToolSessionID(toolSessionID); + + QaSession qaSession=qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue()); + logger.debug("retrieving qaSession: " + qaSession); + + String toolContentID=qaSession.getQaContent().getQaContentId().toString(); + logger.debug("toolContentID: " + toolContentID); + + QaContent qaContent=qaSession.getQaContent(); + logger.debug("using qaContent: " + qaContent); + + LearningUtil.saveFormRequestData(request, qaLearningForm); + /* * The learner is done with the tool session. The tool needs to clean-up. */ - Long toolSessionId=(Long)request.getSession().getAttribute(AttributeNames.PARAM_TOOL_SESSION_ID); HttpSession ss = SessionManager.getSession(); /*get back login user DTO*/ UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); logger.debug("leaving the tool: " + - "leaveToolSession() with toolSessionId: " + toolSessionId + " and user: " + user); + "leaveToolSession() with toolSessionId: " + toolSessionID + " and user: " + user); logger.debug("set status to COMPLETE"); - QaSession qaSession = qaService.retrieveQaSessionOrNullById(toolSessionId.longValue()); + logger.debug("qaSession: " + qaSession); qaSession.setSession_end_date(new Date(System.currentTimeMillis())); qaSession.setSession_status(COMPLETED); qaService.updateQaSession(qaSession); logger.debug("tool session has been marked COMPLETE: " + qaSession); - - String nextActivityUrl = qaService.leaveToolSession(toolSessionId, new Long(user.getUserID().longValue())); + + String httpSessionID=qaLearningForm.getHttpSessionID(); + logger.debug("removing map with httpSessionID: " + httpSessionID); + request.getSession().removeAttribute(httpSessionID); + + String nextActivityUrl = qaService.leaveToolSession(new Long(toolSessionID), new Long(user.getUserID().longValue())); response.sendRedirect(nextActivityUrl); + + return null; } } \ No newline at end of file Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningForm.java =================================================================== diff -u -r3733f9f2d907c3e4b498ee5890b36d93a64814ce -r97ebe40dad2731256147d74073b541245be53871 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningForm.java (.../QaLearningForm.java) (revision 3733f9f2d907c3e4b498ee5890b36d93a64814ce) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningForm.java (.../QaLearningForm.java) (revision 97ebe40dad2731256147d74073b541245be53871) @@ -49,7 +49,11 @@ protected String viewAllResults; protected String responseId; + protected String requestLearningReport; + protected String requestLearningReportProgress; + protected String requestLearningReportViewOnly; + /** * reset user actions in learning mode * @param qaAuthoringForm @@ -249,4 +253,45 @@ public void setTotalQuestionCount(String totalQuestionCount) { this.totalQuestionCount = totalQuestionCount; } + + /** + * @return Returns the requestLearningReport. + */ + public String getRequestLearningReport() { + return requestLearningReport; + } + /** + * @param requestLearningReport The requestLearningReport to set. + */ + public void setRequestLearningReport(String requestLearningReport) { + this.requestLearningReport = requestLearningReport; + } + /** + * @return Returns the requestLearningReportProgress. + */ + public String getRequestLearningReportProgress() { + return requestLearningReportProgress; + } + /** + * @param requestLearningReportProgress The requestLearningReportProgress to set. + */ + public void setRequestLearningReportProgress( + String requestLearningReportProgress) { + this.requestLearningReportProgress = requestLearningReportProgress; + } + + /** + * @return Returns the requestLearningReportViewOnly. + */ + public String getRequestLearningReportViewOnly() { + return requestLearningReportViewOnly; + } + /** + * @param requestLearningReportViewOnly The requestLearningReportViewOnly to set. + */ + public void setRequestLearningReportViewOnly( + String requestLearningReportViewOnly) { + this.requestLearningReportViewOnly = requestLearningReportViewOnly; + } + } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java =================================================================== diff -u -r3733f9f2d907c3e4b498ee5890b36d93a64814ce -r97ebe40dad2731256147d74073b541245be53871 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java (.../QaLearningStarterAction.java) (revision 3733f9f2d907c3e4b498ee5890b36d93a64814ce) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java (.../QaLearningStarterAction.java) (revision 97ebe40dad2731256147d74073b541245be53871) @@ -177,9 +177,6 @@ GeneralLearnerFlowDTO generalLearnerFlowDTO= new GeneralLearnerFlowDTO(); generalLearnerFlowDTO.setCurrentQuestionIndex(new Integer(1)); - //request.getSession().setAttribute(CURRENT_QUESTION_INDEX, "1"); - - //request.getSession().setAttribute(CURRENT_ANSWER, ""); generalLearnerFlowDTO.setCurrentAnswer(""); @@ -190,21 +187,6 @@ qaLearningForm.setHttpSessionID(sessionMap.getSessionID()); generalLearnerFlowDTO.setHttpSessionID(sessionMap.getSessionID()); - - /*initialize available question display modes in the session */ - //request.getSession().setAttribute(QUESTION_LISTING_MODE_SEQUENTIAL,QUESTION_LISTING_MODE_SEQUENTIAL); - //request.getSession().setAttribute(QUESTION_LISTING_MODE_COMBINED, QUESTION_LISTING_MODE_COMBINED); - //request.getSession().setAttribute(QUESTION_LISTING_MODE_PREVIEW, QUESTION_LISTING_MODE_PREVIEW); - - - //request.getSession().setAttribute(TOOL_SERVICE, qaService); - - /*mark the http session as a learning activity */ - //request.getSession().setAttribute(TARGET_MODE,TARGET_MODE_LEARNING); - - - //QaUtils.persistTimeZone(request); - /*validate learning mode parameters*/ ActionForward validateParameters=validateParameters(request, mapping, qaLearningForm); logger.debug("validateParamaters: " + validateParameters); @@ -213,20 +195,17 @@ return validateParameters; } - //String userId=(String)request.getSession().getAttribute(USER_ID); String userID=qaLearningForm.getUserID(); logger.debug("userID: " + userID); /* * use the incoming tool session id and later derive toolContentId from it. */ - //Long toolSessionId=(Long)request.getSession().getAttribute(TOOL_SESSION_ID); String toolSessionID=qaLearningForm.getToolSessionID(); logger.debug("toolSessionID: " + toolSessionID); generalLearnerFlowDTO.setToolSessionID(toolSessionID); + qaLearningForm.setToolSessionID(toolSessionID); - - /* * By now, the passed tool session id MUST exist in the db by calling: * public void createToolSession(Long toolSessionId, Long toolContentId) by the core. @@ -237,7 +216,6 @@ if (!QaUtils.existsSession(new Long(toolSessionID).longValue(), qaService)) { QaUtils.cleanUpSessionAbsolute(request); - //request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString()); logger.debug("error: The tool expects mcSession."); persistError(request,"error.toolSession.notAvailable"); return (mapping.findForward(ERROR_LIST_LEARNER)); @@ -266,35 +244,27 @@ { QaUtils.cleanUpSessionAbsolute(request); logger.debug("error: The tool expects qaContent."); - //request.getSession().setAttribute(USER_EXCEPTION_CONTENT_DOESNOTEXIST, new Boolean(true).toString()); persistError(request,"error.toolContent.notAvailable"); return (mapping.findForward(ERROR_LIST_LEARNER)); } if (qaContent.getTitle() == null) { - //request.getSession().setAttribute(ACTIVITY_TITLE, "Q&A Title"); - //request.getSession().setAttribute(ACTIVITY_INSTRUCTIONS, "Q&A Instructions"); generalLearnerFlowDTO.setActivityTitle("Q&A Title"); generalLearnerFlowDTO.setActivityInstructions("Q&A Instructions"); } else if (qaContent.getTitle().equals("")) { - //request.getSession().setAttribute(ACTIVITY_TITLE, "Q&A Title"); - //request.getSession().setAttribute(ACTIVITY_INSTRUCTIONS, "Q&A Instructions"); generalLearnerFlowDTO.setActivityTitle("Q&A Title"); generalLearnerFlowDTO.setActivityInstructions("Q&A Instructions"); } else { - //request.getSession().setAttribute(ACTIVITY_TITLE, qaContent.getTitle()); - //request.getSession().setAttribute(ACTIVITY_INSTRUCTIONS, qaContent.getInstructions()); generalLearnerFlowDTO.setActivityTitle(qaContent.getTitle()); generalLearnerFlowDTO.setActivityInstructions(qaContent.getInstructions()); } - //request.getSession().setAttribute(AttributeNames.PARAM_TOOL_CONTENT_ID, qaContent.getQaContentId()); logger.debug("using TOOL_CONTENT_ID: " + qaContent.getQaContentId()); generalLearnerFlowDTO.setToolContentID(qaContent.getQaContentId().toString()); @@ -306,21 +276,17 @@ logger.debug("REPORT_TITLE_LEARNER: " + qaContent.getReportTitle()); - //request.getSession().setAttribute(REPORT_TITLE_LEARNER,qaContent.getReportTitle()); generalLearnerFlowDTO.setReportTitleLearner(qaContent.getReportTitle()); - //request.getSession().setAttribute(END_LEARNING_MESSAGE,qaContent.getEndLearningMessage()); generalLearnerFlowDTO.setEndLearningMessage(qaContent.getEndLearningMessage()); logger.debug("END_LEARNING_MESSAGE: " + qaContent.getEndLearningMessage()); /* * Is the tool activity been checked as Run Offline in the property inspector? */ logger.debug("IS_TOOL_ACTIVITY_OFFLINE: " + qaContent.isRunOffline()); - //request.getSession().setAttribute(IS_TOOL_ACTIVITY_OFFLINE, new Boolean(qaContent.isRunOffline()).toString()); generalLearnerFlowDTO.setActivityOffline(new Boolean(qaContent.isRunOffline()).toString()); logger.debug("IS_USERNAME_VISIBLE: " + qaContent.isUsernameVisible()); - //request.getSession().setAttribute(IS_USERNAME_VISIBLE, new Boolean(qaContent.isUsernameVisible())); generalLearnerFlowDTO.setUserNameVisible(new Boolean(qaContent.isUsernameVisible()).toString()); @@ -336,19 +302,15 @@ /* * Learning mode requires this setting for jsp to generate the user's report */ - //request.getSession().setAttribute(CHECK_ALL_SESSIONS_COMPLETED, new Boolean(false)); - logger.debug("IS_QUESTIONS_SEQUENCED: " + qaContent.isQuestionsSequenced()); String feedBackType=""; if (qaContent.isQuestionsSequenced()) { - //request.getSession().setAttribute(QUESTION_LISTING_MODE, QUESTION_LISTING_MODE_SEQUENTIAL); generalLearnerFlowDTO.setQuestionListingMode(QUESTION_LISTING_MODE_SEQUENTIAL); feedBackType=FEEDBACK_TYPE_SEQUENTIAL; } else { - //request.getSession().setAttribute(QUESTION_LISTING_MODE, QUESTION_LISTING_MODE_COMBINED); generalLearnerFlowDTO.setQuestionListingMode(QUESTION_LISTING_MODE_COMBINED); feedBackType=FEEDBACK_TYPE_COMBINED; } @@ -374,19 +336,14 @@ } } - //request.getSession().setAttribute(MAP_ANSWERS, mapAnswers); generalLearnerFlowDTO.setMapAnswers(mapAnswers); - //request.getSession().setAttribute(MAP_QUESTION_CONTENT_LEARNER, mapQuestions); generalLearnerFlowDTO.setMapQuestionContentLearner(mapQuestions); generalLearnerFlowDTO.setMapQuestions(mapQuestions); logger.debug("mapQuestions has : " + mapQuestions.size() + " entries."); - //request.getSession().setAttribute(TOTAL_QUESTION_COUNT, new Long(mapQuestions.size()).toString()); generalLearnerFlowDTO.setTotalQuestionCount(new Integer(mapQuestions.size())); qaLearningForm.setTotalQuestionCount(new Integer(mapQuestions.size()).toString()); - - //String userFeedback= feedBackType + request.getSession().getAttribute(TOTAL_QUESTION_COUNT) + QUESTIONS; String userFeedback= feedBackType + generalLearnerFlowDTO.getTotalQuestionCount() + QUESTIONS; request.getSession().setAttribute(USER_FEEDBACK, userFeedback); @@ -402,15 +359,14 @@ learner */ /*handling PREVIEW mode*/ - String mode=(String) request.getSession().getAttribute(LEARNING_MODE); + String mode=qaLearningForm.getMode(); logger.debug("mode: " + mode); if ((mode != null) && (mode.equals("author"))) { logger.debug("Author requests for a preview of the content."); logger.debug("existing qaContent:" + qaContent); /* overwrite questionListing mode for preview*/ - //request.getSession().setAttribute(QUESTION_LISTING_MODE, QUESTION_LISTING_MODE_PREVIEW); logger.debug("forwarding to for preview: " + LOAD_LEARNER); return (mapping.findForward(LOAD_LEARNER)); } @@ -424,16 +380,16 @@ if ((learnerProgressUserId != null) && (mode.equals("teacher"))) { - logger.debug("start generating learner progress report."); - Long currentToolSessionId=(Long)request.getSession().getAttribute(TOOL_SESSION_ID); - logger.debug("currentToolSessionId: " + currentToolSessionId); + logger.debug("start generating learner progress report for toolSessionID: " + toolSessionID); /* the report should have only this user's entries(with userId)*/ QaMonitoringAction qaMonitoringAction= new QaMonitoringAction(); - qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, true, true, currentToolSessionId.toString(), learnerProgressUserId); - - request.getSession().setAttribute(REQUEST_LEARNING_REPORT, new Boolean(true).toString()); - request.getSession().setAttribute(REQUEST_LEARNING_REPORT_PROGRESS, new Boolean(true).toString()); + logger.debug("using generalLearnerFlowDTO: " + generalLearnerFlowDTO); + generalLearnerFlowDTO.setRequestLearningReport(new Boolean(true).toString()); + generalLearnerFlowDTO.setRequestLearningReportProgress(new Boolean(true).toString()); + + qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, true, true, toolSessionID, learnerProgressUserId, generalLearnerFlowDTO); + logger.debug("fwd'ing to for learner progress" + INDIVIDUAL_LEARNER_REPORT); return (mapping.findForward(INDIVIDUAL_LEARNER_REPORT)); } @@ -445,7 +401,6 @@ { QaUtils.cleanUpSessionAbsolute(request); logger.debug("warning to learner: the activity is offline."); - //request.getSession().setAttribute(USER_EXCEPTION_RUN_OFFLINE, new Boolean(true).toString()); persistError(request,"label.learning.runOffline"); return (mapping.findForward(ERROR_LIST_LEARNER)); } @@ -460,7 +415,6 @@ */ /* if the 'All Responses' has been clicked no more user entry is accepted, and isResponseFinalized() returns true*/ logger.debug("userID:" + userID); - //Long currentToolSessionId=(Long)request.getSession().getAttribute(TOOL_SESSION_ID); Long currentToolSessionID=new Long(qaLearningForm.getToolSessionID()); logger.debug("currentToolSessionID: " + currentToolSessionID); logger.debug("current session uid: " + qaSession.getUid()); @@ -491,10 +445,12 @@ QaMonitoringAction qaMonitoringAction= new QaMonitoringAction(); /*the report should have all the users' entries OR * the report should have only the current session's entries*/ - request.getSession().setAttribute(REQUEST_LEARNING_REPORT_VIEWONLY, new Boolean(true).toString()); - qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, isUserNamesVisible, true, currentToolSessionID.toString(), null); + + qaLearningForm.setRequestLearningReportViewOnly(new Boolean(true).toString()); + qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, isUserNamesVisible, true, currentToolSessionID.toString(), null, null); - request.getSession().setAttribute(REQUEST_LEARNING_REPORT, new Boolean(true).toString()); + qaLearningForm.setRequestLearningReport(new Boolean(true).toString()); + logger.debug("fwd'ing to." + INDIVIDUAL_LEARNER_REPORT); return (mapping.findForward(INDIVIDUAL_LEARNER_REPORT)); } @@ -538,7 +494,6 @@ { userID = user.getUserID().toString(); logger.debug("retrieved userId: " + userID); - //request.getSession().setAttribute(USER_ID, userID); qaLearningForm.setUserID(userID); } } @@ -552,7 +507,6 @@ if ((strToolSessionId == null) || (strToolSessionId.length() == 0)) { QaUtils.cleanUpSessionAbsolute(request); - //request.getSession().setAttribute(USER_EXCEPTION_TOOLSESSIONID_REQUIRED, new Boolean(true).toString()); persistError(request, "error.toolSessionId.required"); return (mapping.findForward(ERROR_LIST_LEARNER)); } @@ -562,13 +516,11 @@ { toolSessionId=new Long(strToolSessionId).longValue(); logger.debug("passed TOOL_SESSION_ID : " + new Long(toolSessionId)); - //request.getSession().setAttribute(TOOL_SESSION_ID,new Long(toolSessionId)); qaLearningForm.setToolSessionID(new Long(toolSessionId).toString()); } catch(NumberFormatException e) { QaUtils.cleanUpSessionAbsolute(request); - //request.getSession().setAttribute(USER_EXCEPTION_NUMBERFORMAT, new Boolean(true).toString()); persistError(request, "error.sessionId.numberFormatException"); logger.debug("add error.sessionId.numberFormatException to ActionMessages."); return (mapping.findForward(ERROR_LIST_LEARNER)); @@ -582,20 +534,18 @@ if ((mode == null) || (mode.length() == 0)) { QaUtils.cleanUpSessionAbsolute(request); - //request.getSession().setAttribute(USER_EXCEPTION_MODE_REQUIRED, new Boolean(true).toString()); persistError(request, "error.mode.required"); return (mapping.findForward(ERROR_LIST_LEARNER)); } if ((!mode.equals("learner")) && (!mode.equals("teacher")) && (!mode.equals("author"))) { QaUtils.cleanUpSessionAbsolute(request); - //request.getSession().setAttribute(USER_EXCEPTION_MODE_INVALID, new Boolean(true).toString()); persistError(request, "error.mode.invalid"); return (mapping.findForward(ERROR_LIST_LEARNER)); } - logger.debug("session LEARNING_MODE set to:" + mode); - //request.getSession().setAttribute(LEARNING_MODE, mode); + + logger.debug("session LEARNING_MODE set to:" + mode); qaLearningForm.setMode(mode); return null; } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java =================================================================== diff -u -rc277bb1c30c1283b5f66c6f651855c51a5f87bc5 -r97ebe40dad2731256147d74073b541245be53871 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java (.../QaMonitoringAction.java) (revision c277bb1c30c1283b5f66c6f651855c51a5f87bc5) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java (.../QaMonitoringAction.java) (revision 97ebe40dad2731256147d74073b541245be53871) @@ -99,6 +99,7 @@ import org.apache.struts.action.ActionMessage; import org.apache.struts.action.ActionMessages; import org.lamsfoundation.lams.tool.exception.ToolException; +import org.lamsfoundation.lams.tool.qa.GeneralLearnerFlowDTO; import org.lamsfoundation.lams.tool.qa.QaAppConstants; import org.lamsfoundation.lams.tool.qa.QaContent; import org.lamsfoundation.lams.tool.qa.QaUsrResp; @@ -507,9 +508,11 @@ logger.debug("SELECTION_CASE: " + request.getSession().getAttribute(SELECTION_CASE)); - request.getSession().setAttribute(CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession); - logger.debug("CURRENT_MONITORED_TOOL_SESSION: " + request.getSession().getAttribute(CURRENT_MONITORED_TOOL_SESSION)); + //request.getSession().setAttribute(CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession); + //logger.debug("CURRENT_MONITORED_TOOL_SESSION: " + request.getSession().getAttribute(CURRENT_MONITORED_TOOL_SESSION)); + request.setAttribute(CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession); + logger.debug("final USER_EXCEPTION_NO_TOOL_SESSIONS: " + request.getSession().getAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS)); return (mapping.findForward(LOAD_MONITORING)); } @@ -643,7 +646,7 @@ qaService.removeUserResponse(qaUsrResp); logger.debug("response deleted."); - logger.debug("CURRENT_MONITORED_TOOL_SESSION: " + request.getSession().getAttribute(CURRENT_MONITORED_TOOL_SESSION)); + //logger.debug("CURRENT_MONITORED_TOOL_SESSION: " + request.getSession().getAttribute(CURRENT_MONITORED_TOOL_SESSION)); refreshUserInput(request); return (mapping.findForward(LOAD_MONITORING)); @@ -773,17 +776,12 @@ ServletException, ToolException { logger.debug("dispatching proxy endLearning to learnng module..."); - IQaService qaService = (IQaService)request.getSession().getAttribute(TOOL_SERVICE); + //IQaService qaService = (IQaService)request.getSession().getAttribute(TOOL_SERVICE); + IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); logger.debug("qaService: " + qaService); - if (qaService == null) - { - logger.debug("will retrieve qaService"); - qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - logger.debug("retrieving qaService from session: " + qaService); - } QaLearningAction qaLearningAction= new QaLearningAction(); - qaLearningAction.endLearning(request, qaService, response); + //qaLearningAction.endLearning(request, qaService, response); return null; } @@ -801,21 +799,13 @@ * @param currentSessionId * @param userId */ - public void refreshSummaryData(HttpServletRequest request, QaContent qaContent, IQaService qaService, - boolean isUserNamesVisible, boolean isLearnerRequest, String currentSessionId, String userId) + public void refreshSummaryData(HttpServletRequest request, QaContent qaContent, IQaService qaService, + boolean isUserNamesVisible, boolean isLearnerRequest, String currentSessionId, String userId, + GeneralLearnerFlowDTO generalLearnerFlowDTO) { - if (qaService == null) - { - logger.debug("will retrieve qaService"); - qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - logger.debug("retrieving qaService from session: " + qaService); - } - if (qaService == null) - { - qaService = (IQaService)request.getSession().getAttribute(TOOL_SERVICE); - logger.debug("qaService: " + qaService); - } - + logger.debug("starting refreshSummaryData: "); + logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); + logger.debug("qaService: " + isUserNamesVisible); logger.debug("isUserNamesVisible: " + isUserNamesVisible); logger.debug("isLearnerRequest: " + isLearnerRequest); @@ -847,15 +837,24 @@ logger.debug("SELECTION_CASE: " + request.getSession().getAttribute(SELECTION_CASE)); /* Default to All for tool Sessions so that all tool sessions' summary information gets displayed when the module starts up */ - request.getSession().setAttribute(CURRENT_MONITORED_TOOL_SESSION, "All"); - logger.debug("CURRENT_MONITORED_TOOL_SESSION: " + request.getSession().getAttribute(CURRENT_MONITORED_TOOL_SESSION)); + //request.getSession().setAttribute(CURRENT_MONITORED_TOOL_SESSION, "All"); + //logger.debug("CURRENT_MONITORED_TOOL_SESSION: " + request.getSession().getAttribute(CURRENT_MONITORED_TOOL_SESSION)); + request.setAttribute(CURRENT_MONITORED_TOOL_SESSION, "All"); logger.debug("using allUsersData to retrieve data: " + isUserNamesVisible); List listMonitoredAnswersContainerDTO=MonitoringUtil.buildGroupsQuestionData(request, qaContent, qaService, isUserNamesVisible, isLearnerRequest, currentSessionId, userId); request.getSession().setAttribute(LIST_MONITORED_ANSWERS_CONTAINER_DTO, listMonitoredAnswersContainerDTO); logger.debug("LIST_MONITORED_ANSWERS_CONTAINER_DTO: " + request.getSession().getAttribute(LIST_MONITORED_ANSWERS_CONTAINER_DTO)); + + if (generalLearnerFlowDTO != null) + { + logger.debug("placing LIST_MONITORED_ANSWERS_CONTAINER_DTO within generalLearnerFlowDTO."); + generalLearnerFlowDTO.setListMonitoredAnswersContainerDTO(listMonitoredAnswersContainerDTO); + request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); + } + /* ends here. */ } @@ -945,7 +944,7 @@ currentMonitoredToolSession="All"; } - refreshSummaryData(request, qaContent, qaService, true, false, null, null); + refreshSummaryData(request, qaContent, qaService, true, false, null, null, null); if (currentMonitoredToolSession.equals("All")) @@ -958,8 +957,9 @@ } logger.debug("SELECTION_CASE: " + request.getSession().getAttribute(SELECTION_CASE)); - request.getSession().setAttribute(CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession); - logger.debug("CURRENT_MONITORED_TOOL_SESSION: " + request.getSession().getAttribute(CURRENT_MONITORED_TOOL_SESSION)); + //request.getSession().setAttribute(CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession); + //logger.debug("CURRENT_MONITORED_TOOL_SESSION: " + request.getSession().getAttribute(CURRENT_MONITORED_TOOL_SESSION)); + request.setAttribute(CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession); logger.debug("submitting session to refresh the data from the database: "); return (mapping.findForward(LOAD_MONITORING)); @@ -1008,7 +1008,7 @@ currentMonitoredToolSession="All"; } - refreshSummaryData(request, qaContent, qaService, true, false, null, null); + refreshSummaryData(request, qaContent, qaService, true, false, null, null, null); if (currentMonitoredToolSession.equals("All")) @@ -1021,8 +1021,9 @@ } logger.debug("SELECTION_CASE: " + request.getSession().getAttribute(SELECTION_CASE)); - request.getSession().setAttribute(CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession); - logger.debug("CURRENT_MONITORED_TOOL_SESSION: " + request.getSession().getAttribute(CURRENT_MONITORED_TOOL_SESSION)); + //request.getSession().setAttribute(CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession); + //logger.debug("CURRENT_MONITORED_TOOL_SESSION: " + request.getSession().getAttribute(CURRENT_MONITORED_TOOL_SESSION)); + request.setAttribute(CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession); logger.debug("submitting session to refresh the data from the database: "); return (mapping.findForward(LOAD_MONITORING)); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java =================================================================== diff -u -r0409f98dc17dfd380badf33ae103a47d0fffc4e5 -r97ebe40dad2731256147d74073b541245be53871 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java (.../QaMonitoringStarterAction.java) (revision 0409f98dc17dfd380badf33ae103a47d0fffc4e5) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java (.../QaMonitoringStarterAction.java) (revision 97ebe40dad2731256147d74073b541245be53871) @@ -41,6 +41,7 @@ import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionMessage; import org.apache.struts.action.ActionMessages; +import org.lamsfoundation.lams.tool.qa.GeneralLearnerFlowDTO; import org.lamsfoundation.lams.tool.qa.QaAppConstants; import org.lamsfoundation.lams.tool.qa.QaApplicationException; import org.lamsfoundation.lams.tool.qa.QaComparator; @@ -243,8 +244,11 @@ QaMonitoringAction qaMonitoringAction= new QaMonitoringAction(); logger.debug("refreshing summary data..."); - qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, true, false, null, null); + GeneralLearnerFlowDTO generalLearnerFlowDTO= LearningUtil.buildGeneralLearnerFlowDTO(qaContent); + logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); + qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO); + logger.debug("refreshing stats data..."); qaMonitoringAction.refreshStatsData(request); Index: lams_tool_laqa/web/learning/LearnerRep.jsp =================================================================== diff -u -re4b11d5f2ee68909df09e749152768bd5006aa88 -r97ebe40dad2731256147d74073b541245be53871 --- lams_tool_laqa/web/learning/LearnerRep.jsp (.../LearnerRep.jsp) (revision e4b11d5f2ee68909df09e749152768bd5006aa88) +++ lams_tool_laqa/web/learning/LearnerRep.jsp (.../LearnerRep.jsp) (revision 97ebe40dad2731256147d74073b541245be53871) @@ -39,41 +39,43 @@

- +

- - + +
- +
- + + + + + + + + + + + + + - + +
@@ -86,43 +88,83 @@ - - + + + + + + + + +
   
: + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+
+ + + + +
+
+ - - - - -
-
-   - - - - -
-
-
- - - - -
-
- - - -
-
-
-
- + + + + + + + + + + + + Index: lams_tool_laqa/web/monitoring/SummaryContent.jsp =================================================================== diff -u -rae31667a6e242fce19d51a36312269d1a7ccd1c3 -r97ebe40dad2731256147d74073b541245be53871 --- lams_tool_laqa/web/monitoring/SummaryContent.jsp (.../SummaryContent.jsp) (revision ae31667a6e242fce19d51a36312269d1a7ccd1c3) +++ lams_tool_laqa/web/monitoring/SummaryContent.jsp (.../SummaryContent.jsp) (revision 97ebe40dad2731256147d74073b541245be53871) @@ -38,7 +38,7 @@
@@ -134,11 +176,62 @@ - - - - - + + + + + + + + +
   
: + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
- + - + @@ -97,12 +97,12 @@ - + - - + + Index: lams_tool_laqa/web/monitoring/UserResponses.jsp =================================================================== diff -u -r8f690879a75ab70b6948682ae6d5c3400dcc3dad -r97ebe40dad2731256147d74073b541245be53871 --- lams_tool_laqa/web/monitoring/UserResponses.jsp (.../UserResponses.jsp) (revision 8f690879a75ab70b6948682ae6d5c3400dcc3dad) +++ lams_tool_laqa/web/monitoring/UserResponses.jsp (.../UserResponses.jsp) (revision 97ebe40dad2731256147d74073b541245be53871) @@ -30,9 +30,9 @@ - + - + - @@ -65,7 +64,7 @@ - + - - + @@ -96,7 +94,7 @@ - + -
    images/edit.gif" align=left onclick="javascript:submitEditResponse('','editResponse');"> @@ -51,7 +51,6 @@ images/tick.gif" align=left onclick="javascript:submitEditResponse('','updateResponse');"> @@ -84,8 +83,7 @@ images/edit.gif" align=left onclick="javascript:submitEditResponse('','editResponse');"> @@ -115,7 +113,6 @@