Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/LearningUtil.java =================================================================== diff -u -r6ce3706b391e6c79a50eb0180c14e2ee4535fff5 -ref86b9bcf237dc6dc32989b19793d14acc46ef28 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/LearningUtil.java (.../LearningUtil.java) (revision 6ce3706b391e6c79a50eb0180c14e2ee4535fff5) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/LearningUtil.java (.../LearningUtil.java) (revision ef86b9bcf237dc6dc32989b19793d14acc46ef28) @@ -56,6 +56,27 @@ public class LearningUtil implements McAppConstants { static Logger logger = Logger.getLogger(LearningUtil.class.getName()); + + public static void saveFormRequestData(HttpServletRequest request, McLearningForm mcLearningForm) + { + String passMarkApplicable=request.getParameter("passMarkApplicable"); + logger.debug("passMarkApplicable: " + passMarkApplicable); + mcLearningForm.setPassMarkApplicable(passMarkApplicable); + + String userOverPassMark=request.getParameter("userOverPassMark"); + logger.debug("userOverPassMark: " + userOverPassMark); + mcLearningForm.setUserOverPassMark(userOverPassMark); + + String learnerProgress=request.getParameter("learnerProgress"); + logger.debug("learnerProgress: " + learnerProgress); + mcLearningForm.setLearnerProgress(learnerProgress); + + String learnerProgressUserId=request.getParameter("learnerProgressUserId"); + logger.debug("learnerProgressUserId: " + learnerProgressUserId); + mcLearningForm.setLearnerProgressUserId(learnerProgressUserId); + logger.debug("done saving form request data."); + } + /** * updates the Map based on learner activity * selectOptionsCheckBox(HttpServletRequest request,McLearningForm mcLearningForm, String questionIndex) Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningAction.java =================================================================== diff -u -r6ce3706b391e6c79a50eb0180c14e2ee4535fff5 -ref86b9bcf237dc6dc32989b19793d14acc46ef28 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningAction.java (.../McLearningAction.java) (revision 6ce3706b391e6c79a50eb0180c14e2ee4535fff5) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningAction.java (.../McLearningAction.java) (revision ef86b9bcf237dc6dc32989b19793d14acc46ef28) @@ -207,9 +207,8 @@ ServletException { McUtils.cleanUpUserExceptions(request); - McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; - AuthoringUtil.readData(request, mcAuthoringForm); - mcAuthoringForm.resetUserAction(); + McLearningForm mcLearningForm = (McLearningForm) form; + LearningUtil.saveFormRequestData(request, mcLearningForm); return null; } @@ -259,8 +258,21 @@ McLearningForm mcLearningForm = (McLearningForm) form; IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - String toolContentId=mcLearningForm.getToolContentId(); - logger.debug("toolContentId: " + toolContentId); + LearningUtil.saveFormRequestData(request, mcLearningForm); + + String toolSessionID=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); + logger.debug("toolSessionID: " + toolSessionID); + mcLearningForm.setToolSessionID(toolSessionID); + + McSession mcSession=mcService.retrieveMcSession(new Long(toolSessionID)); + logger.debug("retrieving mcSession: " + mcSession); + + String toolContentId=mcSession.getMcContent().getMcContentId().toString(); + logger.debug("toolContentId: " + toolContentId); + mcLearningForm.setToolContentID(toolContentId); + + //String toolContentId=mcLearningForm.getToolContentId(); + //logger.debug("toolContentId: " + toolContentId); logger.debug("mcLearningForm nextQuestionSelected : " + mcLearningForm.getNextQuestionSelected()); @@ -293,7 +305,7 @@ { setContentInUse(request, toolContentId, mcService); logger.debug("requested redoQuestionsOk, user is sure to redo the questions."); - mcLearningForm.resetCommands(); + //mcLearningForm.resetCommands(); return redoQuestions(request, mcLearningForm, mapping); } else if (mcLearningForm.getViewAnswers() != null) @@ -310,12 +322,8 @@ { logger.debug("requested learner finished, the learner should be directed to next activity."); - String toolSessionId=mcLearningForm.getToolSessionId(); - logger.debug("toolSessionId: " + toolSessionId); + logger.debug("toolSessionID: " + toolSessionID); - McSession mcSession=mcService.retrieveMcSession(new Long(toolSessionId)); - logger.debug("retrieving mcSession: " + mcSession); - String userID = ""; HttpSession ss = SessionManager.getSession(); logger.debug("ss: " + ss); @@ -330,40 +338,40 @@ } } - logger.debug("attempting to leave/complete session with toolSessionId:" + toolSessionId + " and userID:"+userID); + logger.debug("attempting to leave/complete session with toolSessionId:" + toolSessionID + " and userID:"+userID); McUtils.cleanUpSessionAbsolute(request); String nextUrl=null; try { - nextUrl=mcService.leaveToolSession(new Long(toolSessionId), new Long(userID)); + nextUrl=mcService.leaveToolSession(new Long(toolSessionID), new Long(userID)); logger.debug("nextUrl: "+ nextUrl); } catch (DataMissingException e) { logger.debug("failure getting nextUrl: "+ e); - mcLearningForm.resetCommands(); + //mcLearningForm.resetCommands(); //throw new ServletException(e); return (mapping.findForward(LEARNING_STARTER)); } catch (ToolException e) { logger.debug("failure getting nextUrl: "+ e); - mcLearningForm.resetCommands(); + //mcLearningForm.resetCommands(); //throw new ServletException(e); return (mapping.findForward(LEARNING_STARTER)); } catch (Exception e) { logger.debug("unknown exception getting nextUrl: "+ e); - mcLearningForm.resetCommands(); + //mcLearningForm.resetCommands(); //throw new ServletException(e); return (mapping.findForward(LEARNING_STARTER)); } logger.debug("success getting nextUrl: "+ nextUrl); - mcLearningForm.resetCommands(); + //mcLearningForm.resetCommands(); McQueUsr mcQueUsr=mcService.getMcUserBySession(new Long(userID), mcSession.getUid()); logger.debug("mcQueUsr:" + mcQueUsr); @@ -390,14 +398,14 @@ logger.debug("updated user records to finished"); } - /* pay attention here*/ + logger.debug("redirecting to the nextUrl: "+ nextUrl); response.sendRedirect(nextUrl); return null; } - mcLearningForm.resetCommands(); + //mcLearningForm.resetCommands(); return (mapping.findForward(LOAD_LEARNER)); } @@ -602,8 +610,18 @@ } logger.debug("learnerInput: " + learnerInput); - String toolContentId=mcLearningForm.getToolContentId(); - logger.debug("toolContentId: " + toolContentId); + //String toolContentId=mcLearningForm.getToolContentId(); + //logger.debug("toolContentId: " + toolContentId); + + String toolSessionID=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); + logger.debug("toolSessionID: " + toolSessionID); + + McSession mcSession=mcService.retrieveMcSession(new Long(toolSessionID)); + logger.debug("retrieving mcSession: " + mcSession); + + String toolContentId=mcSession.getMcContent().getMcContentId().toString(); + logger.debug("toolContentId: " + toolContentId); + /* process the answers */ McContent mcContent=mcService.retrieveMc(new Long(toolContentId)); @@ -676,13 +694,9 @@ } */ - String toolSessionId=mcLearningForm.getToolSessionId(); - logger.debug("toolSessionId: " + toolSessionId); + //String toolSessionId=mcLearningForm.getToolSessionId(); + //logger.debug("toolSessionId: " + toolSessionId); - - McSession mcSession=mcService.retrieveMcSession(new Long(toolSessionId)); - logger.debug("retrieving mcSession: " + mcSession); - Long toolSessionUid=mcSession.getUid(); logger.debug("toolSessionUid: " + toolSessionUid); @@ -716,7 +730,7 @@ McQueUsr mcQueUsr=null; if (isUserDefined == false) { - mcQueUsr=LearningUtil.createUser(request, mcService, new Long(toolSessionId)); + mcQueUsr=LearningUtil.createUser(request, mcService, new Long(toolSessionID)); logger.debug("created user in the db: " + mcQueUsr); } else @@ -758,7 +772,7 @@ logger.debug("user over passmark:" + mcLearningForm.getUserOverPassMark()); logger.debug("is passmark applicable:" + mcLearningForm.getPassMarkApplicable()); - mcLearningForm.resetCommands(); + //mcLearningForm.resetCommands(); request.setAttribute(MC_GENERAL_LEARNER_FLOW_DTO, mcGeneralLearnerFlowDTO); logger.debug("MC_GENERAL_LEARNER_FLOW_DTO: " + request.getAttribute(MC_GENERAL_LEARNER_FLOW_DTO)); @@ -793,8 +807,17 @@ String questionIndex=mcLearningForm.getQuestionIndex(); logger.debug("questionIndex: " + questionIndex); - String toolContentId=mcLearningForm.getToolContentId(); - logger.debug("toolContentId: " + toolContentId); + String toolSessionID=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); + logger.debug("toolSessionID: " + toolSessionID); + + McSession mcSession=mcService.retrieveMcSession(new Long(toolSessionID)); + logger.debug("retrieving mcSession: " + mcSession); + + String toolContentId=mcSession.getMcContent().getMcContentId().toString(); + logger.debug("toolContentId: " + toolContentId); + + //String toolContentId=mcLearningForm.getToolContentId(); + //logger.debug("toolContentId: " + toolContentId); McContent mcContent=mcService.retrieveMc(new Long(toolContentId)); logger.debug("mcContent: " + mcContent); @@ -819,7 +842,7 @@ mcGeneralLearnerFlowDTO.setTotalCountReached(new Boolean(true).toString()); } - mcLearningForm.resetCommands(); + //mcLearningForm.resetCommands(); mcGeneralLearnerFlowDTO.setQuestionIndex(new Integer(questionIndex).toString()); request.setAttribute(MC_GENERAL_LEARNER_FLOW_DTO, mcGeneralLearnerFlowDTO); @@ -851,8 +874,17 @@ McLearningForm mcLearningForm = (McLearningForm) form; IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - String toolContentId=mcLearningForm.getToolContentId(); - logger.debug("toolContentId: " + toolContentId); + //String toolContentId=mcLearningForm.getToolContentId(); + //logger.debug("toolContentId: " + toolContentId); + + String toolSessionID=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); + logger.debug("toolSessionID: " + toolSessionID); + + McSession mcSession=mcService.retrieveMcSession(new Long(toolSessionID)); + logger.debug("retrieving mcSession: " + mcSession); + + String toolContentId=mcSession.getMcContent().getMcContentId().toString(); + logger.debug("toolContentId: " + toolContentId); McContent mcContent=mcService.retrieveMc(new Long(toolContentId)); logger.debug("mcContent: " + mcContent); @@ -869,12 +901,9 @@ //request.getSession().setAttribute(CURRENT_QUESTION_INDEX, "1"); //request.getSession().setAttribute(TOTAL_COUNT_REACHED, new Boolean(false).toString()); - String toolSessionId=mcLearningForm.getToolSessionId(); - logger.debug("toolSessionId: " + toolSessionId); - - McSession mcSession=mcService.retrieveMcSession(new Long(toolSessionId)); - logger.debug("retrieving mcSession: " + mcSession); - + //String toolSessionId=mcLearningForm.getToolSessionId(); + //logger.debug("toolSessionId: " + toolSessionId); + String userID = ""; HttpSession ss = SessionManager.getSession(); logger.debug("ss: " + ss); @@ -903,7 +932,7 @@ request.setAttribute(MC_GENERAL_LEARNER_FLOW_DTO, mcGeneralLearnerFlowDTO); logger.debug("MC_GENERAL_LEARNER_FLOW_DTO: " + request.getAttribute(MC_GENERAL_LEARNER_FLOW_DTO)); - mcLearningForm.resetCommands(); + //mcLearningForm.resetCommands(); return (mapping.findForward(REDO_QUESTIONS)); } @@ -933,15 +962,18 @@ McLearningForm mcLearningForm = (McLearningForm) form; IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - String toolContentId=mcLearningForm.getToolContentId(); - logger.debug("toolContentId: " + toolContentId); + //String toolContentId=mcLearningForm.getToolContentId(); + //logger.debug("toolContentId: " + toolContentId); + + String toolSessionID=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); + logger.debug("toolSessionID: " + toolSessionID); - String toolSessionId=mcLearningForm.getToolSessionId(); - logger.debug("toolSessionId: " + toolSessionId); + McSession mcSession=mcService.retrieveMcSession(new Long(toolSessionID)); + logger.debug("retrieving mcSession: " + mcSession); - McSession mcSession=mcService.retrieveMcSession(new Long(toolSessionId)); - logger.debug("retrieving mcSession: " + mcSession); - + String toolContentId=mcSession.getMcContent().getMcContentId().toString(); + logger.debug("toolContentId: " + toolContentId); + McContent mcContent=mcService.retrieveMc(new Long(toolContentId)); logger.debug("mcContent: " + mcContent); @@ -990,7 +1022,7 @@ Long queUsrId=null; if (learnerProgressOn == false) { - mcQueUsr=LearningUtil.getUser(request, mcService, toolSessionId); + mcQueUsr=LearningUtil.getUser(request, mcService, toolSessionID); logger.debug("mcQueUsr: " + mcQueUsr); queUsrId=mcQueUsr.getUid(); @@ -1123,7 +1155,7 @@ request.setAttribute(MC_GENERAL_LEARNER_FLOW_DTO, mcGeneralLearnerFlowDTO); logger.debug("MC_GENERAL_LEARNER_FLOW_DTO: " + request.getAttribute(MC_GENERAL_LEARNER_FLOW_DTO)); - mcLearningForm.resetCommands(); + //mcLearningForm.resetCommands(); return (mapping.findForward(VIEW_ANSWERS)); } @@ -1150,10 +1182,19 @@ logger.debug("dispatching viewSummary..."); McLearningForm mcLearningForm = (McLearningForm) form; IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - - String toolContentId=mcLearningForm.getToolContentId(); - logger.debug("toolContentId: " + toolContentId); - + + //String toolContentId=mcLearningForm.getToolContentId(); + //logger.debug("toolContentId: " + toolContentId); + + String toolSessionID=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); + logger.debug("toolSessionID: " + toolSessionID); + + McSession mcSession=mcService.retrieveMcSession(new Long(toolSessionID)); + logger.debug("retrieving mcSession: " + mcSession); + + String toolContentId=mcSession.getMcContent().getMcContentId().toString(); + logger.debug("toolContentId: " + toolContentId); + McContent mcContent=mcService.retrieveMc(new Long(toolContentId)); logger.debug("mcContent: " + mcContent); @@ -1163,13 +1204,13 @@ Iterator sessionsIterator=mcContent.getMcSessions().iterator(); while (sessionsIterator.hasNext()) { - McSession mcSession= (McSession)sessionsIterator.next(); + McSession mcSessionLocal= (McSession)sessionsIterator.next(); if (mcSession != null) { - logger.debug("mcSession: " + mcSession); - if (mcSession.getSessionStatus().equals(COMPLETED)) + logger.debug("mcSessionLocal: " + mcSessionLocal); + if (mcSessionLocal.getSessionStatus().equals(COMPLETED)) { - logger.debug("COMPLETED session found: " + mcSession); + logger.debug("COMPLETED session found: " + mcSessionLocal); ++countSessionComplete; } } @@ -1194,7 +1235,7 @@ request.setAttribute(MC_GENERAL_LEARNER_FLOW_DTO, mcGeneralLearnerFlowDTO); logger.debug("MC_GENERAL_LEARNER_FLOW_DTO: " + request.getAttribute(MC_GENERAL_LEARNER_FLOW_DTO)); - mcLearningForm.resetCommands(); + //mcLearningForm.resetCommands(); return (mapping.findForward(RESULTS_SUMMARY)); } @@ -1236,13 +1277,22 @@ /* reset the checked options MAP */ Map mapGeneralCheckedOptionsContent= new TreeMap(new McComparator()); - String toolContentId=mcLearningForm.getToolContentId(); - logger.debug("toolContentId: " + toolContentId); + //String toolContentId=mcLearningForm.getToolContentId(); + //logger.debug("toolContentId: " + toolContentId); + String toolSessionID=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); + logger.debug("toolSessionID: " + toolSessionID); + + McSession mcSession=mcService.retrieveMcSession(new Long(toolSessionID)); + logger.debug("retrieving mcSession: " + mcSession); + + String toolContentId=mcSession.getMcContent().getMcContentId().toString(); + logger.debug("toolContentId: " + toolContentId); + McContent mcContent=mcService.retrieveMc(new Long(toolContentId)); logger.debug("mcContent: " + mcContent); - + List listQuestionAndCandidateAnswersDTO=LearningUtil.buildQuestionAndCandidateAnswersDTO(request, mcContent, mcService); logger.debug("listQuestionAndCandidateAnswersDTO: " + listQuestionAndCandidateAnswersDTO); request.setAttribute(LIST_QUESTION_CANDIDATEANSWERS_DTO, listQuestionAndCandidateAnswersDTO); @@ -1252,7 +1302,7 @@ request.setAttribute(MC_GENERAL_LEARNER_FLOW_DTO, mcGeneralLearnerFlowDTO); logger.debug("MC_GENERAL_LEARNER_FLOW_DTO: " + request.getAttribute(MC_GENERAL_LEARNER_FLOW_DTO)); - mcLearningForm.resetCommands(); + //mcLearningForm.resetCommands(); logger.debug("fwding to LOAD_LEARNER: " + LOAD_LEARNER); return (mapping.findForward(LOAD_LEARNER)); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningForm.java =================================================================== diff -u -r6ce3706b391e6c79a50eb0180c14e2ee4535fff5 -ref86b9bcf237dc6dc32989b19793d14acc46ef28 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningForm.java (.../McLearningForm.java) (revision 6ce3706b391e6c79a50eb0180c14e2ee4535fff5) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningForm.java (.../McLearningForm.java) (revision ef86b9bcf237dc6dc32989b19793d14acc46ef28) @@ -47,9 +47,10 @@ protected String[] checkedCa; - protected String toolContentId; + protected String toolContentID; protected String toolContentUID; - protected String toolSessionId; + protected String toolSessionID; + protected String learningMode; protected String currentQuestionIndex; @@ -249,31 +250,6 @@ } /** - * @return Returns the toolContentId. - */ - public String getToolContentId() { - return toolContentId; - } - /** - * @param toolContentId The toolContentId to set. - */ - public void setToolContentId(String toolContentId) { - this.toolContentId = toolContentId; - } - /** - * @return Returns the toolSessionId. - */ - public String getToolSessionId() { - return toolSessionId; - } - /** - * @param toolSessionId The toolSessionId to set. - */ - public void setToolSessionId(String toolSessionId) { - this.toolSessionId = toolSessionId; - } - - /** * @return Returns the learningMode. */ public String getLearningMode() { @@ -377,4 +353,28 @@ } + /** + * @return Returns the toolContentID. + */ + public String getToolContentID() { + return toolContentID; + } + /** + * @param toolContentID The toolContentID to set. + */ + public void setToolContentID(String toolContentID) { + this.toolContentID = toolContentID; + } + /** + * @return Returns the toolSessionID. + */ + public String getToolSessionID() { + return toolSessionID; + } + /** + * @param toolSessionID The toolSessionID to set. + */ + public void setToolSessionID(String toolSessionID) { + this.toolSessionID = toolSessionID; + } } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java =================================================================== diff -u -r6ce3706b391e6c79a50eb0180c14e2ee4535fff5 -ref86b9bcf237dc6dc32989b19793d14acc46ef28 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java (.../McLearningStarterAction.java) (revision 6ce3706b391e6c79a50eb0180c14e2ee4535fff5) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java (.../McLearningStarterAction.java) (revision ef86b9bcf237dc6dc32989b19793d14acc46ef28) @@ -184,8 +184,6 @@ McUtils.cleanUpSessionAbsolute(request); - McLearnerStarterDTO mcLearnerStarterDTO= new McLearnerStarterDTO(); - Map mapQuestionsContent= new TreeMap(new McComparator()); Map mapAnswers= new TreeMap(new McComparator()); @@ -196,17 +194,17 @@ mcLearningForm.setPassMarkApplicable(new Boolean(false).toString()); mcLearningForm.setUserOverPassMark(new Boolean(false).toString()); - mcLearnerStarterDTO.setQuestionListingMode(QUESTION_LISTING_MODE_COMBINED); - - ActionForward validateParameters=validateParameters(request, mcLearningForm, mapping); + ActionForward validateParameters=validateParameters(request, mcLearningForm, mapping); logger.debug("validateParameters: " + validateParameters); if (validateParameters != null) { return validateParameters; } - String toolSessionID=mcLearningForm.getToolSessionId(); + //String toolSessionID=mcLearningForm.getToolSessionId(); + String toolSessionID=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); logger.debug("retrieved toolSessionID: " + toolSessionID); + mcLearningForm.setToolSessionID(new Long(toolSessionID).toString()); /* @@ -245,11 +243,29 @@ * The content we retrieved above must have been created before in Authoring time. * And the passed tool session id already refers to it. */ - setupAttributes(request, mcContent, mcLearnerStarterDTO); + + McLearnerStarterDTO mcLearnerStarterDTO= new McLearnerStarterDTO(); + logger.debug("IS_QUESTIONS_SEQUENCED: " + mcContent.isQuestionsSequenced()); + if (mcContent.isQuestionsSequenced()) + { + mcLearnerStarterDTO.setQuestionListingMode(QUESTION_LISTING_MODE_SEQUENTIAL); + } + else + { + mcLearnerStarterDTO.setQuestionListingMode(QUESTION_LISTING_MODE_COMBINED); + } + + + /* + * Is the tool activity been checked as Run Offline in the property inspector? + */ + logger.debug("IS_TOOL_ACTIVITY_OFFLINE: " + mcContent.isRunOffline()); + mcLearnerStarterDTO.setToolActivityOffline(new Boolean(mcContent.isRunOffline()).toString()); + mcLearnerStarterDTO.setActivityTitle(mcContent.getTitle()); request.setAttribute(MC_LEARNER_STARTER_DTO, mcLearnerStarterDTO); - mcLearningForm.setToolContentId(mcContent.getMcContentId().toString()); - mcLearningForm.setToolContentUID(mcContent.getUid().toString()); + mcLearningForm.setToolContentID(mcContent.getMcContentId().toString()); + //mcLearningForm.setToolContentUID(mcContent.getUid().toString()); commonContentSetup(request, mcContent, mcService); @@ -265,9 +281,10 @@ /* ? CHECK THIS: how do we determine whether preview is requested? Mode is not enough on its own.*/ /*handle PREVIEW mode*/ - String mode=mcLearningForm.getLearningMode(); - + //String mode=mcLearningForm.getLearningMode(); + String mode=request.getParameter(MODE); logger.debug("mode: " + mode); + if ((mode != null) && (mode.equals("author"))) { logger.debug("Author requests for a preview of the content."); @@ -389,25 +406,26 @@ logger.debug("mcQueUsr is not available in the db:" + mcQueUsr); } - String learningMode=mcLearningForm.getLearningMode(); - logger.debug("users learning mode is: " + learningMode); + + //String learningMode=mcLearningForm.getLearningMode(); + logger.debug("users learning mode is: " + mode); request.setAttribute(MC_LEARNER_STARTER_DTO, mcLearnerStarterDTO); /*if the user's session id AND user id exists in the tool tables go to redo questions.*/ - if ((mcQueUsr != null) && learningMode.equals("learner")) + if ((mcQueUsr != null) && mode.equals("learner")) { Long sessionUid=mcQueUsr.getMcSessionId(); logger.debug("users sessionUid: " + sessionUid); McSession mcUserSession= mcService.getMcSessionByUID(sessionUid); logger.debug("mcUserSession: " + mcUserSession); String userSessionId=mcUserSession.getMcSessionId().toString(); logger.debug("userSessionId: " + userSessionId); - String toolSessionId=mcLearningForm.getToolSessionId(); - logger.debug("current toolSessionId: " + toolSessionId); - if (toolSessionId.equals(userSessionId)) + logger.debug("current toolSessionID: " + toolSessionID); + + if (toolSessionID.equals(userSessionId)) { - logger.debug("the user's session id AND user id exists in the tool tables go to redo questions. " + toolSessionId + " mcQueUsr: " + + logger.debug("the user's session id AND user id exists in the tool tables go to redo questions. " + toolSessionID + " mcQueUsr: " + mcQueUsr + " user id: " + mcQueUsr.getQueUsrId()); logger.debug("the learner has already responsed to this content, just generate a read-only report. Use redo questions for this."); @@ -423,10 +441,12 @@ } } } - else if (learningMode.equals("teacher")) + else if (mode.equals("teacher")) { McLearningAction mcLearningAction= new McLearningAction(); logger.debug("present to teacher learners progress..."); + mcLearningForm.setLearnerProgress(new Boolean(true).toString()); + mcLearningForm.setLearnerProgressUserId(userId); return mcLearningAction.viewAnswers(mapping, form, request, response); } logger.debug("just presenting standard learner screen"); @@ -463,35 +483,7 @@ } - /** - * sets up session scope attributes based on content linked to the passed tool session id - * setupAttributes(HttpServletRequest request, McContent mcContent) - * - * @param request - * @param mcContent - */ - protected void setupAttributes(HttpServletRequest request, McContent mcContent, McLearnerStarterDTO mcLearnerStarterDTO) - { - /* same as 1 page per question */ - logger.debug("IS_QUESTIONS_SEQUENCED: " + mcContent.isQuestionsSequenced()); - if (mcContent.isQuestionsSequenced()) - { - mcLearnerStarterDTO.setQuestionListingMode(QUESTION_LISTING_MODE_SEQUENTIAL); - } - else - { - mcLearnerStarterDTO.setQuestionListingMode(QUESTION_LISTING_MODE_COMBINED); - } - mcLearnerStarterDTO.setActivityTitle(mcContent.getTitle()); - - /* - * Is the tool activity been checked as Run Offline in the property inspector? - */ - logger.debug("IS_TOOL_ACTIVITY_OFFLINE: " + mcContent.isRunOffline()); - mcLearnerStarterDTO.setToolActivityOffline(new Boolean(mcContent.isRunOffline()).toString()); - } - protected ActionForward validateParameters(HttpServletRequest request, McLearningForm mcLearningForm, ActionMapping mapping) { /* @@ -530,7 +522,7 @@ { toolSessionId=new Long(strToolSessionId).longValue(); logger.debug("passed TOOL_SESSION_ID : " + new Long(toolSessionId)); - mcLearningForm.setToolSessionId(new Long(toolSessionId).toString()); + //mcLearningForm.setToolSessionId(new Long(toolSessionId).toString()); } catch(NumberFormatException e) { @@ -559,7 +551,7 @@ return (mapping.findForward(ERROR_LIST)); } logger.debug("session LEARNING_MODE set to:" + mode); - mcLearningForm.setLearningMode(mode); + //mcLearningForm.setLearningMode(mode); return null; } Index: lams_tool_lamc/web/WEB-INF/struts-config.xml =================================================================== diff -u -r8a81c117f2bb66e5e4c7e5be0f2ca4bb8a1db7de -ref86b9bcf237dc6dc32989b19793d14acc46ef28 --- lams_tool_lamc/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 8a81c117f2bb66e5e4c7e5be0f2ca4bb8a1db7de) +++ lams_tool_lamc/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision ef86b9bcf237dc6dc32989b19793d14acc46ef28) @@ -198,7 +198,7 @@ @@ -273,7 +273,7 @@ - - + + + + + + Index: lams_tool_lamc/web/learning/IndividualLearnerResults.jsp =================================================================== diff -u -re49068e45839612d025d20b33368c7ca21346a6f -ref86b9bcf237dc6dc32989b19793d14acc46ef28 --- lams_tool_lamc/web/learning/IndividualLearnerResults.jsp (.../IndividualLearnerResults.jsp) (revision e49068e45839612d025d20b33368c7ca21346a6f) +++ lams_tool_lamc/web/learning/IndividualLearnerResults.jsp (.../IndividualLearnerResults.jsp) (revision ef86b9bcf237dc6dc32989b19793d14acc46ef28) @@ -49,6 +49,13 @@
+ + + + + + + + + + + + + + - - - - - -
@@ -89,16 +96,17 @@
+ +
- -
Index: lams_tool_lamc/web/learning/RedoQuestions.jsp =================================================================== diff -u -r8a81c117f2bb66e5e4c7e5be0f2ca4bb8a1db7de -ref86b9bcf237dc6dc32989b19793d14acc46ef28 --- lams_tool_lamc/web/learning/RedoQuestions.jsp (.../RedoQuestions.jsp) (revision 8a81c117f2bb66e5e4c7e5be0f2ca4bb8a1db7de) +++ lams_tool_lamc/web/learning/RedoQuestions.jsp (.../RedoQuestions.jsp) (revision ef86b9bcf237dc6dc32989b19793d14acc46ef28) @@ -49,6 +49,13 @@
+ + + + + + +
Index: lams_tool_lamc/web/learning/ResultsSummary.jsp =================================================================== diff -u -r8a81c117f2bb66e5e4c7e5be0f2ca4bb8a1db7de -ref86b9bcf237dc6dc32989b19793d14acc46ef28 --- lams_tool_lamc/web/learning/ResultsSummary.jsp (.../ResultsSummary.jsp) (revision 8a81c117f2bb66e5e4c7e5be0f2ca4bb8a1db7de) +++ lams_tool_lamc/web/learning/ResultsSummary.jsp (.../ResultsSummary.jsp) (revision ef86b9bcf237dc6dc32989b19793d14acc46ef28) @@ -49,6 +49,13 @@
+ + + + + + +
Index: lams_tool_lamc/web/learning/ViewAnswers.jsp =================================================================== diff -u -re49068e45839612d025d20b33368c7ca21346a6f -ref86b9bcf237dc6dc32989b19793d14acc46ef28 --- lams_tool_lamc/web/learning/ViewAnswers.jsp (.../ViewAnswers.jsp) (revision e49068e45839612d025d20b33368c7ca21346a6f) +++ lams_tool_lamc/web/learning/ViewAnswers.jsp (.../ViewAnswers.jsp) (revision ef86b9bcf237dc6dc32989b19793d14acc46ef28) @@ -49,6 +49,13 @@
+ + + + + + +