Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java =================================================================== diff -u -r163c7460795072098035147b45ece51edb87e4ef -r7d13e6e6b653149634a2867a4aa964bb929c773f --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java (.../ExportServlet.java) (revision 163c7460795072098035147b45ece51edb87e4ef) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java (.../ExportServlet.java) (revision 7d13e6e6b653149634a2867a4aa964bb929c773f) @@ -114,7 +114,7 @@ GeneralLearnerFlowDTO generalLearnerFlowDTO= LearningUtil.buildGeneralLearnerFlowDTO(content); logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); - qaMonitoringAction.refreshSummaryData(request, content, qaService, true, true, toolSessionID.toString(), + qaMonitoringAction.refreshSummaryData(request, content, qaService, content.isUsernameVisible(), true, toolSessionID.toString(), userID.toString(), generalLearnerFlowDTO, false, toolSessionID.toString()); logger.debug("end refreshSummaryData for learner mode."); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/MonitoringUtil.java =================================================================== diff -u -r163c7460795072098035147b45ece51edb87e4ef -r7d13e6e6b653149634a2867a4aa964bb929c773f --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision 163c7460795072098035147b45ece51edb87e4ef) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision 7d13e6e6b653149634a2867a4aa964bb929c773f) @@ -23,6 +23,7 @@ /* $$Id$$ */ package org.lamsfoundation.lams.tool.qa.web; +import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedList; import java.util.List; @@ -202,6 +203,9 @@ * ends up populating the attempt history for all the users of all the tool sessions for a content * buildGroupsQuestionData(HttpServletRequest request, McContent mcContent) * + * User id is needed if isUserNamesVisible is false && is learnerRequest = true, + * as it is required to work out if the data being analysed is the current user. + * * @param request * @param mcContent * @return List @@ -260,7 +264,10 @@ return listMonitoredAnswersContainerDTO; } - + /** User id is needed if learnerRequest = true, as it is required to work out if the data being + * analysed is the current user (for not show other names) or to work out which is the user's answers + * (for not show all answers). + */ public static Map buildGroupsAttemptData(HttpServletRequest request, QaContent qaContent, IQaService qaService, QaQueContent qaQueContent, String questionUid, boolean isUserNamesVisible, boolean isLearnerRequest, String currentSessionId, String userId) { @@ -329,33 +336,26 @@ } else { - /*request is for learner report, use only the passed tool session in the report*/ + /*request is for learner report, use only the passed tool session in the report. */ logger.debug("using currentSessionId for the learner report:" + currentSessionId); - while (itMap.hasNext()) + QaSession qaSession= qaService.retrieveQaSession(new Long(currentSessionId).longValue()); + logger.debug("qaSession: " + " = " + qaSession); + if (qaSession != null) { - Map.Entry pairs = (Map.Entry)itMap.next(); - logger.debug("using the summary tool sessions pair: " + pairs.getKey() + " = " + pairs.getValue()); - - if (!(pairs.getValue().toString().equals("None")) && !(pairs.getValue().toString().equals("All"))) - { - logger.debug("using the numerical summary tool sessions pair: " + " = " + pairs.getValue()); - - if (currentSessionId.equals(pairs.getValue())) - { - logger.debug("only using this tool session for the learner report: " + " = " + pairs.getValue()); - QaSession qaSession= qaService.retrieveQaSession(new Long(pairs.getValue().toString()).longValue()); - logger.debug("qaSession: " + " = " + qaSession); - if (qaSession != null) - { - List listUsers=qaService.getUserBySessionOnly(qaSession); - logger.debug("listQaUsers for session id:" + qaSession.getQaSessionId() + " = " + listUsers); - Map sessionUsersAttempts=populateSessionUsersAttempts(request, qaService, qaSession.getQaSessionId(), listUsers, questionUid, - isUserNamesVisible, isLearnerRequest, userId); - listMonitoredAttemptsContainerDTO.add(sessionUsersAttempts); - } - } - } - } + List listUsers=null; + if ( qaContent.isShowOtherAnswers() ) { + listUsers = qaService.getUserBySessionOnly(qaSession); + } else { + listUsers = new ArrayList(); + QaQueUsr currentUser = qaService.getQaUserBySession(new Long(userId).longValue(),qaSession.getUid()); + if ( currentUser != null ) + listUsers.add(currentUser); + } + logger.debug("listQaUsers for session id:" + qaSession.getQaSessionId() + " = " + listUsers); + Map sessionUsersAttempts=populateSessionUsersAttempts(request, qaService, qaSession.getQaSessionId(), listUsers, questionUid, + isUserNamesVisible, isLearnerRequest, userId); + listMonitoredAttemptsContainerDTO.add(sessionUsersAttempts); + } } logger.debug("final listMonitoredAttemptsContainerDTO:..." + listMonitoredAttemptsContainerDTO); @@ -366,8 +366,10 @@ /** - * ends up populating all the user's attempt data of a particular tool session + * Populates all the user's attempt data of a particular tool session * populateSessionUsersAttempts(HttpServletRequest request,List listUsers) + * User id is needed if isUserNamesVisible is false && is learnerRequest = true, + * as it is required to work out if the data being analysed is the current user. * * @param request * @param listUsers @@ -386,218 +388,56 @@ Map mapMonitoredUserContainerDTO= new TreeMap(new QaStringComparator()); List listMonitoredUserContainerDTO= new LinkedList(); Iterator itUsers=listUsers.iterator(); - - - if (userId == null) + + while (itUsers.hasNext()) { - logger.debug("request is not for learner progress report"); - if ((isUserNamesVisible) && (!isLearnerRequest)) - { - logger.debug("isUserNamesVisible true, isLearnerRequest false" ); - logger.debug("getting alll the user' data"); - while (itUsers.hasNext()) - { - QaQueUsr qaQueUsr=(QaQueUsr)itUsers.next(); - logger.debug("qaQueUsr: " + qaQueUsr); - - if (qaQueUsr != null) - { - logger.debug("getting listUserAttempts for user id: " + qaQueUsr.getUid() + " and que content id: " + questionUid); - List listUserAttempts=qaService.getAttemptsForUserAndQuestionContent(qaQueUsr.getUid(), new Long(questionUid)); - logger.debug("listUserAttempts: " + listUserAttempts); - - Iterator itAttempts=listUserAttempts.iterator(); - while (itAttempts.hasNext()) - { - QaUsrResp qaUsrResp=(QaUsrResp)itAttempts.next(); - logger.debug("qaUsrResp: " + qaUsrResp); - - if (qaUsrResp != null) - { - QaMonitoredUserDTO qaMonitoredUserDTO = new QaMonitoredUserDTO(); - qaMonitoredUserDTO.setAttemptTime(qaUsrResp.getAttemptTime()); - qaMonitoredUserDTO.setTimeZone(qaUsrResp.getTimezone()); - qaMonitoredUserDTO.setUid(qaUsrResp.getResponseId().toString()); - qaMonitoredUserDTO.setUserName(qaQueUsr.getFullname()); - qaMonitoredUserDTO.setQueUsrId(qaQueUsr.getUid().toString()); - qaMonitoredUserDTO.setSessionId(sessionId.toString()); - qaMonitoredUserDTO.setResponse(qaUsrResp.getAnswer()); - - String responsePresentable=QaUtils.replaceNewLines(qaUsrResp.getAnswer()); - logger.debug("responsePresentable: " + responsePresentable); - qaMonitoredUserDTO.setResponsePresentable(responsePresentable); - - qaMonitoredUserDTO.setQuestionUid(questionUid); - qaMonitoredUserDTO.setVisible(new Boolean(qaUsrResp.isVisible()).toString()); - listMonitoredUserContainerDTO.add(qaMonitoredUserDTO); - } - } - } - } - } - else if ((isUserNamesVisible) && (isLearnerRequest)) - { - 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" ); + QaQueUsr qaQueUsr=(QaQueUsr)itUsers.next(); + logger.debug("qaQueUsr: " + qaQueUsr); + + if (qaQueUsr != null) + { + logger.debug("getting listUserAttempts for user id: " + qaQueUsr.getUid() + " and que content id: " + questionUid); + List listUserAttempts=qaService.getAttemptsForUserAndQuestionContent(qaQueUsr.getUid(), new Long(questionUid)); + logger.debug("listUserAttempts: " + listUserAttempts); - 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()); - - while (itUsers.hasNext()) - { - qaQueUsr=(QaQueUsr)itUsers.next(); - logger.debug("qaQueUsr: " + qaQueUsr); - - if (qaQueUsr != null) - { - logger.debug("getting listUserAttempts for user id: " + qaQueUsr.getUid() + " and que content id: " + questionUid); - List listUserAttempts=qaService.getAttemptsForUserAndQuestionContent(qaQueUsr.getUid(), new Long(questionUid)); - logger.debug("listUserAttempts: " + listUserAttempts); - - Iterator itAttempts=listUserAttempts.iterator(); - while (itAttempts.hasNext()) - { - QaUsrResp qaUsrResp=(QaUsrResp)itAttempts.next(); - logger.debug("qaUsrResp: " + qaUsrResp); - - if (qaUsrResp != null) - { - QaMonitoredUserDTO qaMonitoredUserDTO = new QaMonitoredUserDTO(); - qaMonitoredUserDTO.setAttemptTime(qaUsrResp.getAttemptTime()); - qaMonitoredUserDTO.setTimeZone(qaUsrResp.getTimezone()); - qaMonitoredUserDTO.setUid(qaUsrResp.getResponseId().toString()); - qaMonitoredUserDTO.setUserName(qaQueUsr.getFullname()); - qaMonitoredUserDTO.setQueUsrId(qaQueUsr.getUid().toString()); - qaMonitoredUserDTO.setSessionId(sessionId.toString()); - qaMonitoredUserDTO.setResponse(qaUsrResp.getAnswer()); - - String responsePresentable=QaUtils.replaceNewLines(qaUsrResp.getAnswer()); - logger.debug("responsePresentable: " + responsePresentable); - qaMonitoredUserDTO.setResponsePresentable(responsePresentable); - - qaMonitoredUserDTO.setQuestionUid(questionUid); - qaMonitoredUserDTO.setVisible(new Boolean(qaUsrResp.isVisible()).toString()); - listMonitoredUserContainerDTO.add(qaMonitoredUserDTO); - } - } - } - } - } - else if ((!isUserNamesVisible) && (isLearnerRequest)) - { - 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" ); + Iterator itAttempts=listUserAttempts.iterator(); + while (itAttempts.hasNext()) + { + QaUsrResp qaUsrResp=(QaUsrResp)itAttempts.next(); + logger.debug("qaUsrResp: " + qaUsrResp); + + if (qaUsrResp != null) + { + QaMonitoredUserDTO qaMonitoredUserDTO = new QaMonitoredUserDTO(); + qaMonitoredUserDTO.setAttemptTime(qaUsrResp.getAttemptTime()); + qaMonitoredUserDTO.setTimeZone(qaUsrResp.getTimezone()); + qaMonitoredUserDTO.setUid(qaUsrResp.getResponseId().toString()); + + if (!isUserNamesVisible && isLearnerRequest && + !userId.equals(qaQueUsr.getQueUsrId().toString()) ) { + logger.debug("this is not current user, put his name as blank."); + qaMonitoredUserDTO.setUserName(" "); + } else { + logger.debug("this is current user, put his name normally."); + qaMonitoredUserDTO.setUserName(qaQueUsr.getFullname()); + } + + qaMonitoredUserDTO.setQueUsrId(qaQueUsr.getUid().toString()); + qaMonitoredUserDTO.setSessionId(sessionId.toString()); + qaMonitoredUserDTO.setResponse(qaUsrResp.getAnswer()); + + String responsePresentable=QaUtils.replaceNewLines(qaUsrResp.getAnswer()); + logger.debug("responsePresentable: " + responsePresentable); + qaMonitoredUserDTO.setResponsePresentable(responsePresentable); - String userID = QaUtils.getCurrentLearnerID(); - logger.debug("userID: " + userID); - - while (itUsers.hasNext()) - { - QaQueUsr qaQueUsr=(QaQueUsr)itUsers.next(); - logger.debug("qaQueUsr: " + qaQueUsr); - - if (qaQueUsr != null) - { - logger.debug("getting listUserAttempts for user id: " + qaQueUsr.getUid() + " and que content id: " + questionUid); - List listUserAttempts=qaService.getAttemptsForUserAndQuestionContent(qaQueUsr.getUid(), new Long(questionUid)); - logger.debug("listUserAttempts: " + listUserAttempts); - - Iterator itAttempts=listUserAttempts.iterator(); - while (itAttempts.hasNext()) - { - QaUsrResp qaUsrResp=(QaUsrResp)itAttempts.next(); - logger.debug("qaUsrResp: " + qaUsrResp); - - if (qaUsrResp != null) - { - QaMonitoredUserDTO qaMonitoredUserDTO = new QaMonitoredUserDTO(); - qaMonitoredUserDTO.setAttemptTime(qaUsrResp.getAttemptTime()); - qaMonitoredUserDTO.setTimeZone(qaUsrResp.getTimezone()); - qaMonitoredUserDTO.setUid(qaUsrResp.getResponseId().toString()); - - logger.debug("userID versus queUsrId: " + userID + "-" + qaQueUsr.getQueUsrId()); - if (userID.equals(qaQueUsr.getQueUsrId().toString())) - { - logger.debug("this is current user, put his name normally."); - qaMonitoredUserDTO.setUserName(qaQueUsr.getFullname()); - } - else - { - logger.debug("this is not current user, put his name as blank."); - qaMonitoredUserDTO.setUserName(" "); - } - - qaMonitoredUserDTO.setQueUsrId(qaQueUsr.getUid().toString()); - qaMonitoredUserDTO.setSessionId(sessionId.toString()); - qaMonitoredUserDTO.setResponse(qaUsrResp.getAnswer()); - - String responsePresentable=QaUtils.replaceNewLines(qaUsrResp.getAnswer()); - logger.debug("responsePresentable: " + responsePresentable); - qaMonitoredUserDTO.setResponsePresentable(responsePresentable); - - qaMonitoredUserDTO.setQuestionUid(questionUid); - qaMonitoredUserDTO.setVisible(new Boolean(qaUsrResp.isVisible()).toString()); - listMonitoredUserContainerDTO.add(qaMonitoredUserDTO); - } - } - } - } - } + qaMonitoredUserDTO.setQuestionUid(questionUid); + qaMonitoredUserDTO.setVisible(new Boolean(qaUsrResp.isVisible()).toString()); + listMonitoredUserContainerDTO.add(qaMonitoredUserDTO); + } + } + } } - else - { - logger.debug("request is for learner progress report: " + userId); - while (itUsers.hasNext()) - { - QaQueUsr qaQueUsr=(QaQueUsr)itUsers.next(); - logger.debug("qaQueUsr: " + qaQueUsr); - - if (qaQueUsr != null) - { - logger.debug("getting listUserAttempts for user id: " + qaQueUsr.getUid() + " and que content id: " + questionUid); - List listUserAttempts=qaService.getAttemptsForUserAndQuestionContent(qaQueUsr.getUid(), new Long(questionUid)); - logger.debug("listUserAttempts: " + listUserAttempts); - - Iterator itAttempts=listUserAttempts.iterator(); - while (itAttempts.hasNext()) - { - QaUsrResp qaUsrResp=(QaUsrResp)itAttempts.next(); - logger.debug("qaUsrResp: " + qaUsrResp); - - if (qaUsrResp != null) - { - logger.debug("userID versus queUsrId: " + userId + "-" + qaQueUsr.getQueUsrId()); - if (userId.equals(qaQueUsr.getQueUsrId().toString())) - { - logger.debug("this is the user requested , include his name for learner progress."); - QaMonitoredUserDTO qaMonitoredUserDTO = new QaMonitoredUserDTO(); - qaMonitoredUserDTO.setAttemptTime(qaUsrResp.getAttemptTime()); - qaMonitoredUserDTO.setTimeZone(qaUsrResp.getTimezone()); - qaMonitoredUserDTO.setUid(qaUsrResp.getResponseId().toString()); - qaMonitoredUserDTO.setUserName(qaQueUsr.getFullname()); - qaMonitoredUserDTO.setQueUsrId(qaQueUsr.getUid().toString()); - qaMonitoredUserDTO.setSessionId(sessionId.toString()); - qaMonitoredUserDTO.setResponse(qaUsrResp.getAnswer()); - - String responsePresentable=QaUtils.replaceNewLines(qaUsrResp.getAnswer()); - logger.debug("responsePresentable: " + responsePresentable); - qaMonitoredUserDTO.setResponsePresentable(responsePresentable); - - qaMonitoredUserDTO.setQuestionUid(questionUid); - qaMonitoredUserDTO.setVisible(new Boolean(qaUsrResp.isVisible()).toString()); - listMonitoredUserContainerDTO.add(qaMonitoredUserDTO); - } - } - } - } - } - - } - logger.debug("final listMonitoredUserContainerDTO: " + listMonitoredUserContainerDTO); mapMonitoredUserContainerDTO=convertToMcMonitoredUserDTOMap(listMonitoredUserContainerDTO); logger.debug("final mapMonitoredUserContainerDTO:..." + mapMonitoredUserContainerDTO); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java =================================================================== diff -u -r70dfdae7eb53ac8dd1a90f179e5b228dff55de5c -r7d13e6e6b653149634a2867a4aa964bb929c773f --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java (.../QaLearningAction.java) (revision 70dfdae7eb53ac8dd1a90f179e5b228dff55de5c) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java (.../QaLearningAction.java) (revision 7d13e6e6b653149634a2867a4aa964bb929c773f) @@ -552,6 +552,11 @@ /** + * Stores all results and moves onto the next step. + * If view other users answers = true, then goes to the + * view all answers screen, otherwise goes straight + * to the reflection screen (if any). + * * returns Learner Report for a session * ActionForward viewAllResults(ActionMapping mapping, ActionForm form, @@ -567,7 +572,7 @@ * @throws IOException * @throws ServletException */ - public ActionForward viewAllResults(ActionMapping mapping, + public ActionForward storeAllResults(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, @@ -627,12 +632,23 @@ learningUtil.setContentInUse(new Long(toolContentID).longValue(), qaService); logger.debug("content has been set in use"); - logger.debug("start generating learning report..."); + if ( qaContent.isShowOtherAnswers() ) { + return prepareViewAllAnswers(mapping, request, qaLearningForm, qaService, toolSessionID, userID, qaSession, toolContentID, qaContent, generalLearnerFlowDTO, isUserNamesVisible); + } else if ( qaContent.isReflect() ) { + return forwardtoReflection(mapping, request, qaContent, qaService, toolSessionID, userID, qaLearningForm); + } else { + return endLearning(mapping, qaLearningForm, request, response); + } + } + + /** Set up the data for the view all answers screen */ + private ActionForward prepareViewAllAnswers(ActionMapping mapping, HttpServletRequest request, QaLearningForm qaLearningForm, IQaService qaService, String toolSessionID, String userID, QaSession qaSession, String toolContentID, QaContent qaContent, GeneralLearnerFlowDTO generalLearnerFlowDTO, boolean isUserNamesVisible) { + logger.debug("start generating learning report..."); logger.debug("toolContentID: " + toolContentID); QaMonitoringAction qaMonitoringAction= new QaMonitoringAction(); - qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, isUserNamesVisible, true, toolSessionID, null, + qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, isUserNamesVisible, true, toolSessionID, userID, generalLearnerFlowDTO, false , toolSessionID); generalLearnerFlowDTO.setRequestLearningReport(new Boolean(true).toString()); @@ -787,7 +803,8 @@ QaMonitoringAction qaMonitoringAction= new QaMonitoringAction(); - qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, isUserNamesVisible, true, toolSessionID, null, + qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, isUserNamesVisible, true, + toolSessionID, userID, generalLearnerFlowDTO, false , toolSessionID); generalLearnerFlowDTO.setRequestLearningReport(new Boolean(true).toString()); @@ -1261,7 +1278,7 @@ QaMonitoringAction qaMonitoringAction = new QaMonitoringAction(); logger.debug("using generalLearnerFlowDTO: " + generalLearnerFlowDTO); qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, isUserNamesVisible, true, - toolSessionID, null, generalLearnerFlowDTO, false, toolSessionID); + toolSessionID, userID, generalLearnerFlowDTO, false, toolSessionID); logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO); @@ -1440,7 +1457,13 @@ String userID=request.getParameter("userID"); logger.debug("userID: " + userID); qaLearningForm.setUserID(userID); - + + return forwardtoReflection(mapping, request, qaContent, qaService, toolSessionID, userID, qaLearningForm) ; + } + + private ActionForward forwardtoReflection(ActionMapping mapping, HttpServletRequest request, + QaContent qaContent, IQaService qaService, String toolSessionID, + String userID, QaLearningForm qaLearningForm) { GeneralLearnerFlowDTO generalLearnerFlowDTO= new GeneralLearnerFlowDTO(); generalLearnerFlowDTO.setActivityTitle(qaContent.getTitle()); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java =================================================================== diff -u -r70dfdae7eb53ac8dd1a90f179e5b228dff55de5c -r7d13e6e6b653149634a2867a4aa964bb929c773f --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java (.../QaLearningStarterAction.java) (revision 70dfdae7eb53ac8dd1a90f179e5b228dff55de5c) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java (.../QaLearningStarterAction.java) (revision 7d13e6e6b653149634a2867a4aa964bb929c773f) @@ -56,6 +56,7 @@ import org.lamsfoundation.lams.tool.qa.service.IQaService; import org.lamsfoundation.lams.tool.qa.service.QaServiceProxy; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.web.session.SessionManager; import org.lamsfoundation.lams.web.util.AttributeNames; import org.lamsfoundation.lams.web.util.SessionMap; @@ -233,6 +234,7 @@ logger.debug("error during validation"); } + // this is the user id of the current user, set up in validateParameters String userID=qaLearningForm.getUserID(); logger.debug("userID: " + userID); @@ -447,38 +449,39 @@ /* by now, we know that the mode is either teacher or learner * check if the mode is teacher and request is for Learner Progress */ - logger.debug("userID: " + userID); - String learnerProgressUserId=request.getParameter(USER_ID); - logger.debug("learnerProgressUserId: " + learnerProgressUserId); + logger.debug("current userID: " + userID); + String learnerProgressUserIdString = WebUtil.readStrParam(request, AttributeNames.PARAM_USER_ID, true); + logger.debug("learnerProgressUserId: " + learnerProgressUserIdString); - if ((learnerProgressUserId != null) && (mode.equals("teacher"))) + if ((learnerProgressUserIdString != null) && (mode.equals("teacher"))) { logger.debug("start generating learner progress report for toolSessionID: " + toolSessionID); - - /* the report should have only this user's entries(with userId)*/ + + /* the report should have the all entries for the users in this tool session, + * and display under the "my answers" section the answers for the user id in the url */ + qaLearningForm.setUserID(learnerProgressUserIdString); + Long learnerProgressUserId = WebUtil.readLongParam(request, AttributeNames.PARAM_USER_ID, false); QaMonitoringAction qaMonitoringAction= new QaMonitoringAction(); logger.debug("using generalLearnerFlowDTO: " + generalLearnerFlowDTO); generalLearnerFlowDTO.setRequestLearningReport(new Boolean(true).toString()); generalLearnerFlowDTO.setRequestLearningReportProgress(new Boolean(true).toString()); generalLearnerFlowDTO.setTeacherViewOnly(new Boolean(true).toString()); - qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, true, true, toolSessionID, learnerProgressUserId, + qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, qaContent.isUsernameVisible(), true, + toolSessionID, learnerProgressUserIdString, generalLearnerFlowDTO, false, toolSessionID); logger.debug("presenting teacher's report"); - - HttpSession ss = SessionManager.getSession(); - /* get back login user DTO */ - UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER); - Long userId=new Long(toolUser.getUserID().longValue()); + QaQueUsr qaQueUsrLocal=qaService.getQaUserBySession(learnerProgressUserId, qaSession.getUid()); - QaQueUsr qaQueUsrLocal=qaService.getQaUserBySession(userId, qaSession.getUid()); - logger.debug("qaQueUsrLocal: " + qaQueUsrLocal); - logger.debug("qaQueUsrLocal uid : " + qaQueUsrLocal.getUid()); + if ( qaQueUsrLocal != null ) { + logger.debug("qaQueUsrLocal uid : " + qaQueUsrLocal.getUid()); + generalLearnerFlowDTO.setUserUid(qaQueUsrLocal.getUid().toString()); + } else { + generalLearnerFlowDTO.setUserUid(null); + } - generalLearnerFlowDTO.setUserUid(qaQueUsrLocal.getUid().toString()); - logger.debug("fwd'ing to for learner progress" + INDIVIDUAL_LEARNER_REPORT); return (mapping.findForward(INDIVIDUAL_LEARNER_REPORT)); @@ -557,7 +560,7 @@ logger.debug("using generalLearnerFlowDTO: " + generalLearnerFlowDTO); qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, isUserNamesVisible, true, - currentToolSessionID.toString(), null, generalLearnerFlowDTO, false, toolSessionID); + currentToolSessionID.toString(), userID, generalLearnerFlowDTO, false, toolSessionID); logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO); logger.debug("current sessionMap: " + sessionMap); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java =================================================================== diff -u -r163c7460795072098035147b45ece51edb87e4ef -r7d13e6e6b653149634a2867a4aa964bb929c773f --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java (.../QaMonitoringAction.java) (revision 163c7460795072098035147b45ece51edb87e4ef) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java (.../QaMonitoringAction.java) (revision 7d13e6e6b653149634a2867a4aa964bb929c773f) @@ -1660,10 +1660,11 @@ /** - * populates data for summary screen - * refreshSummaryData(HttpServletRequest request, QaContent qaContent, IQaService qaService, - boolean isUserNamesVisible, boolean isLearnerRequest, String currentSessionId, String userId) - + * populates data for summary screen, view all results screen and export portfolio. + * + * User id is needed if isUserNamesVisible is false && learnerRequest is true, + * as it is required to work out if the data being analysed is the current user. + * * @param request * @param qaContent * @param qaService Index: lams_tool_laqa/web/export/exportportfolio.jsp =================================================================== diff -u -r11b770ec0d93423621c0a01bd8be9df57c40a704 -r7d13e6e6b653149634a2867a4aa964bb929c773f --- lams_tool_laqa/web/export/exportportfolio.jsp (.../exportportfolio.jsp) (revision 11b770ec0d93423621c0a01bd8be9df57c40a704) +++ lams_tool_laqa/web/export/exportportfolio.jsp (.../exportportfolio.jsp) (revision 7d13e6e6b653149634a2867a4aa964bb929c773f) @@ -38,22 +38,20 @@
-

- -

+

+

- - - - - - -
- -
-
+ + + + + +
+ +
+
@@ -179,41 +177,47 @@ - - - + + + <%-- Reflection heading - do first time through loop --%> + + - + + + + + <%-- Close off table / rows - do last time through loop --%> + +
+ - - - - - - - - - - - - - + + + + - + <%-- The actual output of a reflection --%> + + + + + + + - - - -
- -
- : -
+ +
- -
+ : + - -
-
+ + + +
+ +
+ + Index: lams_tool_laqa/web/learning/IndividualLearnerResults.jsp =================================================================== diff -u -re3eb83e87a5bef64bc727432b2b3adb7ff1a349e -r7d13e6e6b653149634a2867a4aa964bb929c773f --- lams_tool_laqa/web/learning/IndividualLearnerResults.jsp (.../IndividualLearnerResults.jsp) (revision e3eb83e87a5bef64bc727432b2b3adb7ff1a349e) +++ lams_tool_laqa/web/learning/IndividualLearnerResults.jsp (.../IndividualLearnerResults.jsp) (revision 7d13e6e6b653149634a2867a4aa964bb929c773f) @@ -144,23 +144,23 @@ + onclick="submitMethod('storeAllResults');" styleClass="button">