Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ExportServlet.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ExportServlet.java,v diff -u -r1.12 -r1.13 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ExportServlet.java 2 Oct 2006 01:59:34 -0000 1.12 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ExportServlet.java 22 May 2007 07:27:23 -0000 1.13 @@ -105,16 +105,11 @@ McSession mcSession=mcService.retrieveMcSession(toolSessionID); + // If the learner hasn't selected any options yet, then they won't exist in the session. + // Yet we might be asked for their page, as the activity has been commenced. So need to do a "blank" page in that case McQueUsr learner = mcService.getMcUserBySession(userID,mcSession.getUid()); logger.debug("learner: " + learner); - if (learner == null) - { - String error="The user with user id " + userID + " does not exist in this session or session may not exist."; - logger.error(error); - throw new McApplicationException(error); - } - McContent content=mcSession.getMcContent(); logger.debug("content: " + content); logger.debug("content id: " + content.getMcContentId()); @@ -125,22 +120,20 @@ logger.error(error); throw new McApplicationException(error); } - - McMonitoringAction mcMonitoringAction= new McMonitoringAction(); List listMonitoredAnswersContainerDTO=MonitoringUtil.buildGroupsQuestionDataForExportLearner(request, content, mcService, mcSession, learner ); 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 ( learner != null ) { + String intTotalMark=viewAnswers(request, content, learner, mcSession, mcService); + logger.debug("intTotalMark: " + intTotalMark); + request.getSession().setAttribute(LEARNER_MARK,intTotalMark); + request.getSession().setAttribute(LEARNER_NAME,learner.getFullname() ); + } - String intTotalMark=viewAnswers(request, content, learner, mcSession, mcService); - logger.debug("intTotalMark: " + intTotalMark); - - request.getSession().setAttribute(LEARNER_MARK,intTotalMark); - request.getSession().setAttribute(LEARNER_NAME,learner.getFullname() ); request.getSession().setAttribute(PASSMARK,content.getPassMark().toString()); - request.getSession().setAttribute(PORTFOLIO_EXPORT_MODE, "learner"); mcMonitoringAction.prepareReflectionData(request, content, mcService, userID.toString(), true); logger.debug("ending learner mode: ");