Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaQueUsrDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaQueUsrDAO.java,v diff -u -r1.15 -r1.16 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaQueUsrDAO.java 20 Sep 2006 15:15:44 -0000 1.15 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaQueUsrDAO.java 19 Feb 2009 04:04:31 -0000 1.16 @@ -29,33 +29,29 @@ import org.lamsfoundation.lams.tool.qa.QaQueUsr; import org.lamsfoundation.lams.tool.qa.QaSession; - /** * * @author Ozgur Demirtas - * + * */ -public interface IQaQueUsrDAO -{ - public QaQueUsr getQaUserByUID(Long uid); - +public interface IQaQueUsrDAO { + public QaQueUsr getQaUserByUID(Long uid); + public QaQueUsr getQaQueUsrById(long qaQueUsrId); - + public QaQueUsr loadQaQueUsrById(long qaQueUsrId); - + public QaQueUsr getQaUserBySession(final Long queUsrId, final Long qaSessionId); - + public void createUsr(QaQueUsr usr); - + public void updateUsr(QaQueUsr usr); - + public void deleteQaQueUsr(QaQueUsr qaQueUsr); - + public int countSessionUser(QaSession qaSession); - - public int getTotalNumberOfUsers(); - + public int getTotalNumberOfUsers(QaContent qa); - + public List getUserBySessionOnly(final QaSession qaSession); } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaUploadedFileDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/Attic/IQaUploadedFileDAO.java,v diff -u -r1.10 -r1.11 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaUploadedFileDAO.java 20 Sep 2006 15:15:44 -0000 1.10 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaUploadedFileDAO.java 19 Feb 2009 04:04:31 -0000 1.11 @@ -32,27 +32,24 @@ /** * * @author Ozgur Demirtas - * + * */ -public interface IQaUploadedFileDAO -{ - public QaUploadedFile loadUploadedFileById(long submissionId); +public interface IQaUploadedFileDAO { + public QaUploadedFile loadUploadedFileById(long submissionId); - public void updateUploadFile(QaUploadedFile qaUploadedFile); - - public void saveUploadFile(QaUploadedFile qaUploadedFile); - - public void createUploadFile(QaUploadedFile qaUploadedFile); - - public void UpdateUploadFile(QaUploadedFile qaUploadedFile); + public void updateUploadFile(QaUploadedFile qaUploadedFile); - public void removeUploadFile(Long submissionId); - - public void deleteUploadFile(QaUploadedFile qaUploadedFile); - - public List retrieveQaUploadedFiles(QaContent qa); - - public void cleanUploadedFilesMetaData(); - - public void flush(); + public void saveUploadFile(QaUploadedFile qaUploadedFile); + + public void createUploadFile(QaUploadedFile qaUploadedFile); + + public void UpdateUploadFile(QaUploadedFile qaUploadedFile); + + public void removeUploadFile(Long submissionId); + + public void deleteUploadFile(QaUploadedFile qaUploadedFile); + + public List retrieveQaUploadedFiles(QaContent qa); + + public void flush(); } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaQueUsrDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaQueUsrDAO.java,v diff -u -r1.19 -r1.20 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaQueUsrDAO.java 19 Feb 2009 03:12:53 -0000 1.19 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaQueUsrDAO.java 19 Feb 2009 04:04:31 -0000 1.20 @@ -36,7 +36,7 @@ import org.springframework.orm.hibernate3.support.HibernateDaoSupport; /** - * @author Ozgur Demirtas fixed by lfoxton + * @author Ozgur Demirtas * * TODO To change the template for this generated type comment go to Window - * Preferences - Java - Code Style - Code Templates @@ -48,6 +48,11 @@ private static final String COUNT_SESSION_USER = "select qaQueUsr.queUsrId from QaQueUsr qaQueUsr where qaQueUsr.qaSessionId= :qaSession"; private static final String LOAD_USER_FOR_SESSION = "from qaQueUsr in class QaQueUsr where qaQueUsr.qaSessionId= :qaSessionId"; + private static final String GET_USER_COUNT_FOR_CONTENT = "select count(*) from QaQueUsr quser, QaSession qses, QaQueContent qcon where " + + "quser.qaSession=qses and " + "qses.qaContent=qcon and " + "qcon.uid=:uid"; + + // select count(*) from tl_laqa11_que_usr quser, tl_laqa11_session qses where quser.qa_session_id=qses.uid and qses.qa_content_id=5378; + public QaQueUsr getQaUserByUID(Long uid) { return (QaQueUsr) this.getHibernateTemplate().get(QaQueUsr.class, uid); } @@ -109,12 +114,20 @@ this.getHibernateTemplate().delete(qaQueUsr); } - public int getTotalNumberOfUsers() { - String query = "from obj in class QaQueUsr"; - return this.getHibernateTemplate().find(query).size(); - } - public int getTotalNumberOfUsers(QaContent qa) { + + int returnInt = 0; + if (qa != null && qa.getUid() != null) { + List result = getSession().createQuery(GET_USER_COUNT_FOR_CONTENT).setLong("uid", qa.getUid()).list(); + Integer resultInt = (result.get(0) != null) ? (Integer) result.get(0) : new Integer(0); + returnInt = resultInt.intValue(); + } else { + logger.error("Attempt to count users from null content"); + } + logger.debug("Number of users for quContent " +qa.getUid()+ ": " + returnInt); + return returnInt; + + /* String strGetUser = "from qaQueUsr in class QaQueUsr"; HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(strGetUser).list(); @@ -135,6 +148,7 @@ } logger.debug("final totalUserCount: " + totalUserCount); return totalUserCount; + */ } } \ No newline at end of file Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaUploadedFileDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/Attic/QaUploadedFileDAO.java,v diff -u -r1.13 -r1.14 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaUploadedFileDAO.java 19 Feb 2009 03:12:53 -0000 1.13 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaUploadedFileDAO.java 19 Feb 2009 04:04:31 -0000 1.14 @@ -46,8 +46,6 @@ private static final String GET_UPLOADED_FILES = "from QaUploadedFile qaUploadedFile where qaUploadedFile.qaContent.qaContentId = :contentId"; - private static final String DELETE_FILES_META_DATA = "from qaUploadedFile in class QaUploadedFile"; - public QaUploadedFile getUploadedFileById(long submissionId) { return (QaUploadedFile) this.getHibernateTemplate().load(QaUploadedFile.class, new Long(submissionId)); } @@ -80,26 +78,6 @@ this.getHibernateTemplate().update(qaUploadedFile); } - public void cleanUploadedFilesMetaData() { - /* - String query = "from uploadedFile in class org.lamsfoundation.lams.tool.qa.QaUploadedFile"; - this.getSession().setFlushMode(FlushMode.AUTO); - this.getHibernateTemplate().delete(query); - */ - HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(DELETE_FILES_META_DATA).list(); - - if (list != null && list.size() > 0) { - Iterator listIterator = list.iterator(); - while (listIterator.hasNext()) { - QaUploadedFile mcFile = (QaUploadedFile) listIterator.next(); - this.getSession().setFlushMode(FlushMode.AUTO); - templ.delete(mcFile); - templ.flush(); - } - } - } - public void removeUploadFile(Long submissionId) { if (submissionId != null) { Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/IQaService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/IQaService.java,v diff -u -r1.52 -r1.53 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/IQaService.java 9 Dec 2008 05:38:14 -0000 1.52 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/IQaService.java 19 Feb 2009 04:04:31 -0000 1.53 @@ -76,8 +76,6 @@ public QaContent getQaContentByUID(Long uid) throws QaApplicationException; - public int getTotalNumberOfUsers() throws QaApplicationException; - public int getTotalNumberOfUsers(QaContent qa) throws QaApplicationException; public int countSessionComplete(QaContent qa) throws QaApplicationException; @@ -268,8 +266,6 @@ public List retrieveQaUploadedFiles(QaContent qa) throws QaApplicationException; - public void cleanUploadedFilesMetaData() throws QaApplicationException; - public List retrieveQaQueContentsByToolContentId(long toolContentId); public Long createNotebookEntry(Long id, Integer idType, String signature, Integer userID, String entry); 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.84 -r1.85 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java 9 Dec 2008 05:38:14 -0000 1.84 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java 19 Feb 2009 04:04:31 -0000 1.85 @@ -580,15 +580,6 @@ } } - public int getTotalNumberOfUsers() throws QaApplicationException { - try { - return qaQueUsrDAO.getTotalNumberOfUsers(); - } catch (DataAccessException e) { - throw new QaApplicationException("Exception occured when lams is retrieving total number of QaQueUsr: " - + e.getMessage(), e); - } - } - public int countTotalNumberOfUserResponsed(QaContent qa) throws QaApplicationException { try { return qaDAO.countUserResponsed(qa); @@ -1502,15 +1493,6 @@ QaServicePOJO.logger.debug("removed qaUploadedFile: " + submissionId); } - /** - * removes all the entries in the uploaded files table - */ - public void cleanUploadedFilesMetaData() throws QaApplicationException { - QaServicePOJO.logger.debug("attempt cleaning up uploaded file meta data table from the db"); - qaUploadedFileDAO.cleanUploadedFilesMetaData(); - QaServicePOJO.logger.debug("files meta data has been cleaned up"); - } - public Long createNotebookEntry(Long id, Integer idType, String signature, Integer userID, String entry) { QaServicePOJO.logger.debug("coreNotebookService: " + coreNotebookService); return coreNotebookService.createNotebookEntry(id, idType, signature, userID, "", entry); 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.34 -r1.35 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java 8 Oct 2007 05:16:10 -0000 1.34 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java 19 Feb 2009 04:04:31 -0000 1.35 @@ -17,79 +17,79 @@ USA http://www.gnu.org/licenses/gpl.txt -* ***********************************************************************/ + * ***********************************************************************/ - /** +/** * @author Ozgur Demirtas * - + - - - - - - - + - - + - + + + + + - + + + - - - - + + + + + * */ @@ -135,26 +135,20 @@ import org.lamsfoundation.lams.web.util.AttributeNames; import org.lamsfoundation.lams.web.util.SessionMap; +public class QaLearningAction extends LamsDispatchAction implements QaAppConstants { + static Logger logger = Logger.getLogger(QaLearningAction.class.getName()); -public class QaLearningAction extends LamsDispatchAction implements QaAppConstants -{ - static Logger logger = Logger.getLogger(QaLearningAction.class.getName()); - - public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) - throws IOException, ServletException, ToolException{ - logger.debug("dispatching unspecified..."); - return null; + public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException, ToolException { + logger.debug("dispatching unspecified..."); + return null; } - /** - * submits users responses - * ActionForward submitAnswersContent(ActionMapping mapping, - ActionForm form, - HttpServletRequest request, - HttpServletResponse response) throws IOException, - ServletException - + * submits users responses ActionForward submitAnswersContent(ActionMapping + * mapping, ActionForm form, HttpServletRequest request, HttpServletResponse + * response) throws IOException, ServletException + * * @param mapping * @param form * @param request @@ -163,140 +157,124 @@ * @throws IOException * @throws ServletException */ - public ActionForward submitAnswersContent(ActionMapping mapping, - ActionForm form, - HttpServletRequest request, - HttpServletResponse response) throws IOException, - ServletException - { - logger.debug("dispatching submitAnswersContent..." + request); - QaLearningForm qaLearningForm = (QaLearningForm) form; - - LearningUtil.saveFormRequestData(request, qaLearningForm); - - IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - logger.debug("qaService: " + qaService); + public ActionForward submitAnswersContent(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException { + logger.debug("dispatching submitAnswersContent..." + request); + QaLearningForm qaLearningForm = (QaLearningForm) form; - String toolSessionID=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); - logger.debug("toolSessionID: " + toolSessionID); - qaLearningForm.setToolSessionID(toolSessionID); - - QaSession qaSession=qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue()); - logger.debug("retrieving qaSession: " + qaSession); - - String toolContentID=qaSession.getQaContent().getQaContentId().toString(); - logger.debug("toolContentID: " + toolContentID); - - QaContent qaContent=qaSession.getQaContent(); - logger.debug("using qaContent: " + qaContent); - - GeneralLearnerFlowDTO generalLearnerFlowDTO= LearningUtil.buildGeneralLearnerFlowDTO(qaContent); - logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); - - String totalQuestionCount=generalLearnerFlowDTO.getTotalQuestionCount().toString(); - logger.debug("totalQuestionCount: " + totalQuestionCount); - int intTotalQuestionCount= new Integer(totalQuestionCount).intValue(); - - String questionListingMode=generalLearnerFlowDTO.getQuestionListingMode(); - logger.debug("questionListingMode: " + questionListingMode); - - Map mapAnswers= new TreeMap(new QaComparator()); - Map mapAnswersPresentable= new TreeMap(new QaComparator()); - Map mapFeedback= new TreeMap(new QaComparator()); - /* if the listing mode is QUESTION_LISTING_MODE_COMBINED populate the answers here*/ - if (questionListingMode.equalsIgnoreCase(QUESTION_LISTING_MODE_COMBINED)) - { - logger.debug("the listing mode is combined."); - for (int questionIndex=INITIAL_QUESTION_COUNT.intValue(); questionIndex<= intTotalQuestionCount; questionIndex++ ) - { - String answer=request.getParameter("answer" + questionIndex); - logger.debug("answer for question " + questionIndex + " is:" + answer); - String answerPresentable=QaUtils.replaceNewLines(answer); - logger.debug("answerPresentable: " + answerPresentable); - - mapAnswers.put(new Long(questionIndex).toString(), answer); - mapAnswersPresentable.put(new Long(questionIndex).toString(), answerPresentable); - } - logger.debug("final mapAnswers for the combined mode:" + mapAnswers); - } - else - { - logger.debug("the listing mode is sequential"); - if (totalQuestionCount.equals("1")) - { - logger.debug("totalQuestionCount is 1: " + qaLearningForm.getAnswer()); - String answerPresentable=QaUtils.replaceNewLines(qaLearningForm.getAnswer()); - logger.debug("answerPresentable: " + answerPresentable); - - mapAnswers.put(new Long(1).toString(), qaLearningForm.getAnswer()); - mapAnswersPresentable.put(new Long(1).toString(), answerPresentable); - } - else - { - logger.debug("the listing mode is sequential and there are multiple questions"); - logger.debug("populating mapAnswers..."); - mapAnswers=populateAnswersMap(qaLearningForm, request, generalLearnerFlowDTO, true, true); - logger.debug("mapAnswers: " + mapAnswers); + LearningUtil.saveFormRequestData(request, qaLearningForm); - String httpSessionID=qaLearningForm.getHttpSessionID(); - logger.debug("httpSessionID: " + httpSessionID); - - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - logger.debug("sessionMap: " + sessionMap); - - mapAnswersPresentable=(Map)sessionMap.get(MAP_ALL_RESULTS_KEY); - logger.debug("mapAnswersPresentable, before new lines conversion: " + mapAnswersPresentable); - mapAnswersPresentable=MonitoringUtil.removeNewLinesMap(mapAnswersPresentable); - logger.debug("mapAnswersPresentable, after new lines conversion: " + mapAnswersPresentable); - } - logger.debug("final mapAnswersPresentable for the sequential mode:" + mapAnswersPresentable); - - } - - - - logger.debug("using mapAnswers:" + mapAnswers); - generalLearnerFlowDTO.setMapAnswers(mapAnswers); - - logger.debug("using mapFeedback:" + generalLearnerFlowDTO.getMapFeedback()); - - logger.debug("using mapAnswersPresentable:" + mapAnswersPresentable);; - generalLearnerFlowDTO.setMapAnswersPresentable(mapAnswersPresentable); - - /*mapAnswers will be used in the viewAllAnswers screen*/ - SessionMap sessionMap = new SessionMap(); - sessionMap.put(MAP_ALL_RESULTS_KEY, mapAnswers); - request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); - qaLearningForm.setHttpSessionID(sessionMap.getSessionID()); - generalLearnerFlowDTO.setHttpSessionID(sessionMap.getSessionID()); - - - boolean lockWhenFinished=qaContent.isLockWhenFinished(); - logger.debug("lockWhenFinished: " + lockWhenFinished); - generalLearnerFlowDTO.setLockWhenFinished(new Boolean(lockWhenFinished).toString()); + IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); + logger.debug("qaService: " + qaService); - boolean showOtherAnswers=qaContent.isShowOtherAnswers(); - logger.debug("showOtherAnswers: " + showOtherAnswers); - generalLearnerFlowDTO.setShowOtherAnswers(new Boolean(showOtherAnswers).toString()); - - generalLearnerFlowDTO.setReflection(new Boolean(qaContent.isReflect()).toString()); - - request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); - - qaLearningForm.resetAll(); - logger.debug("fwd'ing to." + INDIVIDUAL_LEARNER_RESULTS); - return (mapping.findForward(INDIVIDUAL_LEARNER_RESULTS)); + String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); + logger.debug("toolSessionID: " + toolSessionID); + qaLearningForm.setToolSessionID(toolSessionID); + + QaSession qaSession = qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue()); + logger.debug("retrieving qaSession: " + qaSession); + + String toolContentID = qaSession.getQaContent().getQaContentId().toString(); + logger.debug("toolContentID: " + toolContentID); + + QaContent qaContent = qaSession.getQaContent(); + logger.debug("using qaContent: " + qaContent); + + GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent); + logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); + + String totalQuestionCount = generalLearnerFlowDTO.getTotalQuestionCount().toString(); + logger.debug("totalQuestionCount: " + totalQuestionCount); + int intTotalQuestionCount = new Integer(totalQuestionCount).intValue(); + + String questionListingMode = generalLearnerFlowDTO.getQuestionListingMode(); + logger.debug("questionListingMode: " + questionListingMode); + + Map mapAnswers = new TreeMap(new QaComparator()); + Map mapAnswersPresentable = new TreeMap(new QaComparator()); + Map mapFeedback = new TreeMap(new QaComparator()); + /* if the listing mode is QUESTION_LISTING_MODE_COMBINED populate the answers here*/ + if (questionListingMode.equalsIgnoreCase(QUESTION_LISTING_MODE_COMBINED)) { + logger.debug("the listing mode is combined."); + for (int questionIndex = INITIAL_QUESTION_COUNT.intValue(); questionIndex <= intTotalQuestionCount; questionIndex++) { + String answer = request.getParameter("answer" + questionIndex); + logger.debug("answer for question " + questionIndex + " is:" + answer); + String answerPresentable = QaUtils.replaceNewLines(answer); + logger.debug("answerPresentable: " + answerPresentable); + + mapAnswers.put(new Long(questionIndex).toString(), answer); + mapAnswersPresentable.put(new Long(questionIndex).toString(), answerPresentable); + } + logger.debug("final mapAnswers for the combined mode:" + mapAnswers); + } else { + logger.debug("the listing mode is sequential"); + if (totalQuestionCount.equals("1")) { + logger.debug("totalQuestionCount is 1: " + qaLearningForm.getAnswer()); + String answerPresentable = QaUtils.replaceNewLines(qaLearningForm.getAnswer()); + logger.debug("answerPresentable: " + answerPresentable); + + mapAnswers.put(new Long(1).toString(), qaLearningForm.getAnswer()); + mapAnswersPresentable.put(new Long(1).toString(), answerPresentable); + } else { + logger.debug("the listing mode is sequential and there are multiple questions"); + logger.debug("populating mapAnswers..."); + mapAnswers = populateAnswersMap(qaLearningForm, request, generalLearnerFlowDTO, true, true); + logger.debug("mapAnswers: " + mapAnswers); + + String httpSessionID = qaLearningForm.getHttpSessionID(); + logger.debug("httpSessionID: " + httpSessionID); + + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); + logger.debug("sessionMap: " + sessionMap); + + mapAnswersPresentable = (Map) sessionMap.get(MAP_ALL_RESULTS_KEY); + logger.debug("mapAnswersPresentable, before new lines conversion: " + mapAnswersPresentable); + mapAnswersPresentable = MonitoringUtil.removeNewLinesMap(mapAnswersPresentable); + logger.debug("mapAnswersPresentable, after new lines conversion: " + mapAnswersPresentable); + } + logger.debug("final mapAnswersPresentable for the sequential mode:" + mapAnswersPresentable); + } - + logger.debug("using mapAnswers:" + mapAnswers); + generalLearnerFlowDTO.setMapAnswers(mapAnswers); + + logger.debug("using mapFeedback:" + generalLearnerFlowDTO.getMapFeedback()); + + logger.debug("using mapAnswersPresentable:" + mapAnswersPresentable); + ; + generalLearnerFlowDTO.setMapAnswersPresentable(mapAnswersPresentable); + + /*mapAnswers will be used in the viewAllAnswers screen*/ + SessionMap sessionMap = new SessionMap(); + sessionMap.put(MAP_ALL_RESULTS_KEY, mapAnswers); + request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); + qaLearningForm.setHttpSessionID(sessionMap.getSessionID()); + generalLearnerFlowDTO.setHttpSessionID(sessionMap.getSessionID()); + + boolean lockWhenFinished = qaContent.isLockWhenFinished(); + logger.debug("lockWhenFinished: " + lockWhenFinished); + generalLearnerFlowDTO.setLockWhenFinished(new Boolean(lockWhenFinished).toString()); + + boolean showOtherAnswers = qaContent.isShowOtherAnswers(); + logger.debug("showOtherAnswers: " + showOtherAnswers); + generalLearnerFlowDTO.setShowOtherAnswers(new Boolean(showOtherAnswers).toString()); + + generalLearnerFlowDTO.setReflection(new Boolean(qaContent.isReflect()).toString()); + + request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); + + qaLearningForm.resetAll(); + logger.debug("fwd'ing to." + INDIVIDUAL_LEARNER_RESULTS); + return (mapping.findForward(INDIVIDUAL_LEARNER_RESULTS)); + } + /** * enables retaking the activity * - * ActionForward redoQuestions(ActionMapping mapping, - ActionForm form, - HttpServletRequest request, - HttpServletResponse response) throws IOException, - ServletException + * ActionForward redoQuestions(ActionMapping mapping, ActionForm form, + * HttpServletRequest request, HttpServletResponse response) throws + * IOException, ServletException * * @param mapping * @param form @@ -306,418 +284,374 @@ * @throws IOException * @throws ServletException */ - public ActionForward redoQuestions(ActionMapping mapping, - ActionForm form, - HttpServletRequest request, - HttpServletResponse response) throws IOException, - ServletException - { - logger.debug("dispatching redoQuestions..."); - QaLearningForm qaLearningForm = (QaLearningForm) form; - - LearningUtil.saveFormRequestData(request, qaLearningForm); - - IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - logger.debug("qaService: " + qaService); + public ActionForward redoQuestions(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException { + logger.debug("dispatching redoQuestions..."); + QaLearningForm qaLearningForm = (QaLearningForm) form; - String toolSessionID=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); - logger.debug("toolSessionID: " + toolSessionID); - qaLearningForm.setToolSessionID(toolSessionID); - - QaSession qaSession=qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue()); - logger.debug("retrieving qaSession: " + qaSession); - - String toolContentID=qaSession.getQaContent().getQaContentId().toString(); - logger.debug("toolContentID: " + toolContentID); - - QaContent qaContent=qaSession.getQaContent(); - logger.debug("using qaContent: " + qaContent); - - GeneralLearnerFlowDTO generalLearnerFlowDTO= LearningUtil.buildGeneralLearnerFlowDTO(qaContent); - logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); - - Map mapQuestions= new TreeMap(new QaComparator()); - Map mapAnswers= new TreeMap(new QaComparator()); - - generalLearnerFlowDTO.setCurrentQuestionIndex(new Integer(1)); - qaLearningForm.setCurrentQuestionIndex(new Integer(1).toString()); - - - String httpSessionID=qaLearningForm.getHttpSessionID(); - logger.debug("httpSessionID: " + httpSessionID); - - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); - qaLearningForm.setHttpSessionID(sessionMap.getSessionID()); - generalLearnerFlowDTO.setHttpSessionID(sessionMap.getSessionID()); - - generalLearnerFlowDTO.setActivityTitle(qaContent.getTitle()); - generalLearnerFlowDTO.setActivityInstructions(qaContent.getInstructions()); - + LearningUtil.saveFormRequestData(request, qaLearningForm); - 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. - * And the passed tool session id refers to it. - */ - - - logger.debug("REPORT_TITLE_LEARNER: " + qaContent.getReportTitle()); - generalLearnerFlowDTO.setReportTitleLearner(qaContent.getReportTitle()); - - /* - * Is the tool activity been checked as Run Offline in the property inspector? - */ - logger.debug("IS_TOOL_ACTIVITY_OFFLINE: " + qaContent.isRunOffline()); - generalLearnerFlowDTO.setActivityOffline(new Boolean(qaContent.isRunOffline()).toString()); - - logger.debug("IS_USERNAME_VISIBLE: " + qaContent.isUsernameVisible()); - generalLearnerFlowDTO.setUserNameVisible(new Boolean(qaContent.isUsernameVisible()).toString()); - generalLearnerFlowDTO.setShowOtherAnswers(new Boolean(qaContent.isShowOtherAnswers()).toString()); + IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); + logger.debug("qaService: " + qaService); + String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); + logger.debug("toolSessionID: " + toolSessionID); + qaLearningForm.setToolSessionID(toolSessionID); - /* - * Learning mode requires this setting for jsp to generate the user's report - */ - logger.debug("IS_QUESTIONS_SEQUENCED: " + qaContent.isQuestionsSequenced()); - String feedBackType=""; - if (qaContent.isQuestionsSequenced()) - { - generalLearnerFlowDTO.setQuestionListingMode(QUESTION_LISTING_MODE_SEQUENTIAL); - feedBackType=FEEDBACK_TYPE_SEQUENTIAL; - } - else - { - generalLearnerFlowDTO.setQuestionListingMode(QUESTION_LISTING_MODE_COMBINED); - feedBackType=FEEDBACK_TYPE_COMBINED; - } - logger.debug("QUESTION_LISTING_MODE: " + generalLearnerFlowDTO.getQuestionListingMode()); + QaSession qaSession = qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue()); + logger.debug("retrieving qaSession: " + qaSession); - - - HttpSession ss = SessionManager.getSession(); - /* get back login user DTO */ - UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER); - logger.debug("retrieving toolUser: " + toolUser); - logger.debug("retrieving toolUser userId: " + toolUser.getUserID()); - logger.debug("retrieving toolUser username: " + toolUser.getLogin()); + String toolContentID = qaSession.getQaContent().getQaContentId().toString(); + logger.debug("toolContentID: " + toolContentID); - String userName=toolUser.getLogin(); - String fullName= toolUser.getFirstName() + " " + toolUser.getLastName(); - logger.debug("retrieving toolUser fullname: " + fullName); - - Long userId=new Long(toolUser.getUserID().longValue()); - logger.debug("userId: " + userId); - - QaQueUsr qaQueUsr=qaService.getQaUserBySession(userId, qaSession.getUid()); - logger.debug("qaQueUsr: " + qaQueUsr); - - Long qaQueUsrUid=null; - boolean isResponseFinalized=false; - if (qaQueUsr != null) - { - qaQueUsrUid=qaQueUsr.getUid(); - logger.debug("qaQueUsrUid: " + qaQueUsrUid); - - isResponseFinalized=qaQueUsr.isResponseFinalized (); - logger.debug("isResponseFinalized: " + isResponseFinalized); - } + QaContent qaContent = qaSession.getQaContent(); + logger.debug("using qaContent: " + qaContent); - - Map mapAnswersFromDb= new TreeMap(new QaComparator()); - /* - * fetch question content from content - */ - Iterator contentIterator=qaContent.getQaQueContents().iterator(); - - int questionCount=0; - while (contentIterator.hasNext()) - { - QaQueContent qaQueContent=(QaQueContent)contentIterator.next(); - if (qaQueContent != null) - { - Long questionUid=qaQueContent.getUid(); - logger.debug("questionUid: " + questionUid); - - int displayOrder=qaQueContent.getDisplayOrder(); - if (displayOrder != 0) - { - ++questionCount; - logger.debug("questionCount: " + questionCount); - - mapQuestions.put(new Integer(displayOrder).toString(),qaQueContent.getQuestion()); - - if (qaQueUsr != null) - { - List listUserAttempts=qaService.getAttemptsForUserAndQuestionContent(qaQueUsrUid, questionUid); - logger.debug("listUserAttempts: " + listUserAttempts); + GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent); + logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); - logger.debug("listUserAttempts size: " + listUserAttempts.size()); - - if (listUserAttempts.size() > 1) - { - logger.debug("Warning: There should not be more than 1 attempts for the question."); - } - - Iterator itAttempts=listUserAttempts.iterator(); - while (itAttempts.hasNext()) - { - QaUsrResp qaUsrResp=(QaUsrResp)itAttempts.next(); - logger.debug("qaUsrResp: " + qaUsrResp); - mapAnswersFromDb.put(new Integer(questionCount).toString() , qaUsrResp.getAnswer()); - } - } - } - } - } - logger.debug("mapAnswersFromDb: " + mapAnswersFromDb); - - - mapAnswers=(Map)sessionMap.get(MAP_ALL_RESULTS_KEY); - logger.debug("mapAnswers: " + mapAnswers); - - qaLearningForm.setHttpSessionID(sessionMap.getSessionID()); - generalLearnerFlowDTO.setHttpSessionID(sessionMap.getSessionID()); - - logger.debug("mapQuestions: " + mapQuestions); - generalLearnerFlowDTO.setMapQuestionContentLearner(mapQuestions); - generalLearnerFlowDTO.setMapQuestions(mapQuestions); - logger.debug("mapQuestions has : " + mapQuestions.size() + " entries."); + Map mapQuestions = new TreeMap(new QaComparator()); + Map mapAnswers = new TreeMap(new QaComparator()); - - if (mapAnswers == null) - { - mapAnswers= new TreeMap(new QaComparator()); - // maybe we have come in from the review screen, if so get the answers from db. - if ( mapAnswersFromDb.size() > 0 ) { - Iterator itMapAnswers = mapAnswersFromDb.entrySet().iterator(); - while (itMapAnswers.hasNext()) - { - Map.Entry pairs = (Map.Entry)itMapAnswers.next(); - mapAnswers.put(pairs.getKey().toString(), pairs.getValue()); - } - mapAnswers.putAll(mapAnswersFromDb); - } else { - Iterator itMapQuestions = mapQuestions.entrySet().iterator(); - while (itMapQuestions.hasNext()) - { - Map.Entry pairs = (Map.Entry)itMapQuestions.next(); - mapAnswers.put(pairs.getKey(), ""); + generalLearnerFlowDTO.setCurrentQuestionIndex(new Integer(1)); + qaLearningForm.setCurrentQuestionIndex(new Integer(1).toString()); - } - } - } - - String currentAnswer=(String)mapAnswers.get("1"); - logger.debug("first entry as the current answer : " + currentAnswer); - generalLearnerFlowDTO.setCurrentAnswer(currentAnswer); + String httpSessionID = qaLearningForm.getHttpSessionID(); + logger.debug("httpSessionID: " + httpSessionID); - sessionMap.put(MAP_SEQUENTIAL_ANSWERS_KEY, mapAnswers); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); + request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); + qaLearningForm.setHttpSessionID(sessionMap.getSessionID()); + generalLearnerFlowDTO.setHttpSessionID(sessionMap.getSessionID()); - logger.debug("final mapAnswers : " + mapAnswers); - generalLearnerFlowDTO.setMapAnswers(mapAnswers); - sessionMap.put(MAP_ALL_RESULTS_KEY, mapAnswers); - request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); - - request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); - - generalLearnerFlowDTO.setTotalQuestionCount(new Integer(mapQuestions.size())); - qaLearningForm.setTotalQuestionCount(new Integer(mapQuestions.size()).toString()); - generalLearnerFlowDTO.setRemainingQuestionCount(new Integer(mapQuestions.size()).toString()); - - request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); - logger.debug("GENERAL_LEARNER_FLOW_DTO: " + request.getAttribute(GENERAL_LEARNER_FLOW_DTO)); - - qaLearningForm.resetAll(); - logger.debug("forwarding to: " + LOAD_LEARNER); - return (mapping.findForward(LOAD_LEARNER)); + generalLearnerFlowDTO.setActivityTitle(qaContent.getTitle()); + generalLearnerFlowDTO.setActivityInstructions(qaContent.getInstructions()); + + 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. + * And the passed tool session id refers to it. + */ + + logger.debug("REPORT_TITLE_LEARNER: " + qaContent.getReportTitle()); + generalLearnerFlowDTO.setReportTitleLearner(qaContent.getReportTitle()); + + /* + * Is the tool activity been checked as Run Offline in the property inspector? + */ + logger.debug("IS_TOOL_ACTIVITY_OFFLINE: " + qaContent.isRunOffline()); + generalLearnerFlowDTO.setActivityOffline(new Boolean(qaContent.isRunOffline()).toString()); + + logger.debug("IS_USERNAME_VISIBLE: " + qaContent.isUsernameVisible()); + generalLearnerFlowDTO.setUserNameVisible(new Boolean(qaContent.isUsernameVisible()).toString()); + generalLearnerFlowDTO.setShowOtherAnswers(new Boolean(qaContent.isShowOtherAnswers()).toString()); + + /* + * Learning mode requires this setting for jsp to generate the user's report + */ + logger.debug("IS_QUESTIONS_SEQUENCED: " + qaContent.isQuestionsSequenced()); + String feedBackType = ""; + if (qaContent.isQuestionsSequenced()) { + generalLearnerFlowDTO.setQuestionListingMode(QUESTION_LISTING_MODE_SEQUENTIAL); + feedBackType = FEEDBACK_TYPE_SEQUENTIAL; + } else { + generalLearnerFlowDTO.setQuestionListingMode(QUESTION_LISTING_MODE_COMBINED); + feedBackType = FEEDBACK_TYPE_COMBINED; } - + logger.debug("QUESTION_LISTING_MODE: " + generalLearnerFlowDTO.getQuestionListingMode()); - + HttpSession ss = SessionManager.getSession(); + /* get back login user DTO */ + UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER); + logger.debug("retrieving toolUser: " + toolUser); + logger.debug("retrieving toolUser userId: " + toolUser.getUserID()); + logger.debug("retrieving toolUser username: " + toolUser.getLogin()); + + String userName = toolUser.getLogin(); + String fullName = toolUser.getFirstName() + " " + toolUser.getLastName(); + logger.debug("retrieving toolUser fullname: " + fullName); + + Long userId = new Long(toolUser.getUserID().longValue()); + logger.debug("userId: " + userId); + + QaQueUsr qaQueUsr = qaService.getQaUserBySession(userId, qaSession.getUid()); + logger.debug("qaQueUsr: " + qaQueUsr); + + Long qaQueUsrUid = null; + boolean isResponseFinalized = false; + if (qaQueUsr != null) { + qaQueUsrUid = qaQueUsr.getUid(); + logger.debug("qaQueUsrUid: " + qaQueUsrUid); + + isResponseFinalized = qaQueUsr.isResponseFinalized(); + logger.debug("isResponseFinalized: " + isResponseFinalized); + } + + Map mapAnswersFromDb = new TreeMap(new QaComparator()); + /* + * fetch question content from content + */ + Iterator contentIterator = qaContent.getQaQueContents().iterator(); + + int questionCount = 0; + while (contentIterator.hasNext()) { + QaQueContent qaQueContent = (QaQueContent) contentIterator.next(); + if (qaQueContent != null) { + Long questionUid = qaQueContent.getUid(); + logger.debug("questionUid: " + questionUid); + + int displayOrder = qaQueContent.getDisplayOrder(); + if (displayOrder != 0) { + ++questionCount; + logger.debug("questionCount: " + questionCount); + + mapQuestions.put(new Integer(displayOrder).toString(), qaQueContent.getQuestion()); + + if (qaQueUsr != null) { + List listUserAttempts = qaService + .getAttemptsForUserAndQuestionContent(qaQueUsrUid, questionUid); + logger.debug("listUserAttempts: " + listUserAttempts); + + logger.debug("listUserAttempts size: " + listUserAttempts.size()); + + if (listUserAttempts.size() > 1) { + logger.debug("Warning: There should not be more than 1 attempts for the question."); + } + + Iterator itAttempts = listUserAttempts.iterator(); + while (itAttempts.hasNext()) { + QaUsrResp qaUsrResp = (QaUsrResp) itAttempts.next(); + logger.debug("qaUsrResp: " + qaUsrResp); + mapAnswersFromDb.put(new Integer(questionCount).toString(), qaUsrResp.getAnswer()); + } + } + } + } + } + logger.debug("mapAnswersFromDb: " + mapAnswersFromDb); + + mapAnswers = (Map) sessionMap.get(MAP_ALL_RESULTS_KEY); + logger.debug("mapAnswers: " + mapAnswers); + + qaLearningForm.setHttpSessionID(sessionMap.getSessionID()); + generalLearnerFlowDTO.setHttpSessionID(sessionMap.getSessionID()); + + logger.debug("mapQuestions: " + mapQuestions); + generalLearnerFlowDTO.setMapQuestionContentLearner(mapQuestions); + generalLearnerFlowDTO.setMapQuestions(mapQuestions); + logger.debug("mapQuestions has : " + mapQuestions.size() + " entries."); + + if (mapAnswers == null) { + mapAnswers = new TreeMap(new QaComparator()); + // maybe we have come in from the review screen, if so get the answers from db. + if (mapAnswersFromDb.size() > 0) { + Iterator itMapAnswers = mapAnswersFromDb.entrySet().iterator(); + while (itMapAnswers.hasNext()) { + Map.Entry pairs = (Map.Entry) itMapAnswers.next(); + mapAnswers.put(pairs.getKey().toString(), pairs.getValue()); + } + mapAnswers.putAll(mapAnswersFromDb); + } else { + Iterator itMapQuestions = mapQuestions.entrySet().iterator(); + while (itMapQuestions.hasNext()) { + Map.Entry pairs = (Map.Entry) itMapQuestions.next(); + mapAnswers.put(pairs.getKey(), ""); + + } + } + } + + String currentAnswer = (String) mapAnswers.get("1"); + logger.debug("first entry as the current answer : " + currentAnswer); + generalLearnerFlowDTO.setCurrentAnswer(currentAnswer); + + sessionMap.put(MAP_SEQUENTIAL_ANSWERS_KEY, mapAnswers); + + logger.debug("final mapAnswers : " + mapAnswers); + generalLearnerFlowDTO.setMapAnswers(mapAnswers); + sessionMap.put(MAP_ALL_RESULTS_KEY, mapAnswers); + request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); + + request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); + + generalLearnerFlowDTO.setTotalQuestionCount(new Integer(mapQuestions.size())); + qaLearningForm.setTotalQuestionCount(new Integer(mapQuestions.size()).toString()); + generalLearnerFlowDTO.setRemainingQuestionCount(new Integer(mapQuestions.size()).toString()); + + request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); + logger.debug("GENERAL_LEARNER_FLOW_DTO: " + request.getAttribute(GENERAL_LEARNER_FLOW_DTO)); + + qaLearningForm.resetAll(); + logger.debug("forwarding to: " + LOAD_LEARNER); + return (mapping.findForward(LOAD_LEARNER)); + } + /** - * Stores all results and moves onto the next step. - * If view other users answers = true, then goes to the - * view all answers screen, otherwise goes straight - * to the reflection screen (if any). + * Stores all results and moves onto the next step. If view other users + * answers = true, then goes to the view all answers screen, otherwise goes + * straight to the reflection screen (if any). * - * returns Learner Report for a session - * ActionForward viewAllResults(ActionMapping mapping, - ActionForm form, - HttpServletRequest request, - HttpServletResponse response) throws IOException, - ServletException) - * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws IOException - * @throws ServletException - */ - public ActionForward storeAllResults(ActionMapping mapping, - ActionForm form, - HttpServletRequest request, - HttpServletResponse response) throws IOException, - ServletException - { - logger.debug("dispatching viewAllResults..."); - QaLearningForm qaLearningForm = (QaLearningForm) form; - - LearningUtil.saveFormRequestData(request, qaLearningForm); - - IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - logger.debug("qaService: " + qaService); + * returns Learner Report for a session ActionForward + * viewAllResults(ActionMapping mapping, ActionForm form, HttpServletRequest + * request, HttpServletResponse response) throws IOException, + * ServletException) + * + * @param mapping + * @param form + * @param request + * @param response + * @return + * @throws IOException + * @throws ServletException + */ + public ActionForward storeAllResults(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException { + logger.debug("dispatching viewAllResults..."); + QaLearningForm qaLearningForm = (QaLearningForm) form; - String toolSessionID=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); - logger.debug("toolSessionID: " + toolSessionID); - qaLearningForm.setToolSessionID(toolSessionID); + LearningUtil.saveFormRequestData(request, qaLearningForm); - String userID=request.getParameter("userID"); - logger.debug("userID: " + userID); + IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); + logger.debug("qaService: " + qaService); - - QaSession qaSession=qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue()); - logger.debug("retrieving qaSession: " + qaSession); - - String toolContentID=qaSession.getQaContent().getQaContentId().toString(); - logger.debug("toolContentID: " + toolContentID); - - QaContent qaContent=qaSession.getQaContent(); - logger.debug("using qaContent: " + qaContent); - - GeneralLearnerFlowDTO generalLearnerFlowDTO= LearningUtil.buildGeneralLearnerFlowDTO(qaContent); - logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); - - String isUserNamesVisibleBoolean=generalLearnerFlowDTO.getUserNameVisible(); - boolean isUserNamesVisible=new Boolean(isUserNamesVisibleBoolean).booleanValue(); - logger.debug("isUserNamesVisible: " + isUserNamesVisible); + String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); + logger.debug("toolSessionID: " + toolSessionID); + qaLearningForm.setToolSessionID(toolSessionID); - String httpSessionID=qaLearningForm.getHttpSessionID(); - logger.debug("httpSessionID: " + httpSessionID); - - qaLearningForm.setHttpSessionID(httpSessionID); - generalLearnerFlowDTO.setHttpSessionID(httpSessionID); - - - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - logger.debug("sessionMap: " + sessionMap); - - Map mapAnswers=(Map)sessionMap.get(MAP_ALL_RESULTS_KEY); - logger.debug("mapAnswers retrieved: " + mapAnswers); - - /*recreate the users and responses*/ - LearningUtil learningUtil= new LearningUtil(); - learningUtil.createUsersAndResponses(mapAnswers, request, qaService, new Long(toolContentID), new Long(toolSessionID)); - qaLearningForm.resetUserActions(); - qaLearningForm.setSubmitAnswersContent(null); - - learningUtil.setContentInUse(new Long(toolContentID).longValue(), qaService); - logger.debug("content has been set in use"); - - if ( qaContent.isShowOtherAnswers() ) { - return prepareViewAllAnswers(mapping, request, qaLearningForm, qaService, toolSessionID, userID, qaSession, toolContentID, qaContent, generalLearnerFlowDTO, isUserNamesVisible); - } else if ( qaContent.isReflect() ) { - return forwardtoReflection(mapping, request, qaContent, qaService, toolSessionID, userID, qaLearningForm); - } else { - return endLearning(mapping, qaLearningForm, request, response); - } + String userID = request.getParameter("userID"); + logger.debug("userID: " + userID); + + QaSession qaSession = qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue()); + logger.debug("retrieving qaSession: " + qaSession); + + String toolContentID = qaSession.getQaContent().getQaContentId().toString(); + logger.debug("toolContentID: " + toolContentID); + + QaContent qaContent = qaSession.getQaContent(); + logger.debug("using qaContent: " + qaContent); + + GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent); + logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); + + String isUserNamesVisibleBoolean = generalLearnerFlowDTO.getUserNameVisible(); + boolean isUserNamesVisible = new Boolean(isUserNamesVisibleBoolean).booleanValue(); + logger.debug("isUserNamesVisible: " + isUserNamesVisible); + + String httpSessionID = qaLearningForm.getHttpSessionID(); + logger.debug("httpSessionID: " + httpSessionID); + + qaLearningForm.setHttpSessionID(httpSessionID); + generalLearnerFlowDTO.setHttpSessionID(httpSessionID); + + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); + logger.debug("sessionMap: " + sessionMap); + + Map mapAnswers = (Map) sessionMap.get(MAP_ALL_RESULTS_KEY); + logger.debug("mapAnswers retrieved: " + mapAnswers); + + /*recreate the users and responses*/ + LearningUtil learningUtil = new LearningUtil(); + learningUtil.createUsersAndResponses(mapAnswers, request, qaService, new Long(toolContentID), new Long( + toolSessionID)); + qaLearningForm.resetUserActions(); + qaLearningForm.setSubmitAnswersContent(null); + + learningUtil.setContentInUse(new Long(toolContentID).longValue(), qaService); + logger.debug("content has been set in use"); + + if (qaContent.isShowOtherAnswers()) { + return prepareViewAllAnswers(mapping, request, qaLearningForm, qaService, toolSessionID, userID, qaSession, + toolContentID, qaContent, generalLearnerFlowDTO, isUserNamesVisible); + } else if (qaContent.isReflect()) { + return forwardtoReflection(mapping, request, qaContent, qaService, toolSessionID, userID, qaLearningForm); + } else { + return endLearning(mapping, qaLearningForm, request, response); } + } /** Set up the data for the view all answers screen */ - private ActionForward prepareViewAllAnswers(ActionMapping mapping, HttpServletRequest request, QaLearningForm qaLearningForm, IQaService qaService, String toolSessionID, String userID, QaSession qaSession, String toolContentID, QaContent qaContent, GeneralLearnerFlowDTO generalLearnerFlowDTO, boolean isUserNamesVisible) { - logger.debug("start generating learning report..."); - logger.debug("toolContentID: " + toolContentID); + private ActionForward prepareViewAllAnswers(ActionMapping mapping, HttpServletRequest request, + QaLearningForm qaLearningForm, IQaService qaService, String toolSessionID, String userID, + QaSession qaSession, String toolContentID, QaContent qaContent, + GeneralLearnerFlowDTO generalLearnerFlowDTO, boolean isUserNamesVisible) { + logger.debug("start generating learning report..."); + logger.debug("toolContentID: " + toolContentID); + QaMonitoringAction qaMonitoringAction = new QaMonitoringAction(); + qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, isUserNamesVisible, true, toolSessionID, + userID, generalLearnerFlowDTO, false, toolSessionID); - QaMonitoringAction qaMonitoringAction= new QaMonitoringAction(); - qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, isUserNamesVisible, true, toolSessionID, userID, - generalLearnerFlowDTO, false , toolSessionID); + generalLearnerFlowDTO.setRequestLearningReport(new Boolean(true).toString()); + generalLearnerFlowDTO.setRequestLearningReportProgress(new Boolean(false).toString()); - generalLearnerFlowDTO.setRequestLearningReport(new Boolean(true).toString()); - generalLearnerFlowDTO.setRequestLearningReportProgress(new Boolean(false).toString()); + generalLearnerFlowDTO.setReflection(new Boolean(qaContent.isReflect()).toString()); - generalLearnerFlowDTO.setReflection(new Boolean(qaContent.isReflect()).toString()); - - qaLearningForm.resetAll(); - - boolean lockWhenFinished=qaContent.isLockWhenFinished(); - logger.debug("lockWhenFinished: " + lockWhenFinished); - generalLearnerFlowDTO.setLockWhenFinished(new Boolean(lockWhenFinished).toString()); - - - HttpSession ss = SessionManager.getSession(); - /* get back login user DTO */ - UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER); - logger.debug("retrieving toolUser: " + toolUser); - logger.debug("retrieving toolUser userId: " + toolUser.getUserID()); - logger.debug("retrieving toolUser username: " + toolUser.getLogin()); + qaLearningForm.resetAll(); - String userName=toolUser.getLogin(); - String fullName= toolUser.getFirstName() + " " + toolUser.getLastName(); - logger.debug("retrieving toolUser fullname: " + fullName); - - Long userId=new Long(toolUser.getUserID().longValue()); - logger.debug("userId: " + userId); - - QaQueUsr qaQueUsr=qaService.getQaUserBySession(userId, qaSession.getUid()); - logger.debug("qaQueUsr: " + qaQueUsr); - logger.debug("qaQueUsr uid : " + qaQueUsr.getUid()); - - generalLearnerFlowDTO.setUserUid(qaQueUsr.getUid().toString()); - - int sessionUserCount=0; - if (qaSession.getQaQueUsers() != null) - { - sessionUserCount=qaSession.getQaQueUsers().size(); - } - - if (sessionUserCount > 1) - { - logger.debug("there are multiple user responses"); - generalLearnerFlowDTO.setExistMultipleUserResponses(new Boolean(true).toString()); - } - - boolean usernameVisible=qaContent.isUsernameVisible(); - generalLearnerFlowDTO.setUserNameVisible(new Boolean(usernameVisible).toString()); - - - - logger.debug("attempt getting notebookEntry: "); - NotebookEntry notebookEntry = qaService.getEntry(new Long(toolSessionID), - CoreNotebookConstants.NOTEBOOK_TOOL, - MY_SIGNATURE, new Integer(userID)); - - logger.debug("notebookEntry: " + notebookEntry); - - if (notebookEntry != null) { - //String notebookEntryPresentable=QaUtils.replaceNewLines(notebookEntry.getEntry()); - String notebookEntryPresentable=notebookEntry.getEntry(); - logger.debug("notebookEntryPresentable: " + notebookEntryPresentable); - qaLearningForm.setEntryText(notebookEntryPresentable); - } - - - request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); - logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO); - - logger.debug("fwd'ing to INDIVIDUAL_LEARNER_REPORT: " + INDIVIDUAL_LEARNER_REPORT); - return (mapping.findForward(INDIVIDUAL_LEARNER_REPORT)); + boolean lockWhenFinished = qaContent.isLockWhenFinished(); + logger.debug("lockWhenFinished: " + lockWhenFinished); + generalLearnerFlowDTO.setLockWhenFinished(new Boolean(lockWhenFinished).toString()); + + HttpSession ss = SessionManager.getSession(); + /* get back login user DTO */ + UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER); + logger.debug("retrieving toolUser: " + toolUser); + logger.debug("retrieving toolUser userId: " + toolUser.getUserID()); + logger.debug("retrieving toolUser username: " + toolUser.getLogin()); + + String userName = toolUser.getLogin(); + String fullName = toolUser.getFirstName() + " " + toolUser.getLastName(); + logger.debug("retrieving toolUser fullname: " + fullName); + + Long userId = new Long(toolUser.getUserID().longValue()); + logger.debug("userId: " + userId); + + QaQueUsr qaQueUsr = qaService.getQaUserBySession(userId, qaSession.getUid()); + logger.debug("qaQueUsr: " + qaQueUsr); + logger.debug("qaQueUsr uid : " + qaQueUsr.getUid()); + + generalLearnerFlowDTO.setUserUid(qaQueUsr.getUid().toString()); + + int sessionUserCount = 0; + if (qaSession.getQaQueUsers() != null) { + sessionUserCount = qaSession.getQaQueUsers().size(); } + if (sessionUserCount > 1) { + logger.debug("there are multiple user responses"); + generalLearnerFlowDTO.setExistMultipleUserResponses(new Boolean(true).toString()); + } + boolean usernameVisible = qaContent.isUsernameVisible(); + generalLearnerFlowDTO.setUserNameVisible(new Boolean(usernameVisible).toString()); + + logger.debug("attempt getting notebookEntry: "); + NotebookEntry notebookEntry = qaService.getEntry(new Long(toolSessionID), CoreNotebookConstants.NOTEBOOK_TOOL, + MY_SIGNATURE, new Integer(userID)); + + logger.debug("notebookEntry: " + notebookEntry); + + if (notebookEntry != null) { + //String notebookEntryPresentable=QaUtils.replaceNewLines(notebookEntry.getEntry()); + String notebookEntryPresentable = notebookEntry.getEntry(); + logger.debug("notebookEntryPresentable: " + notebookEntryPresentable); + qaLearningForm.setEntryText(notebookEntryPresentable); + } + + request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); + logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO); + + logger.debug("fwd'ing to INDIVIDUAL_LEARNER_REPORT: " + INDIVIDUAL_LEARNER_REPORT); + return (mapping.findForward(INDIVIDUAL_LEARNER_REPORT)); + } + /** - * ActionForward refreshAllResults(ActionMapping mapping, - ActionForm form, - HttpServletRequest request, - HttpServletResponse response) throws IOException, - ServletException - + * ActionForward refreshAllResults(ActionMapping mapping, ActionForm form, + * HttpServletRequest request, HttpServletResponse response) throws + * IOException, ServletException + * * @param mapping * @param form * @param request @@ -726,139 +660,125 @@ * @throws IOException * @throws ServletException */ - public ActionForward refreshAllResults(ActionMapping mapping, - ActionForm form, - HttpServletRequest request, - HttpServletResponse response) throws IOException, - ServletException - { - logger.debug("dispatching refreshAllResults..."); - QaLearningForm qaLearningForm = (QaLearningForm) form; - - LearningUtil.saveFormRequestData(request, qaLearningForm); - - IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - logger.debug("qaService: " + qaService); + public ActionForward refreshAllResults(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException { + logger.debug("dispatching refreshAllResults..."); + QaLearningForm qaLearningForm = (QaLearningForm) form; - String toolSessionID=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); - logger.debug("toolSessionID: " + toolSessionID); - qaLearningForm.setToolSessionID(toolSessionID); + LearningUtil.saveFormRequestData(request, qaLearningForm); - String userID=request.getParameter("userID"); - logger.debug("userID: " + userID); + IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); + logger.debug("qaService: " + qaService); - - QaSession qaSession=qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue()); - logger.debug("retrieving qaSession: " + qaSession); - - String toolContentID=qaSession.getQaContent().getQaContentId().toString(); - logger.debug("toolContentID: " + toolContentID); - - QaContent qaContent=qaSession.getQaContent(); - logger.debug("using qaContent: " + qaContent); - - GeneralLearnerFlowDTO generalLearnerFlowDTO= LearningUtil.buildGeneralLearnerFlowDTO(qaContent); - logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); - - String isUserNamesVisibleBoolean=generalLearnerFlowDTO.getUserNameVisible(); - boolean isUserNamesVisible=new Boolean(isUserNamesVisibleBoolean).booleanValue(); - logger.debug("isUserNamesVisible: " + isUserNamesVisible); + String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); + logger.debug("toolSessionID: " + toolSessionID); + qaLearningForm.setToolSessionID(toolSessionID); - String httpSessionID=qaLearningForm.getHttpSessionID(); - logger.debug("httpSessionID: " + httpSessionID); - - qaLearningForm.setHttpSessionID(httpSessionID); - generalLearnerFlowDTO.setHttpSessionID(httpSessionID); - - - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - logger.debug("sessionMap: " + sessionMap); - - Map mapAnswers=(Map)sessionMap.get(MAP_ALL_RESULTS_KEY); - logger.debug("mapAnswers retrieved: " + mapAnswers); - - /*recreate the users and responses*/ - LearningUtil learningUtil= new LearningUtil(); + String userID = request.getParameter("userID"); + logger.debug("userID: " + userID); - qaLearningForm.resetUserActions(); - qaLearningForm.setSubmitAnswersContent(null); - - learningUtil.setContentInUse(new Long(toolContentID).longValue(), qaService); - logger.debug("content has been set in use"); - - logger.debug("start generating learning report..."); - logger.debug("toolContentID: " + toolContentID); + QaSession qaSession = qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue()); + logger.debug("retrieving qaSession: " + qaSession); + String toolContentID = qaSession.getQaContent().getQaContentId().toString(); + logger.debug("toolContentID: " + toolContentID); - QaMonitoringAction qaMonitoringAction= new QaMonitoringAction(); - qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, isUserNamesVisible, true, - toolSessionID, userID, - generalLearnerFlowDTO, false , toolSessionID); + QaContent qaContent = qaSession.getQaContent(); + logger.debug("using qaContent: " + qaContent); - generalLearnerFlowDTO.setRequestLearningReport(new Boolean(true).toString()); - generalLearnerFlowDTO.setRequestLearningReportProgress(new Boolean(false).toString()); + GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent); + logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); - generalLearnerFlowDTO.setReflection(new Boolean(qaContent.isReflect()).toString()); - //generalLearnerFlowDTO.setNotebookEntriesVisible(new Boolean(false).toString()); - - qaLearningForm.resetAll(); - - boolean lockWhenFinished=qaContent.isLockWhenFinished(); - logger.debug("lockWhenFinished: " + lockWhenFinished); - generalLearnerFlowDTO.setLockWhenFinished(new Boolean(lockWhenFinished).toString()); - + String isUserNamesVisibleBoolean = generalLearnerFlowDTO.getUserNameVisible(); + boolean isUserNamesVisible = new Boolean(isUserNamesVisibleBoolean).booleanValue(); + logger.debug("isUserNamesVisible: " + isUserNamesVisible); - HttpSession ss = SessionManager.getSession(); - /* get back login user DTO */ - UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER); - logger.debug("retrieving toolUser: " + toolUser); - logger.debug("retrieving toolUser userId: " + toolUser.getUserID()); - logger.debug("retrieving toolUser username: " + toolUser.getLogin()); + String httpSessionID = qaLearningForm.getHttpSessionID(); + logger.debug("httpSessionID: " + httpSessionID); - String userName=toolUser.getLogin(); - String fullName= toolUser.getFirstName() + " " + toolUser.getLastName(); - logger.debug("retrieving toolUser fullname: " + fullName); - - Long userId=new Long(toolUser.getUserID().longValue()); - logger.debug("userId: " + userId); - - QaQueUsr qaQueUsr=qaService.getQaUserBySession(userId, qaSession.getUid()); - logger.debug("qaQueUsr: " + qaQueUsr); - logger.debug("qaQueUsr uid : " + qaQueUsr.getUid()); - - generalLearnerFlowDTO.setUserUid(qaQueUsr.getUid().toString()); + qaLearningForm.setHttpSessionID(httpSessionID); + generalLearnerFlowDTO.setHttpSessionID(httpSessionID); - int sessionUserCount=0; - if (qaSession.getQaQueUsers() != null) - { - sessionUserCount=qaSession.getQaQueUsers().size(); - } - - if (sessionUserCount > 1) - { - logger.debug("there are multiple user responses"); - generalLearnerFlowDTO.setExistMultipleUserResponses(new Boolean(true).toString()); - } - - boolean usernameVisible=qaContent.isUsernameVisible(); - logger.debug("usernameVisible: " + usernameVisible); - generalLearnerFlowDTO.setUserNameVisible(new Boolean(usernameVisible).toString()); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); + logger.debug("sessionMap: " + sessionMap); - - request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); - logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO); - - logger.debug("fwd'ing to INDIVIDUAL_LEARNER_REPORT: " + INDIVIDUAL_LEARNER_REPORT); - return (mapping.findForward(INDIVIDUAL_LEARNER_REPORT)); + Map mapAnswers = (Map) sessionMap.get(MAP_ALL_RESULTS_KEY); + logger.debug("mapAnswers retrieved: " + mapAnswers); + + /*recreate the users and responses*/ + LearningUtil learningUtil = new LearningUtil(); + + qaLearningForm.resetUserActions(); + qaLearningForm.setSubmitAnswersContent(null); + + learningUtil.setContentInUse(new Long(toolContentID).longValue(), qaService); + logger.debug("content has been set in use"); + + logger.debug("start generating learning report..."); + logger.debug("toolContentID: " + toolContentID); + + QaMonitoringAction qaMonitoringAction = new QaMonitoringAction(); + qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, isUserNamesVisible, true, toolSessionID, + userID, generalLearnerFlowDTO, false, toolSessionID); + + generalLearnerFlowDTO.setRequestLearningReport(new Boolean(true).toString()); + generalLearnerFlowDTO.setRequestLearningReportProgress(new Boolean(false).toString()); + + generalLearnerFlowDTO.setReflection(new Boolean(qaContent.isReflect()).toString()); + //generalLearnerFlowDTO.setNotebookEntriesVisible(new Boolean(false).toString()); + + qaLearningForm.resetAll(); + + boolean lockWhenFinished = qaContent.isLockWhenFinished(); + logger.debug("lockWhenFinished: " + lockWhenFinished); + generalLearnerFlowDTO.setLockWhenFinished(new Boolean(lockWhenFinished).toString()); + + HttpSession ss = SessionManager.getSession(); + /* get back login user DTO */ + UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER); + logger.debug("retrieving toolUser: " + toolUser); + logger.debug("retrieving toolUser userId: " + toolUser.getUserID()); + logger.debug("retrieving toolUser username: " + toolUser.getLogin()); + + String userName = toolUser.getLogin(); + String fullName = toolUser.getFirstName() + " " + toolUser.getLastName(); + logger.debug("retrieving toolUser fullname: " + fullName); + + Long userId = new Long(toolUser.getUserID().longValue()); + logger.debug("userId: " + userId); + + QaQueUsr qaQueUsr = qaService.getQaUserBySession(userId, qaSession.getUid()); + logger.debug("qaQueUsr: " + qaQueUsr); + logger.debug("qaQueUsr uid : " + qaQueUsr.getUid()); + + generalLearnerFlowDTO.setUserUid(qaQueUsr.getUid().toString()); + + int sessionUserCount = 0; + if (qaSession.getQaQueUsers() != null) { + sessionUserCount = qaSession.getQaQueUsers().size(); } - - - + if (sessionUserCount > 1) { + logger.debug("there are multiple user responses"); + generalLearnerFlowDTO.setExistMultipleUserResponses(new Boolean(true).toString()); + } + + boolean usernameVisible = qaContent.isUsernameVisible(); + logger.debug("usernameVisible: " + usernameVisible); + generalLearnerFlowDTO.setUserNameVisible(new Boolean(usernameVisible).toString()); + + request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); + logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO); + + logger.debug("fwd'ing to INDIVIDUAL_LEARNER_REPORT: " + INDIVIDUAL_LEARNER_REPORT); + return (mapping.findForward(INDIVIDUAL_LEARNER_REPORT)); + } + /** - * moves to the next question and modifies the map - * ActionForward getNextQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) - throws IOException, ServletException, ToolException + * moves to the next question and modifies the map ActionForward + * getNextQuestion(ActionMapping mapping, ActionForm form, + * HttpServletRequest request, HttpServletResponse response) throws + * IOException, ServletException, ToolException * * @param mapping * @param form @@ -869,151 +789,142 @@ * @throws ServletException * @throws ToolException */ - public ActionForward getNextQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) - throws IOException, ServletException, ToolException - { - logger.debug("dispatching getNextQuestion..."); - QaLearningForm qaLearningForm = (QaLearningForm) form; - - LearningUtil.saveFormRequestData(request, qaLearningForm); - - IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - logger.debug("qaService: " + qaService); + public ActionForward getNextQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException, ToolException { + logger.debug("dispatching getNextQuestion..."); + QaLearningForm qaLearningForm = (QaLearningForm) form; - String toolSessionID=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); - logger.debug("toolSessionID: " + toolSessionID); - qaLearningForm.setToolSessionID(toolSessionID); + LearningUtil.saveFormRequestData(request, qaLearningForm); - String httpSessionID=qaLearningForm.getHttpSessionID(); - logger.debug("httpSessionID: " + httpSessionID); - - qaLearningForm.setHttpSessionID(httpSessionID); + IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); + logger.debug("qaService: " + qaService); - - QaSession qaSession=qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue()); - logger.debug("retrieving qaSession: " + qaSession); - - String toolContentID=qaSession.getQaContent().getQaContentId().toString(); - logger.debug("toolContentID: " + toolContentID); - - QaContent qaContent=qaSession.getQaContent(); - logger.debug("using qaContent: " + qaContent); - - GeneralLearnerFlowDTO generalLearnerFlowDTO= LearningUtil.buildGeneralLearnerFlowDTO(qaContent); - logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); - - - populateAnswersMap(qaLearningForm, request, generalLearnerFlowDTO, true, false); - - qaLearningForm.resetAll(); - return (mapping.findForward(LOAD_LEARNER)); + String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); + logger.debug("toolSessionID: " + toolSessionID); + qaLearningForm.setToolSessionID(toolSessionID); + + String httpSessionID = qaLearningForm.getHttpSessionID(); + logger.debug("httpSessionID: " + httpSessionID); + + qaLearningForm.setHttpSessionID(httpSessionID); + + QaSession qaSession = qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue()); + logger.debug("retrieving qaSession: " + qaSession); + + String toolContentID = qaSession.getQaContent().getQaContentId().toString(); + logger.debug("toolContentID: " + toolContentID); + + QaContent qaContent = qaSession.getQaContent(); + logger.debug("using qaContent: " + qaContent); + + GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent); + logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); + + populateAnswersMap(qaLearningForm, request, generalLearnerFlowDTO, true, false); + + qaLearningForm.resetAll(); + return (mapping.findForward(LOAD_LEARNER)); } - - - public Map populateAnswersMap(ActionForm form, HttpServletRequest request, GeneralLearnerFlowDTO generalLearnerFlowDTO, - boolean getNextQuestion, boolean learnerDone) - { - logger.debug("learnerDone: " + learnerDone); - - logger.debug("getNextQuestion: " + getNextQuestion); - QaLearningForm qaLearningForm = (QaLearningForm) form; - String httpSessionID=qaLearningForm.getHttpSessionID(); - logger.debug("httpSessionID: " + httpSessionID); - - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - logger.debug("sessionMap: " + sessionMap); - - Map mapSequentialAnswers=(Map)sessionMap.get(MAP_SEQUENTIAL_ANSWERS_KEY); - logger.debug("pre mapSequentialAnswers: " + mapSequentialAnswers); + public Map populateAnswersMap(ActionForm form, HttpServletRequest request, + GeneralLearnerFlowDTO generalLearnerFlowDTO, boolean getNextQuestion, boolean learnerDone) { + logger.debug("learnerDone: " + learnerDone); - String currentQuestionIndex=qaLearningForm.getCurrentQuestionIndex(); - logger.debug("currentQuestionIndex:" + currentQuestionIndex); - - Map mapAnswers=(Map)sessionMap.get(MAP_ALL_RESULTS_KEY); - logger.debug("mapAnswers retrieved: " + mapAnswers); + logger.debug("getNextQuestion: " + getNextQuestion); + QaLearningForm qaLearningForm = (QaLearningForm) form; - if (mapAnswers == null) - mapAnswers= new TreeMap(new QaComparator()); - - logger.debug("getting answer for question: " + currentQuestionIndex + "as: " + qaLearningForm.getAnswer()); - logger.debug("mapSequentialAnswers size:" + mapSequentialAnswers.size()); - - - if (mapSequentialAnswers.size() >= new Integer(currentQuestionIndex).intValue()) - { - logger.debug("mapSequentialAnswers size:" + mapSequentialAnswers.size() + " and currentQuestionIndex: " + currentQuestionIndex); - mapSequentialAnswers.remove(new Long(currentQuestionIndex).toString()); - } - logger.debug("before adding to mapSequentialAnswers: " + mapSequentialAnswers); - mapSequentialAnswers.put(new Long(currentQuestionIndex).toString(), qaLearningForm.getAnswer()); - 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); - + String httpSessionID = qaLearningForm.getHttpSessionID(); + logger.debug("httpSessionID: " + httpSessionID); - int intCurrentQuestionIndex=new Integer(currentQuestionIndex).intValue(); - logger.debug("intCurrentQuestionIndex:" + intCurrentQuestionIndex); - - if (getNextQuestion) - intCurrentQuestionIndex++; - else - intCurrentQuestionIndex--; - - - LearningUtil learningUtil= new LearningUtil(); - logger.debug("current map size:" + mapSequentialAnswers.size()); - - String currentAnswer=""; - if (mapAnswers.size() >= intCurrentQuestionIndex) - { - currentAnswer=(String)mapAnswers.get(new Long(intCurrentQuestionIndex).toString()); - logger.debug("currentAnswer:" + currentAnswer); - } - logger.debug("currentAnswer:" + currentAnswer); - generalLearnerFlowDTO.setCurrentAnswer(currentAnswer); - - logger.debug("currentQuestionIndex will be: " + intCurrentQuestionIndex); - generalLearnerFlowDTO.setCurrentQuestionIndex(new Integer(intCurrentQuestionIndex)); - - String totalQuestionCount=qaLearningForm.getTotalQuestionCount(); - logger.debug("totalQuestionCount: " + totalQuestionCount); - - String userFeedback=learningUtil.feedBackAnswersProgress(request,intCurrentQuestionIndex,totalQuestionCount); - logger.debug("userFeedback: " + userFeedback); - generalLearnerFlowDTO.setUserFeedback(userFeedback); - - String remQCount=learningUtil.getRemainingQuestionCount(intCurrentQuestionIndex,totalQuestionCount); - logger.debug("remQCount: " + remQCount); - generalLearnerFlowDTO.setRemainingQuestionCount(remQCount); - - - qaLearningForm.resetUserActions(); /*resets all except submitAnswersContent */ - - sessionMap.put(MAP_SEQUENTIAL_ANSWERS_KEY, mapSequentialAnswers); - request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); - qaLearningForm.setHttpSessionID(sessionMap.getSessionID()); - generalLearnerFlowDTO.setHttpSessionID(sessionMap.getSessionID()); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); + logger.debug("sessionMap: " + sessionMap); - request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); - - return mapSequentialAnswers; + Map mapSequentialAnswers = (Map) sessionMap.get(MAP_SEQUENTIAL_ANSWERS_KEY); + logger.debug("pre mapSequentialAnswers: " + mapSequentialAnswers); + + 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()); + + if (mapSequentialAnswers.size() >= new Integer(currentQuestionIndex).intValue()) { + logger.debug("mapSequentialAnswers size:" + mapSequentialAnswers.size() + " and currentQuestionIndex: " + + currentQuestionIndex); + mapSequentialAnswers.remove(new Long(currentQuestionIndex).toString()); + } + logger.debug("before adding to mapSequentialAnswers: " + mapSequentialAnswers); + mapSequentialAnswers.put(new Long(currentQuestionIndex).toString(), qaLearningForm.getAnswer()); + 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); + + if (getNextQuestion) + intCurrentQuestionIndex++; + else + intCurrentQuestionIndex--; + + LearningUtil learningUtil = new LearningUtil(); + logger.debug("current map size:" + mapSequentialAnswers.size()); + + String currentAnswer = ""; + if (mapAnswers.size() >= intCurrentQuestionIndex) { + currentAnswer = (String) mapAnswers.get(new Long(intCurrentQuestionIndex).toString()); + logger.debug("currentAnswer:" + currentAnswer); + } + logger.debug("currentAnswer:" + currentAnswer); + generalLearnerFlowDTO.setCurrentAnswer(currentAnswer); + + logger.debug("currentQuestionIndex will be: " + intCurrentQuestionIndex); + generalLearnerFlowDTO.setCurrentQuestionIndex(new Integer(intCurrentQuestionIndex)); + + String totalQuestionCount = qaLearningForm.getTotalQuestionCount(); + logger.debug("totalQuestionCount: " + totalQuestionCount); + + String userFeedback = learningUtil + .feedBackAnswersProgress(request, intCurrentQuestionIndex, totalQuestionCount); + logger.debug("userFeedback: " + userFeedback); + generalLearnerFlowDTO.setUserFeedback(userFeedback); + + String remQCount = learningUtil.getRemainingQuestionCount(intCurrentQuestionIndex, totalQuestionCount); + logger.debug("remQCount: " + remQCount); + generalLearnerFlowDTO.setRemainingQuestionCount(remQCount); + + qaLearningForm.resetUserActions(); /*resets all except submitAnswersContent */ + + sessionMap.put(MAP_SEQUENTIAL_ANSWERS_KEY, mapSequentialAnswers); + request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); + qaLearningForm.setHttpSessionID(sessionMap.getSessionID()); + generalLearnerFlowDTO.setHttpSessionID(sessionMap.getSessionID()); + + request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); + + return mapSequentialAnswers; } - - + /** - * moves to the previous question and modifies the map - * ActionForward getPreviousQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) - throws IOException, ServletException, ToolException + * moves to the previous question and modifies the map ActionForward + * getPreviousQuestion(ActionMapping mapping, ActionForm form, + * HttpServletRequest request, HttpServletResponse response) throws + * IOException, ServletException, ToolException * * @param mapping * @param form @@ -1024,297 +935,273 @@ * @throws ServletException * @throws ToolException */ - public ActionForward getPreviousQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) - throws IOException, ServletException, ToolException - { - logger.debug("dispatching getPreviousQuestion..."); - QaLearningForm qaLearningForm = (QaLearningForm) form; - - LearningUtil.saveFormRequestData(request, qaLearningForm); - - IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - logger.debug("qaService: " + qaService); + public ActionForward getPreviousQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException, ToolException { + logger.debug("dispatching getPreviousQuestion..."); + QaLearningForm qaLearningForm = (QaLearningForm) form; - String httpSessionID=qaLearningForm.getHttpSessionID(); - logger.debug("httpSessionID: " + httpSessionID); - - qaLearningForm.setHttpSessionID(httpSessionID); + LearningUtil.saveFormRequestData(request, qaLearningForm); - String toolSessionID=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); - logger.debug("toolSessionID: " + toolSessionID); - qaLearningForm.setToolSessionID(toolSessionID); - - QaSession qaSession=qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue()); - logger.debug("retrieving qaSession: " + qaSession); - - String toolContentID=qaSession.getQaContent().getQaContentId().toString(); - logger.debug("toolContentID: " + toolContentID); - - QaContent qaContent=qaSession.getQaContent(); - logger.debug("using qaContent: " + qaContent); - - GeneralLearnerFlowDTO generalLearnerFlowDTO= LearningUtil.buildGeneralLearnerFlowDTO(qaContent); - logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); - - populateAnswersMap(qaLearningForm, request, generalLearnerFlowDTO, false, false); - - qaLearningForm.resetAll(); - return (mapping.findForward(LOAD_LEARNER)); + IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); + logger.debug("qaService: " + qaService); + + String httpSessionID = qaLearningForm.getHttpSessionID(); + logger.debug("httpSessionID: " + httpSessionID); + + qaLearningForm.setHttpSessionID(httpSessionID); + + String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); + logger.debug("toolSessionID: " + toolSessionID); + qaLearningForm.setToolSessionID(toolSessionID); + + QaSession qaSession = qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue()); + logger.debug("retrieving qaSession: " + qaSession); + + String toolContentID = qaSession.getQaContent().getQaContentId().toString(); + logger.debug("toolContentID: " + toolContentID); + + QaContent qaContent = qaSession.getQaContent(); + logger.debug("using qaContent: " + qaContent); + + GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent); + logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); + + populateAnswersMap(qaLearningForm, request, generalLearnerFlowDTO, false, false); + + qaLearningForm.resetAll(); + return (mapping.findForward(LOAD_LEARNER)); } - - + /** - * finishes the user's tool activity - * endLearning(HttpServletRequest request, IQaService qaService, HttpServletResponse response) - throws IOException, ToolException + * finishes the user's tool activity endLearning(HttpServletRequest request, + * IQaService qaService, HttpServletResponse response) throws IOException, + * ToolException * * @param request * @param qaService * @param response * @throws IOException * @throws ToolException */ - public ActionForward endLearning(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) - throws IOException, ServletException, ToolException - { - logger.debug("dispatching endLearning..."); - QaLearningForm qaLearningForm = (QaLearningForm) form; - - LearningUtil.saveFormRequestData(request, qaLearningForm); - - IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - logger.debug("qaService: " + qaService); + public ActionForward endLearning(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException, ToolException { + logger.debug("dispatching endLearning..."); + QaLearningForm qaLearningForm = (QaLearningForm) form; - String toolSessionID=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); - logger.debug("toolSessionID: " + toolSessionID); - qaLearningForm.setToolSessionID(toolSessionID); + LearningUtil.saveFormRequestData(request, qaLearningForm); - String userID=request.getParameter("userID"); - logger.debug("userID: " + userID); - qaLearningForm.setUserID(userID); + IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); + logger.debug("qaService: " + qaService); - //QaUtils.replaceNewLines(entryText) - - String entryText=request.getParameter("entryText"); - logger.debug("entryText: " + entryText); + String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); + logger.debug("toolSessionID: " + toolSessionID); + qaLearningForm.setToolSessionID(toolSessionID); - /* - NotebookEntry notebookEntry = qaService.getEntry(new Long(toolSessionID), - CoreNotebookConstants.NOTEBOOK_TOOL, - MY_SIGNATURE, new Integer(userID)); - - logger.debug("notebookEntry: " + notebookEntry); - if (notebookEntry != null) { - notebookEntry.setEntry(entryText); - qaService.updateEntry(notebookEntry); - } - - - NotebookEntry notebookEntryLocal = new NotebookEntry(); - notebookEntryLocal.setEntry(entryText); + String userID = request.getParameter("userID"); + logger.debug("userID: " + userID); + qaLearningForm.setUserID(userID); - User userLocal = new User(); - userLocal.setUserId(new Integer(userID)); - notebookEntryLocal.setUser(userLocal); - - qaService.updateEntry(notebookEntryLocal); - logger.debug("entry updated: " + entryText); - */ + //QaUtils.replaceNewLines(entryText) - - - QaSession qaSession=qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue()); - logger.debug("retrieving qaSession: " + qaSession); + String entryText = request.getParameter("entryText"); + logger.debug("entryText: " + entryText); + + /* + NotebookEntry notebookEntry = qaService.getEntry(new Long(toolSessionID), + CoreNotebookConstants.NOTEBOOK_TOOL, + MY_SIGNATURE, new Integer(userID)); - QaQueUsr qaQueUsr=qaService.getQaUserBySession(new Long(userID), qaSession.getUid()); - logger.debug("QaQueUsr:" + qaQueUsr); - - /* it is possible that qaQueUsr can be null if the content is set as runoffline and reflection is on*/ - if (qaQueUsr == null) - { - logger.debug("attempt creating user record since it must exist for the runOffline + reflection screens"); - HttpSession ss = SessionManager.getSession(); + logger.debug("notebookEntry: " + notebookEntry); + if (notebookEntry != null) { + notebookEntry.setEntry(entryText); + qaService.updateEntry(notebookEntry); + } + + + NotebookEntry notebookEntryLocal = new NotebookEntry(); + notebookEntryLocal.setEntry(entryText); - UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER); - logger.debug("retrieving toolUser: " + toolUser); - logger.debug("retrieving toolUser userId: " + toolUser.getUserID()); - logger.debug("retrieving toolUser username: " + toolUser.getLogin()); + User userLocal = new User(); + userLocal.setUserId(new Integer(userID)); + notebookEntryLocal.setUser(userLocal); + + qaService.updateEntry(notebookEntryLocal); + logger.debug("entry updated: " + entryText); + */ - String userName=toolUser.getLogin(); - String fullName= toolUser.getFirstName() + " " + toolUser.getLastName(); - logger.debug("retrieving toolUser fullname: " + fullName); - - Long userId=new Long(toolUser.getUserID().longValue()); - logger.debug("retrieving toolUser fullname: " + fullName); + QaSession qaSession = qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue()); + logger.debug("retrieving qaSession: " + qaSession); - qaQueUsr= new QaQueUsr(userId, - userName, - fullName, - null, - qaSession, - new TreeSet()); - - logger.debug("createQaQueUsr - qaQueUsr: " + qaQueUsr); - - logger.debug("session uid: " + qaSession.getUid()); - logger.debug("qaQueUsr: " + qaQueUsr); - qaService.createQaQueUsr(qaQueUsr); - logger.debug("created qaQueUsr in the db: " + qaQueUsr); - } + QaQueUsr qaQueUsr = qaService.getQaUserBySession(new Long(userID), qaSession.getUid()); + logger.debug("QaQueUsr:" + qaQueUsr); - qaQueUsr.setLearnerFinished(true); - logger.debug("learner is finished:" + qaQueUsr); - qaService.updateQaQueUsr(qaQueUsr); - - - String toolContentID=qaSession.getQaContent().getQaContentId().toString(); - logger.debug("toolContentID: " + toolContentID); - - QaContent qaContent=qaSession.getQaContent(); - logger.debug("using qaContent: " + qaContent); - - /* - * The learner is done with the tool session. The tool needs to clean-up. - */ + /* it is possible that qaQueUsr can be null if the content is set as runoffline and reflection is on*/ + if (qaQueUsr == null) { + logger.debug("attempt creating user record since it must exist for the runOffline + reflection screens"); HttpSession ss = SessionManager.getSession(); - /*get back login user DTO*/ - UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); - logger.debug("leaving the tool: " + - "leaveToolSession() with toolSessionId: " + toolSessionID + " and user: " + user); - - logger.debug("set status to COMPLETE"); - - logger.debug("qaSession: " + qaSession); - qaSession.setSession_end_date(new Date(System.currentTimeMillis())); - qaSession.setSession_status(COMPLETED); - qaService.updateQaSession(qaSession); - logger.debug("tool session has been marked COMPLETE: " + qaSession); - String httpSessionID=qaLearningForm.getHttpSessionID(); - logger.debug("removing map with httpSessionID: " + httpSessionID); - //request.getSession().removeAttribute(httpSessionID); - qaLearningForm.setHttpSessionID(httpSessionID); + UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER); + logger.debug("retrieving toolUser: " + toolUser); + logger.debug("retrieving toolUser userId: " + toolUser.getUserID()); + logger.debug("retrieving toolUser username: " + toolUser.getLogin()); + String userName = toolUser.getLogin(); + String fullName = toolUser.getFirstName() + " " + toolUser.getLastName(); + logger.debug("retrieving toolUser fullname: " + fullName); - qaLearningForm.resetAll(); - - String nextActivityUrl = qaService.leaveToolSession(new Long(toolSessionID), new Long(user.getUserID().longValue())); - response.sendRedirect(nextActivityUrl); - - return null; + Long userId = new Long(toolUser.getUserID().longValue()); + logger.debug("retrieving toolUser fullname: " + fullName); + + qaQueUsr = new QaQueUsr(userId, userName, fullName, null, qaSession, new TreeSet()); + + logger.debug("createQaQueUsr - qaQueUsr: " + qaQueUsr); + + logger.debug("session uid: " + qaSession.getUid()); + logger.debug("qaQueUsr: " + qaQueUsr); + qaService.createQaQueUsr(qaQueUsr); + logger.debug("created qaQueUsr in the db: " + qaQueUsr); } - - - - public ActionForward updateReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) - throws IOException, ServletException, ToolException - { - logger.debug("dispatching updateReflection..."); - QaLearningForm qaLearningForm = (QaLearningForm) form; - - LearningUtil.saveFormRequestData(request, qaLearningForm); - - IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - logger.debug("qaService: " + qaService); - String httpSessionID=qaLearningForm.getHttpSessionID(); - logger.debug("httpSessionID: " + httpSessionID); - - qaLearningForm.setHttpSessionID(httpSessionID); + qaQueUsr.setLearnerFinished(true); + logger.debug("learner is finished:" + qaQueUsr); + qaService.updateQaQueUsr(qaQueUsr); - String toolSessionID=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); - logger.debug("toolSessionID: " + toolSessionID); - qaLearningForm.setToolSessionID(toolSessionID); + String toolContentID = qaSession.getQaContent().getQaContentId().toString(); + logger.debug("toolContentID: " + toolContentID); - String userID=request.getParameter("userID"); - logger.debug("userID: " + userID); - qaLearningForm.setUserID(userID); - - QaSession qaSession=qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue()); - logger.debug("retrieving qaSession: " + qaSession); + QaContent qaContent = qaSession.getQaContent(); + logger.debug("using qaContent: " + qaContent); - QaContent qaContent=qaSession.getQaContent(); - logger.debug("using qaContent: " + qaContent); + /* + * The learner is done with the tool session. The tool needs to clean-up. + */ + HttpSession ss = SessionManager.getSession(); + /*get back login user DTO*/ + UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + logger.debug("leaving the tool: " + "leaveToolSession() with toolSessionId: " + toolSessionID + " and user: " + + user); - - QaQueUsr qaQueUsr=qaService.getQaUserBySession(new Long(userID), qaSession.getUid()); - logger.debug("QaQueUsr:" + qaQueUsr); + logger.debug("set status to COMPLETE"); - - String entryText=request.getParameter("entryText"); - logger.debug("entryText: " + entryText); - qaLearningForm.setEntryText(entryText); - - NotebookEntry notebookEntryLocal = new NotebookEntry(); - notebookEntryLocal.setEntry(entryText); - //notebookEntry.setUser(qaQueUsr); - User user = new User(); - user.setUserId(new Integer(userID)); - notebookEntryLocal.setUser(user); - - qaService.updateEntry(notebookEntryLocal); - logger.debug("entry updated: " + entryText); - - GeneralLearnerFlowDTO generalLearnerFlowDTO= new GeneralLearnerFlowDTO(); - - generalLearnerFlowDTO.setNotebookEntry(entryText); - generalLearnerFlowDTO.setRequestLearningReportProgress(new Boolean(true).toString()); - Boolean isUserNamesVisibleBoolean=new Boolean(qaContent.isUsernameVisible()); - boolean isUserNamesVisible=isUserNamesVisibleBoolean.booleanValue(); - - - QaMonitoringAction qaMonitoringAction = new QaMonitoringAction(); - logger.debug("using generalLearnerFlowDTO: " + generalLearnerFlowDTO); - qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, isUserNamesVisible, true, - toolSessionID, userID, generalLearnerFlowDTO, false, toolSessionID); - logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO); - - - int sessionUserCount=0; - if (qaSession.getQaQueUsers() != null) - { - sessionUserCount=qaSession.getQaQueUsers().size(); - } - - if (sessionUserCount > 1) - { - logger.debug("there are multiple user responses"); - generalLearnerFlowDTO.setExistMultipleUserResponses(new Boolean(true).toString()); - } - - boolean isLearnerFinished=qaQueUsr.isLearnerFinished(); - logger.debug("isLearnerFinished: " + isLearnerFinished); - generalLearnerFlowDTO.setRequestLearningReportViewOnly(new Boolean(isLearnerFinished).toString()); + logger.debug("qaSession: " + qaSession); + qaSession.setSession_end_date(new Date(System.currentTimeMillis())); + qaSession.setSession_status(COMPLETED); + qaService.updateQaSession(qaSession); + logger.debug("tool session has been marked COMPLETE: " + qaSession); - boolean lockWhenFinished=qaContent.isLockWhenFinished(); - generalLearnerFlowDTO.setLockWhenFinished(new Boolean(lockWhenFinished).toString()); - - - logger.debug("attempt getting notebookEntry: "); - NotebookEntry notebookEntry = qaService.getEntry(new Long(toolSessionID), - CoreNotebookConstants.NOTEBOOK_TOOL, - MY_SIGNATURE, new Integer(userID)); - - logger.debug("notebookEntry: " + notebookEntry); - - if (notebookEntry != null) { - String notebookEntryPresentable=QaUtils.replaceNewLines(notebookEntry.getEntry()); - logger.debug("notebookEntryPresentable: " + notebookEntryPresentable); - qaLearningForm.setEntryText(notebookEntryPresentable); - } + String httpSessionID = qaLearningForm.getHttpSessionID(); + logger.debug("removing map with httpSessionID: " + httpSessionID); + //request.getSession().removeAttribute(httpSessionID); + qaLearningForm.setHttpSessionID(httpSessionID); - request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); - logger.debug("before fwd, GENERAL_LEARNER_FLOW_DTO: " + request.getAttribute(GENERAL_LEARNER_FLOW_DTO)); + qaLearningForm.resetAll(); + String nextActivityUrl = qaService.leaveToolSession(new Long(toolSessionID), new Long(user.getUserID() + .longValue())); + response.sendRedirect(nextActivityUrl); - logger.debug("fwd'ing to." + REVISITED_LEARNER_REP); - return (mapping.findForward(REVISITED_LEARNER_REP)); + return null; + } + + public ActionForward updateReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException, ToolException { + logger.debug("dispatching updateReflection..."); + QaLearningForm qaLearningForm = (QaLearningForm) form; + + LearningUtil.saveFormRequestData(request, qaLearningForm); + + IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); + logger.debug("qaService: " + qaService); + + String httpSessionID = qaLearningForm.getHttpSessionID(); + logger.debug("httpSessionID: " + httpSessionID); + + qaLearningForm.setHttpSessionID(httpSessionID); + + String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); + logger.debug("toolSessionID: " + toolSessionID); + qaLearningForm.setToolSessionID(toolSessionID); + + String userID = request.getParameter("userID"); + logger.debug("userID: " + userID); + qaLearningForm.setUserID(userID); + + QaSession qaSession = qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue()); + logger.debug("retrieving qaSession: " + qaSession); + + QaContent qaContent = qaSession.getQaContent(); + logger.debug("using qaContent: " + qaContent); + + QaQueUsr qaQueUsr = qaService.getQaUserBySession(new Long(userID), qaSession.getUid()); + logger.debug("QaQueUsr:" + qaQueUsr); + + String entryText = request.getParameter("entryText"); + logger.debug("entryText: " + entryText); + qaLearningForm.setEntryText(entryText); + + NotebookEntry notebookEntryLocal = new NotebookEntry(); + notebookEntryLocal.setEntry(entryText); + //notebookEntry.setUser(qaQueUsr); + User user = new User(); + user.setUserId(new Integer(userID)); + notebookEntryLocal.setUser(user); + + qaService.updateEntry(notebookEntryLocal); + logger.debug("entry updated: " + entryText); + + GeneralLearnerFlowDTO generalLearnerFlowDTO = new GeneralLearnerFlowDTO(); + + generalLearnerFlowDTO.setNotebookEntry(entryText); + generalLearnerFlowDTO.setRequestLearningReportProgress(new Boolean(true).toString()); + Boolean isUserNamesVisibleBoolean = new Boolean(qaContent.isUsernameVisible()); + boolean isUserNamesVisible = isUserNamesVisibleBoolean.booleanValue(); + + QaMonitoringAction qaMonitoringAction = new QaMonitoringAction(); + logger.debug("using generalLearnerFlowDTO: " + generalLearnerFlowDTO); + qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, isUserNamesVisible, true, toolSessionID, + userID, generalLearnerFlowDTO, false, toolSessionID); + logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO); + + int sessionUserCount = 0; + if (qaSession.getQaQueUsers() != null) { + sessionUserCount = qaSession.getQaQueUsers().size(); } - + if (sessionUserCount > 1) { + logger.debug("there are multiple user responses"); + generalLearnerFlowDTO.setExistMultipleUserResponses(new Boolean(true).toString()); + } + + boolean isLearnerFinished = qaQueUsr.isLearnerFinished(); + logger.debug("isLearnerFinished: " + isLearnerFinished); + generalLearnerFlowDTO.setRequestLearningReportViewOnly(new Boolean(isLearnerFinished).toString()); + + boolean lockWhenFinished = qaContent.isLockWhenFinished(); + generalLearnerFlowDTO.setLockWhenFinished(new Boolean(lockWhenFinished).toString()); + + logger.debug("attempt getting notebookEntry: "); + NotebookEntry notebookEntry = qaService.getEntry(new Long(toolSessionID), CoreNotebookConstants.NOTEBOOK_TOOL, + MY_SIGNATURE, new Integer(userID)); + + logger.debug("notebookEntry: " + notebookEntry); + + if (notebookEntry != null) { + String notebookEntryPresentable = QaUtils.replaceNewLines(notebookEntry.getEntry()); + logger.debug("notebookEntryPresentable: " + notebookEntryPresentable); + qaLearningForm.setEntryText(notebookEntryPresentable); + } + + request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); + logger.debug("before fwd, GENERAL_LEARNER_FLOW_DTO: " + request.getAttribute(GENERAL_LEARNER_FLOW_DTO)); + + logger.debug("fwd'ing to." + REVISITED_LEARNER_REP); + return (mapping.findForward(REVISITED_LEARNER_REP)); + } + /** - * ActionForward submitReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) - throws IOException, ServletException, ToolException + * ActionForward submitReflection(ActionMapping mapping, ActionForm form, + * HttpServletRequest request, HttpServletResponse response) throws + * IOException, ServletException, ToolException * * @param mapping * @param form @@ -1325,90 +1212,83 @@ * @throws ServletException * @throws ToolException */ - public ActionForward submitReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) - throws IOException, ServletException, ToolException - { - logger.debug("dispatching submitReflection..."); - QaLearningForm qaLearningForm = (QaLearningForm) form; - - LearningUtil.saveFormRequestData(request, qaLearningForm); - - IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - logger.debug("qaService: " + qaService); + public ActionForward submitReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException, ToolException { + logger.debug("dispatching submitReflection..."); + QaLearningForm qaLearningForm = (QaLearningForm) form; - String httpSessionID=qaLearningForm.getHttpSessionID(); - logger.debug("httpSessionID: " + httpSessionID); - - qaLearningForm.setHttpSessionID(httpSessionID); + LearningUtil.saveFormRequestData(request, qaLearningForm); - String toolSessionID=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); - logger.debug("toolSessionID: " + toolSessionID); - qaLearningForm.setToolSessionID(toolSessionID); + IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); + logger.debug("qaService: " + qaService); - String userID=request.getParameter("userID"); - logger.debug("userID: " + userID); - qaLearningForm.setUserID(userID); - - String reflectionEntry=request.getParameter(ENTRY_TEXT); - logger.debug("reflectionEntry: " + reflectionEntry); + String httpSessionID = qaLearningForm.getHttpSessionID(); + logger.debug("httpSessionID: " + httpSessionID); - QaSession qaSession=qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue()); - logger.debug("retrieving qaSession: " + qaSession); - - QaQueUsr qaQueUsr=qaService.getQaUserBySession(new Long(userID), qaSession.getUid()); - logger.debug("QaQueUsr:" + qaQueUsr); - - /* it is possible that qaQueUsr can be null if the content is set as runoffline and reflection is on*/ - if (qaQueUsr == null) - { - logger.debug("attempt creating user record since it must exist for the runOffline + reflection screens"); - HttpSession ss = SessionManager.getSession(); + qaLearningForm.setHttpSessionID(httpSessionID); - UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER); - logger.debug("retrieving toolUser: " + toolUser); - logger.debug("retrieving toolUser userId: " + toolUser.getUserID()); - logger.debug("retrieving toolUser username: " + toolUser.getLogin()); + String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); + logger.debug("toolSessionID: " + toolSessionID); + qaLearningForm.setToolSessionID(toolSessionID); - String userName=toolUser.getLogin(); - String fullName= toolUser.getFirstName() + " " + toolUser.getLastName(); - logger.debug("retrieving toolUser fullname: " + fullName); - - Long userId=new Long(toolUser.getUserID().longValue()); - logger.debug("retrieving toolUser fullname: " + fullName); + String userID = request.getParameter("userID"); + logger.debug("userID: " + userID); + qaLearningForm.setUserID(userID); - qaQueUsr= new QaQueUsr(userId, - userName, - fullName, - null, - qaSession, - new TreeSet()); - - logger.debug("createQaQueUsr - qaQueUsr: " + qaQueUsr); - - logger.debug("session uid: " + qaSession.getUid()); - logger.debug("qaQueUsr: " + qaQueUsr); - qaService.createQaQueUsr(qaQueUsr); - logger.debug("created qaQueUsr in the db: " + qaQueUsr); - } - - logger.debug("QaQueUsr:" + qaQueUsr); - logger.debug("toolSessionID:" + toolSessionID); - logger.debug("CoreNotebookConstants.NOTEBOOK_TOOL:" + CoreNotebookConstants.NOTEBOOK_TOOL); - logger.debug("MY_SIGNATURE:" + MY_SIGNATURE); - logger.debug("userID:" + userID); - logger.debug("reflectionEntry:" + reflectionEntry); - - qaService.createNotebookEntry(new Long(toolSessionID), CoreNotebookConstants.NOTEBOOK_TOOL, - MY_SIGNATURE, new Integer(userID), reflectionEntry); - - qaLearningForm.resetUserActions(); /*resets all except submitAnswersContent */ - return endLearning(mapping, form, request, response); + String reflectionEntry = request.getParameter(ENTRY_TEXT); + logger.debug("reflectionEntry: " + reflectionEntry); + + QaSession qaSession = qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue()); + logger.debug("retrieving qaSession: " + qaSession); + + QaQueUsr qaQueUsr = qaService.getQaUserBySession(new Long(userID), qaSession.getUid()); + logger.debug("QaQueUsr:" + qaQueUsr); + + /* it is possible that qaQueUsr can be null if the content is set as runoffline and reflection is on*/ + if (qaQueUsr == null) { + logger.debug("attempt creating user record since it must exist for the runOffline + reflection screens"); + HttpSession ss = SessionManager.getSession(); + + UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER); + logger.debug("retrieving toolUser: " + toolUser); + logger.debug("retrieving toolUser userId: " + toolUser.getUserID()); + logger.debug("retrieving toolUser username: " + toolUser.getLogin()); + + String userName = toolUser.getLogin(); + String fullName = toolUser.getFirstName() + " " + toolUser.getLastName(); + logger.debug("retrieving toolUser fullname: " + fullName); + + Long userId = new Long(toolUser.getUserID().longValue()); + logger.debug("retrieving toolUser fullname: " + fullName); + + qaQueUsr = new QaQueUsr(userId, userName, fullName, null, qaSession, new TreeSet()); + + logger.debug("createQaQueUsr - qaQueUsr: " + qaQueUsr); + + logger.debug("session uid: " + qaSession.getUid()); + logger.debug("qaQueUsr: " + qaQueUsr); + qaService.createQaQueUsr(qaQueUsr); + logger.debug("created qaQueUsr in the db: " + qaQueUsr); } - - + + logger.debug("QaQueUsr:" + qaQueUsr); + logger.debug("toolSessionID:" + toolSessionID); + logger.debug("CoreNotebookConstants.NOTEBOOK_TOOL:" + CoreNotebookConstants.NOTEBOOK_TOOL); + logger.debug("MY_SIGNATURE:" + MY_SIGNATURE); + logger.debug("userID:" + userID); + logger.debug("reflectionEntry:" + reflectionEntry); + + qaService.createNotebookEntry(new Long(toolSessionID), CoreNotebookConstants.NOTEBOOK_TOOL, MY_SIGNATURE, + new Integer(userID), reflectionEntry); + + qaLearningForm.resetUserActions(); /*resets all except submitAnswersContent */ + return endLearning(mapping, form, request, response); + } + /** - * ActionForward forwardtoReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) - throws IOException, ServletException, ToolException + * ActionForward forwardtoReflection(ActionMapping mapping, ActionForm form, + * HttpServletRequest request, HttpServletResponse response) throws + * IOException, ServletException, ToolException * * @param mapping * @param form @@ -1419,68 +1299,63 @@ * @throws ServletException * @throws ToolException */ - public ActionForward forwardtoReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) - throws IOException, ServletException, ToolException - { - logger.debug("dispatching forwardtoReflection..."); - QaLearningForm qaLearningForm = (QaLearningForm) form; - IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - logger.debug("qaService: " + qaService); - - String httpSessionID=qaLearningForm.getHttpSessionID(); - logger.debug("httpSessionID: " + httpSessionID); - - qaLearningForm.setHttpSessionID(httpSessionID); + public ActionForward forwardtoReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException, ToolException { + logger.debug("dispatching forwardtoReflection..."); + QaLearningForm qaLearningForm = (QaLearningForm) form; + IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); + logger.debug("qaService: " + qaService); - String toolSessionID=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); - logger.debug("toolSessionID: " + toolSessionID); + String httpSessionID = qaLearningForm.getHttpSessionID(); + logger.debug("httpSessionID: " + httpSessionID); - QaSession qaSession=qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue()); - logger.debug("retrieving qaSession: " + qaSession); - - QaContent qaContent=qaSession.getQaContent(); - logger.debug("using qaContent: " + qaContent); - + qaLearningForm.setHttpSessionID(httpSessionID); - String userID=request.getParameter("userID"); - logger.debug("userID: " + userID); - qaLearningForm.setUserID(userID); - - return forwardtoReflection(mapping, request, qaContent, qaService, toolSessionID, userID, qaLearningForm) ; + String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); + logger.debug("toolSessionID: " + toolSessionID); + + QaSession qaSession = qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue()); + logger.debug("retrieving qaSession: " + qaSession); + + QaContent qaContent = qaSession.getQaContent(); + logger.debug("using qaContent: " + qaContent); + + String userID = request.getParameter("userID"); + logger.debug("userID: " + userID); + qaLearningForm.setUserID(userID); + + return forwardtoReflection(mapping, request, qaContent, qaService, toolSessionID, userID, qaLearningForm); + } + + private ActionForward forwardtoReflection(ActionMapping mapping, HttpServletRequest request, QaContent qaContent, + IQaService qaService, String toolSessionID, String userID, QaLearningForm qaLearningForm) { + + GeneralLearnerFlowDTO generalLearnerFlowDTO = new GeneralLearnerFlowDTO(); + generalLearnerFlowDTO.setActivityTitle(qaContent.getTitle()); + String reflectionSubject = qaContent.getReflectionSubject(); + reflectionSubject = QaUtils.replaceNewLines(reflectionSubject); + generalLearnerFlowDTO.setReflectionSubject(reflectionSubject); + + logger.debug("attempt getting notebookEntry: "); + NotebookEntry notebookEntry = qaService.getEntry(new Long(toolSessionID), CoreNotebookConstants.NOTEBOOK_TOOL, + MY_SIGNATURE, new Integer(userID)); + + logger.debug("notebookEntry: " + notebookEntry); + + if (notebookEntry != null) { + //String notebookEntryPresentable=QaUtils.replaceNewLines(notebookEntry.getEntry()); + String notebookEntryPresentable = notebookEntry.getEntry(); + logger.debug("notebookEntryPresentable: " + notebookEntryPresentable); + generalLearnerFlowDTO.setNotebookEntry(notebookEntryPresentable); + qaLearningForm.setEntryText(notebookEntryPresentable); } - - private ActionForward forwardtoReflection(ActionMapping mapping, HttpServletRequest request, - QaContent qaContent, IQaService qaService, String toolSessionID, - String userID, QaLearningForm qaLearningForm) { - - GeneralLearnerFlowDTO generalLearnerFlowDTO= new GeneralLearnerFlowDTO(); - generalLearnerFlowDTO.setActivityTitle(qaContent.getTitle()); - String reflectionSubject=qaContent.getReflectionSubject(); - reflectionSubject=QaUtils.replaceNewLines(reflectionSubject); - generalLearnerFlowDTO.setReflectionSubject(reflectionSubject); - - logger.debug("attempt getting notebookEntry: "); - NotebookEntry notebookEntry = qaService.getEntry(new Long(toolSessionID), - CoreNotebookConstants.NOTEBOOK_TOOL, - MY_SIGNATURE, new Integer(userID)); - - logger.debug("notebookEntry: " + notebookEntry); - - if (notebookEntry != null) { - //String notebookEntryPresentable=QaUtils.replaceNewLines(notebookEntry.getEntry()); - String notebookEntryPresentable=notebookEntry.getEntry(); - logger.debug("notebookEntryPresentable: " + notebookEntryPresentable); - generalLearnerFlowDTO.setNotebookEntry(notebookEntryPresentable); - qaLearningForm.setEntryText(notebookEntryPresentable); - } - - - request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); - logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO); - qaLearningForm.resetUserActions(); /*resets all except submitAnswersContent */ - - qaLearningForm.resetAll(); - logger.debug("fwd'ing to: " + NOTEBOOK); - return (mapping.findForward(NOTEBOOK)); - } + + request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); + logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO); + qaLearningForm.resetUserActions(); /*resets all except submitAnswersContent */ + + qaLearningForm.resetAll(); + logger.debug("fwd'ing to: " + NOTEBOOK); + return (mapping.findForward(NOTEBOOK)); + } } \ No newline at end of file Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java,v diff -u -r1.59 -r1.60 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java 30 Sep 2008 05:54:57 -0000 1.59 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java 19 Feb 2009 04:04:31 -0000 1.60 @@ -244,8 +244,10 @@ } /** - * switches to instructions tab of the monitoring url. getInstructions(ActionMapping mapping, ActionForm form, - * HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + * switches to instructions tab of the monitoring url. + * getInstructions(ActionMapping mapping, ActionForm form, + * HttpServletRequest request, HttpServletResponse response) throws + * IOException, ServletException * * @param mapping * @param form @@ -360,8 +362,9 @@ } /** - * activates editActivity screen ActionForward editActivity(ActionMapping mapping, ActionForm form, - * HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + * activates editActivity screen ActionForward editActivity(ActionMapping + * mapping, ActionForm form, HttpServletRequest request, HttpServletResponse + * response) throws IOException, ServletException * * @param mapping * @param form @@ -486,8 +489,9 @@ /** * switches to summary tab of the monitoring url * - * getSummary(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) - * throws IOException, ServletException + * getSummary(ActionMapping mapping, ActionForm form, HttpServletRequest + * request, HttpServletResponse response) throws IOException, + * ServletException * * @param mapping * @param form @@ -736,10 +740,12 @@ } /** - * gets called when the user selects a group from dropdown box in the summary tab + * gets called when the user selects a group from dropdown box in the + * summary tab * - * submitSession(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) - * throws IOException, ServletException + * submitSession(ActionMapping mapping, ActionForm form, HttpServletRequest + * request, HttpServletResponse response) throws IOException, + * ServletException * * @param mapping * @param form @@ -836,8 +842,10 @@ } /** - * enables the user to edit responses ActionForward editResponse(ActionMapping mapping, ActionForm form, - * HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + * enables the user to edit responses ActionForward + * editResponse(ActionMapping mapping, ActionForm form, HttpServletRequest + * request, HttpServletResponse response) throws IOException, + * ServletException * * @param mapping * @param form @@ -1037,8 +1045,10 @@ } /** - * enables the user to update responses ActionForward updateResponse(ActionMapping mapping, ActionForm form, - * HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + * enables the user to update responses ActionForward + * updateResponse(ActionMapping mapping, ActionForm form, HttpServletRequest + * request, HttpServletResponse response) throws IOException, + * ServletException * * @param mapping * @param form @@ -1256,8 +1266,10 @@ } /** - * enables the user to delete responses ActionForward deleteResponse(ActionMapping mapping, ActionForm form, - * HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + * enables the user to delete responses ActionForward + * deleteResponse(ActionMapping mapping, ActionForm form, HttpServletRequest + * request, HttpServletResponse response) throws IOException, + * ServletException * * @param mapping * @param form @@ -1426,7 +1438,8 @@ } /** - * persists error messages to request scope persistError(HttpServletRequest request, String message) + * persists error messages to request scope persistError(HttpServletRequest + * request, String message) * * @param request * @param message @@ -1439,10 +1452,12 @@ } /** - * populates data for summary screen, view all results screen and export portfolio. + * populates data for summary screen, view all results screen and export + * portfolio. * - * User id is needed if isUserNamesVisible is false && learnerRequest is true, as it is required to work out if the - * data being analysed is the current user. + * User id is needed if isUserNamesVisible is false && learnerRequest is + * true, as it is required to work out if the data being analysed is the + * current user. * * @param request * @param qaContent @@ -1583,7 +1598,8 @@ } /** - * populates data for stats screen refreshStatsData(HttpServletRequest request) + * populates data for stats screen refreshStatsData(HttpServletRequest + * request) * * @param request */ @@ -3607,7 +3623,8 @@ /** * returns reflection data for a specific session * - * getReflectionListForSession(QaContent qaContent, String userID, IQaService qaService, String currentSessionId) + * getReflectionListForSession(QaContent qaContent, String userID, + * IQaService qaService, String currentSessionId) * * @param qaContent * @param userID