Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/LearningUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/LearningUtil.java,v diff -u -r1.32 -r1.33 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/LearningUtil.java 23 Jul 2006 20:14:31 -0000 1.32 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/LearningUtil.java 23 Jul 2006 22:44:55 -0000 1.33 @@ -702,6 +702,7 @@ mcGeneralLearnerFlowDTO.setActivityInstructions(mcContent.getInstructions()); mcGeneralLearnerFlowDTO.setPassMark(mcContent.getPassMark().toString()); mcGeneralLearnerFlowDTO.setReportTitleLearner(mcContent.getReportTitle()); + mcGeneralLearnerFlowDTO.setLearnerProgress(new Boolean(false).toString()); if (mcContent.isQuestionsSequenced()) mcGeneralLearnerFlowDTO.setQuestionListingMode(QUESTION_LISTING_MODE_SEQUENTIAL); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningAction.java,v diff -u -r1.30 -r1.31 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningAction.java 23 Jul 2006 20:14:31 -0000 1.30 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningAction.java 23 Jul 2006 22:44:55 -0000 1.31 @@ -257,7 +257,7 @@ McUtils.cleanUpUserExceptions(request); McLearningForm mcLearningForm = (McLearningForm) form; IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - + LearningUtil.saveFormRequestData(request, mcLearningForm); String toolSessionID=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); @@ -579,7 +579,7 @@ logger.debug("dispatching continueOptionsCombined..."); McLearningForm mcLearningForm = (McLearningForm) form; IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - logger.debug("retrieving mcService from proxy: " + mcService); + logger.debug("retrieving mcService: " + mcService); String questionListingMode=mcLearningForm.getQuestionListingMode(); logger.debug("questionListingMode: " + questionListingMode); @@ -844,7 +844,8 @@ McUtils.cleanUpUserExceptions(request); logger.debug("dispatching getNextOptions..."); McLearningForm mcLearningForm = (McLearningForm) form; - IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + logger.debug("mcService: " + mcService); String questionIndex=mcLearningForm.getQuestionIndex(); logger.debug("questionIndex: " + questionIndex); @@ -1036,13 +1037,23 @@ HttpServletResponse response) throws IOException, ServletException { - - - McUtils.cleanUpUserExceptions(request); - logger.debug("dispatching viewAnswers..."); + logger.debug("dispatching viewAnswers..." + form); McLearningForm mcLearningForm = (McLearningForm) form; - IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + logger.debug("mcLearningForm :" + mcLearningForm); + logger.debug("getServlet() :" + getServlet()); + IMcService mcService=null; + if (getServlet() != null) + mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + else + { + logger.debug("getting service from the form :"); + mcService=mcLearningForm.getMcService(); + } + logger.debug("mcService :" + mcService); + + LearningUtil.saveFormRequestData(request, mcLearningForm); + String toolSessionID=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); logger.debug("toolSessionID: " + toolSessionID); @@ -1258,7 +1269,8 @@ McUtils.cleanUpUserExceptions(request); logger.debug("dispatching viewSummary..."); McLearningForm mcLearningForm = (McLearningForm) form; - IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + logger.debug("mcService: " + mcService); String toolSessionID=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); logger.debug("toolSessionID: " + toolSessionID); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningForm.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningForm.java,v diff -u -r1.21 -r1.22 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningForm.java 23 Jul 2006 20:14:31 -0000 1.21 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningForm.java 23 Jul 2006 22:44:55 -0000 1.22 @@ -27,6 +27,7 @@ import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; import org.lamsfoundation.lams.tool.mc.McAppConstants; +import org.lamsfoundation.lams.tool.mc.service.IMcService; /** * @author Ozgur Demirtas @@ -67,6 +68,8 @@ protected String questionIndex; protected String nextQuestionSelected; protected String httpSessionID; + + public IMcService mcService; public void resetCa(ActionMapping mapping, HttpServletRequest request) { checkedCa = new String[0]; @@ -405,4 +408,17 @@ public void setSequentialCheckedCa(String[] sequentialCheckedCa) { this.sequentialCheckedCa = sequentialCheckedCa; } + + /** + * @return Returns the mcService. + */ + public IMcService getMcService() { + return mcService; + } + /** + * @param mcService The mcService to set. + */ + public void setMcService(IMcService mcService) { + this.mcService = mcService; + } } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java,v diff -u -r1.55 -r1.56 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java 23 Jul 2006 20:14:31 -0000 1.55 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java 23 Jul 2006 22:44:55 -0000 1.56 @@ -202,6 +202,7 @@ logger.debug("retrieving mcService from proxy: " + mcService); McLearningForm mcLearningForm = (McLearningForm) form; + mcLearningForm.setMcService(mcService); mcLearningForm.setPassMarkApplicable(new Boolean(false).toString()); mcLearningForm.setUserOverPassMark(new Boolean(false).toString()); @@ -324,6 +325,14 @@ mcLearningForm.setLearnerProgress(new Boolean(true).toString()); mcLearningForm.setLearnerProgressUserId(userId); + McGeneralLearnerFlowDTO mcGeneralLearnerFlowDTO=(McGeneralLearnerFlowDTO)request.getAttribute(MC_GENERAL_LEARNER_FLOW_DTO); + mcGeneralLearnerFlowDTO.setLearnerProgress(new Boolean(true).toString()); + mcGeneralLearnerFlowDTO.setLearnerProgressUserId(userId); + request.setAttribute(MC_GENERAL_LEARNER_FLOW_DTO, mcGeneralLearnerFlowDTO); + logger.debug("MC_GENERAL_LEARNER_FLOW_DTO: " + request.getAttribute(MC_GENERAL_LEARNER_FLOW_DTO)); + + + McLearningAction mcLearningAction= new McLearningAction(); /* pay attention that this userId is the learner's userId passed by the request parameter. * It is differerent than USER_ID kept in the session of the current system user*/ @@ -339,13 +348,15 @@ /* check whether the user's session really referrs to the session id passed to the url*/ Long sessionUid=mcQueUsr.getMcSessionId(); - logger.debug("sessionUid" + sessionUid); + logger.debug("sessionUid: " + sessionUid); McSession mcSessionLocal=mcService.getMcSessionByUID(sessionUid); logger.debug("checking mcSessionLocal" + mcSessionLocal); - Long toolSessionId=(Long)request.getSession().getAttribute(TOOL_SESSION_ID); - logger.debug("toolSessionId: " + toolSessionId + " versus" + mcSessionLocal); + + toolSessionID=(String)mcLearningForm.getToolSessionID(); + logger.debug("toolSessionID: " + toolSessionID + " versus" + mcSessionLocal); + if ((mcSessionLocal == null) || - (mcSessionLocal.getMcSessionId().longValue() != toolSessionId.longValue())) + (mcSessionLocal.getMcSessionId().longValue() != new Long(toolSessionID).longValue())) { McUtils.cleanUpSessionAbsolute(request); persistError(request, "error.learner.sessionId.inconsistent"); @@ -534,7 +545,6 @@ { toolSessionId=new Long(strToolSessionId).longValue(); logger.debug("passed TOOL_SESSION_ID : " + new Long(toolSessionId)); - //mcLearningForm.setToolSessionId(new Long(toolSessionId).toString()); } catch(NumberFormatException e) { Fisheye: Tag 1.2 refers to a dead (removed) revision in file `lams_tool_lamc/web/learning/Copy of SingleQuestionAnswersContent.jsp'. Fisheye: No comparison available. Pass `N' to diff?