Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java =================================================================== diff -u -re9b9a4b7a0e27ad4a900150c29a30cd0e1eff428 -re3a9298bc43dacd6add3de2f6d9e3ec061f84af6 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java (.../QaLearningAction.java) (revision e9b9a4b7a0e27ad4a900150c29a30cd0e1eff428) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java (.../QaLearningAction.java) (revision e3a9298bc43dacd6add3de2f6d9e3ec061f84af6) @@ -142,13 +142,18 @@ ServletException { logger.debug("dispatching submitAnswersContent..." + request); + QaLearningForm qaLearningForm = (QaLearningForm) form; Map mapQuestions=(Map)request.getSession().getAttribute(MAP_QUESTION_CONTENT_LEARNER); logger.debug("MAP_QUESTION_CONTENT_LEARNER:" + request.getSession().getAttribute(MAP_QUESTION_CONTENT_LEARNER)); Map mapAnswers=(Map)request.getSession().getAttribute(MAP_ANSWERS); logger.debug(logger + " " + this.getClass().getName() + "submit the responses: " + mapAnswers); + + String totalQuestionCount=(String)request.getSession().getAttribute(TOTAL_QUESTION_COUNT); + logger.debug("totalQuestionCount: " + totalQuestionCount); + String questionListingMode=(String) request.getSession().getAttribute(QUESTION_LISTING_MODE); /* if the listing mode is QUESTION_LISTING_MODE_COMBINED populate the answers here*/ if (questionListingMode.equalsIgnoreCase(QUESTION_LISTING_MODE_COMBINED)) @@ -161,10 +166,20 @@ mapAnswers.put(new Long(questionIndex).toString(), answer); } } + else + { + if (totalQuestionCount.equals("1")) + { + logger.debug("totalQuestionCount is 1: " + qaLearningForm.getAnswer()); + mapAnswers.put(new Long(1).toString(), qaLearningForm.getAnswer()); + + } + + } logger.debug(logger + " " + this.getClass().getName() + "final mapAnswers: " + mapAnswers); + request.getSession().setAttribute(MAP_ANSWERS, mapAnswers); - QaLearningForm qaLearningForm = (QaLearningForm) form; - + IQaService qaService = (IQaService)request.getSession().getAttribute(TOOL_SERVICE); logger.debug("qaService: " + qaService); if (qaService == null) @@ -210,7 +225,7 @@ QaMonitoringAction qaMonitoringAction= new QaMonitoringAction(); /*the report should have all the users' entries OR * the report should have only the current session's entries*/ - qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, isUserNamesVisible, true, currentSessionId, null); + qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, isUserNamesVisible, true, currentSessionId, userID); request.getSession().setAttribute(REQUEST_LEARNING_REPORT, new Boolean(true).toString()); logger.debug("fwd'ing to." + LEARNER_REPORT); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java =================================================================== diff -u -rd209d27db8fcd94344c8160d628ae1edf0258894 -re3a9298bc43dacd6add3de2f6d9e3ec061f84af6 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java (.../QaLearningStarterAction.java) (revision d209d27db8fcd94344c8160d628ae1edf0258894) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java (.../QaLearningStarterAction.java) (revision e3a9298bc43dacd6add3de2f6d9e3ec061f84af6) @@ -413,15 +413,18 @@ * check if the mode is teacher and request is for Learner Progress */ logger.debug("userId: " + userId); - if ((userId != null) && (mode.equals("teacher"))) + String learnerProgressUserId=request.getParameter(USER_ID); + logger.debug("learnerProgressUserId: " + learnerProgressUserId); + + if ((learnerProgressUserId != null) && (mode.equals("teacher"))) { logger.debug("start generating learner progress report."); Long currentToolSessionId=(Long)request.getSession().getAttribute(TOOL_SESSION_ID); logger.debug("currentToolSessionId: " + currentToolSessionId); /* the report should have only this user's entries(with userId)*/ QaMonitoringAction qaMonitoringAction= new QaMonitoringAction(); - qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, true, true, currentToolSessionId.toString(), userId); + qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, true, true, currentToolSessionId.toString(), learnerProgressUserId); request.getSession().setAttribute(REQUEST_LEARNING_REPORT, new Boolean(true).toString()); request.getSession().setAttribute(REQUEST_LEARNING_REPORT_PROGRESS, new Boolean(true).toString()); @@ -449,39 +452,46 @@ * * if the user's tool session id AND user id exists in the tool tables go to learner's report. */ - QaQueUsr qaQueUsr=qaService.loadQaQueUsr(new Long(userId)); - logger.debug("QaQueUsr:" + qaQueUsr); - if (qaQueUsr != null) + if (userId != null) { - QaSession checkSession=qaQueUsr.getQaSession(); - logger.debug("checkSession:" + checkSession); - Long currentToolSessionId=(Long)request.getSession().getAttribute(TOOL_SESSION_ID); - logger.debug("currentToolSessionId: " + currentToolSessionId); - - if (checkSession != null) - { - Long checkQaSessionId=checkSession.getQaSessionId(); - logger.debug("checkQaSessionId:" + checkQaSessionId); - if (checkQaSessionId.toString().equals(currentToolSessionId.toString())) - { - logger.debug("the learner is in the same session and has already responsed to this content, just generate a read-only report."); - Boolean isUserNamesVisibleBoolean=(Boolean)request.getSession().getAttribute(IS_USERNAME_VISIBLE); - boolean isUserNamesVisible=isUserNamesVisibleBoolean.booleanValue(); - logger.debug("isUserNamesVisible: " + isUserNamesVisible); + QaQueUsr qaQueUsr=qaService.loadQaQueUsr(new Long(userId)); + logger.debug("QaQueUsr:" + qaQueUsr); + if (qaQueUsr != null) + { + QaSession checkSession=qaQueUsr.getQaSession(); + logger.debug("checkSession:" + checkSession); + Long currentToolSessionId=(Long)request.getSession().getAttribute(TOOL_SESSION_ID); + logger.debug("currentToolSessionId: " + currentToolSessionId); + + if (checkSession != null) + { + Long checkQaSessionId=checkSession.getQaSessionId(); + logger.debug("checkQaSessionId:" + checkQaSessionId); + if (checkQaSessionId.toString().equals(currentToolSessionId.toString())) + { + logger.debug("the learner is in the same session and has already responsed to this content, just generate a read-only report."); + Boolean isUserNamesVisibleBoolean=(Boolean)request.getSession().getAttribute(IS_USERNAME_VISIBLE); + boolean isUserNamesVisible=isUserNamesVisibleBoolean.booleanValue(); + logger.debug("isUserNamesVisible: " + isUserNamesVisible); - - QaMonitoringAction qaMonitoringAction= new QaMonitoringAction(); - /*the report should have all the users' entries OR - * the report should have only the current session's entries*/ - request.getSession().setAttribute(REQUEST_LEARNING_REPORT_VIEWONLY, new Boolean(true).toString()); - qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, isUserNamesVisible, true, currentToolSessionId.toString(), null); - - request.getSession().setAttribute(REQUEST_LEARNING_REPORT, new Boolean(true).toString()); - logger.debug("fwd'ing to." + LEARNER_REPORT); - return (mapping.findForward(LEARNER_REPORT)); - } - } + + QaMonitoringAction qaMonitoringAction= new QaMonitoringAction(); + /*the report should have all the users' entries OR + * the report should have only the current session's entries*/ + request.getSession().setAttribute(REQUEST_LEARNING_REPORT_VIEWONLY, new Boolean(true).toString()); + qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, isUserNamesVisible, true, currentToolSessionId.toString(), null); + + request.getSession().setAttribute(REQUEST_LEARNING_REPORT, new Boolean(true).toString()); + logger.debug("fwd'ing to." + LEARNER_REPORT); + return (mapping.findForward(LEARNER_REPORT)); + } + } + } } + else + { + logger.debug("userId is null, it should not be, report this."); + } /* * if the content is not ready yet, don't even proceed. Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java =================================================================== diff -u -r5ce575b11f3206c1e80792d2a2be752612bd26d7 -re3a9298bc43dacd6add3de2f6d9e3ec061f84af6 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java (.../QaStarterAction.java) (revision 5ce575b11f3206c1e80792d2a2be752612bd26d7) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java (.../QaStarterAction.java) (revision e3a9298bc43dacd6add3de2f6d9e3ec061f84af6) @@ -391,6 +391,8 @@ logger.debug("QaContent: " + qaContent); QaUtils.setDefaultSessionAttributes(request, qaContent, qaAuthoringForm); + logger.debug("form title is: : " + qaAuthoringForm.getTitle()); + QaUtils.populateUploadedFilesData(request, qaContent, qaService); request.getSession().setAttribute(IS_DEFINE_LATER, new Boolean(qaContent.isDefineLater())); @@ -537,7 +539,6 @@ return (mapping.findForward(LOAD_QUESTIONS)); } logger.debug("using qaQueContent uid: " + qaQueContent.getUid()); - //request.getSession().setAttribute(DEFAULT_QUESTION_UID, new Long(queContentUID)); request.getSession().setAttribute(DEFAULT_QUESTION_CONTENT, qaQueContent.getQuestion()); } catch(Exception e) Index: lams_tool_laqa/web/learning/SequentialAnswersContent.jsp =================================================================== diff -u -rb7d1cba64f8a7451afeead5b83c37f7c6c074f1c -re3a9298bc43dacd6add3de2f6d9e3ec061f84af6 --- lams_tool_laqa/web/learning/SequentialAnswersContent.jsp (.../SequentialAnswersContent.jsp) (revision b7d1cba64f8a7451afeead5b83c37f7c6c074f1c) +++ lams_tool_laqa/web/learning/SequentialAnswersContent.jsp (.../SequentialAnswersContent.jsp) (revision e3a9298bc43dacd6add3de2f6d9e3ec061f84af6) @@ -55,7 +55,8 @@
|
+ |
+
|
|