Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/GeneralLearnerFlowDTO.java =================================================================== diff -u --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/GeneralLearnerFlowDTO.java (revision 0) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/GeneralLearnerFlowDTO.java (revision fef255c381132c29ddbd1f7a7c37106ba90f2b52) @@ -0,0 +1,305 @@ +/*************************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * ***********************************************************************/ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.qa; + +import java.util.Map; + +import org.apache.commons.lang.builder.ToStringBuilder; + + + + +/** + *

DTO that holds learner flow decision properties and some other view-only properties + *

+ * + * @author Ozgur Demirtas + */ +public class GeneralLearnerFlowDTO implements Comparable +{ + protected String activityOffline; + + protected Integer totalQuestionCount; + + protected String activityInstructions; + + protected String activityTitle; + + protected String countSessionComplete; + + protected String toolSessionID; + + protected String toolContentID; + + protected Integer currentQuestionIndex; + + protected String questionListingMode; + + protected String currentAnswer; + + protected String reportTitleLearner; + + protected String endLearningMessage; + + protected String userNameVisible; + + protected Map mapAnswers; + + protected Map mapQuestions; + + + /** + * @return Returns the currentAnswer. + */ + public String getCurrentAnswer() { + return currentAnswer; + } + /** + * @param currentAnswer The currentAnswer to set. + */ + public void setCurrentAnswer(String currentAnswer) { + this.currentAnswer = currentAnswer; + } + protected String userFeedback; + + protected Map mapQuestionContentLearner; + + /** + * @return Returns the mapQuestionContentLearner. + */ + public Map getMapQuestionContentLearner() { + return mapQuestionContentLearner; + } + /** + * @param mapQuestionContentLearner The mapQuestionContentLearner to set. + */ + public void setMapQuestionContentLearner(Map mapQuestionContentLearner) { + this.mapQuestionContentLearner = mapQuestionContentLearner; + } + /** + * @return Returns the userFeedback. + */ + public String getUserFeedback() { + return userFeedback; + } + /** + * @param userFeedback The userFeedback to set. + */ + public void setUserFeedback(String userFeedback) { + this.userFeedback = userFeedback; + } + /** + * @return Returns the activityInstructions. + */ + public String getActivityInstructions() { + return activityInstructions; + } + /** + * @param activityInstructions The activityInstructions to set. + */ + public void setActivityInstructions(String activityInstructions) { + this.activityInstructions = activityInstructions; + } + /** + * @return Returns the activityOffline. + */ + public String getActivityOffline() { + return activityOffline; + } + /** + * @param activityOffline The activityOffline to set. + */ + public void setActivityOffline(String activityOffline) { + this.activityOffline = activityOffline; + } + /** + * @return Returns the activityTitle. + */ + public String getActivityTitle() { + return activityTitle; + } + /** + * @param activityTitle The activityTitle to set. + */ + public void setActivityTitle(String activityTitle) { + this.activityTitle = activityTitle; + } + /** + * @return Returns the countSessionComplete. + */ + public String getCountSessionComplete() { + return countSessionComplete; + } + /** + * @param countSessionComplete The countSessionComplete to set. + */ + public void setCountSessionComplete(String countSessionComplete) { + this.countSessionComplete = countSessionComplete; + } + + /** + * @return Returns the questionListingMode. + */ + public String getQuestionListingMode() { + return questionListingMode; + } + /** + * @param questionListingMode The questionListingMode to set. + */ + public void setQuestionListingMode(String questionListingMode) { + this.questionListingMode = questionListingMode; + } + + public int compareTo(Object o) + { + GeneralLearnerFlowDTO gneralLearnerFlowDTO = (GeneralLearnerFlowDTO) o; + + if (gneralLearnerFlowDTO == null) + return 1; + else + return 0; + } + + public String toString() { + return new ToStringBuilder(this) + .append("activityOffline: ", activityOffline) + .append("totalQuestionCount : ", totalQuestionCount) + .append("activityInstructions: ", activityInstructions) + .append("activityTitle: ", activityTitle) + .append("countSessionComplete: ", countSessionComplete) + .append("toolSessionID: ", toolSessionID) + .append("currentQuestionIndex: ", currentQuestionIndex) + .append("questionListingMode: ", questionListingMode) + .toString(); + } + + + /** + * @param currentQuestionIndex The currentQuestionIndex to set. + */ + public void setCurrentQuestionIndex(Integer currentQuestionIndex) { + this.currentQuestionIndex = currentQuestionIndex; + } + /** + * @param totalQuestionCount The totalQuestionCount to set. + */ + public void setTotalQuestionCount(Integer totalQuestionCount) { + this.totalQuestionCount = totalQuestionCount; + } + /** + * @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 currentQuestionIndex. + */ + public Integer getCurrentQuestionIndex() { + return currentQuestionIndex; + } + /** + * @return Returns the totalQuestionCount. + */ + public Integer getTotalQuestionCount() { + return totalQuestionCount; + } + /** + * @return Returns the endLearningMessage. + */ + public String getEndLearningMessage() { + return endLearningMessage; + } + /** + * @param endLearningMessage The endLearningMessage to set. + */ + public void setEndLearningMessage(String endLearningMessage) { + this.endLearningMessage = endLearningMessage; + } + /** + * @return Returns the reportTitleLearner. + */ + public String getReportTitleLearner() { + return reportTitleLearner; + } + /** + * @param reportTitleLearner The reportTitleLearner to set. + */ + public void setReportTitleLearner(String reportTitleLearner) { + this.reportTitleLearner = reportTitleLearner; + } + /** + * @return Returns the userNameVisible. + */ + public String getUserNameVisible() { + return userNameVisible; + } + /** + * @param userNameVisible The userNameVisible to set. + */ + public void setUserNameVisible(String userNameVisible) { + this.userNameVisible = userNameVisible; + } + /** + * @return Returns the mapAnswers. + */ + public Map getMapAnswers() { + return mapAnswers; + } + /** + * @param mapAnswers The mapAnswers to set. + */ + public void setMapAnswers(Map mapAnswers) { + this.mapAnswers = mapAnswers; + } + /** + * @return Returns the mapQuestions. + */ + public Map getMapQuestions() { + return mapQuestions; + } + /** + * @param mapQuestions The mapQuestions to set. + */ + public void setMapQuestions(Map mapQuestions) { + this.mapQuestions = mapQuestions; + } +} Fisheye: Tag fef255c381132c29ddbd1f7a7c37106ba90f2b52 refers to a dead (removed) revision in file `lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/McGeneralLearnerFlowDTO.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java =================================================================== diff -u -r9393c098e5dfd603e2d37347cd1e531a25aa424a -rfef255c381132c29ddbd1f7a7c37106ba90f2b52 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java (.../QaAppConstants.java) (revision 9393c098e5dfd603e2d37347cd1e531a25aa424a) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java (.../QaAppConstants.java) (revision fef255c381132c29ddbd1f7a7c37106ba90f2b52) @@ -76,6 +76,7 @@ public static final String IS_MONITORED_CONTENT_IN_USE ="isMonitoredContentInUse"; public static final String LOAD_MONITORING_CONTENT_EDITACTIVITY ="loadMonitoringEditActivity"; public static final String IS_PORTFOLIO_EXPORT ="isPortfolioExport"; + public static final String GENERAL_LEARNER_FLOW_DTO ="generalLearnerFlowDTO"; public static final Long INITIAL_QUESTION_COUNT =new Long(1); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningForm.java =================================================================== diff -u -r44120a6df157dd073c610ffd29566919c89cce22 -rfef255c381132c29ddbd1f7a7c37106ba90f2b52 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningForm.java (.../QaLearningForm.java) (revision 44120a6df157dd073c610ffd29566919c89cce22) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningForm.java (.../QaLearningForm.java) (revision fef255c381132c29ddbd1f7a7c37106ba90f2b52) @@ -42,6 +42,19 @@ protected String endLearning; protected String toolSessionID; + protected String userID; + /** + * @return Returns the userID. + */ + public String getUserID() { + return userID; + } + /** + * @param userID The userID to set. + */ + public void setUserID(String userID) { + this.userID = userID; + } protected String mode; /** Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java =================================================================== diff -u -r44120a6df157dd073c610ffd29566919c89cce22 -rfef255c381132c29ddbd1f7a7c37106ba90f2b52 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java (.../QaLearningStarterAction.java) (revision 44120a6df157dd073c610ffd29566919c89cce22) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java (.../QaLearningStarterAction.java) (revision fef255c381132c29ddbd1f7a7c37106ba90f2b52) @@ -39,9 +39,9 @@ import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionMessage; import org.apache.struts.action.ActionMessages; +import org.lamsfoundation.lams.tool.qa.GeneralLearnerFlowDTO; import org.lamsfoundation.lams.tool.qa.QaAppConstants; import org.lamsfoundation.lams.tool.qa.QaApplicationException; -import org.lamsfoundation.lams.tool.qa.McGeneralLearnerFlowDTO; import org.lamsfoundation.lams.tool.qa.QaComparator; import org.lamsfoundation.lams.tool.qa.QaContent; import org.lamsfoundation.lams.tool.qa.QaQueContent; @@ -162,6 +162,9 @@ QaUtils.cleanUpSessionAbsolute(request); + IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); + logger.debug("retrieving qaService: " + qaService); + /* holds the question contents for a given tool session and relevant content */ Map mapQuestions= new TreeMap(new QaComparator()); @@ -170,22 +173,19 @@ QaLearningForm qaLearningForm = (QaLearningForm) form; - McGeneralLearnerFlowDTO mcGeneralLearnerFlowDTO= new McGeneralLearnerFlowDTO(); - mcGeneralLearnerFlowDTO.setCurrentQuestionIndex(new Integer(1)); + GeneralLearnerFlowDTO generalLearnerFlowDTO= new GeneralLearnerFlowDTO(); + generalLearnerFlowDTO.setCurrentQuestionIndex(new Integer(1)); //request.getSession().setAttribute(CURRENT_QUESTION_INDEX, "1"); //request.getSession().setAttribute(CURRENT_ANSWER, ""); - mcGeneralLearnerFlowDTO.setCurrentAnswer(""); + generalLearnerFlowDTO.setCurrentAnswer(""); - /*initialize available question display modes in the session */ //request.getSession().setAttribute(QUESTION_LISTING_MODE_SEQUENTIAL,QUESTION_LISTING_MODE_SEQUENTIAL); //request.getSession().setAttribute(QUESTION_LISTING_MODE_COMBINED, QUESTION_LISTING_MODE_COMBINED); //request.getSession().setAttribute(QUESTION_LISTING_MODE_PREVIEW, QUESTION_LISTING_MODE_PREVIEW); - IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - logger.debug("retrieving qaService: " + qaService); //request.getSession().setAttribute(TOOL_SERVICE, qaService); /*mark the http session as a learning activity */ @@ -202,15 +202,19 @@ return validateParameters; } - String userId=(String)request.getSession().getAttribute(USER_ID); - logger.debug("userId: " + userId); - + //String userId=(String)request.getSession().getAttribute(USER_ID); + String userID=qaLearningForm.getUserID(); + logger.debug("userID: " + userID); + /* * use the incoming tool session id and later derive toolContentId from it. */ - Long toolSessionId=(Long)request.getSession().getAttribute(TOOL_SESSION_ID); - logger.debug("toolSessionId: " + toolSessionId); + //Long toolSessionId=(Long)request.getSession().getAttribute(TOOL_SESSION_ID); + String toolSessionID=qaLearningForm.getToolSessionID(); + logger.debug("toolSessionID: " + toolSessionID); + generalLearnerFlowDTO.setToolSessionID(toolSessionID); + /* * By now, the passed tool session id MUST exist in the db by calling: @@ -219,10 +223,10 @@ * make sure this session exists in tool's session table by now. */ - if (!QaUtils.existsSession(toolSessionId.longValue(), qaService)) + if (!QaUtils.existsSession(new Long(toolSessionID).longValue(), qaService)) { QaUtils.cleanUpSessionAbsolute(request); - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString()); + //request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString()); logger.debug("error: The tool expects mcSession."); persistError(request,"error.toolSession.notAvailable"); return (mapping.findForward(ERROR_LIST_LEARNER)); @@ -235,7 +239,7 @@ */ - QaSession qaSession=qaService.retrieveQaSessionOrNullById(toolSessionId.longValue()); + QaSession qaSession=qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue()); logger.debug("retrieving qaSession: " + qaSession); /* * find out what content this tool session is referring to @@ -251,31 +255,38 @@ { QaUtils.cleanUpSessionAbsolute(request); logger.debug("error: The tool expects qaContent."); - request.getSession().setAttribute(USER_EXCEPTION_CONTENT_DOESNOTEXIST, new Boolean(true).toString()); + //request.getSession().setAttribute(USER_EXCEPTION_CONTENT_DOESNOTEXIST, new Boolean(true).toString()); persistError(request,"error.toolContent.notAvailable"); return (mapping.findForward(ERROR_LIST_LEARNER)); } if (qaContent.getTitle() == null) { - request.getSession().setAttribute(ACTIVITY_TITLE, "Q&A Title"); - request.getSession().setAttribute(ACTIVITY_INSTRUCTIONS, "Q&A Instructions"); + //request.getSession().setAttribute(ACTIVITY_TITLE, "Q&A Title"); + //request.getSession().setAttribute(ACTIVITY_INSTRUCTIONS, "Q&A Instructions"); + generalLearnerFlowDTO.setActivityTitle("Q&A Title"); + generalLearnerFlowDTO.setActivityInstructions("Q&A Instructions"); } else if (qaContent.getTitle().equals("")) { - request.getSession().setAttribute(ACTIVITY_TITLE, "Q&A Title"); - request.getSession().setAttribute(ACTIVITY_INSTRUCTIONS, "Q&A Instructions"); + //request.getSession().setAttribute(ACTIVITY_TITLE, "Q&A Title"); + //request.getSession().setAttribute(ACTIVITY_INSTRUCTIONS, "Q&A Instructions"); + generalLearnerFlowDTO.setActivityTitle("Q&A Title"); + generalLearnerFlowDTO.setActivityInstructions("Q&A Instructions"); } else { - request.getSession().setAttribute(ACTIVITY_TITLE, qaContent.getTitle()); - request.getSession().setAttribute(ACTIVITY_INSTRUCTIONS, qaContent.getInstructions()); + //request.getSession().setAttribute(ACTIVITY_TITLE, qaContent.getTitle()); + //request.getSession().setAttribute(ACTIVITY_INSTRUCTIONS, qaContent.getInstructions()); + generalLearnerFlowDTO.setActivityTitle(qaContent.getTitle()); + generalLearnerFlowDTO.setActivityInstructions(qaContent.getInstructions()); } - - request.getSession().setAttribute(AttributeNames.PARAM_TOOL_CONTENT_ID, qaContent.getQaContentId()); + //request.getSession().setAttribute(AttributeNames.PARAM_TOOL_CONTENT_ID, qaContent.getQaContentId()); logger.debug("using TOOL_CONTENT_ID: " + qaContent.getQaContentId()); + generalLearnerFlowDTO.setToolContentID(qaContent.getQaContentId().toString()); + /* * The content we retrieved above must have been created before in Authoring time. @@ -284,19 +295,24 @@ logger.debug("REPORT_TITLE_LEARNER: " + qaContent.getReportTitle()); - request.getSession().setAttribute(REPORT_TITLE_LEARNER,qaContent.getReportTitle()); + //request.getSession().setAttribute(REPORT_TITLE_LEARNER,qaContent.getReportTitle()); + generalLearnerFlowDTO.setReportTitleLearner(qaContent.getReportTitle()); - request.getSession().setAttribute(END_LEARNING_MESSAGE,qaContent.getEndLearningMessage()); + //request.getSession().setAttribute(END_LEARNING_MESSAGE,qaContent.getEndLearningMessage()); + generalLearnerFlowDTO.setEndLearningMessage(qaContent.getEndLearningMessage()); logger.debug("END_LEARNING_MESSAGE: " + qaContent.getEndLearningMessage()); /* * Is the tool activity been checked as Run Offline in the property inspector? */ logger.debug("IS_TOOL_ACTIVITY_OFFLINE: " + qaContent.isRunOffline()); - request.getSession().setAttribute(IS_TOOL_ACTIVITY_OFFLINE, new Boolean(qaContent.isRunOffline()).toString()); + //request.getSession().setAttribute(IS_TOOL_ACTIVITY_OFFLINE, new Boolean(qaContent.isRunOffline()).toString()); + generalLearnerFlowDTO.setActivityOffline(new Boolean(qaContent.isRunOffline()).toString()); logger.debug("IS_USERNAME_VISIBLE: " + qaContent.isUsernameVisible()); - request.getSession().setAttribute(IS_USERNAME_VISIBLE, new Boolean(qaContent.isUsernameVisible())); + //request.getSession().setAttribute(IS_USERNAME_VISIBLE, new Boolean(qaContent.isUsernameVisible())); + generalLearnerFlowDTO.setUserNameVisible(new Boolean(qaContent.isUsernameVisible()).toString()); + /* * Is the tool activity been checked as Define Later in the property inspector? */ @@ -309,21 +325,23 @@ /* * Learning mode requires this setting for jsp to generate the user's report */ - request.getSession().setAttribute(CHECK_ALL_SESSIONS_COMPLETED, new Boolean(false)); + //request.getSession().setAttribute(CHECK_ALL_SESSIONS_COMPLETED, new Boolean(false)); logger.debug("IS_QUESTIONS_SEQUENCED: " + qaContent.isQuestionsSequenced()); String feedBackType=""; if (qaContent.isQuestionsSequenced()) { - request.getSession().setAttribute(QUESTION_LISTING_MODE, QUESTION_LISTING_MODE_SEQUENTIAL); + //request.getSession().setAttribute(QUESTION_LISTING_MODE, QUESTION_LISTING_MODE_SEQUENTIAL); + generalLearnerFlowDTO.setQuestionListingMode(QUESTION_LISTING_MODE_SEQUENTIAL); feedBackType=FEEDBACK_TYPE_SEQUENTIAL; } else { - request.getSession().setAttribute(QUESTION_LISTING_MODE, QUESTION_LISTING_MODE_COMBINED); + //request.getSession().setAttribute(QUESTION_LISTING_MODE, QUESTION_LISTING_MODE_COMBINED); + generalLearnerFlowDTO.setQuestionListingMode(QUESTION_LISTING_MODE_COMBINED); feedBackType=FEEDBACK_TYPE_COMBINED; } - logger.debug("QUESTION_LISTING_MODE: " + request.getSession().getAttribute(QUESTION_LISTING_MODE)); + logger.debug("QUESTION_LISTING_MODE: " + generalLearnerFlowDTO.getQuestionListingMode()); /* * fetch question content from content @@ -345,14 +363,22 @@ } } - request.getSession().setAttribute(MAP_ANSWERS, mapAnswers); - request.getSession().setAttribute(MAP_QUESTION_CONTENT_LEARNER, mapQuestions); + //request.getSession().setAttribute(MAP_ANSWERS, mapAnswers); + generalLearnerFlowDTO.setMapAnswers(mapAnswers); + //request.getSession().setAttribute(MAP_QUESTION_CONTENT_LEARNER, mapQuestions); + generalLearnerFlowDTO.setMapQuestions(mapQuestions); logger.debug("mapQuestions has : " + mapQuestions.size() + " entries."); - request.getSession().setAttribute(TOTAL_QUESTION_COUNT, new Long(mapQuestions.size()).toString()); - String userFeedback= feedBackType + request.getSession().getAttribute(TOTAL_QUESTION_COUNT) + QUESTIONS; + //request.getSession().setAttribute(TOTAL_QUESTION_COUNT, new Long(mapQuestions.size()).toString()); + generalLearnerFlowDTO.setTotalQuestionCount(new Integer(mapQuestions.size())); + + //String userFeedback= feedBackType + request.getSession().getAttribute(TOTAL_QUESTION_COUNT) + QUESTIONS; + String userFeedback= feedBackType + generalLearnerFlowDTO.getTotalQuestionCount() + QUESTIONS; + request.getSession().setAttribute(USER_FEEDBACK, userFeedback); + generalLearnerFlowDTO.setUserFeedback(userFeedback); + request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); /* Is the request for a preview by the author? Preview The tool must be able to show the specified content as if it was running in a lesson. It will be the learner url with tool access mode set to ToolAccessMode.AUTHOR @@ -378,7 +404,7 @@ /* by now, we know that the mode is either teacher or learner * check if the mode is teacher and request is for Learner Progress */ - logger.debug("userId: " + userId); + logger.debug("userID: " + userID); String learnerProgressUserId=request.getParameter(USER_ID); logger.debug("learnerProgressUserId: " + learnerProgressUserId); @@ -405,7 +431,7 @@ { QaUtils.cleanUpSessionAbsolute(request); logger.debug("warning to learner: the activity is offline."); - request.getSession().setAttribute(USER_EXCEPTION_RUN_OFFLINE, new Boolean(true).toString()); + //request.getSession().setAttribute(USER_EXCEPTION_RUN_OFFLINE, new Boolean(true).toString()); persistError(request,"label.learning.runOffline"); return (mapping.findForward(ERROR_LIST_LEARNER)); } @@ -419,14 +445,15 @@ * if the user's tool session id AND user id exists in the tool tables go to learner's report. */ /* if the 'All Responses' has been clicked no more user entry is accepted, and isResponseFinalized() returns true*/ - logger.debug("userId:" + userId); - Long currentToolSessionId=(Long)request.getSession().getAttribute(TOOL_SESSION_ID); - logger.debug("currentToolSessionId: " + currentToolSessionId); + logger.debug("userID:" + userID); + //Long currentToolSessionId=(Long)request.getSession().getAttribute(TOOL_SESSION_ID); + Long currentToolSessionID=new Long(qaLearningForm.getToolSessionID()); + logger.debug("currentToolSessionID: " + currentToolSessionID); logger.debug("current session uid: " + qaSession.getUid()); - if (userId != null) + if (userID != null) { - QaQueUsr qaQueUsr=qaService.getQaUserBySession(new Long(userId), qaSession.getUid()); + QaQueUsr qaQueUsr=qaService.getQaUserBySession(new Long(userID), qaSession.getUid()); logger.debug("QaQueUsr:" + qaQueUsr); if ((qaQueUsr != null) && (qaQueUsr.isResponseFinalized())) @@ -439,7 +466,7 @@ { Long checkQaSessionId=checkSession.getQaSessionId(); logger.debug("checkQaSessionId:" + checkQaSessionId); - if (checkQaSessionId.toString().equals(currentToolSessionId.toString())) + 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); @@ -451,7 +478,7 @@ /*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); + 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." + INDIVIDUAL_LEARNER_REPORT); @@ -468,6 +495,8 @@ /* * present user with the questions. */ + request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); + logger.debug("GENERAL_LEARNER_FLOW_DTO: " + request.getAttribute(GENERAL_LEARNER_FLOW_DTO)); logger.debug("forwarding to: " + LOAD_LEARNER); return (mapping.findForward(LOAD_LEARNER)); } @@ -496,6 +525,7 @@ userID = user.getUserID().toString(); logger.debug("retrieved userId: " + userID); //request.getSession().setAttribute(USER_ID, userID); + qaLearningForm.setUserID(userID); } }