Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java,v diff -u -r1.63 -r1.64 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java 29 Aug 2006 04:36:54 -0000 1.63 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java 29 Aug 2006 13:30:34 -0000 1.64 @@ -2059,21 +2059,21 @@ Date now = new Date(); QaContent toolContentObj = new QaContent(); - toolContentObj.setContentLocked(Boolean.FALSE); + toolContentObj.setContentLocked(Boolean.FALSE.booleanValue() ); toolContentObj.setCreatedBy(user.getUserID().longValue()); toolContentObj.setCreationDate(now); - toolContentObj.setDefineLater(Boolean.FALSE); + toolContentObj.setDefineLater(Boolean.FALSE.booleanValue()); toolContentObj.setInstructions(null); toolContentObj.setOfflineInstructions(null); toolContentObj.setOnlineInstructions(null); // TODO add reflection //toolContentObj.setReflectInstructions(null); //toolContentObj.setReflectOnActivity(Boolean.FALSE); - toolContentObj.setRunOffline(Boolean.FALSE); + toolContentObj.setRunOffline(Boolean.FALSE.booleanValue()); toolContentObj.setTitle((String)importValues.get(ToolContentImport102Manager.CONTENT_TITLE)); toolContentObj.setQaContentId(toolContentId); toolContentObj.setUpdateDate(now); - toolContentObj.setQuestionsSequenced(Boolean.FALSE); // there is only 1 question + toolContentObj.setQuestionsSequenced(Boolean.FALSE.booleanValue()); // there is only 1 question toolContentObj.setContent(null); toolContentObj.setReportTitle(null); toolContentObj.setMonitoringReportTitle(null); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java,v diff -u -r1.18 -r1.19 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java 28 Aug 2006 11:28:30 -0000 1.18 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java 29 Aug 2006 13:30:34 -0000 1.19 @@ -261,7 +261,7 @@ GeneralLearnerFlowDTO generalLearnerFlowDTO= LearningUtil.buildGeneralLearnerFlowDTO(qaContent); logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); - Map mapQuestions= new TreeMap(new QaComparator()); + Map mapQuestions= new TreeMap(new QaComparator()); Map mapAnswers= new TreeMap(new QaComparator()); generalLearnerFlowDTO.setCurrentQuestionIndex(new Integer(1)); @@ -358,7 +358,14 @@ generalLearnerFlowDTO.setMapQuestionContentLearner(mapQuestions); generalLearnerFlowDTO.setMapQuestions(mapQuestions); logger.debug("mapQuestions has : " + mapQuestions.size() + " entries."); - + + if (mapAnswers != null) + { + String currentAnswer=(String)mapAnswers.get("1"); + logger.debug("first entry as the current answer : " + currentAnswer); + generalLearnerFlowDTO.setCurrentAnswer(currentAnswer); + } + generalLearnerFlowDTO.setTotalQuestionCount(new Integer(mapQuestions.size())); qaLearningForm.setTotalQuestionCount(new Integer(mapQuestions.size()).toString()); @@ -503,6 +510,8 @@ populateAnswersMap(qaLearningForm, request, generalLearnerFlowDTO, true, false); + + return (mapping.findForward(LOAD_LEARNER)); } @@ -527,6 +536,12 @@ String currentQuestionIndex=qaLearningForm.getCurrentQuestionIndex(); logger.debug("currentQuestionIndex:" + currentQuestionIndex); + Map mapAnswers=(Map)sessionMap.get(MAP_ALL_RESULTS_KEY); + logger.debug("mapAnswers retrieved: " + mapAnswers); + + if (mapAnswers == null) + mapAnswers= new TreeMap(new QaComparator()); + logger.debug("getting answer for question: " + currentQuestionIndex + "as: " + qaLearningForm.getAnswer()); logger.debug("mapSequentialAnswers size:" + mapSequentialAnswers.size()); @@ -541,6 +556,16 @@ logger.debug("adding new answer:" + qaLearningForm.getAnswer() + " to mapSequentialAnswers."); logger.debug("updated mapSequentialAnswers:" + mapSequentialAnswers); + + mapAnswers.put(currentQuestionIndex, qaLearningForm.getAnswer()); + logger.debug("updated mapAnswers:" + mapAnswers); + + 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); + int intCurrentQuestionIndex=new Integer(currentQuestionIndex).intValue(); logger.debug("intCurrentQuestionIndex:" + intCurrentQuestionIndex); @@ -555,9 +580,10 @@ logger.debug("current map size:" + mapSequentialAnswers.size()); String currentAnswer=""; - if (mapSequentialAnswers.size() >= intCurrentQuestionIndex) + if (mapAnswers.size() >= intCurrentQuestionIndex) { - currentAnswer=(String)mapSequentialAnswers.get(new Long(intCurrentQuestionIndex).toString()); + currentAnswer=(String)mapAnswers.get(new Long(intCurrentQuestionIndex).toString()); + logger.debug("currentAnswer:" + currentAnswer); } logger.debug("currentAnswer:" + currentAnswer); generalLearnerFlowDTO.setCurrentAnswer(currentAnswer);