Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaContent.java =================================================================== diff -u -rc527318c8c79f72151f6261342c5cc1a830d1e4d -r328cd4dbe60d9e5c588e13cc16b7e7414893b0af --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaContent.java (.../QaContent.java) (revision c527318c8c79f72151f6261342c5cc1a830d1e4d) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaContent.java (.../QaContent.java) (revision 328cd4dbe60d9e5c588e13cc16b7e7414893b0af) @@ -189,22 +189,18 @@ new TreeSet(new TextSearchConditionComparator())); newContent.setQaQueContents(qa.deepCopyQaQueContent(newContent)); - QaContent.logger.debug(QaContent.logger + " " + "QaContent" + " " + "after doing deepCopyQaQueContent"); newContent.setQaUploadedFiles(qa.deepCopyQaAttachments(toolContentHandler, newContent)); newContent.setConditions(qa.deepCopyConditions(newContent)); return newContent; } public Set deepCopyQaQueContent(QaContent newQaContent) { - QaContent.logger.debug(QaContent.logger + " " + "QaContent" + " " + "start of deepCopyQaQueContent"); Set newQaQueContent = new TreeSet(); for (Iterator i = this.getQaQueContents().iterator(); i.hasNext();) { QaQueContent queContent = (QaQueContent) i.next(); newQaQueContent.add(QaQueContent.newInstance(queContent, newQaContent)); } - QaContent.logger.debug(QaContent.logger + " " + "QaContent" + " " + "returning newQaQueContent: " - + newQaQueContent); return newQaQueContent; } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaQueContent.java =================================================================== diff -u -rc527318c8c79f72151f6261342c5cc1a830d1e4d -r328cd4dbe60d9e5c588e13cc16b7e7414893b0af --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaQueContent.java (.../QaQueContent.java) (revision c527318c8c79f72151f6261342c5cc1a830d1e4d) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaQueContent.java (.../QaQueContent.java) (revision 328cd4dbe60d9e5c588e13cc16b7e7414893b0af) @@ -131,8 +131,6 @@ public static QaQueContent newInstance(QaQueContent queContent, QaContent newQaContent) { QaQueContent newQueContent = new QaQueContent(queContent.getQuestion(), queContent.getDisplayOrder(), queContent.getFeedback(), newQaContent, new TreeSet(), new TreeSet()); - QaQueContent.logger.debug(QaQueContent.logger + " " + "QaQueContent" + " " + "returning newQueContent: " - + newQueContent); return newQueContent; } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java =================================================================== diff -u -rc527318c8c79f72151f6261342c5cc1a830d1e4d -r328cd4dbe60d9e5c588e13cc16b7e7414893b0af --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java (.../QaUtils.java) (revision c527318c8c79f72151f6261342c5cc1a830d1e4d) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java (.../QaUtils.java) (revision 328cd4dbe60d9e5c588e13cc16b7e7414893b0af) @@ -73,11 +73,11 @@ } public static String replaceNewLines(String text) { - logger.debug("using text: " + text); + String newText = ""; if (text != null) { newText = text.replaceAll("\n", "
"); - logger.debug("newText: " + newText); + } return newText; @@ -129,34 +129,34 @@ qaGeneralAuthoringDTO.setLockWhenFinished(lockWhenFinished); String offlineInstructions = request.getParameter(OFFLINE_INSTRUCTIONS); - logger.debug("offlineInstructions: " + offlineInstructions); + qaAuthoringForm.setOfflineInstructions(offlineInstructions); qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions); String onlineInstructions = request.getParameter(ONLINE_INSTRUCTIONS); - logger.debug("onlineInstructions: " + onlineInstructions); + qaAuthoringForm.setOnlineInstructions(onlineInstructions); qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); String reflect = request.getParameter(REFLECT); - logger.debug("reflect: " + reflect); + qaAuthoringForm.setReflect(reflect); qaGeneralAuthoringDTO.setReflect(reflect); String reflectionSubject = request.getParameter(REFLECTION_SUBJECT); - logger.debug("reflectionSubject: " + reflectionSubject); + qaAuthoringForm.setReflectionSubject(reflectionSubject); qaGeneralAuthoringDTO.setReflectionSubject(reflectionSubject); - logger.debug("ending setFormProperties with qaAuthoringForm: " + qaAuthoringForm); - logger.debug("ending setFormProperties with qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); + + } public static int getCurrentUserId(HttpServletRequest request) throws QaApplicationException { HttpSession ss = SessionManager.getSession(); /* get back login user DTO */ UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); - logger.debug(logger + " " + "QaUtils" + " Current user is: " + user + " with id: " + user.getUserID()); + logger.debug(logger + " " + "QaUtils" + " Current user id: " + user.getUserID()); return user.getUserID().intValue(); } @@ -170,7 +170,6 @@ */ public static boolean existsContent(long toolContentID, IQaService qaService) { QaContent qaContent = qaService.loadQa(toolContentID); - logger.debug(logger + " " + "QaUtils " + "retrieving qaContent: " + qaContent); if (qaContent == null) return false; @@ -187,7 +186,7 @@ public static boolean existsSession(long toolContentID, IQaService qaService) { logger.debug("existsSession"); QaSession qaSession = qaService.retrieveQaSessionOrNullById(toolContentID); - logger.debug("qaSession:" + qaSession); + if (qaSession == null) return false; @@ -196,14 +195,12 @@ } public static String getFormattedDateString(Date date) { - logger.debug(logger + " " + " QaUtils getFormattedDateString: " - + DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG).format(date)); return (DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG).format(date)); } public static void configureContentRepository(HttpServletRequest request, IQaService qaService) { logger.debug("attempt configureContentRepository"); - logger.debug("qaService: " + qaService); + logger.debug("calling configureContentRepository()"); qaService.configureContentRepository(); logger.debug("configureContentRepository ran successfully"); @@ -471,12 +468,12 @@ */ public static void setDefineLater(HttpServletRequest request, boolean value, String strToolContentID, IQaService qaService) { - logger.debug("qaService: " + qaService); + logger.debug("value:" + value); logger.debug("strToolContentID:" + strToolContentID); QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - logger.debug("qaContent:" + qaContent); + if (qaContent != null) { qaContent.setDefineLater(value); logger.debug("defineLater has been set to:" + value); @@ -508,11 +505,11 @@ public static void setDefineLater(HttpServletRequest request, boolean value, IQaService qaService, String toolContentID) { - logger.debug("qaService:" + qaService); + logger.debug("toolContentID:" + toolContentID); QaContent qaContent = qaService.loadQa(new Long(toolContentID).longValue()); - logger.debug("qaContent:" + qaContent); + if (qaContent != null) { qaContent.setDefineLater(value); logger.debug("defineLater has been set to true"); @@ -523,7 +520,7 @@ public static String getCurrentLearnerID() { String userID = ""; HttpSession ss = SessionManager.getSession(); - logger.debug("ss: " + ss); + if (ss != null) { UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); @@ -540,7 +537,7 @@ HttpSession ss = SessionManager.getSession(); /* get back login user DTO */ UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER); - logger.debug("retrieving toolUser: " + toolUser); + return toolUser; } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/QaQueUsrDAO.java =================================================================== diff -u -r7b3e1eb125d38e4df23c247e25c27061adbaa269 -r328cd4dbe60d9e5c588e13cc16b7e7414893b0af --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/QaQueUsrDAO.java (.../QaQueUsrDAO.java) (revision 7b3e1eb125d38e4df23c247e25c27061adbaa269) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/QaQueUsrDAO.java (.../QaQueUsrDAO.java) (revision 328cd4dbe60d9e5c588e13cc16b7e7414893b0af) @@ -126,29 +126,6 @@ } 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(); - logger.debug("strGetUser: " + strGetUser); - logger.debug("qa: " + qa); - logger.debug("list: " + list); - - int totalUserCount = 0; - if (list != null && list.size() > 0) { - QaQueUsr usr = (QaQueUsr) list.get(0); - logger.debug("usr: " + usr); - logger.debug("local usr content uid versus incoming content uid: " - + usr.getQaSession().getQaContent().getUid().intValue() + " versus " + qa.getUid().intValue()); - - if (usr.getQaSession().getQaContent().getUid().intValue() == qa.getUid().intValue()) { - ++totalUserCount; - } - } - 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/QaContentDAO.java =================================================================== diff -u -raa22c03aa1f00c8f79e73f6d47c62fb2c0d00ad0 -r328cd4dbe60d9e5c588e13cc16b7e7414893b0af --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaContentDAO.java (.../QaContentDAO.java) (revision aa22c03aa1f00c8f79e73f6d47c62fb2c0d00ad0) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaContentDAO.java (.../QaContentDAO.java) (revision 328cd4dbe60d9e5c588e13cc16b7e7414893b0af) @@ -79,7 +79,6 @@ public void updateQa(QaContent qa) { this.getSession().setFlushMode(FlushMode.AUTO); - QaContentDAO.logger.debug("before updateQa: " + qa); this.getHibernateTemplate().update(qa); } @@ -100,13 +99,11 @@ public void saveOrUpdateQa(QaContent qa) { this.getSession().setFlushMode(FlushMode.AUTO); - QaContentDAO.logger.debug("before saveOrUpdateQa: " + qa); this.getHibernateTemplate().saveOrUpdate(qa); } public void createQa(QaContent qa) { this.getSession().setFlushMode(FlushMode.AUTO); - QaContentDAO.logger.debug("before createQa: " + qa); this.getHibernateTemplate().save(qa); } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaQueUsrDAO.java =================================================================== diff -u -r7b3e1eb125d38e4df23c247e25c27061adbaa269 -r328cd4dbe60d9e5c588e13cc16b7e7414893b0af --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaQueUsrDAO.java (.../QaQueUsrDAO.java) (revision 7b3e1eb125d38e4df23c247e25c27061adbaa269) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaQueUsrDAO.java (.../QaQueUsrDAO.java) (revision 328cd4dbe60d9e5c588e13cc16b7e7414893b0af) @@ -124,7 +124,6 @@ } else { logger.error("Attempt to count users from null content"); } - logger.debug("Number of users for quContent " +qa.getUid()+ ": " + returnInt); return returnInt; } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaSessionDAO.java =================================================================== diff -u -raa22c03aa1f00c8f79e73f6d47c62fb2c0d00ad0 -r328cd4dbe60d9e5c588e13cc16b7e7414893b0af --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaSessionDAO.java (.../QaSessionDAO.java) (revision aa22c03aa1f00c8f79e73f6d47c62fb2c0d00ad0) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaSessionDAO.java (.../QaSessionDAO.java) (revision 328cd4dbe60d9e5c588e13cc16b7e7414893b0af) @@ -62,10 +62,6 @@ int sessionCount = 0; if (list != null && list.size() > 0) { QaSession qaSession = (QaSession) list.get(0); - logger.debug("qaSession: " + qaSession); - logger.debug("local session's content uid versus incoming content uid: " - + qaSession.getQaContent().getUid().intValue() + " versus " + qa.getUid().intValue()); - if (qaSession.getQaContent().getUid().intValue() == qa.getUid().intValue()) { ++sessionCount; } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java =================================================================== diff -u -rc527318c8c79f72151f6261342c5cc1a830d1e4d -r328cd4dbe60d9e5c588e13cc16b7e7414893b0af --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java (.../QaServicePOJO.java) (revision c527318c8c79f72151f6261342c5cc1a830d1e4d) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java (.../QaServicePOJO.java) (revision 328cd4dbe60d9e5c588e13cc16b7e7414893b0af) @@ -150,14 +150,11 @@ private Random generator = new Random(); public void configureContentRepository() throws QaApplicationException { - QaServicePOJO.logger.debug("retrieved repService: " + repositoryService); cred = new SimpleCredentials(repositoryUser, repositoryId); QaServicePOJO.logger.debug("retrieved cred: " + cred); try { repositoryService.createCredentials(cred); - QaServicePOJO.logger.debug("created credentails."); repositoryService.addWorkspace(cred, repositoryWorkspace); - QaServicePOJO.logger.debug("created workspace."); } catch (ItemExistsException ie) { QaServicePOJO.logger.warn("Tried to configure repository but it " + " appears to be already configured. Exception thrown by repository being ignored. ", ie); @@ -254,9 +251,7 @@ public void createQaQue(QaQueContent qaQueContent) throws QaApplicationException { try { - QaServicePOJO.logger.debug("attempt service createQaQue: " + qaQueContent); qaQueContentDAO.createQueContent(qaQueContent); - QaServicePOJO.logger.debug("after servicecreateQaQue: " + qaQueContent); } catch (DataAccessException e) { throw new QaApplicationException("Exception occured when lams is creating qa content: " + e.getMessage(), e); } @@ -484,7 +479,6 @@ public void updateQaSession(QaSession qaSession) throws QaApplicationException { try { - QaServicePOJO.logger.debug("before updateQaSession: " + qaSession); qaSessionDAO.UpdateQaSession(qaSession); } catch (DataAccessException e) { throw new QaApplicationException("Exception occured when lams is updating qa session : " + e.getMessage(), @@ -534,7 +528,6 @@ * logs hiding of a user entered vote */ public void hideResponse(QaUsrResp qaUsrResp) throws QaApplicationException { - QaServicePOJO.logger.debug("hiding user entry: " + qaUsrResp.getAnswer()); auditService.logHideEntry(QaAppConstants.MY_SIGNATURE, qaUsrResp.getQueUsrId(), qaUsrResp.getQaQueUser() .getUsername(), qaUsrResp.getAnswer()); } @@ -543,7 +536,6 @@ * logs showing of a user entered vote */ public void showResponse(QaUsrResp qaUsrResp) throws QaApplicationException { - QaServicePOJO.logger.debug("showing user entry: " + qaUsrResp.getAnswer()); auditService.logShowEntry(QaAppConstants.MY_SIGNATURE, qaUsrResp.getQueUsrId(), qaUsrResp.getQaQueUser() .getUsername(), qaUsrResp.getAnswer()); } @@ -674,20 +666,15 @@ * @throws QaApplicationException */ public boolean studentActivityOccurredGlobal(QaContent qaContent) throws QaApplicationException { - QaServicePOJO.logger.debug("doing studentActivityOccurredGlobal : " + qaContent); - if (qaContent != null) { Iterator questionIterator = qaContent.getQaQueContents().iterator(); while (questionIterator.hasNext()) { QaQueContent qaQueContent = (QaQueContent) questionIterator.next(); - QaServicePOJO.logger.debug("iterated question : " + qaQueContent); Iterator responsesIterator = qaQueContent.getQaUsrResps().iterator(); while (responsesIterator.hasNext()) { - QaServicePOJO.logger.debug("there is at least one response"); return true; } } - QaServicePOJO.logger.debug("there is no response for this content"); } return false; } @@ -701,7 +688,6 @@ * @throws QaApplicationException */ public int countIncompleteSession(QaContent qa) throws QaApplicationException { - QaServicePOJO.logger.debug("start of countIncompleteSession: " + qa); QaServicePOJO.logger.debug("qaContentId: " + qa.getQaContentId()); int countIncompleteSession = qaSessionDAO.countSessionIncomplete(); QaServicePOJO.logger.debug("countIncompleteSession: " + countIncompleteSession); @@ -722,7 +708,6 @@ * @throws QaApplicationException */ public boolean studentActivityOccurred(QaContent qa) throws QaApplicationException { - QaServicePOJO.logger.debug("start of studentActivityOccurred: " + qa); QaServicePOJO.logger.debug("qaContentId: " + qa.getQaContentId()); int countStudentActivity = qaSessionDAO.studentActivityOccurred(qa); QaServicePOJO.logger.debug("countIncompleteSession: " + countStudentActivity); @@ -789,23 +774,16 @@ } fromContent = qaDAO.loadQaById(fromContentId.longValue()); - - QaServicePOJO.logger.debug("using fromContent: " + fromContent); } if (fromContentId.equals(defaultContentId) && fromContent != null && fromContent.getConditions().isEmpty()) { fromContent.getConditions().add(getQaOutputFactory().createDefaultComplexCondition(fromContent)); } - QaServicePOJO.logger.debug("final - retrieved fromContent: " + fromContent); - QaServicePOJO.logger.debug("final - before new instance using " + fromContent + " and " + toContentId); - QaContent toContent = QaContent.newInstance(qaToolContentHandler, fromContent, toContentId); if (toContent == null) { QaServicePOJO.logger.debug("throwing ToolException: WARNING!, retrieved toContent is null."); throw new ToolException("WARNING! Fail to create toContent. Can't continue!"); } else { - QaServicePOJO.logger.debug("retrieved toContent: " + toContent); qaDAO.saveQa(toContent); - QaServicePOJO.logger.debug("toContent has been saved successfully: " + toContent); } QaServicePOJO.logger.debug("end of copyToolContent with ids: " + fromContentId + " and " + toContentId); } catch (DataAccessException e) { @@ -829,15 +807,13 @@ * toolSessionId */ public void setAsForceCompleteSession(Long toolSessionId) throws QaApplicationException { - QaServicePOJO.logger.debug("rrequest for setAsForceCompleteSession has come for toolSessionId: " + QaServicePOJO.logger.debug("Request for setAsForceCompleteSession has come for toolSessionId: " + toolSessionId); QaSession qaSession = retrieveQaSessionOrNullById(toolSessionId.longValue()); - QaServicePOJO.logger.debug("retrieved qaSession is : " + qaSession); qaSession.setSession_status(QaSession.COMPLETED); - QaServicePOJO.logger.debug("updated qaSession to COMPLETED : "); updateQaSession(qaSession); - QaServicePOJO.logger.debug("updated qaSession to COMPLETED in the db : "); + QaServicePOJO.logger.debug("updated qaSession to COMPLETED : "); } /** @@ -851,21 +827,16 @@ QaQueUsr qaQueUsr = loadQaQueUsr(userId); if (qaQueUsr != null) { - QaServicePOJO.logger.debug("retrieved qaQueUsr : " + qaQueUsr); - QaServicePOJO.logger.debug("retrieved qaQueUsr has the tool session : " + qaQueUsr.getQaSession()); QaSession qaSession = qaQueUsr.getQaSession(); if (qaSession != null) { Long usersToolSessionId = qaSession.getQaSessionId(); QaServicePOJO.logger.debug("retrieved tool session has tool session id : " + usersToolSessionId); qaSession = retrieveQaSessionOrNullById(usersToolSessionId.longValue()); - QaServicePOJO.logger.debug("retrieved qaSession is : " + qaSession); qaSession.setSession_status(QaSession.COMPLETED); - QaServicePOJO.logger.debug("updated qaSession to COMPLETED : "); updateQaSession(qaSession); - QaServicePOJO.logger.debug("updated qaSession to COMPLETED in the db : "); + QaServicePOJO.logger.debug("updated qaSession to COMPLETED"); QaContent qaContent = qaSession.getQaContent(); - QaServicePOJO.logger.debug("qaSession uses qaContent : " + qaContent); QaServicePOJO.logger.debug("qaSession uses qaContentId : " + qaContent.getQaContentId()); int countIncompleteSession = countIncompleteSession(qaContent); @@ -874,7 +845,6 @@ if (countIncompleteSession == 0) { qaContent.setContentLocked(false); updateQa(qaContent); - QaServicePOJO.logger.debug("qaContent has been updated for contentLocked" + qaContent); } } else { QaServicePOJO.logger.debug("WARNING!: retrieved qaSession is null."); @@ -906,7 +876,6 @@ } qaContent.setDefineLater(value); updateQa(qaContent); - QaServicePOJO.logger.debug("qaContent has been updated for defineLater: " + qaContent); } /** @@ -929,7 +898,6 @@ } qaContent.setRunOffline(value); updateQa(qaContent); - QaServicePOJO.logger.debug("qaContent has been updated for runOffline: " + qaContent); } /** @@ -946,33 +914,28 @@ QaServicePOJO.logger.debug("start of removeToolContent with toolContentID: " + toolContentID); QaContent qaContent = qaDAO.loadQaById(toolContentID.longValue()); - QaServicePOJO.logger.debug("retrieving qaContent: " + qaContent); if (qaContent != null) { Iterator sessionIterator = qaContent.getQaSessions().iterator(); while (sessionIterator.hasNext()) { QaSession qaSession = (QaSession) sessionIterator.next(); - QaServicePOJO.logger.debug("iterated qaSession : " + qaSession); Iterator sessionUsersIterator = qaSession.getQaQueUsers().iterator(); while (sessionUsersIterator.hasNext()) { QaQueUsr qaQueUsr = (QaQueUsr) sessionUsersIterator.next(); - QaServicePOJO.logger.debug("iterated qaQueUsr : " + qaQueUsr); Iterator sessionUsersResponsesIterator = qaQueUsr.getQaUsrResps().iterator(); while (sessionUsersResponsesIterator.hasNext()) { QaUsrResp qaUsrResp = (QaUsrResp) sessionUsersResponsesIterator.next(); - QaServicePOJO.logger.debug("iterated qaUsrResp : " + qaUsrResp); removeUserResponse(qaUsrResp); - QaServicePOJO.logger.debug("removed qaUsrResp : " + qaUsrResp); + QaServicePOJO.logger.debug("removed qaUsrResp : " + qaUsrResp.getQueUsrId()); } } } QaServicePOJO.logger.debug("removed all existing responses of toolContent with toolContentID:" + toolContentID); qaDAO.removeQa(toolContentID); - QaServicePOJO.logger.debug("removed qaContent:" + qaContent); } } @@ -984,19 +947,15 @@ Iterator sessionIterator = qaContent.getQaSessions().iterator(); while (sessionIterator.hasNext()) { QaSession qaSession = (QaSession) sessionIterator.next(); - QaServicePOJO.logger.debug("iterated qaSession : " + qaSession); Iterator sessionUsersIterator = qaSession.getQaQueUsers().iterator(); while (sessionUsersIterator.hasNext()) { QaQueUsr qaQueUsr = (QaQueUsr) sessionUsersIterator.next(); - QaServicePOJO.logger.debug("iterated qaQueUsr : " + qaQueUsr); Iterator sessionUsersResponsesIterator = qaQueUsr.getQaUsrResps().iterator(); while (sessionUsersResponsesIterator.hasNext()) { QaUsrResp qaUsrResp = (QaUsrResp) sessionUsersResponsesIterator.next(); - QaServicePOJO.logger.debug("iterated qaUsrResp : " + qaUsrResp); removeUserResponse(qaUsrResp); - QaServicePOJO.logger.debug("removed qaUsrResp : " + qaUsrResp); } } } @@ -1021,7 +980,6 @@ } QaContent qaContent = qaDAO.loadQaById(toolContentID.longValue()); - QaServicePOJO.logger.debug("retrieving qaContent: " + qaContent); if (qaContent != null) { Iterator sessionIterator = qaContent.getQaSessions().iterator(); @@ -1032,27 +990,23 @@ } QaSession qaSession = (QaSession) sessionIterator.next(); - QaServicePOJO.logger.debug("iterated qaSession : " + qaSession); Iterator sessionUsersIterator = qaSession.getQaQueUsers().iterator(); while (sessionUsersIterator.hasNext()) { QaQueUsr qaQueUsr = (QaQueUsr) sessionUsersIterator.next(); - QaServicePOJO.logger.debug("iterated qaQueUsr : " + qaQueUsr); Iterator sessionUsersResponsesIterator = qaQueUsr.getQaUsrResps().iterator(); while (sessionUsersResponsesIterator.hasNext()) { QaUsrResp qaUsrResp = (QaUsrResp) sessionUsersResponsesIterator.next(); - QaServicePOJO.logger.debug("iterated qaUsrResp : " + qaUsrResp); removeUserResponse(qaUsrResp); - QaServicePOJO.logger.debug("removed qaUsrResp : " + qaUsrResp); + QaServicePOJO.logger.debug("removed qaUsrResp : " + qaUsrResp.getResponseId()); } } } QaServicePOJO.logger.debug("removed all existing responses of toolContent with toolContentID:" + toolContentID); qaDAO.removeQa(toolContentID); - QaServicePOJO.logger.debug("removed qaContent:" + qaContent); } else { QaServicePOJO.logger.debug("Warning!!!, We should have not come here. qaContent is null."); throw new ToolException("toolContentID is missing"); @@ -1194,7 +1148,7 @@ QaServicePOJO.logger.debug("qaSession does not exist yet: " + toolSessionId); return false; } else { - QaServicePOJO.logger.debug("retrieving an existing qaSession: " + qaSession + " " + toolSessionId); + QaServicePOJO.logger.debug("Retrieving an existing qaSession: " + toolSessionId); } return true; } @@ -1237,7 +1191,6 @@ QaServicePOJO.logger.debug("final toolSessionId and toolContentID: " + toolSessionId + " " + toolContentID); QaContent qaContent = qaDAO.loadQaById(toolContentID.longValue()); - QaServicePOJO.logger.debug("retrieved qaContent: " + qaContent); if (qaContent == null) { QaServicePOJO.logger.debug("qaContent is null."); @@ -1260,7 +1213,6 @@ qaContent.getConditions().add(getQaOutputFactory().createDefaultComplexCondition(qaContent)); } } - QaServicePOJO.logger.debug("final - retrieved qaContent: " + qaContent); /* * create a new a new tool session if it does not already exist in the tool session table @@ -1269,11 +1221,7 @@ try { QaSession qaSession = new QaSession(toolSessionId, new Date(System.currentTimeMillis()), QaSession.INCOMPLETE, toolSessionName, qaContent, new TreeSet()); - - QaServicePOJO.logger.debug("created qaSession: " + qaSession); qaSessionDAO.CreateQaSession(qaSession); - QaServicePOJO.logger.debug("created qaSession in the db: " + qaSession); - } catch (Exception e) { QaServicePOJO.logger.debug("Error creating new toolsession in the db"); throw new ToolException("Error creating new toolsession in the db: " + e); @@ -1291,7 +1239,6 @@ QaSession qaSession = null; try { qaSession = retrieveQaSessionOrNullById(toolSessionId.longValue()); - QaServicePOJO.logger.debug("retrieved qaSession: " + qaSession); } catch (QaApplicationException e) { throw new DataMissingException("error retrieving qaSession: " + e); } catch (Exception e) { @@ -1305,7 +1252,7 @@ try { qaSessionDAO.deleteQaSession(qaSession); - QaServicePOJO.logger.debug("qaSession " + qaSession + " has been deleted successfully."); + QaServicePOJO.logger.debug("qaSession " + qaSession.getUid() + " has been deleted successfully."); } catch (QaApplicationException e) { throw new ToolException("error deleting qaSession:" + e); } @@ -1337,7 +1284,7 @@ qaSession.setSession_end_date(new Date(System.currentTimeMillis())); qaSession.setSession_status(QaAppConstants.COMPLETED); updateQaSession(qaSession); - QaServicePOJO.logger.debug("tool session has been marked COMPLETE: " + qaSession); + QaServicePOJO.logger.debug("tool session has been marked COMPLETE: " + qaSession.getUid()); try { String nextUrl = learnerService.completeToolSession(toolSessionId, learnerId); @@ -1391,7 +1338,6 @@ public IToolVO getToolBySignature(String toolSignature) throws QaApplicationException { QaServicePOJO.logger.debug("attempt retrieving tool with signature : " + toolSignature); IToolVO tool = toolService.getToolBySignature(toolSignature); - QaServicePOJO.logger.debug("retrieved tool: " + tool); return tool; } @@ -1406,12 +1352,10 @@ public QaQueContent getToolDefaultQuestionContent(long contentId) throws QaApplicationException { QaServicePOJO.logger.debug("before attempting retrieving QaQueContent with contentId : " + contentId); QaQueContent qaQueContent = qaQueContentDAO.getToolDefaultQuestionContent(contentId); - QaServicePOJO.logger.debug("retrieved QaQueContent : " + qaQueContent); return qaQueContent; } public List getToolSessionsForContent(QaContent qa) { - QaServicePOJO.logger.debug("attempt retrieving listToolSessionIds for : " + qa); List listToolSessionIds = qaSessionDAO.getToolSessionsForContent(qa); return listToolSessionIds; } @@ -1429,12 +1373,10 @@ */ public ITicket getRepositoryLoginTicket() throws QaApplicationException { repositoryService = RepositoryProxy.getRepositoryService(); - QaServicePOJO.logger.debug("retrieved repositoryService : " + repositoryService); ICredentials credentials = new SimpleCredentials(repositoryUser, repositoryId); try { ITicket ticket = repositoryService.login(credentials, repositoryWorkspace); - QaServicePOJO.logger.debug("retrieved ticket: " + ticket); return ticket; } catch (AccessDeniedException e) { throw new QaApplicationException("Access Denied to repository." + e.getMessage()); @@ -1457,10 +1399,8 @@ */ public void deleteFromRepository(Long uuid, Long versionID) throws QaApplicationException { ITicket ticket = getRepositoryLoginTicket(); - QaServicePOJO.logger.debug("retrieved ticket: " + ticket); try { String files[] = repositoryService.deleteVersion(ticket, uuid, versionID); - QaServicePOJO.logger.debug("retrieved files: " + files); } catch (Exception e) { throw new QaApplicationException("Exception occured while deleting files from" + " the repository " + e.getMessage()); @@ -1471,7 +1411,6 @@ ITicket ticket = getRepositoryLoginTicket(); try { IVersionedNode node = repositoryService.getFileItem(ticket, uuid, null); - QaServicePOJO.logger.debug("retrieved node: " + node); return node.getFile(); } catch (AccessDeniedException e) { throw new QaApplicationException("AccessDeniedException occured while trying to download file " @@ -1489,23 +1428,19 @@ */ public void persistFile(String uuid, boolean isOnlineFile, String fileName, QaContent qaContent) throws QaApplicationException { - QaServicePOJO.logger.debug("attempt persisting file to the db: " + uuid + " " + isOnlineFile + " " + fileName - + " " + qaContent); QaUploadedFile qaUploadedFile = new QaUploadedFile(uuid, isOnlineFile, fileName, qaContent); - QaServicePOJO.logger.debug("created qaUploadedFile: " + qaUploadedFile); qaUploadedFileDAO.saveUploadFile(qaUploadedFile); - QaServicePOJO.logger.debug("persisted qaUploadedFile: " + qaUploadedFile); + QaServicePOJO.logger.debug("persisted qaUploadedFile: " + qaUploadedFile.getUuid()); } /** * adds a new entry to the uploaded files table */ public void persistFile(QaContent content, QaUploadedFile file) throws QaApplicationException { - QaServicePOJO.logger.debug("in persistFile: " + file); content.getQaUploadedFiles().add(file); file.setQaContent(content); qaDAO.saveOrUpdateQa(content); - QaServicePOJO.logger.debug("persisted qaUploadedFile: " + file); + QaServicePOJO.logger.debug("persisted qaUploadedFile: " + file.getUuid()); } /** @@ -1517,7 +1452,6 @@ } 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); } @@ -1532,21 +1466,6 @@ } /** - * @return Returns the logger. - */ - public static Logger getLogger() { - return QaServicePOJO.logger; - } - - /** - * @param logger - * The logger to set. - */ - public static void setLogger(Logger logger) { - QaServicePOJO.logger = logger; - } - - /** * @return Returns the cred. */ public ICredentials getCred() { Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/AuthoringUtil.java =================================================================== diff -u -rc527318c8c79f72151f6261342c5cc1a830d1e4d -r328cd4dbe60d9e5c588e13cc16b7e7414893b0af --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision c527318c8c79f72151f6261342c5cc1a830d1e4d) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision 328cd4dbe60d9e5c588e13cc16b7e7414893b0af) @@ -65,9 +65,6 @@ protected static List swapNodes(List listQuestionContentDTO, String questionIndex, String direction, Set conditions) { AuthoringUtil.logger.debug("swapNodes:"); - AuthoringUtil.logger.debug("listQuestionContentDTO:" + listQuestionContentDTO); - AuthoringUtil.logger.debug("questionIndex:" + questionIndex); - AuthoringUtil.logger.debug("direction:" + direction); int intQuestionIndex = new Integer(questionIndex).intValue(); int intOriginalQuestionIndex = intQuestionIndex; @@ -86,37 +83,28 @@ AuthoringUtil.logger.debug("replacing nodes:" + intOriginalQuestionIndex + " and " + replacedNodeIndex); QaQuestionContentDTO mainNode = extractNodeAtDisplayOrder(listQuestionContentDTO, intOriginalQuestionIndex); - AuthoringUtil.logger.debug("mainNode:" + mainNode); QaQuestionContentDTO replacedNode = extractNodeAtDisplayOrder(listQuestionContentDTO, replacedNodeIndex); - AuthoringUtil.logger.debug("replacedNode:" + replacedNode); List listFinalQuestionContentDTO = new LinkedList(); listFinalQuestionContentDTO = reorderSwappedListQuestionContentDTO(listQuestionContentDTO, intOriginalQuestionIndex, replacedNodeIndex, mainNode, replacedNode, conditions); - AuthoringUtil.logger.debug("listFinalQuestionContentDTO:" + listFinalQuestionContentDTO); return listFinalQuestionContentDTO; } protected static List reorderSwappedListQuestionContentDTO(List listQuestionContentDTO, int intOriginalQuestionIndex, int replacedNodeIndex, QaQuestionContentDTO mainNode, QaQuestionContentDTO replacedNode, Set conditions) { - AuthoringUtil.logger.debug("reorderSwappedListQuestionContentDTO: intOriginalQuestionIndex:" - + intOriginalQuestionIndex); - AuthoringUtil.logger.debug("reorderSwappedListQuestionContentDTO: replacedNodeIndex:" + replacedNodeIndex); - AuthoringUtil.logger.debug("mainNode: " + mainNode); - AuthoringUtil.logger.debug("replacedNode: " + replacedNode); + AuthoringUtil.logger.debug("reorderSwappedListQuestionContentDTO:"); List listFinalQuestionContentDTO = new LinkedList(); int queIndex = 0; Iterator listIterator = listQuestionContentDTO.iterator(); while (listIterator.hasNext()) { QaQuestionContentDTO qaQuestionContentDTO = (QaQuestionContentDTO) listIterator.next(); - AuthoringUtil.logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO); - AuthoringUtil.logger.debug("qaQuestionContentDTO question:" + qaQuestionContentDTO.getQuestion()); queIndex++; QaQuestionContentDTO tempNode = new QaQuestionContentDTO(); @@ -153,73 +141,55 @@ condition.temporaryQuestionDTOSet = newQuestionDTOSet; } } - AuthoringUtil.logger.debug("final listFinalQuestionContentDTO:" + listFinalQuestionContentDTO); return listFinalQuestionContentDTO; } protected static QaQuestionContentDTO extractNodeAtDisplayOrder(List listQuestionContentDTO, int intOriginalQuestionIndex) { - AuthoringUtil.logger.debug("listQuestionContentDTO:" + listQuestionContentDTO); AuthoringUtil.logger.debug("intOriginalQuestionIndex:" + intOriginalQuestionIndex); Iterator listIterator = listQuestionContentDTO.iterator(); while (listIterator.hasNext()) { QaQuestionContentDTO qaQuestionContentDTO = (QaQuestionContentDTO) listIterator.next(); - AuthoringUtil.logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO); - AuthoringUtil.logger.debug("qaQuestionContentDTO question:" + qaQuestionContentDTO.getQuestion()); - AuthoringUtil.logger.debug("intOriginalQuestionIndex versus displayOrder:" + new Integer(intOriginalQuestionIndex).toString() + " versus " + qaQuestionContentDTO.getDisplayOrder()); if (new Integer(intOriginalQuestionIndex).toString().equals(qaQuestionContentDTO.getDisplayOrder())) { - AuthoringUtil.logger.debug("node found:" + qaQuestionContentDTO); return qaQuestionContentDTO; } } return null; } protected static Map extractMapQuestionContent(List listQuestionContentDTO) { - AuthoringUtil.logger.debug("listQuestionContentDTO:" + listQuestionContentDTO); Map mapQuestionContent = new TreeMap(new QaComparator()); Iterator listIterator = listQuestionContentDTO.iterator(); int queIndex = 0; while (listIterator.hasNext()) { QaQuestionContentDTO qaQuestionContentDTO = (QaQuestionContentDTO) listIterator.next(); - AuthoringUtil.logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO); - AuthoringUtil.logger.debug("qaQuestionContentDTO question:" + qaQuestionContentDTO.getQuestion()); - queIndex++; AuthoringUtil.logger.debug("queIndex:" + queIndex); mapQuestionContent.put(new Integer(queIndex).toString(), qaQuestionContentDTO.getQuestion()); } - AuthoringUtil.logger.debug("mapQuestionContent:" + mapQuestionContent); return mapQuestionContent; } protected static Map extractMapFeedback(List listQuestionContentDTO) { - AuthoringUtil.logger.debug("listQuestionContentDTO:" + listQuestionContentDTO); Map mapFeedbackContent = new TreeMap(new QaComparator()); Iterator listIterator = listQuestionContentDTO.iterator(); int queIndex = 0; while (listIterator.hasNext()) { QaQuestionContentDTO qaQuestionContentDTO = (QaQuestionContentDTO) listIterator.next(); - AuthoringUtil.logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO); - AuthoringUtil.logger.debug("qaQuestionContentDTO feedback:" + qaQuestionContentDTO.getFeedback()); - queIndex++; AuthoringUtil.logger.debug("queIndex:" + queIndex); mapFeedbackContent.put(new Integer(queIndex).toString(), qaQuestionContentDTO.getFeedback()); } - AuthoringUtil.logger.debug("mapFeedbackContent:" + mapFeedbackContent); return mapFeedbackContent; } protected static Map reorderQuestionContentMap(Map mapQuestionContent) { - AuthoringUtil.logger.debug("reorderQuestionContentMap:" + mapQuestionContent); - Map mapFinalQuestionContent = new TreeMap(new QaComparator()); int queIndex = 0; @@ -233,14 +203,11 @@ } } - - AuthoringUtil.logger.debug("final mapFinalQuestionContent:" + mapFinalQuestionContent); return mapFinalQuestionContent; } protected static List reorderListQuestionContentDTO(List listQuestionContentDTO, String excludeQuestionIndex) { AuthoringUtil.logger.debug("reorderListQuestionContentDTO"); - AuthoringUtil.logger.debug("listQuestionContentDTO:" + listQuestionContentDTO); AuthoringUtil.logger.debug("excludeQuestionIndex:" + excludeQuestionIndex); List listFinalQuestionContentDTO = new LinkedList(); @@ -249,25 +216,20 @@ Iterator listIterator = listQuestionContentDTO.iterator(); while (listIterator.hasNext()) { QaQuestionContentDTO qaQuestionContentDTO = (QaQuestionContentDTO) listIterator.next(); - AuthoringUtil.logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO); - AuthoringUtil.logger.debug("qaQuestionContentDTO question:" + qaQuestionContentDTO.getQuestion()); - + String question = qaQuestionContentDTO.getQuestion(); - AuthoringUtil.logger.debug("question:" + question); String displayOrder = qaQuestionContentDTO.getDisplayOrder(); AuthoringUtil.logger.debug("displayOrder:" + displayOrder); String feedback = qaQuestionContentDTO.getFeedback(); - AuthoringUtil.logger.debug("feedback:" + feedback); AuthoringUtil.logger.debug("displayOrder versus excludeQuestionIndex :" + displayOrder + " versus " + excludeQuestionIndex); if (question != null && !question.equals("")) { if (!displayOrder.equals(excludeQuestionIndex)) { ++queIndex; - AuthoringUtil.logger.debug("using queIndex:" + queIndex); qaQuestionContentDTO.setQuestion(question); qaQuestionContentDTO.setDisplayOrder(new Integer(queIndex).toString()); @@ -277,35 +239,26 @@ } } } - - AuthoringUtil.logger.debug("final listFinalQuestionContentDTO:" + listFinalQuestionContentDTO); return listFinalQuestionContentDTO; } protected static List reorderSimpleListQuestionContentDTO(List listQuestionContentDTO) { AuthoringUtil.logger.debug("reorderListQuestionContentDTO"); - AuthoringUtil.logger.debug("listQuestionContentDTO:" + listQuestionContentDTO); List listFinalQuestionContentDTO = new LinkedList(); int queIndex = 0; Iterator listIterator = listQuestionContentDTO.iterator(); while (listIterator.hasNext()) { QaQuestionContentDTO qaQuestionContentDTO = (QaQuestionContentDTO) listIterator.next(); - AuthoringUtil.logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO); - AuthoringUtil.logger.debug("qaQuestionContentDTO question:" + qaQuestionContentDTO.getQuestion()); - + String question = qaQuestionContentDTO.getQuestion(); - AuthoringUtil.logger.debug("question:" + question); String displayOrder = qaQuestionContentDTO.getDisplayOrder(); - AuthoringUtil.logger.debug("displayOrder:" + displayOrder); String feedback = qaQuestionContentDTO.getFeedback(); - AuthoringUtil.logger.debug("feedback:" + feedback); if (question != null && !question.equals("")) { ++queIndex; - AuthoringUtil.logger.debug("using queIndex:" + queIndex); qaQuestionContentDTO.setQuestion(question); qaQuestionContentDTO.setDisplayOrder(new Integer(queIndex).toString()); @@ -314,16 +267,12 @@ listFinalQuestionContentDTO.add(qaQuestionContentDTO); } } - - AuthoringUtil.logger.debug("final listFinalQuestionContentDTO:" + listFinalQuestionContentDTO); return listFinalQuestionContentDTO; } protected static List reorderUpdateListQuestionContentDTO(List listQuestionContentDTO, QaQuestionContentDTO qaQuestionContentDTONew, String editableQuestionIndex) { AuthoringUtil.logger.debug("reorderUpdateListQuestionContentDTO"); - AuthoringUtil.logger.debug("listQuestionContentDTO:" + listQuestionContentDTO); - AuthoringUtil.logger.debug("qaQuestionContentDTONew:" + qaQuestionContentDTONew); AuthoringUtil.logger.debug("editableQuestionIndex:" + editableQuestionIndex); List listFinalQuestionContentDTO = new LinkedList(); @@ -332,41 +281,30 @@ Iterator listIterator = listQuestionContentDTO.iterator(); while (listIterator.hasNext()) { QaQuestionContentDTO qaQuestionContentDTO = (QaQuestionContentDTO) listIterator.next(); - AuthoringUtil.logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO); - AuthoringUtil.logger.debug("qaQuestionContentDTO question:" + qaQuestionContentDTO.getQuestion()); - + ++queIndex; - AuthoringUtil.logger.debug("using queIndex:" + queIndex); + String question = qaQuestionContentDTO.getQuestion(); - AuthoringUtil.logger.debug("question:" + question); String displayOrder = qaQuestionContentDTO.getDisplayOrder(); - AuthoringUtil.logger.debug("displayOrder:" + displayOrder); String feedback = qaQuestionContentDTO.getFeedback(); - AuthoringUtil.logger.debug("feedback:" + feedback); if (displayOrder.equals(editableQuestionIndex)) { - AuthoringUtil.logger.debug("displayOrder equals editableQuestionIndex:" + editableQuestionIndex); qaQuestionContentDTO.setQuestion(qaQuestionContentDTONew.getQuestion()); qaQuestionContentDTO.setDisplayOrder(qaQuestionContentDTONew.getDisplayOrder()); qaQuestionContentDTO.setFeedback(qaQuestionContentDTONew.getFeedback()); listFinalQuestionContentDTO.add(qaQuestionContentDTO); } else { - AuthoringUtil.logger - .debug("displayOrder does not equal editableQuestionIndex:" + editableQuestionIndex); qaQuestionContentDTO.setQuestion(question); qaQuestionContentDTO.setDisplayOrder(displayOrder); qaQuestionContentDTO.setFeedback(feedback); listFinalQuestionContentDTO.add(qaQuestionContentDTO); } - } - - AuthoringUtil.logger.debug("listFinalQuestionContentDTO:" + listFinalQuestionContentDTO); return listFinalQuestionContentDTO; } @@ -383,17 +321,13 @@ * if there is data in the Map remaining from previous session remove those */ mapQuestionContent.clear(); - AuthoringUtil.logger.debug("Map got initialized: " + mapQuestionContent); for (long i = 0; i < intQuestionIndex; i++) { String candidateQuestionEntry = request.getParameter("questionContent" + i); if (i == 0) { - AuthoringUtil.logger.debug("defaultQuestionContent set to: " + candidateQuestionEntry); } if (candidateQuestionEntry != null && candidateQuestionEntry.length() > 0) { - AuthoringUtil.logger.debug("using key: " + i); mapQuestionContent.put(new Long(i + 1).toString(), candidateQuestionEntry); - AuthoringUtil.logger.debug("added new entry."); } } } @@ -406,41 +340,29 @@ String richTextTitle = request.getParameter(QaAppConstants.TITLE); String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS); - AuthoringUtil.logger.debug("richTextTitle: " + richTextTitle); - AuthoringUtil.logger.debug("richTextInstructions: " + richTextInstructions); - String synchInMonitor = request.getParameter(QaAppConstants.SYNC_IN_MONITOR); - AuthoringUtil.logger.debug("synchInMonitor: " + synchInMonitor); String usernameVisible = request.getParameter(QaAppConstants.USERNAME_VISIBLE); - AuthoringUtil.logger.debug("usernameVisible: " + usernameVisible); String showOtherAnswers = request.getParameter("showOtherAnswers"); - AuthoringUtil.logger.debug("showOtherAnswers: " + showOtherAnswers); String questionsSequenced = request.getParameter(QaAppConstants.QUESTIONS_SEQUENCED); - AuthoringUtil.logger.debug("questionsSequenced: " + questionsSequenced); String lockWhenFinished = request.getParameter("lockWhenFinished"); - AuthoringUtil.logger.debug("lockWhenFinished: " + lockWhenFinished); String richTextOfflineInstructions = request.getParameter(QaAppConstants.OFFLINE_INSTRUCTIONS); String richTextOnlineInstructions = request.getParameter(QaAppConstants.ONLINE_INSTRUCTIONS); String reflect = request.getParameter(QaAppConstants.REFLECT); - AuthoringUtil.logger.debug("reflect: " + reflect); String reflectionSubject = request.getParameter(QaAppConstants.REFLECTION_SUBJECT); - AuthoringUtil.logger.debug("reflectionSubject: " + reflectionSubject); String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE); - AuthoringUtil.logger.debug("activeModule: " + activeModule); boolean setCommonContent = true; if (questionsSequenced == null || synchInMonitor == null || lockWhenFinished == null || usernameVisible == null || reflect == null || showOtherAnswers == null) { setCommonContent = false; } - AuthoringUtil.logger.debug("setCommonContent: " + setCommonContent); boolean questionsSequencedBoolean = false; boolean synchInMonitorBoolean = false; @@ -472,52 +394,34 @@ if (reflect != null && reflect.equalsIgnoreCase("1")) { reflectBoolean = true; } - - AuthoringUtil.logger.debug("questionsSequencedBoolean: " + questionsSequencedBoolean); - AuthoringUtil.logger.debug("synchInMonitorBoolean: " + synchInMonitorBoolean); - AuthoringUtil.logger.debug("lockWhenFinishedBoolean: " + lockWhenFinishedBoolean); - AuthoringUtil.logger.debug("usernameVisibleBoolean: " + usernameVisibleBoolean); - AuthoringUtil.logger.debug("showOtherAnswersBoolean: " + showOtherAnswersBoolean); - AuthoringUtil.logger.debug("reflectBoolean: " + reflectBoolean); - long userId = 0; if (toolUser != null) { userId = toolUser.getUserID().longValue(); } else { HttpSession ss = SessionManager.getSession(); - AuthoringUtil.logger.debug("ss: " + ss); UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); - AuthoringUtil.logger.debug("user" + user); if (user != null) { userId = user.getUserID().longValue(); } else { - AuthoringUtil.logger.debug("should not reach here"); userId = 0; } } - AuthoringUtil.logger.debug("userId: " + userId); - AuthoringUtil.logger.debug("qaContent: " + qaContent); boolean newContent = false; if (qaContent == null) { qaContent = new QaContent(); newContent = true; } - AuthoringUtil.logger.debug("setting common content values..." + richTextTitle + " " + richTextInstructions); qaContent.setQaContentId(new Long(strToolContentID)); qaContent.setTitle(richTextTitle); qaContent.setInstructions(richTextInstructions); qaContent.setUpdateDate(new Date(System.currentTimeMillis())); /** keep updating this one */ - AuthoringUtil.logger.debug("userId: " + userId); qaContent.setCreatedBy(userId); /** make sure we are setting the userId from the User object above */ - AuthoringUtil.logger.debug("end of setting common content values..."); - AuthoringUtil.logger.debug("activeModule:" + activeModule); if (activeModule.equals(QaAppConstants.AUTHORING)) { - AuthoringUtil.logger.debug("setting other content values..."); qaContent.setOnlineInstructions(richTextOnlineInstructions); qaContent.setOfflineInstructions(richTextOfflineInstructions); qaContent.setUsernameVisible(usernameVisibleBoolean); @@ -532,15 +436,12 @@ qaContent.setConditions(new TreeSet(new TextSearchConditionComparator())); if (newContent) { - AuthoringUtil.logger.debug("will create: " + qaContent); qaService.createQa(qaContent); } else { - AuthoringUtil.logger.debug("will update: " + qaContent); qaService.updateQa(qaContent); } qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - AuthoringUtil.logger.debug("qaContent: " + qaContent); qaContent = createQuestionContent(mapQuestionContent, mapFeedback, qaService, qaContent, conditions); qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); @@ -572,49 +473,34 @@ public void removeRedundantQuestions(Map mapQuestionContent, IQaService qaService, QaAuthoringForm qaAuthoringForm, HttpServletRequest request, String toolContentID) { AuthoringUtil.logger.debug("removing unused entries... "); - AuthoringUtil.logger.debug("mapQuestionContent: " + mapQuestionContent); AuthoringUtil.logger.debug("toolContentID: " + toolContentID); QaContent qaContent = qaService.loadQa(new Long(toolContentID).longValue()); - AuthoringUtil.logger.debug("qaContent: " + qaContent); if (qaContent != null) { AuthoringUtil.logger.debug("qaContent uid: " + qaContent.getUid()); List allQuestions = qaService.getAllQuestionEntries(qaContent.getUid()); - AuthoringUtil.logger.debug("allQuestions: " + allQuestions); Iterator listIterator = allQuestions.iterator(); int mapIndex = 0; boolean entryUsed = false; while (listIterator.hasNext()) { ++mapIndex; - AuthoringUtil.logger.debug("current mapIndex: " + mapIndex); QaQueContent queContent = (QaQueContent) listIterator.next(); - AuthoringUtil.logger.debug("queContent data: " + queContent); - AuthoringUtil.logger.debug("queContent: " + queContent.getQuestion() + " " - + queContent.getDisplayOrder()); entryUsed = false; Iterator itMap = mapQuestionContent.entrySet().iterator(); int displayOrder = 0; while (itMap.hasNext()) { ++displayOrder; - AuthoringUtil.logger.debug("current displayOrder: " + displayOrder); + entryUsed = false; Map.Entry pairs = (Map.Entry) itMap.next(); AuthoringUtil.logger.debug("using the pair: " + pairs.getKey() + " = " + pairs.getValue()); if (pairs.getValue().toString().length() != 0) { - AuthoringUtil.logger.debug("text from map:" + pairs.getValue().toString()); - AuthoringUtil.logger.debug("text from db:" + queContent.getQuestion()); - - AuthoringUtil.logger.debug("mapIndex versus displayOrder:" + mapIndex + " versus " - + displayOrder); if (mapIndex == displayOrder) { - // logger.debug("used entry in db:" + - // queContent.getQuestion()); - AuthoringUtil.logger.debug("used displayOrder position:" + displayOrder); entryUsed = true; break; } @@ -623,16 +509,12 @@ } if (entryUsed == false) { - AuthoringUtil.logger.debug("removing unused entry in db:" + queContent.getQuestion()); QaQueContent removeableQaQueContent = qaService.getQuestionContentByQuestionText(queContent .getQuestion(), qaContent.getUid()); - AuthoringUtil.logger.debug("removeableQaQueContent" + removeableQaQueContent); if (removeableQaQueContent != null) { // qaContent.getQaQueContents().remove(removeableQaQueContent); qaService.removeQaQueContent(removeableQaQueContent); - AuthoringUtil.logger.debug("removed removeableQaQueContent from the db: " - + removeableQaQueContent); } } @@ -652,69 +534,36 @@ AuthoringUtil.logger.debug("createQuestionContent: "); AuthoringUtil.logger.debug("content uid is: " + qaContent.getUid()); List questions = qaService.retrieveQaQueContentsByToolContentId(qaContent.getUid().longValue()); - AuthoringUtil.logger.debug("questions: " + questions); - AuthoringUtil.logger.debug("mapQuestionContent: " + mapQuestionContent); - AuthoringUtil.logger.debug("mapFeedback: " + mapFeedback); - Iterator itMap = mapQuestionContent.entrySet().iterator(); int displayOrder = 0; while (itMap.hasNext()) { Map.Entry pairs = (Map.Entry) itMap.next(); - AuthoringUtil.logger.debug("using the pair: " + pairs.getKey() + " = " + pairs.getValue()); if (pairs.getValue().toString().length() != 0) { - AuthoringUtil.logger.debug("starting createQuestionContent: pairs.getValue().toString():" - + pairs.getValue().toString()); - AuthoringUtil.logger.debug("starting createQuestionContent: qaContent: " + qaContent); - ++displayOrder; - AuthoringUtil.logger.debug("starting createQuestionContent: displayOrder: " + displayOrder); String currentFeedback = (String) mapFeedback.get(new Integer(displayOrder).toString()); - AuthoringUtil.logger.debug("currentFeedback: " + currentFeedback); QaQueContent queContent = new QaQueContent(pairs.getValue().toString(), displayOrder, currentFeedback, qaContent, null, null); - AuthoringUtil.logger.debug("queContent: " + queContent); - - /* checks if the question is already recorded */ - AuthoringUtil.logger.debug("question text is: " + pairs.getValue().toString()); - AuthoringUtil.logger.debug("content uid is: " + qaContent.getUid()); - AuthoringUtil.logger.debug("question display order is: " + displayOrder); QaQueContent existingQaQueContent = qaService.getQuestionContentByDisplayOrder(new Long(displayOrder), qaContent.getUid()); - AuthoringUtil.logger.debug("existingQaQueContent: " + existingQaQueContent); if (existingQaQueContent == null) { - /* - * make sure a question with the same question text is not already saved - */ QaQueContent duplicateQaQueContent = qaService.getQuestionContentByQuestionText(pairs.getValue() .toString(), qaContent.getUid()); - AuthoringUtil.logger.debug("duplicateQaQueContent: " + duplicateQaQueContent); - // if (duplicateQaQueContent == null) - // { - AuthoringUtil.logger.debug("adding a new question to content: " + queContent); qaContent.getQaQueContents().add(queContent); queContent.setQaContent(qaContent); qaService.createQaQue(queContent); - - // } } else { String existingQuestion = existingQaQueContent.getQuestion(); - AuthoringUtil.logger.debug("existingQuestion: " + existingQuestion); - AuthoringUtil.logger.debug("map question versus existingQuestion: " + pairs.getValue().toString() - + " versus db question value: " + existingQuestion); - existingQaQueContent.setQuestion(pairs.getValue().toString()); existingQaQueContent.setFeedback(currentFeedback); existingQaQueContent.setDisplayOrder(displayOrder); - - AuthoringUtil.logger.debug("updating the existing question content: " + existingQaQueContent); qaService.saveOrUpdateQaQueContent(existingQaQueContent); } } @@ -724,20 +573,15 @@ } public static boolean checkDuplicateQuestions(List listQuestionContentDTO, String newQuestion) { - AuthoringUtil.logger.debug("checkDuplicateQuestions: " + listQuestionContentDTO); - AuthoringUtil.logger.debug("newQuestion: " + newQuestion); + AuthoringUtil.logger.debug("checkDuplicateQuestions: "); Map mapQuestionContent = extractMapQuestionContent(listQuestionContentDTO); - AuthoringUtil.logger.debug("mapQuestionContent: " + mapQuestionContent); Iterator itMap = mapQuestionContent.entrySet().iterator(); while (itMap.hasNext()) { Map.Entry pairs = (Map.Entry) itMap.next(); if (pairs.getValue() != null && !pairs.getValue().equals("")) { - AuthoringUtil.logger.debug("checking the pair: " + pairs.getKey() + " = " + pairs.getValue()); - if (pairs.getValue().equals(newQuestion)) { - AuthoringUtil.logger.debug("entry found: " + newQuestion); return true; } } @@ -757,23 +601,19 @@ */ public void reOrganizeDisplayOrder(Map mapQuestionContent, IQaService qaService, QaAuthoringForm qaAuthoringForm, QaContent qaContent) { - AuthoringUtil.logger.debug("qaContent: " + qaContent); if (qaContent != null) { AuthoringUtil.logger.debug("content uid: " + qaContent.getUid()); List sortedQuestions = qaService.getAllQuestionEntriesSorted(qaContent.getUid().longValue()); - AuthoringUtil.logger.debug("sortedQuestions: " + sortedQuestions); Iterator listIterator = sortedQuestions.iterator(); int displayOrder = 1; while (listIterator.hasNext()) { QaQueContent queContent = (QaQueContent) listIterator.next(); - AuthoringUtil.logger.debug("queContent data: " + queContent); AuthoringUtil.logger.debug("queContent: " + queContent.getQuestion() + " " + queContent.getDisplayOrder()); QaQueContent existingQaQueContent = qaService.getQuestionContentByQuestionText( queContent.getQuestion(), qaContent.getUid()); - AuthoringUtil.logger.debug("existingQaQueContent: " + existingQaQueContent); existingQaQueContent.setDisplayOrder(displayOrder); AuthoringUtil.logger.debug("updating the existing question content for displayOrder: " + existingQaQueContent); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java =================================================================== diff -u -rc527318c8c79f72151f6261342c5cc1a830d1e4d -r328cd4dbe60d9e5c588e13cc16b7e7414893b0af --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java (.../ExportServlet.java) (revision c527318c8c79f72151f6261342c5cc1a830d1e4d) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java (.../ExportServlet.java) (revision 328cd4dbe60d9e5c588e13cc16b7e7414893b0af) @@ -112,10 +112,9 @@ // Yet we might be asked for their page, as the activity has been commenced. // So need to do a "blank" page in that case QaQueUsr learner = qaService.getQaUserBySession(userID, qaSession.getUid()); - logger.debug("learner: " + learner); + logger.debug("UserID: " + learner.getUid()); QaContent content = qaSession.getQaContent(); - logger.debug("content: " + content); logger.debug("content id: " + content.getQaContentId()); if (content == null) { @@ -130,7 +129,6 @@ GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(content); generalLearnerFlowDTO.setUserUid(learner != null ? learner.getUid().toString() : null); - logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); // if learner is null, don't want to show other people's answers if (learner != null) { @@ -143,7 +141,6 @@ } generalLearnerFlowDTO = (GeneralLearnerFlowDTO) request.getAttribute(GENERAL_LEARNER_FLOW_DTO); - logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO); logger.debug("for the special case of export portfolio we place generalLearnerFlowDTO into session scope"); request.getSession().setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); @@ -164,7 +161,6 @@ } QaContent content = qaService.loadQa(toolContentID.longValue()); - logger.debug("content: " + content); if (content == null) { String error = "Data is missing from the database. Unable to Continue"; @@ -176,16 +172,13 @@ logger.debug("start refreshSummaryData for teacher mode."); GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(content); - logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); qaMonitoringAction.refreshSummaryData(request, content, qaService, true, false, null, null, generalLearnerFlowDTO, false, "All"); logger.debug("end refreshSummaryData for teacher mode."); logger.debug("teacher uses content id: " + content.getQaContentId()); generalLearnerFlowDTO = (GeneralLearnerFlowDTO) request.getAttribute(GENERAL_LEARNER_FLOW_DTO); - logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO); - logger.debug("for the special case of export portfolio we place generalLearnerFlowDTO into session scope"); request.getSession().setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); request.getSession().setAttribute(PORTFOLIO_EXPORT_MODE, "teacher"); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/LearningUtil.java =================================================================== diff -u -rc527318c8c79f72151f6261342c5cc1a830d1e4d -r328cd4dbe60d9e5c588e13cc16b7e7414893b0af --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/LearningUtil.java (.../LearningUtil.java) (revision c527318c8c79f72151f6261342c5cc1a830d1e4d) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/LearningUtil.java (.../LearningUtil.java) (revision 328cd4dbe60d9e5c588e13cc16b7e7414893b0af) @@ -61,26 +61,22 @@ public static void saveFormRequestData(HttpServletRequest request, QaLearningForm qaLearningForm) { logger.debug("saving form request data..."); String toolSessionID = request.getParameter("toolSessionID"); - logger.debug("toolSessionID: " + toolSessionID); qaLearningForm.setToolSessionID(toolSessionID); String userID = request.getParameter("userID"); - logger.debug("userID: " + userID); qaLearningForm.setUserID(userID); String httpSessionID = request.getParameter("httpSessionID"); - logger.debug("httpSessionID: " + httpSessionID); qaLearningForm.setHttpSessionID(httpSessionID); String totalQuestionCount = request.getParameter("totalQuestionCount"); - logger.debug("totalQuestionCount: " + totalQuestionCount); qaLearningForm.setTotalQuestionCount(totalQuestionCount); logger.debug("done saving form request data."); } public static GeneralLearnerFlowDTO buildGeneralLearnerFlowDTO(QaContent qaContent) { - logger.debug("starting buildMcGeneralLearnerFlowDTO: " + qaContent); + logger.debug("starting buildMcGeneralLearnerFlowDTO: " + qaContent.getUid()); GeneralLearnerFlowDTO generalLearnerFlowDTO = new GeneralLearnerFlowDTO(); generalLearnerFlowDTO.setActivityTitle(qaContent.getTitle()); generalLearnerFlowDTO.setActivityInstructions(qaContent.getInstructions()); @@ -95,9 +91,7 @@ generalLearnerFlowDTO.setShowOtherAnswers(new Boolean(qaContent.isShowOtherAnswers()).toString()); generalLearnerFlowDTO.setActivityOffline(new Boolean(qaContent.isRunOffline()).toString()); - logger.debug("continue buildGeneralLearnerFlowDTO: " + qaContent); generalLearnerFlowDTO.setTotalQuestionCount(new Integer(qaContent.getQaQueContents().size())); - logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO); Map mapQuestions = new TreeMap(new QaComparator()); Map mapFeedback = new TreeMap(new QaComparator()); @@ -114,7 +108,6 @@ mapQuestions.put(new Integer(displayOrder).toString(), qaQueContent.getQuestion()); String feedback = qaQueContent.getFeedback(); - logger.debug("feedback: " + feedback); if (feedback == null) feedback = ""; @@ -123,8 +116,6 @@ } } - logger.debug("mapFeedback: " + mapFeedback); - generalLearnerFlowDTO.setMapFeedback(mapFeedback); generalLearnerFlowDTO.setMapQuestionContentLearner(mapQuestions); return generalLearnerFlowDTO; @@ -140,137 +131,97 @@ */ protected void createUsersAndResponses(Map mapAnswers, HttpServletRequest request, IQaService qaService, Long toolContentID, Long toolSessionID) { - logger.debug("createUsers-retrieving qaService: " + qaService); - logger.debug("mapAnswers: " + mapAnswers); logger.debug("toolContentID: " + toolContentID); logger.debug("toolSessionID: " + toolSessionID); 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()); /* * obtain QaContent to be used in creating QaQueUsr */ QaContent qaContent = qaService.retrieveQa(toolContentID.longValue()); - logger.debug("createUsers-retrieving qaContent: " + qaContent); QaSession qaSession = qaService.retrieveQaSessionOrNullById(toolSessionID.longValue()); - logger.debug("createUsers-retrieving qaSession: " + qaSession); Iterator contentIterator = qaContent.getQaQueContents().iterator(); - logger.debug("createUsers-attempt iteration questions"); QaQueUsr qaQueUsr = new QaQueUsr(userId, userName, fullName, null, qaSession, new TreeSet()); - logger.debug("createQaQueUsr - qaQueUsr: " + qaQueUsr); logger.debug("session uid: " + qaSession.getUid()); /*note that it is possible for a user to already exist from another tool session. In this case don't add any more user record*/ QaQueUsr qaQueUsrLocal = qaService.getQaUserBySession(userId, qaSession.getUid()); - logger.debug("qaQueUsrLocal: " + qaQueUsrLocal); if ((qaQueUsr != null) && (qaQueUsrLocal == null)) { qaQueUsr = createUser(request, toolSessionID, qaService); - logger.debug("created qaQueUsr: " + qaQueUsr); } else { - logger.debug("assign user"); qaQueUsr = qaQueUsrLocal; } - logger.debug("qaQueUsr uid:" + qaQueUsr.getUid()); - boolean isResponseFinalized = qaQueUsr.isResponseFinalized(); - logger.debug("isResponseFinalized: " + isResponseFinalized); boolean lockWhenFinished = qaContent.isLockWhenFinished(); - logger.debug("lockWhenFinished: " + lockWhenFinished); boolean enableAttemptEntry = false; boolean userAttemptExist = false; if (!isResponseFinalized) { - logger.debug("type 1 attempt entry"); enableAttemptEntry = true; } if (isResponseFinalized && (!lockWhenFinished)) { - logger.debug("type 2 attempt entry"); - logger.debug("second visit and lockWhenFinished is false, enable attempt entry"); userAttemptExist = true; enableAttemptEntry = true; } - logger.debug("final enableAttemptEntry: " + enableAttemptEntry); - logger.debug("final userAttemptExist: " + userAttemptExist); if (enableAttemptEntry) { logger.debug("enableAttemptEntry is true, so creating the responses: "); while (contentIterator.hasNext()) { QaQueContent qaQueContent = (QaQueContent) contentIterator.next(); if (qaQueContent != null) { - logger.debug("qaQueContent uid:" + qaQueContent.getUid()); - String question = qaQueContent.getQuestion(); - logger.debug("question:" + question); String displayOrder = new Long(qaQueContent.getDisplayOrder()).toString(); - logger.debug("displayOrder:" + displayOrder); String answer = (String) mapAnswers.get(displayOrder); - logger.debug("iterationg question-answers: displayOrder: " + displayOrder + " question: " - + question + " answer: " + answer); + String timezoneId = ""; List attempts = qaService.getAttemptsForUserAndQuestionContent(qaQueUsr.getUid(), qaQueContent .getUid()); - logger.debug("attempts:" + attempts); if (userAttemptExist) { - logger.debug("since userAttemptExist is true remove them:"); qaService.removeAttemptsForUserAndQuestionContent(qaQueUsr.getUid(), qaQueContent.getUid()); - logger.debug("creating response."); QaUsrResp qaUsrResp = new QaUsrResp(answer, false, new Date(System.currentTimeMillis()), timezoneId, qaQueContent, qaQueUsr, true); - logger.debug("iterationg qaUsrResp: " + qaUsrResp); if (qaUsrResp != null) { qaService.createQaUsrResp(qaUsrResp); - logger.debug("created qaUsrResp in the db"); } - - logger.debug("recreated user attempts since the content is not locked when finished"); } else { - logger.debug("first time attempt entry or content is locked"); if ((attempts != null) && (attempts.size() > 0)) { - logger.debug("this user already responsed to q/a in this session:"); } else { - logger.debug("creating response."); QaUsrResp qaUsrResp = new QaUsrResp(answer, false, new Date(System.currentTimeMillis()), timezoneId, qaQueContent, qaQueUsr, true); - logger.debug("iterationg qaUsrResp: " + qaUsrResp); if (qaUsrResp != null) { qaService.createQaUsrResp(qaUsrResp); - logger.debug("created qaUsrResp in the db"); } } } } } } - - logger.debug("current user is: " + qaQueUsr); if (qaQueUsr != null) { qaQueUsr.setResponseFinalized(true); logger.debug("finalized user input"); @@ -280,19 +231,16 @@ public static QaQueUsr createUser(HttpServletRequest request, Long toolSessionID, IQaService qaService) { logger.debug("creating a new user in the tool db, toolSessionID: " + toolSessionID); - logger.debug("qaService: " + qaService); Long queUsrId = QaUtils.getUserId(); String username = QaUtils.getUserName(); String fullname = QaUtils.getUserFullName(); QaSession qaSession = qaService.retrieveQaSessionOrNullById(toolSessionID.longValue()); - logger.debug("qaSession: " + qaSession); QaQueUsr qaQueUsr = new QaQueUsr(queUsrId, username, fullname, null, qaSession, new TreeSet()); qaService.createQaQueUsr(qaQueUsr); - logger.debug("created qaQueUsr in the db: " + qaQueUsr); return qaQueUsr; } @@ -327,7 +275,6 @@ public void setContentInUse(long toolContentID, IQaService qaService) { QaContent qaContent = qaService.loadQa(toolContentID); - logger.debug("retrieve qaContent: " + qaContent); qaContent.setContentLocked(true); logger.debug("content with id : " + toolContentID + "has been marked LOCKED"); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/MonitoringUtil.java =================================================================== diff -u -rc527318c8c79f72151f6261342c5cc1a830d1e4d -r328cd4dbe60d9e5c588e13cc16b7e7414893b0af --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision c527318c8c79f72151f6261342c5cc1a830d1e4d) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision 328cd4dbe60d9e5c588e13cc16b7e7414893b0af) @@ -75,7 +75,6 @@ Iterator sessionIterator = qaContent.getQaSessions().iterator(); while (sessionIterator.hasNext()) { QaSession qaSession = (QaSession) sessionIterator.next(); - logger.debug("iterated qaSession : " + qaSession); if (qaSession.getSession_status().equalsIgnoreCase(QaSession.INCOMPLETE)) return false; } @@ -95,10 +94,8 @@ public void updateResponse(IQaService qaService, String responseId, String updatedResponse) { logger.debug("load response with responseId: " + new Long(responseId).longValue()); QaUsrResp qaUsrResp = qaService.retrieveQaUsrResp(new Long(responseId).longValue()); - logger.debug("loaded user response: " + qaUsrResp); qaUsrResp.setAnswer(updatedResponse); qaService.updateQaUsrResp(qaUsrResp); - logger.debug("updated user response in the db: " + qaUsrResp); } /** @@ -110,10 +107,8 @@ public void hideResponse(IQaService qaService, String responseId) { logger.debug("load response with responseId for hiding: " + new Long(responseId).longValue()); QaUsrResp qaUsrResp = qaService.retrieveQaUsrResp(new Long(responseId).longValue()); - logger.debug("loaded user response: " + qaUsrResp); qaUsrResp.setHidden(true); qaService.updateQaUsrResp(qaUsrResp); - logger.debug("updated user response in the db: " + qaUsrResp); } /** @@ -125,10 +120,8 @@ public void unHideResponse(IQaService qaService, String responseId) { logger.debug("load response with responseId for un-hiding: " + new Long(responseId).longValue()); QaUsrResp qaUsrResp = qaService.retrieveQaUsrResp(new Long(responseId).longValue()); - logger.debug("loaded user response: " + qaUsrResp); qaUsrResp.setHidden(false); qaService.updateQaUsrResp(qaUsrResp); - logger.debug("updated user response in the db: " + qaUsrResp); } /** @@ -144,8 +137,6 @@ logger.debug("sessionsList size is:..." + sessionsList.size()); Map sessionsMap = QaUtils.convertToStringMap(sessionsList, "String"); - logger.debug("generated sessionsMap:..." + sessionsMap); - logger.debug("sessionsMap size:..." + sessionsMap.size()); if (sessionsMap.isEmpty()) { logger.debug("sessionsMap size is 0:"); @@ -154,8 +145,6 @@ logger.debug("sessionsMap has some entries: " + sessionsMap.size()); sessionsMap.put(new Long(sessionsMap.size() + 1).toString(), "All"); } - - logger.debug("final sessionsMap:" + sessionsMap); return sessionsMap; } @@ -172,7 +161,6 @@ logger.debug("sessionsList size is:..." + sessionsList.size()); Map sessionsMap = QaUtils.convertToStringMap(sessionsList, "Long"); - logger.debug("generated sessionsMap:..." + sessionsMap); logger.debug("sessionsMap size:..." + sessionsMap.size()); if (sessionsMap.isEmpty()) { @@ -182,8 +170,6 @@ logger.debug("sessionsMap has some entries: " + sessionsMap.size()); sessionsMap.put(new Long(sessionsMap.size() + 1).toString(), "All"); } - - logger.debug("final sessionsMap:" + sessionsMap); return sessionsMap; } @@ -204,31 +190,21 @@ boolean isUserNamesVisible, boolean isLearnerRequest, String currentSessionId, String userId) { logger.debug("buildGroupsQuestionData: " + currentSessionId); - logger.debug("isUserNamesVisible: " + isUserNamesVisible); - logger.debug("isLearnerRequest: " + isLearnerRequest); - logger.debug("userId: " + userId); - logger.debug("qaService: " + qaService); - - logger.debug("will be building groups question data for content:..." + qaContent); List listQuestions = qaService.getAllQuestionEntries(qaContent.getUid()); - logger.debug("listQuestions:..." + listQuestions); String sessionName = ""; if ((currentSessionId != null) && (!currentSessionId.equals("All"))) { QaSession qaSession = qaService.retrieveQaSessionOrNullById(new Long(currentSessionId).longValue()); - logger.debug("qaSession: " + qaSession); sessionName = qaSession.getSession_name(); } - logger.debug("sessionName: " + sessionName); request.setAttribute(CURRENT_SESSION_NAME, sessionName); List listMonitoredAnswersContainerDTO = new LinkedList(); Iterator itListQuestions = listQuestions.iterator(); while (itListQuestions.hasNext()) { QaQueContent qaQueContent = (QaQueContent) itListQuestions.next(); - logger.debug("mcQueContent:..." + qaQueContent); if (qaQueContent != null) { QaMonitoredAnswersDTO qaMonitoredAnswersDTO = new QaMonitoredAnswersDTO(); @@ -240,13 +216,11 @@ Map questionAttemptData = buildGroupsAttemptData(request, qaContent, qaService, qaQueContent, qaQueContent.getUid().toString(), isUserNamesVisible, isLearnerRequest, currentSessionId, userId); - logger.debug("questionAttemptData:..." + questionAttemptData); qaMonitoredAnswersDTO.setQuestionAttempts(questionAttemptData); listMonitoredAnswersContainerDTO.add(qaMonitoredAnswersDTO); } } - logger.debug("final listMonitoredAnswersContainerDTO:..." + listMonitoredAnswersContainerDTO); return listMonitoredAnswersContainerDTO; } @@ -259,18 +233,11 @@ QaQueContent qaQueContent, String questionUid, boolean isUserNamesVisible, boolean isLearnerRequest, String currentSessionId, String userId) { logger.debug("doing buildGroupsAttemptData..."); - logger.debug("isUserNamesVisible: " + isUserNamesVisible); - logger.debug("isLearnerRequest: " + isLearnerRequest); - logger.debug("currentSessionId: " + currentSessionId); - logger.debug("userId: " + userId); - logger.debug("qaService: " + qaService); - Map mapMonitoredAttemptsContainerDTO = new TreeMap(new QaStringComparator()); List listMonitoredAttemptsContainerDTO = new LinkedList(); Map summaryToolSessions = populateToolSessionsId(request, qaContent, qaService); - logger.debug("summaryToolSessions: " + summaryToolSessions); Iterator itMap = summaryToolSessions.entrySet().iterator(); @@ -279,24 +246,16 @@ if (currentSessionId != null) { if (currentSessionId.equals("All")) { - logger.debug("**summary request is for All**:"); while (itMap.hasNext()) { Map.Entry pairs = (Map.Entry) itMap.next(); - logger.debug("using the summary tool sessions pair: " + pairs.getKey() + " = " - + pairs.getValue()); if (!(pairs.getValue().toString().equals("None")) && !(pairs.getValue().toString().equals("All"))) { - logger - .debug("using the numerical summary tool sessions pair: " + " = " - + pairs.getValue()); QaSession qaSession = qaService.retrieveQaSession(new Long(pairs.getValue().toString()) .longValue()); - logger.debug("qaSession: " + " = " + qaSession); + if (qaSession != null) { List listUsers = qaService.getUserBySessionOnly(qaSession); - logger.debug("listMcUsers for session id:" + qaSession.getQaSessionId() + " = " - + listUsers); Map sessionUsersAttempts = populateSessionUsersAttempts(request, qaService, qaSession .getQaSessionId(), listUsers, questionUid, isUserNamesVisible, isLearnerRequest, userId); @@ -305,13 +264,10 @@ } } } else if (!currentSessionId.equals("All")) { - logger.debug("**summary request is for currentSessionId**:" + currentSessionId); QaSession qaSession = qaService .retrieveQaSession(new Long(currentSessionId.toString()).longValue()); - logger.debug("qaSession: " + " = " + qaSession); List listUsers = qaService.getUserBySessionOnly(qaSession); - logger.debug("listUsers: " + " = " + listUsers); Map sessionUsersAttempts = populateSessionUsersAttempts(request, qaService, new Long( currentSessionId), listUsers, questionUid, isUserNamesVisible, isLearnerRequest, userId); @@ -322,7 +278,6 @@ /*request is for learner report, use only the passed tool session in the report. */ logger.debug("using currentSessionId for the learner report:" + currentSessionId); QaSession qaSession = qaService.retrieveQaSession(new Long(currentSessionId).longValue()); - logger.debug("qaSession: " + " = " + qaSession); if (qaSession != null) { List listUsers = null; if (qaContent.isShowOtherAnswers()) { @@ -341,9 +296,7 @@ } } - logger.debug("final listMonitoredAttemptsContainerDTO:..." + listMonitoredAttemptsContainerDTO); mapMonitoredAttemptsContainerDTO = convertToMap(listMonitoredAttemptsContainerDTO); - logger.debug("final mapMonitoredAttemptsContainerDTO:..." + mapMonitoredAttemptsContainerDTO); return mapMonitoredAttemptsContainerDTO; } @@ -360,32 +313,23 @@ */ public static Map populateSessionUsersAttempts(HttpServletRequest request, IQaService qaService, Long sessionId, List listUsers, String questionUid, boolean isUserNamesVisible, boolean isLearnerRequest, String userId) { - logger.debug("isUserNamesVisible: " + isUserNamesVisible); - logger.debug("isLearnerRequest: " + isLearnerRequest); - logger.debug("userId: " + userId); logger.debug("doing populateSessionUsersAttempts..."); - logger.debug("qaService: " + qaService); Map mapMonitoredUserContainerDTO = new TreeMap(new QaStringComparator()); List listMonitoredUserContainerDTO = new LinkedList(); Iterator itUsers = listUsers.iterator(); while (itUsers.hasNext()) { QaQueUsr qaQueUsr = (QaQueUsr) itUsers.next(); - logger.debug("qaQueUsr: " + qaQueUsr); if (qaQueUsr != null) { - logger.debug("getting listUserAttempts for user id: " + qaQueUsr.getUid() + " and que content id: " - + questionUid); List listUserAttempts = qaService.getAttemptsForUserAndQuestionContent(qaQueUsr.getUid(), new Long( questionUid)); - logger.debug("listUserAttempts: " + listUserAttempts); Iterator itAttempts = listUserAttempts.iterator(); while (itAttempts.hasNext()) { QaUsrResp qaUsrResp = (QaUsrResp) itAttempts.next(); - logger.debug("qaUsrResp: " + qaUsrResp); if (qaUsrResp != null) { QaMonitoredUserDTO qaMonitoredUserDTO = new QaMonitoredUserDTO(); @@ -407,7 +351,6 @@ qaMonitoredUserDTO.setResponse(qaUsrResp.getAnswer()); String responsePresentable = QaUtils.replaceNewLines(qaUsrResp.getAnswer()); - logger.debug("responsePresentable: " + responsePresentable); qaMonitoredUserDTO.setResponsePresentable(responsePresentable); qaMonitoredUserDTO.setQuestionUid(questionUid); @@ -417,15 +360,11 @@ } } } - - logger.debug("final listMonitoredUserContainerDTO: " + listMonitoredUserContainerDTO); mapMonitoredUserContainerDTO = convertToMcMonitoredUserDTOMap(listMonitoredUserContainerDTO); - logger.debug("final mapMonitoredUserContainerDTO:..." + mapMonitoredUserContainerDTO); return mapMonitoredUserContainerDTO; } public static Map convertToMcMonitoredUserDTOMap(List list) { - logger.debug("using convertToQaMonitoredUserDTOMap: " + list); Map map = new TreeMap(new QaStringComparator()); Iterator listIterator = list.iterator(); @@ -448,12 +387,10 @@ logger.debug("using the summary tool sessions pair: " + pairs.getKey() + " = " + pairs.getValue()); newMap.put(pairs.getKey(), QaUtils.replaceNewLines(pairs.getValue().toString())); } - logger.debug("newMap: " + newMap); return newMap; } public static Map convertToMap(List list) { - logger.debug("using convertToMap: " + list); Map map = new TreeMap(new QaStringComparator()); Iterator listIterator = list.iterator(); @@ -468,31 +405,23 @@ } public static boolean notebookEntriesExist(IQaService qaService, QaContent qaContent) { - logger.debug("finding out about content level notebook entries: " + qaContent); Iterator iteratorSession = qaContent.getQaSessions().iterator(); while (iteratorSession.hasNext()) { QaSession qaSession = (QaSession) iteratorSession.next(); - logger.debug("qaSession: " + qaSession); if (qaSession != null) { logger.debug("qaSession id: " + qaSession.getQaSessionId()); Iterator iteratorUser = qaSession.getQaQueUsers().iterator(); while (iteratorUser.hasNext()) { QaQueUsr qaQueUsr = (QaQueUsr) iteratorUser.next(); - logger.debug("qaQueUsr: " + qaQueUsr); if (qaQueUsr != null) { - logger.debug("qaQueUsr id: " + qaQueUsr.getQueUsrId()); - logger.debug("attempt getting notebookEntry: "); NotebookEntry notebookEntry = qaService.getEntry(qaSession.getQaSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, MY_SIGNATURE, new Integer(qaQueUsr.getQueUsrId() .intValue())); - - logger.debug("notebookEntry: " + notebookEntry); if (notebookEntry != null) { - logger.debug("found at least one notebookEntry: " + notebookEntry.getEntry()); return true; } @@ -504,19 +433,15 @@ } public static void buildQaStatsDTO(HttpServletRequest request, IQaService qaService, QaContent qaContent) { - logger.debug("building qaStatsDTO: " + qaContent); QaStatsDTO qaStatsDTO = new QaStatsDTO(); int countSessionComplete = 0; int countAllUsers = 0; - logger.debug("finding out about content level notebook entries: " + qaContent); Iterator iteratorSession = qaContent.getQaSessions().iterator(); while (iteratorSession.hasNext()) { QaSession qaSession = (QaSession) iteratorSession.next(); - logger.debug("qaSession: " + qaSession); if (qaSession != null) { - logger.debug("qaSession id: " + qaSession.getQaSessionId()); if (qaSession.getSession_status().equals(COMPLETED)) { ++countSessionComplete; @@ -525,10 +450,8 @@ Iterator iteratorUser = qaSession.getQaQueUsers().iterator(); while (iteratorUser.hasNext()) { QaQueUsr qaQueUsr = (QaQueUsr) iteratorUser.next(); - logger.debug("qaQueUsr: " + qaQueUsr); if (qaQueUsr != null) { - logger.debug("qaQueUsr foundid"); ++countAllUsers; } } @@ -540,17 +463,13 @@ qaStatsDTO.setCountAllUsers(new Integer(countAllUsers).toString()); qaStatsDTO.setCountSessionComplete(new Integer(countSessionComplete).toString()); - logger.debug("qaStatsDTO: " + qaStatsDTO); - request.setAttribute(QA_STATS_DTO, qaStatsDTO); } public static void generateGroupsSessionData(HttpServletRequest request, IQaService qaService, QaContent qaContent, boolean forExport) { - logger.debug("generateGroupsSessionData: " + qaContent); List listAllGroupsDTO = buildGroupBasedSessionData(request, qaContent, qaService); - logger.debug("listAllGroupsDTO: " + listAllGroupsDTO); request.setAttribute(LIST_ALL_GROUPS_DTO, listAllGroupsDTO); @@ -559,22 +478,17 @@ } public static List buildGroupBasedSessionData(HttpServletRequest request, QaContent qaContent, IQaService qaService) { - logger.debug("buildGroupBasedSessionData" + qaContent); - logger.debug("will be building groups question data for content:..." + qaContent); + logger.debug("buildGroupBasedSessionData: " + qaContent.getUid()); List listQuestions = qaService.getAllQuestionEntries(qaContent.getUid()); - logger.debug("listQuestions:..." + listQuestions); List listAllGroupsContainerDTO = new LinkedList(); Iterator iteratorSession = qaContent.getQaSessions().iterator(); while (iteratorSession.hasNext()) { QaSession qaSession = (QaSession) iteratorSession.next(); - logger.debug("iteration for group based session data: " + qaSession); String currentSessionId = qaSession.getQaSessionId().toString(); - logger.debug("currentSessionId: " + currentSessionId); String currentSessionName = qaSession.getSession_name(); - logger.debug("currentSessionName: " + currentSessionName); QaAllGroupsDTO qaAllGroupsDTO = new QaAllGroupsDTO(); List listMonitoredAnswersContainerDTO = new LinkedList(); @@ -583,10 +497,8 @@ Iterator itListQuestions = listQuestions.iterator(); while (itListQuestions.hasNext()) { QaQueContent qaQueContent = (QaQueContent) itListQuestions.next(); - logger.debug("qaQueContent:..." + qaQueContent); if (qaQueContent != null) { - logger.debug("populating QaMonitoredAnswersDTO for : " + qaQueContent); QaMonitoredAnswersDTO qaMonitoredAnswersDTO = new QaMonitoredAnswersDTO(); qaMonitoredAnswersDTO.setQuestionUid(qaQueContent.getUid().toString()); qaMonitoredAnswersDTO.setQuestion(qaQueContent.getQuestion()); @@ -595,29 +507,18 @@ Map questionAttemptData = buildGroupsAttemptData(request, qaContent, qaService, qaQueContent, qaQueContent.getUid().toString(), true, false, currentSessionId, null); - logger.debug("generated questionAttemptData: " + questionAttemptData); qaMonitoredAnswersDTO.setQuestionAttempts(questionAttemptData); - - logger.debug("adding qaMonitoredAnswersDTO to the listMonitoredAnswersContainerDTO: " - + qaMonitoredAnswersDTO); listMonitoredAnswersContainerDTO.add(qaMonitoredAnswersDTO); } } } - logger.debug("listMonitoredAnswersContainerDTO:" + listMonitoredAnswersContainerDTO); - logger.debug("adding listMonitoredAnswersContainerDTO to the qaAllGroupsDTO:" - + listMonitoredAnswersContainerDTO); qaAllGroupsDTO.setGroupData(listMonitoredAnswersContainerDTO); qaAllGroupsDTO.setSessionName(currentSessionName); qaAllGroupsDTO.setSessionId(currentSessionId); - - logger.debug("built qaAllGroupsDTO:" + qaAllGroupsDTO); listAllGroupsContainerDTO.add(qaAllGroupsDTO); } - - logger.debug("final listAllGroupsContainerDTO:..." + listAllGroupsContainerDTO); return listAllGroupsContainerDTO; } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java =================================================================== diff -u -rc527318c8c79f72151f6261342c5cc1a830d1e4d -r328cd4dbe60d9e5c588e13cc16b7e7414893b0af --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java (.../QaAction.java) (revision c527318c8c79f72151f6261342c5cc1a830d1e4d) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java (.../QaAction.java) (revision 328cd4dbe60d9e5c588e13cc16b7e7414893b0af) @@ -210,84 +210,64 @@ public ActionForward submitAllContent(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - QaAction.logger.debug("dispathcing submitAllContent :" + form); QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form; IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaAction.logger.debug("qaService: " + qaService); String httpSessionID = qaAuthoringForm.getHttpSessionID(); - QaAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - QaAction.logger.debug("sessionMap: " + sessionMap); SortedSet conditionSet = (SortedSet) sessionMap .get(QaAppConstants.ATTR_CONDITION_SET); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - QaAction.logger.debug("contentFolderID: " + contentFolderID); qaAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE); - QaAction.logger.debug("activeModule: " + activeModule); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - QaAction.logger.debug("strToolContentID: " + strToolContentID); String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR); - QaAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr); List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY); - QaAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO); Map mapQuestionContent = AuthoringUtil.extractMapQuestionContent(listQuestionContentDTO); - QaAction.logger.debug("extracted mapQuestionContent: " + mapQuestionContent); Map mapFeedback = AuthoringUtil.extractMapFeedback(listQuestionContentDTO); - QaAction.logger.debug("extracted mapFeedback: " + mapFeedback); ActionMessages errors = new ActionMessages(); - QaAction.logger.debug("mapQuestionContent size: " + mapQuestionContent.size()); if (mapQuestionContent.size() == 0) { ActionMessage error = new ActionMessage("questions.none.submitted"); errors.add(ActionMessages.GLOBAL_MESSAGE, error); } - QaAction.logger.debug("errors: " + errors); AuthoringUtil authoringUtil = new AuthoringUtil(); QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO(); - QaAction.logger.debug("activeModule: " + activeModule); if (activeModule.equals(QaAppConstants.AUTHORING)) { List attachmentListBackup = new ArrayList(); List attachmentList = (List) sessionMap.get(QaAppConstants.ATTACHMENT_LIST_KEY); - QaAction.logger.debug("attachmentList: " + attachmentList); attachmentListBackup = attachmentList; List deletedAttachmentListBackup = new ArrayList(); List deletedAttachmentList = (List) sessionMap.get(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY); - QaAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList); deletedAttachmentListBackup = deletedAttachmentList; String onlineInstructions = (String) sessionMap.get(QaAppConstants.ONLINE_INSTRUCTIONS_KEY); - QaAction.logger.debug("onlineInstructions: " + onlineInstructions); qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); String offlineInstructions = (String) sessionMap.get(QaAppConstants.OFFLINE_INSTRUCTIONS_KEY); - QaAction.logger.debug("offlineInstructions: " + offlineInstructions); qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions); qaGeneralAuthoringDTO.setAttachmentList(attachmentList); qaGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList); String strOnlineInstructions = request.getParameter("onlineInstructions"); String strOfflineInstructions = request.getParameter("offlineInstructions"); - QaAction.logger.debug("onlineInstructions: " + strOnlineInstructions); - QaAction.logger.debug("offlineInstructions: " + strOfflineInstructions); qaAuthoringForm.setOfflineInstructions(strOfflineInstructions); qaAuthoringForm.setOnlineInstructions(strOnlineInstructions); @@ -298,8 +278,6 @@ String richTextTitle = request.getParameter(QaAppConstants.TITLE); String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS); - QaAction.logger.debug("richTextTitle: " + richTextTitle); - QaAction.logger.debug("richTextInstructions: " + richTextInstructions); qaGeneralAuthoringDTO.setActivityTitle(richTextTitle); qaAuthoringForm.setTitle(richTextTitle); @@ -310,17 +288,12 @@ sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); qaGeneralAuthoringDTO.setMapQuestionContent(mapQuestionContent); - QaAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); - QaAction.logger.debug("qaGeneralAuthoringDTO now: " + qaGeneralAuthoringDTO); request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO); - QaAction.logger.debug("there are no issues with input, continue and submit data"); QaContent qaContentTest = qaService.loadQa(new Long(strToolContentID).longValue()); - QaAction.logger.debug("qaContentTest: " + qaContentTest); - QaAction.logger.debug("errors: " + errors); if (!errors.isEmpty()) { saveErrors(request, errors); QaAction.logger.debug("errors saved: " + errors); @@ -329,7 +302,6 @@ QaContent qaContent = qaContentTest; if (errors.isEmpty()) { - QaAction.logger.debug("errors is empty: " + errors); /* * to remove deleted entries in the questions table based on mapQuestionContent */ @@ -339,7 +311,6 @@ qaContent = authoringUtil.saveOrUpdateQaContent(mapQuestionContent, mapFeedback, qaService, qaAuthoringForm, request, qaContentTest, strToolContentID, conditionSet); - QaAction.logger.debug("qaContent: " + qaContent); long defaultContentID = 0; QaAction.logger.debug("attempt retrieving tool with signatute : " + QaAppConstants.MY_SIGNATURE); @@ -349,7 +320,6 @@ if (qaContent != null) { qaGeneralAuthoringDTO.setDefaultContentIdStr(new Long(defaultContentID).toString()); } - QaAction.logger.debug("updated qaGeneralAuthoringDTO to: " + qaGeneralAuthoringDTO); authoringUtil.reOrganizeDisplayOrder(mapQuestionContent, qaService, qaAuthoringForm, qaContent); @@ -413,7 +383,6 @@ qaAuthoringForm.resetUserAction(); qaGeneralAuthoringDTO.setMapQuestionContent(mapQuestionContent); - QaAction.logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO); request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO); @@ -455,58 +424,39 @@ QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form; IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaAction.logger.debug("qaService: " + qaService); String httpSessionID = qaAuthoringForm.getHttpSessionID(); - QaAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - QaAction.logger.debug("sessionMap: " + sessionMap); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - QaAction.logger.debug("contentFolderID: " + contentFolderID); qaAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE); - QaAction.logger.debug("activeModule: " + activeModule); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - QaAction.logger.debug("strToolContentID: " + strToolContentID); String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR); - QaAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr); String editQuestionBoxRequest = request.getParameter("editQuestionBoxRequest"); - QaAction.logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest); QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaAction.logger.debug("qaContent: " + qaContent); - /* - * if (qaContent == null) { logger.debug("using defaultContentIdStr: " + defaultContentIdStr); - * qaContent=qaService.loadQa(new Long(defaultContentIdStr).longValue()); } - */ - QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO(); - QaAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); qaGeneralAuthoringDTO.setContentFolderID(contentFolderID); qaGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString()); AuthoringUtil authoringUtil = new AuthoringUtil(); List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY); - QaAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO); String newQuestion = request.getParameter("newQuestion"); - QaAction.logger.debug("newQuestion: " + newQuestion); String feedback = request.getParameter("feedback"); - QaAction.logger.debug("feedback: " + feedback); String editableQuestionIndex = request.getParameter("editableQuestionIndex"); - QaAction.logger.debug("editableQuestionIndex: " + editableQuestionIndex); if (newQuestion != null && newQuestion.length() > 0) { if (editQuestionBoxRequest != null && editQuestionBoxRequest.equals("false")) { @@ -519,12 +469,10 @@ Iterator listIterator = listQuestionContentDTO.iterator(); while (listIterator.hasNext()) { qaQuestionContentDTO = (QaQuestionContentDTO) listIterator.next(); - QaAction.logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO); - QaAction.logger.debug("qaQuestionContentDTO question:" + qaQuestionContentDTO.getQuestion()); - + String question = qaQuestionContentDTO.getQuestion(); String displayOrder = qaQuestionContentDTO.getDisplayOrder(); - QaAction.logger.debug("displayOrder:" + displayOrder); + if (displayOrder != null && !displayOrder.equals("")) { if (displayOrder.equals(editableQuestionIndex)) { @@ -533,16 +481,13 @@ } } - QaAction.logger.debug("qaQuestionContentDTO found:" + qaQuestionContentDTO); qaQuestionContentDTO.setQuestion(newQuestion); qaQuestionContentDTO.setFeedback(feedback); qaQuestionContentDTO.setDisplayOrder(editableQuestionIndex); listQuestionContentDTO = AuthoringUtil.reorderUpdateListQuestionContentDTO(listQuestionContentDTO, qaQuestionContentDTO, editableQuestionIndex); - QaAction.logger.debug("post reorderUpdateListQuestionContentDTO listQuestionContentDTO: " - + listQuestionContentDTO); } else { QaAction.logger.debug("duplicate question entry, not adding"); } @@ -552,12 +497,9 @@ Iterator listIterator = listQuestionContentDTO.iterator(); while (listIterator.hasNext()) { qaQuestionContentDTO = (QaQuestionContentDTO) listIterator.next(); - QaAction.logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO); - QaAction.logger.debug("qaQuestionContentDTO question:" + qaQuestionContentDTO.getQuestion()); String question = qaQuestionContentDTO.getQuestion(); String displayOrder = qaQuestionContentDTO.getDisplayOrder(); - QaAction.logger.debug("displayOrder:" + displayOrder); if (displayOrder != null && !displayOrder.equals("")) { if (displayOrder.equals(editableQuestionIndex)) { @@ -566,30 +508,24 @@ } } - QaAction.logger.debug("qaQuestionContentDTO found:" + qaQuestionContentDTO); qaQuestionContentDTO.setQuestion(newQuestion); qaQuestionContentDTO.setFeedback(feedback); qaQuestionContentDTO.setDisplayOrder(editableQuestionIndex); listQuestionContentDTO = AuthoringUtil.reorderUpdateListQuestionContentDTO(listQuestionContentDTO, qaQuestionContentDTO, editableQuestionIndex); - QaAction.logger.debug("post reorderUpdateListQuestionContentDTO listQuestionContentDTO: " - + listQuestionContentDTO); } } else { QaAction.logger.debug("entry blank, not adding"); } request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO); sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO); - QaAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO); String richTextTitle = request.getParameter(QaAppConstants.TITLE); String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS); - QaAction.logger.debug("richTextTitle: " + richTextTitle); - QaAction.logger.debug("richTextInstructions: " + richTextInstructions); qaGeneralAuthoringDTO.setActivityTitle(richTextTitle); qaAuthoringForm.setTitle(richTextTitle); @@ -598,29 +534,24 @@ sessionMap.put(QaAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); - QaAction.logger.debug("activeModule: " + activeModule); + if (activeModule.equals(QaAppConstants.AUTHORING)) { String onlineInstructions = (String) sessionMap.get(QaAppConstants.ONLINE_INSTRUCTIONS_KEY); - QaAction.logger.debug("onlineInstructions: " + onlineInstructions); + qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); String offlineInstructions = (String) sessionMap.get(QaAppConstants.OFFLINE_INSTRUCTIONS_KEY); - QaAction.logger.debug("offlineInstructions: " + offlineInstructions); qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions); List attachmentList = (List) sessionMap.get(QaAppConstants.ATTACHMENT_LIST_KEY); - QaAction.logger.debug("attachmentList: " + attachmentList); List deletedAttachmentList = (List) sessionMap.get(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY); - QaAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList); qaGeneralAuthoringDTO.setAttachmentList(attachmentList); qaGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList); String strOnlineInstructions = request.getParameter("onlineInstructions"); String strOfflineInstructions = request.getParameter("offlineInstructions"); - QaAction.logger.debug("onlineInstructions: " + strOnlineInstructions); - QaAction.logger.debug("offlineInstructions: " + strOfflineInstructions); qaAuthoringForm.setOnlineInstructions(strOnlineInstructions); qaAuthoringForm.setOfflineInstructions(strOfflineInstructions); @@ -629,7 +560,6 @@ qaGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString()); request.getSession().setAttribute(httpSessionID, sessionMap); - sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO); QaUtils.setFormProperties(request, qaService, qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID, defaultContentIdStr, activeModule, sessionMap, httpSessionID); @@ -647,15 +577,11 @@ qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); - QaAction.logger.debug("qaGeneralAuthoringDTO now: " + qaGeneralAuthoringDTO); request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO); QaAction.logger.debug("httpSessionID: " + httpSessionID); - QaAction.logger.debug("sessionMap: " + sessionMap); request.getSession().setAttribute(httpSessionID, sessionMap); - QaAction.logger.debug("qaGeneralAuthoringDTO.getMapQuestionContent(); " - + qaGeneralAuthoringDTO.getMapQuestionContent()); request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size())); @@ -677,62 +603,41 @@ public ActionForward addSingleQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - QaAction.logger.debug("dispathcing addSingleQuestion"); QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form; IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaAction.logger.debug("qaService: " + qaService); String httpSessionID = qaAuthoringForm.getHttpSessionID(); - QaAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - QaAction.logger.debug("sessionMap: " + sessionMap); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - QaAction.logger.debug("contentFolderID: " + contentFolderID); qaAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE); - QaAction.logger.debug("activeModule: " + activeModule); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - QaAction.logger.debug("strToolContentID: " + strToolContentID); String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR); - QaAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr); - QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaAction.logger.debug("qaContent: " + qaContent); - /* - * if (qaContent == null) { logger.debug("using defaultContentIdStr: " + defaultContentIdStr); - * qaContent=qaService.loadQa(new Long(defaultContentIdStr).longValue()); } logger.debug("final qaContent: " + - * qaContent); - */ - QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO(); - QaAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); + qaGeneralAuthoringDTO.setContentFolderID(contentFolderID); qaGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString()); AuthoringUtil authoringUtil = new AuthoringUtil(); List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY); - QaAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO); String newQuestion = request.getParameter("newQuestion"); - QaAction.logger.debug("newQuestion: " + newQuestion); String feedback = request.getParameter("feedback"); - QaAction.logger.debug("feedback: " + feedback); int listSize = listQuestionContentDTO.size(); - QaAction.logger.debug("listSize: " + listSize); if (newQuestion != null && newQuestion.length() > 0) { boolean duplicates = AuthoringUtil.checkDuplicateQuestions(listQuestionContentDTO, newQuestion); - QaAction.logger.debug("duplicates: " + duplicates); if (!duplicates) { QaQuestionContentDTO qaQuestionContentDTO = new QaQuestionContentDTO(); @@ -741,22 +646,12 @@ qaQuestionContentDTO.setQuestion(newQuestion); listQuestionContentDTO.add(qaQuestionContentDTO); - QaAction.logger.debug("updated listQuestionContentDTO: " + listQuestionContentDTO); } else { QaAction.logger.debug("entry duplicate, not adding"); - /* - * ActionMessages errors = new ActionMessages(); ActionMessage error = new - * ActionMessage("question.duplicate"); errors.add(ActionMessages.GLOBAL_MESSAGE, error); - * saveErrors(request, errors); logger.debug("errors saved: " + errors); - */ + } } else { QaAction.logger.debug("entry blank, not adding"); - /* - * ActionMessages errors = new ActionMessages(); ActionMessage error = new ActionMessage("question.blank"); - * errors.add(ActionMessages.GLOBAL_MESSAGE, error); saveErrors(request, errors); logger.debug("errors - * saved: " + errors); - */ } request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO); @@ -765,8 +660,6 @@ String richTextTitle = request.getParameter(QaAppConstants.TITLE); String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS); - QaAction.logger.debug("richTextTitle: " + richTextTitle); - QaAction.logger.debug("richTextInstructions: " + richTextInstructions); qaGeneralAuthoringDTO.setActivityTitle(richTextTitle); qaAuthoringForm.setTitle(richTextTitle); @@ -778,26 +671,20 @@ QaAction.logger.debug("activeModule: " + activeModule); if (activeModule.equals(QaAppConstants.AUTHORING)) { String onlineInstructions = (String) sessionMap.get(QaAppConstants.ONLINE_INSTRUCTIONS_KEY); - QaAction.logger.debug("onlineInstructions: " + onlineInstructions); qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); String offlineInstructions = (String) sessionMap.get(QaAppConstants.OFFLINE_INSTRUCTIONS_KEY); - QaAction.logger.debug("offlineInstructions: " + offlineInstructions); qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions); List attachmentList = (List) sessionMap.get(QaAppConstants.ATTACHMENT_LIST_KEY); - QaAction.logger.debug("attachmentList: " + attachmentList); List deletedAttachmentList = (List) sessionMap.get(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY); - QaAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList); qaGeneralAuthoringDTO.setAttachmentList(attachmentList); qaGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList); String strOnlineInstructions = request.getParameter("onlineInstructions"); String strOfflineInstructions = request.getParameter("offlineInstructions"); - QaAction.logger.debug("onlineInstructions: " + strOnlineInstructions); - QaAction.logger.debug("offlineInstructions: " + strOfflineInstructions); qaAuthoringForm.setOnlineInstructions(strOnlineInstructions); qaAuthoringForm.setOfflineInstructions(strOfflineInstructions); } @@ -821,17 +708,12 @@ qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); - QaAction.logger.debug("qaGeneralAuthoringDTO now: " + qaGeneralAuthoringDTO); request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO); QaAction.logger.debug("httpSessionID: " + httpSessionID); - QaAction.logger.debug("sessionMap: " + sessionMap); request.getSession().setAttribute(httpSessionID, sessionMap); - QaAction.logger.debug("qaGeneralAuthoringDTO.getMapQuestionContent(); " - + qaGeneralAuthoringDTO.getMapQuestionContent()); - request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size())); QaAction.logger.debug("fwd ing to LOAD_QUESTIONS: " + QaAppConstants.LOAD_QUESTIONS); @@ -856,46 +738,31 @@ QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form; IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaAction.logger.debug("qaService: " + qaService); String httpSessionID = qaAuthoringForm.getHttpSessionID(); - QaAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - QaAction.logger.debug("sessionMap: " + sessionMap); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - QaAction.logger.debug("contentFolderID: " + contentFolderID); + qaAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE); - QaAction.logger.debug("activeModule: " + activeModule); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - QaAction.logger.debug("strToolContentID: " + strToolContentID); String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR); - QaAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr); - QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaAction.logger.debug("qaContent: " + qaContent); - - /* - * if (qaContent == null) { logger.debug("using defaultContentIdStr: " + defaultContentIdStr); - * qaContent=qaService.loadQa(new Long(defaultContentIdStr).longValue()); } logger.debug("final qaContent: " + - * qaContent); - */ - QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO(); - QaAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); + qaGeneralAuthoringDTO.setContentFolderID(contentFolderID); String richTextTitle = request.getParameter(QaAppConstants.TITLE); + String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS); - QaAction.logger.debug("richTextTitle: " + richTextTitle); - QaAction.logger.debug("richTextInstructions: " + richTextInstructions); qaGeneralAuthoringDTO.setActivityTitle(richTextTitle); + qaAuthoringForm.setTitle(richTextTitle); qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); @@ -907,19 +774,15 @@ if (activeModule.equals(QaAppConstants.AUTHORING)) { String strOnlineInstructions = request.getParameter("onlineInstructions"); String strOfflineInstructions = request.getParameter("offlineInstructions"); - QaAction.logger.debug("onlineInstructions: " + strOnlineInstructions); - QaAction.logger.debug("offlineInstructions: " + strOnlineInstructions); qaAuthoringForm.setOnlineInstructions(strOnlineInstructions); qaAuthoringForm.setOfflineInstructions(strOfflineInstructions); } qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); - QaAction.logger.debug("qaGeneralAuthoringDTO now: " + qaGeneralAuthoringDTO); request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO); List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY); - QaAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO); request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size())); @@ -952,70 +815,53 @@ QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form; IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaAction.logger.debug("qaService: " + qaService); String httpSessionID = qaAuthoringForm.getHttpSessionID(); - QaAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - QaAction.logger.debug("sessionMap: " + sessionMap); String questionIndex = request.getParameter("questionIndex"); - QaAction.logger.debug("questionIndex: " + questionIndex); qaAuthoringForm.setEditableQuestionIndex(questionIndex); List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY); - QaAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO); String editableQuestion = ""; String editableFeedback = ""; Iterator listIterator = listQuestionContentDTO.iterator(); while (listIterator.hasNext()) { QaQuestionContentDTO qaQuestionContentDTO = (QaQuestionContentDTO) listIterator.next(); - QaAction.logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO); - QaAction.logger.debug("qaQuestionContentDTO question:" + qaQuestionContentDTO.getQuestion()); String question = qaQuestionContentDTO.getQuestion(); String displayOrder = qaQuestionContentDTO.getDisplayOrder(); if (displayOrder != null && !displayOrder.equals("")) { if (displayOrder.equals(questionIndex)) { editableFeedback = qaQuestionContentDTO.getFeedback(); editableQuestion = qaQuestionContentDTO.getQuestion(); - QaAction.logger.debug("editableFeedback found :" + editableFeedback); break; } } } - QaAction.logger.debug("editableFeedback found :" + editableFeedback); - QaAction.logger.debug("editableQuestion found :" + editableQuestion); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - QaAction.logger.debug("contentFolderID: " + contentFolderID); qaAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE); - QaAction.logger.debug("activeModule: " + activeModule); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - QaAction.logger.debug("strToolContentID: " + strToolContentID); String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR); - QaAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr); QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaAction.logger.debug("qaContent: " + qaContent); QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO(); - QaAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); + qaGeneralAuthoringDTO.setContentFolderID(contentFolderID); String richTextTitle = request.getParameter(QaAppConstants.TITLE); String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS); - QaAction.logger.debug("richTextTitle: " + richTextTitle); - QaAction.logger.debug("richTextInstructions: " + richTextInstructions); qaGeneralAuthoringDTO.setActivityTitle(richTextTitle); qaAuthoringForm.setTitle(richTextTitle); @@ -1030,7 +876,6 @@ qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); - QaAction.logger.debug("qaGeneralAuthoringDTO now: " + qaGeneralAuthoringDTO); request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO); request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size())); @@ -1039,8 +884,6 @@ if (activeModule.equals(QaAppConstants.AUTHORING)) { String strOnlineInstructions = request.getParameter("onlineInstructions"); String strOfflineInstructions = request.getParameter("offlineInstructions"); - QaAction.logger.debug("onlineInstructions: " + strOnlineInstructions); - QaAction.logger.debug("offlineInstructions: " + strOnlineInstructions); qaAuthoringForm.setOnlineInstructions(strOnlineInstructions); qaAuthoringForm.setOfflineInstructions(strOfflineInstructions); } @@ -1065,34 +908,25 @@ */ public ActionForward removeQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - QaAction.logger.debug("dispatching removeQuestion"); QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form; IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaAction.logger.debug("qaService: " + qaService); String httpSessionID = qaAuthoringForm.getHttpSessionID(); - QaAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - QaAction.logger.debug("sessionMap: " + sessionMap); String questionIndex = request.getParameter("questionIndex"); - QaAction.logger.debug("questionIndex: " + questionIndex); List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY); - QaAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO); QaQuestionContentDTO qaQuestionContentDTO = null; Iterator listIterator = listQuestionContentDTO.iterator(); while (listIterator.hasNext()) { qaQuestionContentDTO = (QaQuestionContentDTO) listIterator.next(); - QaAction.logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO); - QaAction.logger.debug("qaQuestionContentDTO question:" + qaQuestionContentDTO.getQuestion()); - + String question = qaQuestionContentDTO.getQuestion(); String displayOrder = qaQuestionContentDTO.getDisplayOrder(); - QaAction.logger.debug("displayOrder:" + displayOrder); if (displayOrder != null && !displayOrder.equals("")) { if (displayOrder.equals(questionIndex)) { @@ -1102,7 +936,6 @@ } } - QaAction.logger.debug("qaQuestionContentDTO found:" + qaQuestionContentDTO); qaQuestionContentDTO.setQuestion(""); SortedSet list = (SortedSet) sessionMap.get(QaAppConstants.ATTR_CONDITION_SET); @@ -1121,46 +954,36 @@ } } - QaAction.logger.debug("listQuestionContentDTO after remove:" + listQuestionContentDTO); listQuestionContentDTO = AuthoringUtil.reorderListQuestionContentDTO(listQuestionContentDTO, questionIndex); QaAction.logger.debug("listQuestionContentDTO reordered:" + listQuestionContentDTO); - sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - QaAction.logger.debug("contentFolderID: " + contentFolderID); + qaAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE); - QaAction.logger.debug("activeModule: " + activeModule); String richTextTitle = request.getParameter(QaAppConstants.TITLE); - QaAction.logger.debug("richTextTitle: " + richTextTitle); String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS); - QaAction.logger.debug("richTextInstructions: " + richTextInstructions); sessionMap.put(QaAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - QaAction.logger.debug("strToolContentID: " + strToolContentID); String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR); - QaAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr); QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaAction.logger.debug("qaContent: " + qaContent); if (qaContent == null) { QaAction.logger.debug("using defaultContentIdStr: " + defaultContentIdStr); qaContent = qaService.loadQa(new Long(defaultContentIdStr).longValue()); } - QaAction.logger.debug("final qaContent: " + qaContent); QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO(); - QaAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); qaGeneralAuthoringDTO.setContentFolderID(contentFolderID); qaGeneralAuthoringDTO.setActivityTitle(richTextTitle); @@ -1171,25 +994,19 @@ QaAction.logger.debug("activeModule: " + activeModule); if (activeModule.equals(QaAppConstants.AUTHORING)) { String onlineInstructions = (String) sessionMap.get(QaAppConstants.ONLINE_INSTRUCTIONS_KEY); - QaAction.logger.debug("onlineInstructions: " + onlineInstructions); qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); String offlineInstructions = (String) sessionMap.get(QaAppConstants.OFFLINE_INSTRUCTIONS_KEY); - QaAction.logger.debug("offlineInstructions: " + offlineInstructions); qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions); List attachmentList = (List) sessionMap.get(QaAppConstants.ATTACHMENT_LIST_KEY); - QaAction.logger.debug("attachmentList: " + attachmentList); List deletedAttachmentList = (List) sessionMap.get(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY); - QaAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList); qaGeneralAuthoringDTO.setAttachmentList(attachmentList); qaGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList); String strOnlineInstructions = request.getParameter("onlineInstructions"); String strOfflineInstructions = request.getParameter("offlineInstructions"); - QaAction.logger.debug("onlineInstructions: " + strOnlineInstructions); - QaAction.logger.debug("offlineInstructions: " + strOnlineInstructions); qaAuthoringForm.setOnlineInstructions(strOnlineInstructions); qaAuthoringForm.setOfflineInstructions(strOfflineInstructions); } @@ -1214,12 +1031,9 @@ qaAuthoringForm.setCurrentTab("1"); request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO); - QaAction.logger.debug("qaQuestionContentDTO now: " + qaQuestionContentDTO); - QaAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO); qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); - QaAction.logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO); request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size())); @@ -1245,58 +1059,43 @@ QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form; IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaAction.logger.debug("qaService: " + qaService); String httpSessionID = qaAuthoringForm.getHttpSessionID(); - QaAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - QaAction.logger.debug("sessionMap: " + sessionMap); String questionIndex = request.getParameter("questionIndex"); - QaAction.logger.debug("questionIndex: " + questionIndex); List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY); - QaAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO); SortedSet conditionSet = (SortedSet) sessionMap .get(QaAppConstants.ATTR_CONDITION_SET); listQuestionContentDTO = AuthoringUtil.swapNodes(listQuestionContentDTO, questionIndex, "down", conditionSet); - QaAction.logger.debug("listQuestionContentDTO after swap: " + listQuestionContentDTO); listQuestionContentDTO = AuthoringUtil.reorderSimpleListQuestionContentDTO(listQuestionContentDTO); - QaAction.logger.debug("listQuestionContentDTO after reordersimple: " + listQuestionContentDTO); sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - QaAction.logger.debug("contentFolderID: " + contentFolderID); qaAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE); - QaAction.logger.debug("activeModule: " + activeModule); String richTextTitle = request.getParameter(QaAppConstants.TITLE); - QaAction.logger.debug("richTextTitle: " + richTextTitle); String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS); - QaAction.logger.debug("richTextInstructions: " + richTextInstructions); sessionMap.put(QaAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - QaAction.logger.debug("strToolContentID: " + strToolContentID); String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR); - QaAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr); QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaAction.logger.debug("qaContent: " + qaContent); QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO(); - QaAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); qaGeneralAuthoringDTO.setContentFolderID(contentFolderID); qaGeneralAuthoringDTO.setActivityTitle(richTextTitle); @@ -1307,25 +1106,19 @@ QaAction.logger.debug("activeModule: " + activeModule); if (activeModule.equals(QaAppConstants.AUTHORING)) { String onlineInstructions = (String) sessionMap.get(QaAppConstants.ONLINE_INSTRUCTIONS_KEY); - QaAction.logger.debug("onlineInstructions: " + onlineInstructions); qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); String offlineInstructions = (String) sessionMap.get(QaAppConstants.OFFLINE_INSTRUCTIONS_KEY); - QaAction.logger.debug("offlineInstructions: " + offlineInstructions); qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions); List attachmentList = (List) sessionMap.get(QaAppConstants.ATTACHMENT_LIST_KEY); - QaAction.logger.debug("attachmentList: " + attachmentList); List deletedAttachmentList = (List) sessionMap.get(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY); - QaAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList); qaGeneralAuthoringDTO.setAttachmentList(attachmentList); qaGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList); String strOnlineInstructions = request.getParameter("onlineInstructions"); String strOfflineInstructions = request.getParameter("offlineInstructions"); - QaAction.logger.debug("onlineInstructions: " + strOnlineInstructions); - QaAction.logger.debug("offlineInstructions: " + strOnlineInstructions); qaAuthoringForm.setOnlineInstructions(strOnlineInstructions); qaAuthoringForm.setOfflineInstructions(strOfflineInstructions); } @@ -1350,11 +1143,9 @@ qaAuthoringForm.setCurrentTab("1"); request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO); - QaAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO); qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); - QaAction.logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO); request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size())); @@ -1376,89 +1167,70 @@ */ public ActionForward moveQuestionUp(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - QaAction.logger.debug("dispatching moveQuestionUp"); QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form; IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaAction.logger.debug("qaService: " + qaService); String httpSessionID = qaAuthoringForm.getHttpSessionID(); - QaAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - QaAction.logger.debug("sessionMap: " + sessionMap); String questionIndex = request.getParameter("questionIndex"); - QaAction.logger.debug("questionIndex: " + questionIndex); List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY); - QaAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO); + SortedSet conditionSet = (SortedSet) sessionMap .get(QaAppConstants.ATTR_CONDITION_SET); listQuestionContentDTO = AuthoringUtil.swapNodes(listQuestionContentDTO, questionIndex, "up", conditionSet); - QaAction.logger.debug("listQuestionContentDTO after swap: " + listQuestionContentDTO); listQuestionContentDTO = AuthoringUtil.reorderSimpleListQuestionContentDTO(listQuestionContentDTO); - QaAction.logger.debug("listQuestionContentDTO after reordersimple: " + listQuestionContentDTO); sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - QaAction.logger.debug("contentFolderID: " + contentFolderID); + qaAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE); - QaAction.logger.debug("activeModule: " + activeModule); String richTextTitle = request.getParameter(QaAppConstants.TITLE); - QaAction.logger.debug("richTextTitle: " + richTextTitle); String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS); - QaAction.logger.debug("richTextInstructions: " + richTextInstructions); sessionMap.put(QaAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - QaAction.logger.debug("strToolContentID: " + strToolContentID); String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR); - QaAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr); QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaAction.logger.debug("qaContent: " + qaContent); QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO(); - QaAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); + qaGeneralAuthoringDTO.setContentFolderID(contentFolderID); qaGeneralAuthoringDTO.setActivityTitle(richTextTitle); qaAuthoringForm.setTitle(richTextTitle); qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); - QaAction.logger.debug("activeModule: " + activeModule); + if (activeModule.equals(QaAppConstants.AUTHORING)) { String onlineInstructions = (String) sessionMap.get(QaAppConstants.ONLINE_INSTRUCTIONS_KEY); - QaAction.logger.debug("onlineInstructions: " + onlineInstructions); qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); String offlineInstructions = (String) sessionMap.get(QaAppConstants.OFFLINE_INSTRUCTIONS_KEY); - QaAction.logger.debug("offlineInstructions: " + offlineInstructions); qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions); List attachmentList = (List) sessionMap.get(QaAppConstants.ATTACHMENT_LIST_KEY); - QaAction.logger.debug("attachmentList: " + attachmentList); List deletedAttachmentList = (List) sessionMap.get(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY); - QaAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList); qaGeneralAuthoringDTO.setAttachmentList(attachmentList); qaGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList); String strOnlineInstructions = request.getParameter("onlineInstructions"); String strOfflineInstructions = request.getParameter("offlineInstructions"); - QaAction.logger.debug("onlineInstructions: " + strOnlineInstructions); - QaAction.logger.debug("offlineInstructions: " + strOnlineInstructions); qaAuthoringForm.setOnlineInstructions(strOnlineInstructions); qaAuthoringForm.setOfflineInstructions(strOfflineInstructions); } @@ -1483,11 +1255,9 @@ qaAuthoringForm.setCurrentTab("1"); request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO); - QaAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO); qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); - QaAction.logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO); request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size())); @@ -1516,46 +1286,35 @@ QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form; IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaAction.logger.debug("qaService: " + qaService); - + String httpSessionID = qaAuthoringForm.getHttpSessionID(); - QaAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - QaAction.logger.debug("sessionMap: " + sessionMap); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - QaAction.logger.debug("contentFolderID: " + contentFolderID); qaAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE); - QaAction.logger.debug("activeModule: " + activeModule); String onlineInstructions = request.getParameter(QaAppConstants.ONLINE_INSTRUCTIONS); - QaAction.logger.debug("onlineInstructions: " + onlineInstructions); String offlineInstructions = request.getParameter(QaAppConstants.OFFLINE_INSTRUCTIONS); - QaAction.logger.debug("offlineInstructions: " + offlineInstructions); sessionMap.put(QaAppConstants.ONLINE_INSTRUCTIONS_KEY, onlineInstructions); sessionMap.put(QaAppConstants.OFFLINE_INSTRUCTIONS, offlineInstructions); List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY); - QaAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO); request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - QaAction.logger.debug("strToolContentID: " + strToolContentID); String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR); - QaAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr); QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaAction.logger.debug("qaContent: " + qaContent); QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO(); - QaAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); + qaGeneralAuthoringDTO.setContentFolderID(contentFolderID); qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); @@ -1566,8 +1325,6 @@ String richTextTitle = request.getParameter(QaAppConstants.TITLE); String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS); - QaAction.logger.debug("richTextTitle: " + richTextTitle); - QaAction.logger.debug("richTextInstructions: " + richTextInstructions); qaGeneralAuthoringDTO.setActivityTitle(richTextTitle); qaAuthoringForm.setTitle(richTextTitle); @@ -1577,14 +1334,10 @@ sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); List attachmentList = (List) sessionMap.get(QaAppConstants.ATTACHMENT_LIST_KEY); - QaAction.logger.debug("attachmentList: " + attachmentList); List deletedAttachmentList = (List) sessionMap.get(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY); - QaAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList); addFileToContentRepository(request, qaAuthoringForm, attachmentList, deletedAttachmentList, sessionMap, qaGeneralAuthoringDTO); - QaAction.logger.debug("post addFileToContentRepository, attachmentList: " + attachmentList); - QaAction.logger.debug("post addFileToContentRepository, deletedAttachmentList: " + deletedAttachmentList); sessionMap.put(QaAppConstants.ATTACHMENT_LIST_KEY, attachmentList); sessionMap.put(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY, deletedAttachmentList); @@ -1606,15 +1359,13 @@ qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr); qaAuthoringForm.setCurrentTab("3"); - QaAction.logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO); qaAuthoringForm.resetUserAction(); String strOnlineInstructions = request.getParameter("onlineInstructions"); String strOfflineInstructions = request.getParameter("offlineInstructions"); - QaAction.logger.debug("onlineInstructions: " + strOnlineInstructions); - QaAction.logger.debug("offlineInstructions: " + strOnlineInstructions); + qaAuthoringForm.setOnlineInstructions(strOnlineInstructions); qaAuthoringForm.setOfflineInstructions(strOfflineInstructions); @@ -1644,37 +1395,28 @@ QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form; IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaAction.logger.debug("qaService: " + qaService); String httpSessionID = qaAuthoringForm.getHttpSessionID(); - QaAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - QaAction.logger.debug("sessionMap: " + sessionMap); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - QaAction.logger.debug("contentFolderID: " + contentFolderID); qaAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE); - QaAction.logger.debug("activeModule: " + activeModule); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - QaAction.logger.debug("strToolContentID: " + strToolContentID); String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR); - QaAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr); List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY); - QaAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO); request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO); QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaAction.logger.debug("qaContent: " + qaContent); QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO(); - QaAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); + qaGeneralAuthoringDTO.setContentFolderID(contentFolderID); qaGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString()); @@ -1683,10 +1425,8 @@ defaultContentIdStr, activeModule, sessionMap, httpSessionID); String onlineInstructions = (String) sessionMap.get(QaAppConstants.ONLINE_INSTRUCTIONS_KEY); - QaAction.logger.debug("onlineInstructions: " + onlineInstructions); String offlineInstructions = (String) sessionMap.get(QaAppConstants.OFFLINE_INSTRUCTIONS_KEY); - QaAction.logger.debug("offlineInstructions: " + offlineInstructions); qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions); @@ -1696,8 +1436,6 @@ String richTextTitle = (String) sessionMap.get(QaAppConstants.ACTIVITY_TITLE_KEY); String richTextInstructions = (String) sessionMap.get(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY); - QaAction.logger.debug("richTextTitle: " + richTextTitle); - QaAction.logger.debug("richTextInstructions: " + richTextInstructions); qaGeneralAuthoringDTO.setActivityTitle(richTextTitle); qaAuthoringForm.setTitle(richTextTitle); @@ -1706,14 +1444,12 @@ long uuid = WebUtil.readLongParam(request, QaAppConstants.UUID); List attachmentList = (List) sessionMap.get(QaAppConstants.ATTACHMENT_LIST_KEY); - QaAction.logger.debug("attachmentList: " + attachmentList); if (attachmentList == null) { attachmentList = new ArrayList(); } List deletedAttachmentList = (List) sessionMap.get(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY); - QaAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList); if (deletedAttachmentList == null) { deletedAttachmentList = new ArrayList(); @@ -1743,7 +1479,6 @@ qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr); qaAuthoringForm.setCurrentTab("3"); - QaAction.logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO); request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size())); @@ -1780,10 +1515,7 @@ List attachmentList, List deletedAttachmentList, SessionMap sessionMap, QaGeneralAuthoringDTO qaGeneralAuthoringDTO) { QaAction.logger.debug("attempt addFileToContentRepository"); - QaAction.logger.debug("attachmentList: " + attachmentList); - QaAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList); IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaAction.logger.debug("qaService: " + qaService); if (attachmentList == null) { attachmentList = new ArrayList(); @@ -1799,12 +1531,10 @@ if (qaAuthoringForm.getTheOfflineFile() != null && qaAuthoringForm.getTheOfflineFile().getFileSize() > 0) { QaAction.logger.debug("theOfflineFile is available: "); uploadedFile = qaAuthoringForm.getTheOfflineFile(); - QaAction.logger.debug("uploadedFile: " + uploadedFile); fileType = IToolContentHandler.TYPE_OFFLINE; } else if (qaAuthoringForm.getTheOnlineFile() != null && qaAuthoringForm.getTheOnlineFile().getFileSize() > 0) { QaAction.logger.debug("theOnlineFile is available: "); uploadedFile = qaAuthoringForm.getTheOnlineFile(); - QaAction.logger.debug("uploadedFile: " + uploadedFile); isOnlineFile = true; fileType = IToolContentHandler.TYPE_ONLINE; } else { @@ -1827,7 +1557,6 @@ */ deletedAttachmentList = QaUtils.moveToDelete(uploadedFile.getFileName(), isOnlineFile, attachmentList, deletedAttachmentList); - QaAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList); try { /* @@ -1902,22 +1631,19 @@ private List saveAttachments(QaContent qaContent, List attachmentList, List deletedAttachmentList, ActionMapping mapping, HttpServletRequest request) { - QaAction.logger.debug("start saveAttachments, attachmentList " + attachmentList); - QaAction.logger.debug("start deletedAttachmentList, deletedAttachmentList " + deletedAttachmentList); + QaAction.logger.debug("start saveAttachments"); if (attachmentList == null || deletedAttachmentList == null) { return null; } IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaAction.logger.debug("qaService: " + qaService); if (deletedAttachmentList != null) { QaAction.logger.debug("deletedAttachmentList is iterated..."); Iterator iter = deletedAttachmentList.iterator(); while (iter.hasNext()) { QaUploadedFile attachment = (QaUploadedFile) iter.next(); - QaAction.logger.debug("attachment: " + attachment); /* remove entry from db, leave in content repository. */ @@ -1934,14 +1660,12 @@ Iterator iter = attachmentList.iterator(); while (iter.hasNext()) { QaUploadedFile attachment = (QaUploadedFile) iter.next(); - QaAction.logger.debug("attachment: " + attachment); QaAction.logger.debug("attachment submission id: " + attachment.getSubmissionId()); if (attachment.getSubmissionId() == null) { /* * add entry to tool table - file already in content repository */ - QaAction.logger.debug("calling persistFile with attachment: " + attachment); qaService.persistFile(qaContent, attachment); } } @@ -1972,7 +1696,6 @@ */ public ActionForward getSummary(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - QaAction.logger.debug("dispatching proxy getSummary...start with monitoringStarter" + request); QaMonitoringAction qaMonitoringAction = new QaMonitoringAction(); return qaMonitoringAction.getSummary(mapping, form, request, response); } @@ -1993,7 +1716,6 @@ */ public ActionForward getInstructions(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - QaAction.logger.debug("dispatching proxy getInstructions..." + request); QaMonitoringAction qaMonitoringAction = new QaMonitoringAction(); return qaMonitoringAction.getInstructions(mapping, form, request, response); } @@ -2015,7 +1737,6 @@ */ public ActionForward getStats(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - QaAction.logger.debug("dispatching proxy getStats..." + request); QaMonitoringAction qaMonitoringAction = new QaMonitoringAction(); // return qaMonitoringAction.getStats(mapping, form, request, response, // "All"); @@ -2042,39 +1763,27 @@ QaAction.logger.debug("dispatching editActivityQuestions..."); QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form; - QaAction.logger.debug("qaAuthoringForm: " + qaAuthoringForm); IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaAction.logger.debug("qaService: " + qaService); String httpSessionID = qaAuthoringForm.getHttpSessionID(); - QaAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - QaAction.logger.debug("sessionMap: " + sessionMap); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - QaAction.logger.debug("contentFolderID: " + contentFolderID); qaAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE); - QaAction.logger.debug("activeModule: " + activeModule); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - QaAction.logger.debug("strToolContentID: " + strToolContentID); String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR); - QaAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr); QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaAction.logger.debug("qaContent: " + qaContent); QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO(); - QaAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); qaGeneralAuthoringDTO.setContentFolderID(contentFolderID); - QaAction.logger.debug("title: " + qaContent.getTitle()); - QaAction.logger.debug("instructions: " + qaContent.getInstructions()); qaGeneralAuthoringDTO.setActivityTitle(qaContent.getTitle()); qaAuthoringForm.setTitle(qaContent.getTitle()); @@ -2086,13 +1795,11 @@ /* determine whether the request is from Monitoring url Edit Activity */ String sourceMcStarter = (String) request.getAttribute(QaAppConstants.SOURCE_MC_STARTER); - QaAction.logger.debug("sourceMcStarter: " + sourceMcStarter); qaAuthoringForm.setDefineLaterInEditMode(new Boolean(true).toString()); qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); boolean isContentInUse = QaUtils.isContentInUse(qaContent); - QaAction.logger.debug("isContentInUse:" + isContentInUse); qaGeneralAuthoringDTO.setMonitoredContentInUse(new Boolean(false).toString()); if (isContentInUse == true) { @@ -2129,25 +1836,19 @@ QaQueContent qaQueContent = (QaQueContent) queIterator.next(); if (qaQueContent != null) { - QaAction.logger.debug("question: " + qaQueContent.getQuestion()); - QaAction.logger.debug("displayorder: " + new Integer(qaQueContent.getDisplayOrder()).toString()); - QaAction.logger.debug("feedback: " + qaQueContent.getFeedback()); qaQuestionContentDTO.setQuestion(qaQueContent.getQuestion()); qaQuestionContentDTO.setDisplayOrder(new Integer(qaQueContent.getDisplayOrder()).toString()); qaQuestionContentDTO.setFeedback(qaQueContent.getFeedback()); listQuestionContentDTO.add(qaQuestionContentDTO); } } - QaAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO); request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO); sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO); request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size())); request.getSession().setAttribute(httpSessionID, sessionMap); - QaAction.logger.debug("before fwding to jsp, qaAuthoringForm: " + qaAuthoringForm); - QaAction.logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO); QaAction.logger.debug("forwarding to : " + QaAppConstants.LOAD_QUESTIONS); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaDLStarterAction.java =================================================================== diff -u -rc527318c8c79f72151f6261342c5cc1a830d1e4d -r328cd4dbe60d9e5c588e13cc16b7e7414893b0af --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaDLStarterAction.java (.../QaDLStarterAction.java) (revision c527318c8c79f72151f6261342c5cc1a830d1e4d) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaDLStarterAction.java (.../QaDLStarterAction.java) (revision 328cd4dbe60d9e5c588e13cc16b7e7414893b0af) @@ -82,7 +82,6 @@ logger.debug("init defineLater mode. removed attributes..."); QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form; - logger.debug("qaAuthoringForm: " + qaAuthoringForm); IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); qaAuthoringForm.setQaService(qaService); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java =================================================================== diff -u -rc527318c8c79f72151f6261342c5cc1a830d1e4d -r328cd4dbe60d9e5c588e13cc16b7e7414893b0af --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java (.../QaLearningAction.java) (revision c527318c8c79f72151f6261342c5cc1a830d1e4d) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java (.../QaLearningAction.java) (revision 328cd4dbe60d9e5c588e13cc16b7e7414893b0af) @@ -159,36 +159,28 @@ */ public ActionForward submitAnswersContent(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - logger.debug("dispatching submitAnswersContent..." + request); + logger.debug("dispatching submitAnswersContent..."); QaLearningForm qaLearningForm = (QaLearningForm) form; LearningUtil.saveFormRequestData(request, qaLearningForm); 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); 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()); @@ -198,51 +190,35 @@ 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*/ @@ -253,11 +229,9 @@ 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()); @@ -292,23 +266,17 @@ LearningUtil.saveFormRequestData(request, qaLearningForm); 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); 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()); @@ -317,7 +285,6 @@ 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); @@ -335,23 +302,19 @@ * 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); @@ -360,24 +323,19 @@ 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; @@ -386,7 +344,6 @@ logger.debug("qaQueUsrUid: " + qaQueUsrUid); isResponseFinalized = qaQueUsr.isResponseFinalized(); - logger.debug("isResponseFinalized: " + isResponseFinalized); } Map mapAnswersFromDb = new TreeMap(new QaComparator()); @@ -400,48 +357,39 @@ 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()); @@ -464,12 +412,10 @@ } 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); @@ -481,7 +427,6 @@ 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); @@ -514,42 +459,31 @@ LearningUtil.saveFormRequestData(request, qaLearningForm); 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); 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(); @@ -591,26 +525,20 @@ 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()); @@ -627,21 +555,16 @@ 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)); @@ -668,42 +591,31 @@ LearningUtil.saveFormRequestData(request, qaLearningForm); 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); 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(); @@ -712,7 +624,6 @@ 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); @@ -730,19 +641,15 @@ 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); @@ -764,11 +671,9 @@ } 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)); @@ -797,28 +702,21 @@ LearningUtil.saveFormRequestData(request, qaLearningForm); 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); 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); @@ -829,24 +727,19 @@ 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); 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()); @@ -859,14 +752,9 @@ + 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); @@ -888,9 +776,7 @@ 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); @@ -901,7 +787,6 @@ String userFeedback = learningUtil .feedBackAnswersProgress(request, intCurrentQuestionIndex, totalQuestionCount); - logger.debug("userFeedback: " + userFeedback); generalLearnerFlowDTO.setUserFeedback(userFeedback); String remQCount = learningUtil.getRemainingQuestionCount(intCurrentQuestionIndex, totalQuestionCount); @@ -943,28 +828,21 @@ 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); 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); @@ -991,103 +869,54 @@ LearningUtil.saveFormRequestData(request, qaLearningForm); 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); String userID = request.getParameter("userID"); logger.debug("userID: " + userID); qaLearningForm.setUserID(userID); - //QaUtils.replaceNewLines(entryText) - - String entryText = request.getParameter("entryText"); - logger.debug("entryText: " + entryText); - - /* - 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); - - User userLocal = new User(); - userLocal.setUserId(new Integer(userID)); - notebookEntryLocal.setUser(userLocal); - - qaService.updateEntry(notebookEntryLocal); - logger.debug("entry updated: " + entryText); - */ - 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); } qaQueUsr.setLearnerFinished(true); - logger.debug("learner is finished:" + qaQueUsr); + logger.debug("learner is finished:" + qaQueUsr.getUid()); 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. */ 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); @@ -1111,32 +940,24 @@ 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(); @@ -1147,7 +968,6 @@ notebookEntryLocal.setUser(user); qaService.updateEntry(notebookEntryLocal); - logger.debug("entry updated: " + entryText); GeneralLearnerFlowDTO generalLearnerFlowDTO = new GeneralLearnerFlowDTO(); @@ -1157,10 +977,8 @@ 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) { @@ -1173,26 +991,21 @@ } 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)); @@ -1220,64 +1033,42 @@ 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); 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); @@ -1304,21 +1095,16 @@ 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); 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); @@ -1340,18 +1126,14 @@ 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(); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java =================================================================== diff -u -rc527318c8c79f72151f6261342c5cc1a830d1e4d -r328cd4dbe60d9e5c588e13cc16b7e7414893b0af --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java (.../QaLearningStarterAction.java) (revision c527318c8c79f72151f6261342c5cc1a830d1e4d) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java (.../QaLearningStarterAction.java) (revision 328cd4dbe60d9e5c588e13cc16b7e7414893b0af) @@ -169,7 +169,6 @@ QaUtils.cleanUpSessionAbsolute(request); IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - logger.debug("retrieving qaService: " + qaService); /* holds the question contents for a given tool session and relevant content */ Map mapQuestions = new TreeMap(new QaComparator()); @@ -183,13 +182,10 @@ generalLearnerFlowDTO.setCurrentQuestionIndex(new Integer(1)); generalLearnerFlowDTO.setCurrentAnswer(""); - logger.debug("reading httpSessionID"); String httpSessionID = qaLearningForm.getHttpSessionID(); - logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - logger.debug("sessionMap: " + sessionMap); if (sessionMap == null) { sessionMap = new SessionMap(); @@ -203,7 +199,6 @@ /*validate learning mode parameters*/ boolean validateParameters = validateParameters(request, mapping, qaLearningForm); - logger.debug("validateParamaters: " + validateParameters); if (!validateParameters) { logger.debug("error during validation"); } @@ -239,7 +234,6 @@ */ QaSession qaSession = qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue()); - logger.debug("retrieving qaSession: " + qaSession); /* * find out what content this tool session is referring to * get the content for this tool session (many to one mapping) @@ -249,7 +243,6 @@ * Each passed tool session id points to a particular content. Many to one mapping. */ QaContent qaContent = qaSession.getQaContent(); - logger.debug("using qaContent: " + qaContent); if (qaContent == null) { QaUtils.cleanUpSessionAbsolute(request); logger.debug("error: The tool expects qaContent."); @@ -261,19 +254,16 @@ logger.debug("is tool reflective: " + qaContent.isReflect()); generalLearnerFlowDTO.setReflection(new Boolean(qaContent.isReflect()).toString()); - logger.debug("reflection subject: " + qaContent.getReflectionSubject()); generalLearnerFlowDTO.setReflectionSubject(qaContent.getReflectionSubject()); 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); } @@ -285,23 +275,19 @@ * 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()); /* * Is the tool activity been checked as Define Later in the property inspector? */ - logger.debug("IS_DEFINE_LATER: " + qaContent.isDefineLater()); if (qaContent.isDefineLater()) { QaUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(DEFINE_LATER)); @@ -310,7 +296,6 @@ /* * 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); @@ -319,19 +304,15 @@ generalLearnerFlowDTO.setQuestionListingMode(QUESTION_LISTING_MODE_COMBINED); feedBackType = FEEDBACK_TYPE_COMBINED; } - logger.debug("QUESTION_LISTING_MODE: " + generalLearnerFlowDTO.getQuestionListingMode()); /* * fetch question content from content */ Iterator contentIterator = qaContent.getQaQueContents().iterator(); while (contentIterator.hasNext()) { QaQueContent qaQueContent = (QaQueContent) contentIterator.next(); - logger.debug("qaQueContent: " + qaQueContent); - logger.debug("question: " + qaQueContent.getQuestion()); if (qaQueContent != null) { int displayOrder = qaQueContent.getDisplayOrder(); - logger.debug("displayOrder: " + displayOrder); if (displayOrder != 0) { /* @@ -341,7 +322,6 @@ } } } - logger.debug("mapQuestions: " + mapQuestions); generalLearnerFlowDTO.setMapQuestions(mapQuestions); generalLearnerFlowDTO.setMapQuestionContentLearner(mapQuestions); @@ -352,12 +332,9 @@ mapAnswers.put(pairs.getKey(), ""); } - logger.debug("mapAnswers : " + mapAnswers); + generalLearnerFlowDTO.setMapAnswers(mapAnswers); - logger.debug("mapQuestions: " + mapQuestions); - logger.debug("mapQuestions has : " + mapQuestions.size() + " entries."); - generalLearnerFlowDTO.setTotalQuestionCount(new Integer(mapQuestions.size())); qaLearningForm.setTotalQuestionCount(new Integer(mapQuestions.size()).toString()); @@ -400,7 +377,6 @@ */ logger.debug("current userID: " + userID); String learnerProgressUserIdString = WebUtil.readStrParam(request, AttributeNames.PARAM_USER_ID, true); - logger.debug("learnerProgressUserId: " + learnerProgressUserIdString); if ((learnerProgressUserIdString != null) && (mode.equals("teacher"))) { logger.debug("start generating learner progress report for toolSessionID: " + toolSessionID); @@ -410,7 +386,6 @@ qaLearningForm.setUserID(learnerProgressUserIdString); Long learnerProgressUserId = WebUtil.readLongParam(request, AttributeNames.PARAM_USER_ID, false); QaMonitoringAction qaMonitoringAction = new QaMonitoringAction(); - logger.debug("using generalLearnerFlowDTO: " + generalLearnerFlowDTO); generalLearnerFlowDTO.setRequestLearningReport(new Boolean(true).toString()); generalLearnerFlowDTO.setRequestLearningReportProgress(new Boolean(true).toString()); generalLearnerFlowDTO.setTeacherViewOnly(new Boolean(true).toString()); @@ -466,7 +441,6 @@ if (userID != null) { QaQueUsr qaQueUsr = qaService.getQaUserBySession(new Long(userID), qaSession.getUid()); - logger.debug("QaQueUsr:" + qaQueUsr); if ((qaQueUsr != null) && (qaQueUsr.isResponseFinalized())) { logger.debug("is current user's response finalised: " + qaQueUsr.isResponseFinalized()); @@ -497,15 +471,10 @@ generalLearnerFlowDTO.setRequestLearningReport(new Boolean(true).toString()); - logger.debug("using generalLearnerFlowDTO: " + generalLearnerFlowDTO); qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, isUserNamesVisible, true, currentToolSessionID.toString(), userID, generalLearnerFlowDTO, false, toolSessionID); - logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO); - logger.debug("current sessionMap: " + sessionMap); - mapAnswers = (Map) sessionMap.get(MAP_ALL_RESULTS_KEY); - logger.debug("mapAnswers: " + mapAnswers); HttpSession ss = SessionManager.getSession(); /* get back login user DTO */ @@ -518,15 +487,12 @@ generalLearnerFlowDTO.setUserUid(qaQueUsrLocal.getUid().toString()); String noteBookEntry = generalLearnerFlowDTO.getNotebookEntry(); - logger.debug("noteBookEntry : " + noteBookEntry); qaLearningForm.setEntryText(noteBookEntry); logger.debug("attempt getting notebookEntry: "); NotebookEntry notebookEntryLocal = qaService.getEntry(new Long(toolSessionID), CoreNotebookConstants.NOTEBOOK_TOOL, MY_SIGNATURE, new Integer(userID)); - logger.debug("notebookEntryLocal: " + notebookEntryLocal); - if (notebookEntryLocal != null) { String notebookEntryPresentable = QaUtils.replaceNewLines(notebookEntryLocal.getEntry()); logger.debug("notebookEntryPresentable: " + notebookEntryPresentable); @@ -539,8 +505,6 @@ generalLearnerFlowDTO.setRequestLearningReportViewOnly(new Boolean(true).toString()); 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)); @@ -549,8 +513,6 @@ generalLearnerFlowDTO.setRequestLearningReportViewOnly(new Boolean(false).toString()); 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." + INDIVIDUAL_LEARNER_REPORT); @@ -566,7 +528,6 @@ * present user with the questions. */ request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); - logger.debug("GENERAL_LEARNER_FLOW_DTO: " + request.getAttribute(GENERAL_LEARNER_FLOW_DTO)); logger.debug("forwarding to: " + LOAD_LEARNER); return (mapping.findForward(LOAD_LEARNER)); } @@ -585,7 +546,6 @@ */ String userID = ""; HttpSession ss = SessionManager.getSession(); - logger.debug("ss: " + ss); if (ss != null) { UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); @@ -635,7 +595,6 @@ boolean isSessionCompleted(String userSessionId, IQaService qaService) { logger.debug("userSessionId:" + userSessionId); QaSession qaSession = qaService.retrieveQaSessionOrNullById(new Long(userSessionId).longValue()); - logger.debug("retrieving qaSession: " + qaSession); logger.debug("voteSession status : " + qaSession.getSession_status()); if ((qaSession.getSession_status() != null) && (qaSession.getSession_status().equals(COMPLETED))) { logger.debug("this session is COMPLETED voteSession status : " + userSessionId); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java =================================================================== diff -u -rf7b64c7ef2c9cd9db07f7d9c5569a1a663b3fc39 -r328cd4dbe60d9e5c588e13cc16b7e7414893b0af --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java (.../QaMonitoringAction.java) (revision f7b64c7ef2c9cd9db07f7d9c5569a1a663b3fc39) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java (.../QaMonitoringAction.java) (revision 328cd4dbe60d9e5c588e13cc16b7e7414893b0af) @@ -154,7 +154,6 @@ QaMonitoringAction.logger.debug("starting initStatsContent..."); QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form; - QaMonitoringAction.logger.debug("qaMonitoringForm: " + qaMonitoringForm); IQaService qaService = null; if (getServlet() != null) { @@ -163,28 +162,24 @@ qaService = qaMonitoringForm.getQaService(); } - QaMonitoringAction.logger.debug("qaService: " + qaService); - String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID); + qaMonitoringForm.setToolContentID(strToolContentID); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID); + qaMonitoringForm.setContentFolderID(contentFolderID); String editResponse = request.getParameter(QaAppConstants.EDIT_RESPONSE); - QaMonitoringAction.logger.debug("editResponse: " + editResponse); + qaMonitoringForm.setEditResponse(editResponse); QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaMonitoringAction.logger.debug("existing qaContent:" + qaContent); + Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService); - QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions); + request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions); - QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: " - + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS)); Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService); QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId); @@ -215,7 +210,7 @@ /* find out if there are any reflection entries, from here */ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent); - QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist); + if (notebookEntriesExist) { request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); @@ -229,12 +224,12 @@ generalMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - QaMonitoringAction.logger.debug("attachmentList: " + attachmentList); + generalMonitoringDTO.setAttachmentList(attachmentList); generalMonitoringDTO.setDeletedAttachmentList(new ArrayList()); /** ...till here * */ - QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO); + request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO); QaMonitoringAction.logger.debug("ending initStatsContent..."); @@ -268,10 +263,10 @@ public void initInstructionsContent(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { QaMonitoringAction.logger.debug("starting initInstructionsContent..."); - QaMonitoringAction.logger.debug("dispatching getInstructions..." + request); + QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form; - QaMonitoringAction.logger.debug("qaMonitoringForm: " + qaMonitoringForm); + GeneralMonitoringDTO generalMonitoringDTO = new GeneralMonitoringDTO(); @@ -282,28 +277,26 @@ qaService = qaMonitoringForm.getQaService(); } - QaMonitoringAction.logger.debug("qaService: " + qaService); + String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID); + qaMonitoringForm.setToolContentID(strToolContentID); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID); + qaMonitoringForm.setContentFolderID(contentFolderID); String editResponse = request.getParameter(QaAppConstants.EDIT_RESPONSE); - QaMonitoringAction.logger.debug("editResponse: " + editResponse); + qaMonitoringForm.setEditResponse(editResponse); QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaMonitoringAction.logger.debug("existing qaContent:" + qaContent); + Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService); - QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions); + request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions); - QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: " - + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS)); Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService); QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId); @@ -325,15 +318,15 @@ EditActivityDTO editActivityDTO = new EditActivityDTO(); boolean isContentInUse = QaUtils.isContentInUse(qaContent); - QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); + if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } request.setAttribute(QaAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO); /* find out if there are any reflection entries, from here */ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent); - QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist); + if (notebookEntriesExist) { request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); @@ -347,18 +340,18 @@ generalMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - QaMonitoringAction.logger.debug("attachmentList: " + attachmentList); + generalMonitoringDTO.setAttachmentList(attachmentList); generalMonitoringDTO.setDeletedAttachmentList(new ArrayList()); /** ...till here * */ - QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO); + request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO); MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false); - QaMonitoringAction.logger.debug("ending initInstructionsContent..."); + } /** @@ -378,10 +371,10 @@ HttpServletResponse response) throws IOException, ServletException { QaMonitoringAction.logger.debug("dispatching editActivity..."); QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form; - QaMonitoringAction.logger.debug("qaMonitoringForm: " + qaMonitoringForm); + IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaMonitoringAction.logger.debug("qaService: " + qaService); + if (qaService == null) { qaService = qaMonitoringForm.getQaService(); @@ -390,35 +383,33 @@ QaStarterAction qaStarterAction = new QaStarterAction(); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID); + qaMonitoringForm.setToolContentID(strToolContentID); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID); + qaMonitoringForm.setContentFolderID(contentFolderID); String editResponse = request.getParameter(QaAppConstants.EDIT_RESPONSE); - QaMonitoringAction.logger.debug("editResponse: " + editResponse); + qaMonitoringForm.setEditResponse(editResponse); request.setAttribute(QaAppConstants.SOURCE_MC_STARTER, "monitoring"); - QaMonitoringAction.logger.debug("SOURCE_MC_STARTER: monitoring"); + /* * it is possible that the content is being used by some learners. In this situation, the content is marked as * "in use" and content in use is not modifiable */ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaMonitoringAction.logger.debug("qaContent:" + qaContent); + QaMonitoringAction.logger.debug("qaContent:" + qaContent.getUid()); Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService); - QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions); + request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions); - QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: " - + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS)); Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService); - QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId); + request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId); GeneralMonitoringDTO generalMonitoringDTO = new GeneralMonitoringDTO(); @@ -437,7 +428,7 @@ generalMonitoringDTO.setActivityInstructions(qaContent.getInstructions()); } - QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO); + request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO); EditActivityDTO editActivityDTO = new EditActivityDTO(); @@ -453,12 +444,12 @@ generalMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - QaMonitoringAction.logger.debug("attachmentList: " + attachmentList); + generalMonitoringDTO.setAttachmentList(attachmentList); generalMonitoringDTO.setDeletedAttachmentList(new ArrayList()); /** ...till here * */ - QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO); + request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO); prepareReflectionData(request, qaContent, qaService, null, false, "All"); @@ -512,7 +503,7 @@ HttpServletResponse response) throws IOException, ServletException { QaMonitoringAction.logger.debug("initSummaryContent..."); QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form; - QaMonitoringAction.logger.debug("qaMonitoringForm: " + qaMonitoringForm); + GeneralMonitoringDTO generalMonitoringDTO = new GeneralMonitoringDTO(); @@ -523,31 +514,30 @@ qaService = qaMonitoringForm.getQaService(); } - QaMonitoringAction.logger.debug("qaService: " + qaService); + String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID); qaMonitoringForm.setToolContentID(strToolContentID); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID); + qaMonitoringForm.setContentFolderID(contentFolderID); String editResponse = request.getParameter(QaAppConstants.EDIT_RESPONSE); - QaMonitoringAction.logger.debug("editResponse: " + editResponse); + qaMonitoringForm.setEditResponse(editResponse); QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaMonitoringAction.logger.debug("existing qaContent:" + qaContent); + /* this section is related to summary tab. Starts here. */ Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService); - QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions); + request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions); - QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: " - + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS)); + Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService); QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId); request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId); @@ -591,7 +581,7 @@ generalMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - QaMonitoringAction.logger.debug("attachmentList: " + attachmentList); + generalMonitoringDTO.setAttachmentList(attachmentList); generalMonitoringDTO.setDeletedAttachmentList(new ArrayList()); /* ...till here */ @@ -604,7 +594,7 @@ request.setAttribute("reflect", qaContent.isReflect()); request.setAttribute("reflectionSubject", qaContent.getReflectionSubject()); - QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO); + request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO); MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); @@ -618,10 +608,10 @@ QaMonitoringAction.logger.debug("dispatching editActivityQuestions..."); QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form; - QaMonitoringAction.logger.debug("qaMonitoringForm: " + qaMonitoringForm); + IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaMonitoringAction.logger.debug("qaService: " + qaService); + GeneralMonitoringDTO generalMonitoringDTO = new GeneralMonitoringDTO(); @@ -633,23 +623,23 @@ generalMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); - QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO); + request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID); qaMonitoringForm.setToolContentID(strToolContentID); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID); + qaMonitoringForm.setContentFolderID(contentFolderID); String httpSessionID = request.getParameter("httpSessionID"); - QaMonitoringAction.logger.debug("httpSessionID: " + httpSessionID); + qaMonitoringForm.setHttpSessionID(httpSessionID); QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaMonitoringAction.logger.debug("existing qaContent:" + qaContent); + qaMonitoringForm.setTitle(qaContent.getTitle()); @@ -672,12 +662,12 @@ generalMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - QaMonitoringAction.logger.debug("attachmentList: " + attachmentList); + generalMonitoringDTO.setAttachmentList(attachmentList); generalMonitoringDTO.setDeletedAttachmentList(new ArrayList()); /** ...till here * */ - QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO); + request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO); List listQuestionContentDTO = new LinkedList(); @@ -688,18 +678,13 @@ QaQueContent qaQueContent = (QaQueContent) queIterator.next(); if (qaQueContent != null) { - QaMonitoringAction.logger.debug("question: " + qaQueContent.getQuestion()); - QaMonitoringAction.logger.debug("displayorder: " - + new Integer(qaQueContent.getDisplayOrder()).toString()); - QaMonitoringAction.logger.debug("feedback: " + qaQueContent.getFeedback()); - qaQuestionContentDTO.setQuestion(qaQueContent.getQuestion()); qaQuestionContentDTO.setDisplayOrder(new Integer(qaQueContent.getDisplayOrder()).toString()); qaQuestionContentDTO.setFeedback(qaQueContent.getFeedback()); listQuestionContentDTO.add(qaQuestionContentDTO); } } - QaMonitoringAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO); + request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO); request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size())); @@ -760,7 +745,7 @@ QaMonitoringAction.logger.debug("dispatching submitSession..."); IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaMonitoringAction.logger.debug("qaService: " + qaService); + QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form; @@ -794,20 +779,18 @@ qaMonitoringForm.setEditResponse(editResponse); QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaMonitoringAction.logger.debug("existing qaContent:" + qaContent); + Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService); - QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions); + request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions); - QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: " - + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS)); Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService); QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId); request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId); GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent); - QaMonitoringAction.logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); + prepareReflectionData(request, qaContent, qaService, null, false, currentMonitoredToolSession); @@ -860,7 +843,7 @@ QaMonitoringAction.logger.debug("dispatching editResponse..."); IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaMonitoringAction.logger.debug("qaService: " + qaService); + QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form; @@ -877,15 +860,15 @@ request.getSession().setAttribute(QaAppConstants.EDITABLE_RESPONSE_ID, responseId); QaUsrResp qaUsrResp = qaService.retrieveQaUsrResp(new Long(responseId).longValue()); - QaMonitoringAction.logger.debug("qaUsrResp: " + qaUsrResp); + refreshUserInput(request, qaMonitoringForm); QaContent qaContent = qaUsrResp.getQaQueContent().getQaContent(); - QaMonitoringAction.logger.debug("qaContent: " + qaContent); + String currentMonitoredToolSession = qaMonitoringForm.getSelectedToolSessionId(); - QaMonitoringAction.logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession); + if (currentMonitoredToolSession.equals("")) { currentMonitoredToolSession = "All"; @@ -906,17 +889,15 @@ request.setAttribute(QaAppConstants.CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession); Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService); - QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions); + request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions); - QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: " - + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS)); Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService); QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId); request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId); GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent); - QaMonitoringAction.logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); + refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, true, currentMonitoredToolSession); @@ -955,12 +936,12 @@ QaMonitoringAction.logger.debug("dispatching editGroupResponse..."); IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaMonitoringAction.logger.debug("qaService: " + qaService); + QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form; String editResponse = request.getParameter(QaAppConstants.EDIT_RESPONSE); - QaMonitoringAction.logger.debug("editResponse: " + editResponse); + qaMonitoringForm.setEditResponse(editResponse); String editableSessionId = request.getParameter("sessionId"); @@ -976,12 +957,12 @@ request.getSession().setAttribute(QaAppConstants.EDITABLE_RESPONSE_ID, responseId); QaUsrResp qaUsrResp = qaService.retrieveQaUsrResp(new Long(responseId).longValue()); - QaMonitoringAction.logger.debug("qaUsrResp: " + qaUsrResp); + refreshUserInput(request, qaMonitoringForm); QaContent qaContent = qaUsrResp.getQaQueContent().getQaContent(); - QaMonitoringAction.logger.debug("qaContent: " + qaContent); + String currentMonitoredToolSession = qaMonitoringForm.getSelectedToolSessionId(); QaMonitoringAction.logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession); @@ -996,20 +977,18 @@ request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(1)); } - QaMonitoringAction.logger.debug("SELECTION_CASE: " + request.getAttribute(QaAppConstants.SELECTION_CASE)); + Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService); - QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions); + request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions); - QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: " - + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS)); Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService); QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId); request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId); GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent); - QaMonitoringAction.logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); + refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, true, currentMonitoredToolSession); @@ -1063,7 +1042,7 @@ QaMonitoringAction.logger.debug("dispatching updateResponse..."); IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaMonitoringAction.logger.debug("qaService: " + qaService); + QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form; @@ -1072,16 +1051,16 @@ qaMonitoringForm.setContentFolderID(contentFolderID); String editResponse = request.getParameter(QaAppConstants.EDIT_RESPONSE); - QaMonitoringAction.logger.debug("editResponse: " + editResponse); + qaMonitoringForm.setEditResponse(editResponse); String responseId = qaMonitoringForm.getResponseId(); QaMonitoringAction.logger.debug("responseId: " + responseId); String updatedResponse = request.getParameter("updatedResponse"); - QaMonitoringAction.logger.debug("updatedResponse: " + updatedResponse); + QaUsrResp qaUsrResp = qaService.retrieveQaUsrResp(new Long(responseId).longValue()); - QaMonitoringAction.logger.debug("qaUsrResp: " + qaUsrResp); + /* * write out the audit log entry. If you move this after the update of the response, then make sure you update @@ -1113,24 +1092,22 @@ } else { request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(1)); } - QaMonitoringAction.logger.debug("SELECTION_CASE: " + request.getAttribute(QaAppConstants.SELECTION_CASE)); + request.setAttribute(QaAppConstants.CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession); QaContent qaContent = qaUsrResp.getQaQueContent().getQaContent(); - QaMonitoringAction.logger.debug("qaContent: " + qaContent); + Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService); - QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions); + request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions); - QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: " - + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS)); Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService); QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId); request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId); GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent); - QaMonitoringAction.logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); + refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, false, currentMonitoredToolSession); @@ -1169,7 +1146,7 @@ QaMonitoringAction.logger.debug("dispatching updateGroupResponse..."); IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaMonitoringAction.logger.debug("qaService: " + qaService); + QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form; @@ -1178,16 +1155,16 @@ qaMonitoringForm.setContentFolderID(contentFolderID); String editResponse = request.getParameter(QaAppConstants.EDIT_RESPONSE); - QaMonitoringAction.logger.debug("editResponse: " + editResponse); + qaMonitoringForm.setEditResponse(editResponse); String responseId = qaMonitoringForm.getResponseId(); QaMonitoringAction.logger.debug("responseId: " + responseId); String updatedResponse = request.getParameter("updatedResponse"); - QaMonitoringAction.logger.debug("updatedResponse: " + updatedResponse); + QaUsrResp qaUsrResp = qaService.retrieveQaUsrResp(new Long(responseId).longValue()); - QaMonitoringAction.logger.debug("qaUsrResp: " + qaUsrResp); + /* * write out the audit log entry. If you move this after the update of the response, then make sure you update @@ -1214,23 +1191,21 @@ } else { request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(1)); } - QaMonitoringAction.logger.debug("SELECTION_CASE: " + request.getAttribute(QaAppConstants.SELECTION_CASE)); + QaContent qaContent = qaUsrResp.getQaQueContent().getQaContent(); - QaMonitoringAction.logger.debug("qaContent: " + qaContent); + Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService); QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions); request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions); - QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: " - + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS)); Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService); QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId); request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId); GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent); - QaMonitoringAction.logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); + refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, false, currentMonitoredToolSession); @@ -1284,7 +1259,7 @@ QaMonitoringAction.logger.debug("dispatching deleteResponse..."); IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaMonitoringAction.logger.debug("qaService: " + qaService); + QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form; @@ -1293,7 +1268,7 @@ qaMonitoringForm.setContentFolderID(contentFolderID); String editResponse = request.getParameter(QaAppConstants.EDIT_RESPONSE); - QaMonitoringAction.logger.debug("editResponse: " + editResponse); + qaMonitoringForm.setEditResponse(editResponse); String currentMonitoredToolSession = qaMonitoringForm.getSelectedToolSessionId(); @@ -1309,34 +1284,32 @@ request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(1)); } - QaMonitoringAction.logger.debug("SELECTION_CASE: " + request.getAttribute(QaAppConstants.SELECTION_CASE)); + String responseId = qaMonitoringForm.getResponseId(); QaMonitoringAction.logger.debug("responseId: " + responseId); QaUsrResp qaUsrResp = qaService.retrieveQaUsrResp(new Long(responseId).longValue()); - QaMonitoringAction.logger.debug("qaUsrResp: " + qaUsrResp); + qaService.removeUserResponse(qaUsrResp); QaMonitoringAction.logger.debug("response deleted."); refreshUserInput(request, qaMonitoringForm); QaContent qaContent = qaUsrResp.getQaQueContent().getQaContent(); - QaMonitoringAction.logger.debug("qaContent: " + qaContent); + Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService); QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions); request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions); - QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: " - + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS)); Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService); QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId); request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId); GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent); - QaMonitoringAction.logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); + refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, false, currentMonitoredToolSession); @@ -1385,8 +1358,6 @@ qaService = qaMonitoringForm.getQaService(); } - QaMonitoringAction.logger.debug("qaService: " + qaService); - QaMonitoringAction.logger.debug("qaMonitoringForm: " + qaMonitoringForm); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID); @@ -1397,13 +1368,11 @@ qaMonitoringForm.setContentFolderID(contentFolderID); QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaMonitoringAction.logger.debug("existing qaContent:" + qaContent); + Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService); QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions); request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions); - QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: " - + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS)); Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService); QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId); @@ -1470,19 +1439,16 @@ public void refreshSummaryData(HttpServletRequest request, QaContent qaContent, IQaService qaService, boolean isUserNamesVisible, boolean isLearnerRequest, String currentSessionId, String userId, GeneralLearnerFlowDTO generalLearnerFlowDTO, boolean setEditResponse, String currentMonitoredToolSession) { - QaMonitoringAction.logger.debug("starting refreshSummaryData: setEditResponse + " + setEditResponse); + QaMonitoringAction.logger.debug("starting refreshSummaryData"); QaMonitoringAction.logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession); - QaMonitoringAction.logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); - QaMonitoringAction.logger.debug("qaService: " + isUserNamesVisible); - QaMonitoringAction.logger.debug("isUserNamesVisible: " + isUserNamesVisible); QaMonitoringAction.logger.debug("isLearnerRequest: " + isLearnerRequest); GeneralMonitoringDTO generalMonitoringDTO = new GeneralMonitoringDTO(); /* this section is related to summary tab. Starts here. */ Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService); - QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions); + request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions); if (qaContent.getTitle() == null) { @@ -1506,7 +1472,7 @@ generalMonitoringDTO.setMonitoredContentInUse(new Boolean(false).toString()); if (isContentInUse == true) { - QaMonitoringAction.logger.debug("monitoring url does not allow editActivity since the content is in use."); + persistError(request, "error.content.inUse"); generalMonitoringDTO.setMonitoredContentInUse(new Boolean(true).toString()); } @@ -1527,7 +1493,7 @@ List listMonitoredAnswersContainerDTO = MonitoringUtil.buildGroupsQuestionData(request, qaContent, qaService, isUserNamesVisible, isLearnerRequest, currentSessionId, userId); - QaMonitoringAction.logger.debug("listMonitoredAnswersContainerDTO: " + listMonitoredAnswersContainerDTO); + /* getting stats screen content from here... */ int countAllUsers = qaService.getTotalNumberOfUsers(qaContent); @@ -1554,13 +1520,13 @@ generalMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - QaMonitoringAction.logger.debug("attachmentList: " + attachmentList); + generalMonitoringDTO.setAttachmentList(attachmentList); generalMonitoringDTO.setDeletedAttachmentList(new ArrayList()); /* ...till here * */ if (generalLearnerFlowDTO != null) { - QaMonitoringAction.logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO); + QaMonitoringAction.logger .debug("placing LIST_MONITORED_ANSWERS_CONTAINER_DTO within generalLearnerFlowDTO"); generalLearnerFlowDTO.setListMonitoredAnswersContainerDTO(listMonitoredAnswersContainerDTO); @@ -1569,9 +1535,6 @@ QaMonitoringAction.logger.debug("isLearnerRequest is true."); generalLearnerFlowDTO.setRequestLearningReportProgress(new Boolean(true).toString()); } - - QaMonitoringAction.logger.debug("end of refreshSummaryData, generalLearnerFlowDTO : " - + generalLearnerFlowDTO); request.setAttribute(QaAppConstants.GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); } @@ -1590,7 +1553,7 @@ } /* ... till here */ - QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO); + request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO); MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent); @@ -1605,22 +1568,20 @@ */ public void refreshStatsData(HttpServletRequest request, QaMonitoringForm qaMonitoringForm, IQaService qaService, GeneralMonitoringDTO generalMonitoringDTO) { - QaMonitoringAction.logger.debug("starting refreshStatsData: " + qaService); - QaMonitoringAction.logger.debug("starting refreshStatsData with generalMonitoringDTO: " + generalMonitoringDTO); + + /* it is possible that no users has ever logged in for the activity yet */ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID); qaMonitoringForm.setToolContentID(strToolContentID); QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaMonitoringAction.logger.debug("existing qaContent:" + qaContent); + Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService); - QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions); + request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions); - QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: " - + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS)); Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService); QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId); @@ -1653,12 +1614,12 @@ } List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - QaMonitoringAction.logger.debug("attachmentList: " + attachmentList); + generalMonitoringDTO.setAttachmentList(attachmentList); - QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO); + request.setAttribute(QaAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO); - QaMonitoringAction.logger.debug("ending refreshStatsData with generalMonitoringDTO: " + generalMonitoringDTO); + QaMonitoringAction.logger.debug("ending refreshStatsData"); request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO); /* find out if there are any reflection entries, from here */ @@ -1681,18 +1642,18 @@ QaMonitoringAction.logger.debug("dispatching showResponse..."); IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaMonitoringAction.logger.debug("qaService: " + qaService); + QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form; String currentUid = qaMonitoringForm.getCurrentUid(); QaMonitoringAction.logger.debug("currentUid: " + currentUid); QaUsrResp qaUsrResp = qaService.getAttemptByUID(new Long(currentUid)); - QaMonitoringAction.logger.debug("qaUsrResp: " + qaUsrResp); + qaUsrResp.setVisible(true); qaService.updateUserResponse(qaUsrResp); qaService.showResponse(qaUsrResp); - QaMonitoringAction.logger.debug("qaUsrResp: " + qaUsrResp); + String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID); @@ -1703,17 +1664,15 @@ qaMonitoringForm.setContentFolderID(contentFolderID); String editResponse = request.getParameter(QaAppConstants.EDIT_RESPONSE); - QaMonitoringAction.logger.debug("editResponse: " + editResponse); + qaMonitoringForm.setEditResponse(editResponse); QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaMonitoringAction.logger.debug("existing qaContent:" + qaContent); + Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService); - QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions); + request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions); - QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: " - + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS)); Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService); QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId); @@ -1727,12 +1686,12 @@ } GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent); - QaMonitoringAction.logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); + refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, false, currentMonitoredToolSession); - QaMonitoringAction.logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession); + if (currentMonitoredToolSession.equals("All")) { request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(2)); } else { @@ -1744,7 +1703,7 @@ request.setAttribute(QaAppConstants.CURRENT_SESSION_NAME, qaSession.getSession_name()); } - QaMonitoringAction.logger.debug("SELECTION_CASE: " + request.getAttribute(QaAppConstants.SELECTION_CASE)); + request.setAttribute(QaAppConstants.CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession); prepareReflectionData(request, qaContent, qaService, null, false, currentMonitoredToolSession); @@ -1782,18 +1741,18 @@ QaMonitoringAction.logger.debug("dispatching showGroupResponse..."); IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaMonitoringAction.logger.debug("qaService: " + qaService); + QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form; String currentUid = qaMonitoringForm.getCurrentUid(); QaMonitoringAction.logger.debug("currentUid: " + currentUid); QaUsrResp qaUsrResp = qaService.getAttemptByUID(new Long(currentUid)); - QaMonitoringAction.logger.debug("qaUsrResp: " + qaUsrResp); + qaUsrResp.setVisible(true); qaService.updateUserResponse(qaUsrResp); qaService.showResponse(qaUsrResp); - QaMonitoringAction.logger.debug("qaUsrResp: " + qaUsrResp); + String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID); @@ -1804,17 +1763,15 @@ qaMonitoringForm.setContentFolderID(contentFolderID); String editResponse = request.getParameter(QaAppConstants.EDIT_RESPONSE); - QaMonitoringAction.logger.debug("editResponse: " + editResponse); + qaMonitoringForm.setEditResponse(editResponse); QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaMonitoringAction.logger.debug("existing qaContent:" + qaContent); + Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService); - QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions); + request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions); - QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: " - + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS)); Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService); QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId); @@ -1828,19 +1785,19 @@ } GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent); - QaMonitoringAction.logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); + refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, false, currentMonitoredToolSession); - QaMonitoringAction.logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession); + if (currentMonitoredToolSession.equals("All")) { request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(2)); } else { request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(1)); } - QaMonitoringAction.logger.debug("SELECTION_CASE: " + request.getAttribute(QaAppConstants.SELECTION_CASE)); + prepareReflectionData(request, qaContent, qaService, null, false, currentMonitoredToolSession); @@ -1877,7 +1834,7 @@ HttpServletResponse response) throws IOException, ServletException, ToolException { QaMonitoringAction.logger.debug("dispatching hideResponse..."); IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaMonitoringAction.logger.debug("qaService: " + qaService); + QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form; @@ -1888,28 +1845,26 @@ String currentUid = qaMonitoringForm.getCurrentUid(); QaMonitoringAction.logger.debug("currentUid: " + currentUid); QaUsrResp qaUsrResp = qaService.getAttemptByUID(new Long(currentUid)); - QaMonitoringAction.logger.debug("qaUsrResp: " + qaUsrResp); + qaUsrResp.setVisible(false); qaService.updateUserResponse(qaUsrResp); qaService.hideResponse(qaUsrResp); - QaMonitoringAction.logger.debug("qaUsrResp: " + qaUsrResp); + String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID); qaMonitoringForm.setToolContentID(strToolContentID); String editResponse = request.getParameter(QaAppConstants.EDIT_RESPONSE); - QaMonitoringAction.logger.debug("editResponse: " + editResponse); + qaMonitoringForm.setEditResponse(editResponse); QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaMonitoringAction.logger.debug("existing qaContent:" + qaContent); + Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService); - QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions); + request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions); - QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: " - + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS)); Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService); QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId); @@ -1933,11 +1888,11 @@ request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(1)); } - QaMonitoringAction.logger.debug("SELECTION_CASE: " + request.getAttribute(QaAppConstants.SELECTION_CASE)); + request.setAttribute(QaAppConstants.CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession); GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent); - QaMonitoringAction.logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); + refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, false, currentMonitoredToolSession); @@ -1975,7 +1930,7 @@ HttpServletResponse response) throws IOException, ServletException, ToolException { QaMonitoringAction.logger.debug("dispatching hideGroupResponse..."); IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaMonitoringAction.logger.debug("qaService: " + qaService); + QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form; @@ -1986,28 +1941,26 @@ String currentUid = qaMonitoringForm.getCurrentUid(); QaMonitoringAction.logger.debug("currentUid: " + currentUid); QaUsrResp qaUsrResp = qaService.getAttemptByUID(new Long(currentUid)); - QaMonitoringAction.logger.debug("qaUsrResp: " + qaUsrResp); + qaUsrResp.setVisible(false); qaService.updateUserResponse(qaUsrResp); qaService.hideResponse(qaUsrResp); - QaMonitoringAction.logger.debug("qaUsrResp: " + qaUsrResp); + String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID); qaMonitoringForm.setToolContentID(strToolContentID); String editResponse = request.getParameter(QaAppConstants.EDIT_RESPONSE); - QaMonitoringAction.logger.debug("editResponse: " + editResponse); + qaMonitoringForm.setEditResponse(editResponse); QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaMonitoringAction.logger.debug("existing qaContent:" + qaContent); + Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService); - QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions); + request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions); - QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: " - + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS)); Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService); QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId); @@ -2026,10 +1979,10 @@ request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(1)); } - QaMonitoringAction.logger.debug("SELECTION_CASE: " + request.getAttribute(QaAppConstants.SELECTION_CASE)); + GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent); - QaMonitoringAction.logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); + refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, false, currentMonitoredToolSession); @@ -2070,7 +2023,7 @@ QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form; IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaMonitoringAction.logger.debug("qaService: " + qaService); + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID); @@ -2091,7 +2044,7 @@ NotebookEntry notebookEntry = qaService.getEntry(new Long(sessionId), CoreNotebookConstants.NOTEBOOK_TOOL, QaAppConstants.MY_SIGNATURE, new Integer(userId)); - QaMonitoringAction.logger.debug("notebookEntry: " + notebookEntry); + GeneralLearnerFlowDTO generalLearnerFlowDTO = new GeneralLearnerFlowDTO(); if (notebookEntry != null) { @@ -2100,20 +2053,20 @@ generalLearnerFlowDTO.setUserName(userName); } - QaMonitoringAction.logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); + request.setAttribute(QaAppConstants.GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); QaSession qaSession = qaService.retrieveQaSessionOrNullById(new Long(sessionId).longValue()); - QaMonitoringAction.logger.debug("qaSession: " + qaSession); + QaContent qaContent = qaSession.getQaContent(); - QaMonitoringAction.logger.debug("qaContent: " + qaContent); + prepareEditActivityScreenData(request, qaContent); GeneralMonitoringDTO generalMonitoringDTO = new GeneralMonitoringDTO(); List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - QaMonitoringAction.logger.debug("attachmentList: " + attachmentList); + generalMonitoringDTO.setAttachmentList(attachmentList); if (qaService.studentActivityOccurredGlobal(qaContent)) { @@ -2124,7 +2077,7 @@ generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } - QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO); + request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO); /* find out if there are any reflection entries, from here */ @@ -2135,7 +2088,7 @@ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); String userExceptionNoToolSessions = generalMonitoringDTO.getUserExceptionNoToolSessions(); - QaMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions); + if (userExceptionNoToolSessions.equals("true")) { QaMonitoringAction.logger.debug("there are no online student activity but there are reflections : "); @@ -2153,13 +2106,13 @@ } public void prepareEditActivityScreenData(HttpServletRequest request, QaContent qaContent) { - QaMonitoringAction.logger.debug("starting prepareEditActivityScreenData: " + qaContent); + QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO(); qaGeneralAuthoringDTO.setActivityTitle(qaContent.getTitle()); qaGeneralAuthoringDTO.setActivityInstructions(qaContent.getInstructions()); - QaMonitoringAction.logger.debug("final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); + request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO); } @@ -2169,23 +2122,23 @@ /* start authoring code */ QaAuthoringForm qaAuthoringForm = (QaMonitoringForm) form; - QaMonitoringAction.logger.debug("dispathcing submitAllContent :" + form); + IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaMonitoringAction.logger.debug("qaService: " + qaService); + String httpSessionID = request.getParameter("httpSessionID"); QaMonitoringAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - QaMonitoringAction.logger.debug("sessionMap: " + sessionMap); + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID); qaAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE); - QaMonitoringAction.logger.debug("activeModule: " + activeModule); + String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID); @@ -2194,13 +2147,13 @@ QaMonitoringAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr); List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY); - QaMonitoringAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO); + Map mapQuestionContent = AuthoringUtil.extractMapQuestionContent(listQuestionContentDTO); - QaMonitoringAction.logger.debug("extracted mapQuestionContent: " + mapQuestionContent); + Map mapFeedback = AuthoringUtil.extractMapFeedback(listQuestionContentDTO); - QaMonitoringAction.logger.debug("extracted mapFeedback: " + mapFeedback); + ActionMessages errors = new ActionMessages(); QaMonitoringAction.logger.debug("mapQuestionContent size: " + mapQuestionContent.size()); @@ -2219,9 +2172,6 @@ String richTextTitle = request.getParameter(QaAppConstants.TITLE); String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS); - QaMonitoringAction.logger.debug("richTextTitle: " + richTextTitle); - QaMonitoringAction.logger.debug("richTextInstructions: " + richTextInstructions); - qaGeneralAuthoringDTO.setActivityTitle(richTextTitle); qaAuthoringForm.setTitle(richTextTitle); @@ -2236,10 +2186,7 @@ QaMonitoringAction.logger.debug("qaGeneralAuthoringDTO now: " + qaGeneralAuthoringDTO); request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO); - QaMonitoringAction.logger.debug("there are no issues with input, continue and submit data"); - QaContent qaContentTest = qaService.loadQa(new Long(strToolContentID).longValue()); - QaMonitoringAction.logger.debug("qaContentTest: " + qaContentTest); QaMonitoringAction.logger.debug("errors: " + errors); if (!errors.isEmpty()) { @@ -2261,7 +2208,7 @@ qaContent = authoringUtil.saveOrUpdateQaContent(mapQuestionContent, mapFeedback, qaService, qaAuthoringForm, request, qaContentTest, strToolContentID, null); - QaMonitoringAction.logger.debug("qaContent: " + qaContent); + long defaultContentID = 0; QaMonitoringAction.logger.debug("attempt retrieving tool with signatute : " + QaAppConstants.MY_SIGNATURE); @@ -2271,7 +2218,7 @@ if (qaContent != null) { qaGeneralAuthoringDTO.setDefaultContentIdStr(new Long(defaultContentID).toString()); } - QaMonitoringAction.logger.debug("updated qaGeneralAuthoringDTO to: " + qaGeneralAuthoringDTO); + authoringUtil.reOrganizeDisplayOrder(mapQuestionContent, qaService, qaAuthoringForm, qaContent); @@ -2309,7 +2256,7 @@ qaAuthoringForm.resetUserAction(); qaGeneralAuthoringDTO.setMapQuestionContent(mapQuestionContent); - QaMonitoringAction.logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); + request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO); request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO); @@ -2343,24 +2290,24 @@ qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - QaMonitoringAction.logger.debug("attachmentList: " + attachmentList); + qaGeneralMonitoringDTO.setAttachmentList(attachmentList); - QaMonitoringAction.logger.debug("final qaGeneralMonitoringDTO: " + qaGeneralMonitoringDTO); + - QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + qaGeneralMonitoringDTO); + request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, qaGeneralMonitoringDTO); prepareReflectionData(request, qaContent, qaService, null, false, "All"); /* find out if there are any reflection entries, from here */ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent); - QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist); + if (notebookEntriesExist) { request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); String userExceptionNoToolSessions = qaGeneralMonitoringDTO.getUserExceptionNoToolSessions(); - QaMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions); + if (userExceptionNoToolSessions.equals("true")) { QaMonitoringAction.logger.debug("there are no online student activity but there are reflections : "); @@ -2387,20 +2334,20 @@ QaMonitoringAction.logger.debug("dispathcing saveSingleQuestion"); IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaMonitoringAction.logger.debug("qaService: " + qaService); + String httpSessionID = request.getParameter("httpSessionID"); QaMonitoringAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - QaMonitoringAction.logger.debug("sessionMap: " + sessionMap); + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID); qaAuthoringForm.setContentFolderID(contentFolderID); String editQuestionBoxRequest = request.getParameter("editQuestionBoxRequest"); - QaMonitoringAction.logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest); + String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE); QaMonitoringAction.logger.debug("activeModule: " + activeModule); @@ -2412,31 +2359,31 @@ QaMonitoringAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr); QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaMonitoringAction.logger.debug("qaContent: " + qaContent); + if (qaContent == null) { QaMonitoringAction.logger.debug("using defaultContentIdStr: " + defaultContentIdStr); qaContent = qaService.loadQa(new Long(defaultContentIdStr).longValue()); } - QaMonitoringAction.logger.debug("final qaContent: " + qaContent); + QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO(); - QaMonitoringAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); + qaGeneralAuthoringDTO.setContentFolderID(contentFolderID); qaGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString()); AuthoringUtil authoringUtil = new AuthoringUtil(); List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY); - QaMonitoringAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO); + String newQuestion = request.getParameter("newQuestion"); - QaMonitoringAction.logger.debug("newQuestion: " + newQuestion); + String feedback = request.getParameter("feedback"); - QaMonitoringAction.logger.debug("feedback: " + feedback); + String editableQuestionIndex = request.getParameter("editableQuestionIndex"); QaMonitoringAction.logger.debug("editableQuestionIndex: " + editableQuestionIndex); @@ -2452,13 +2399,9 @@ Iterator listIterator = listQuestionContentDTO.iterator(); while (listIterator.hasNext()) { qaQuestionContentDTO = (QaQuestionContentDTO) listIterator.next(); - QaMonitoringAction.logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO); - QaMonitoringAction.logger.debug("qaQuestionContentDTO question:" - + qaQuestionContentDTO.getQuestion()); String question = qaQuestionContentDTO.getQuestion(); String displayOrder = qaQuestionContentDTO.getDisplayOrder(); - QaMonitoringAction.logger.debug("displayOrder:" + displayOrder); if (displayOrder != null && !displayOrder.equals("")) { if (displayOrder.equals(editableQuestionIndex)) { @@ -2467,16 +2410,14 @@ } } - QaMonitoringAction.logger.debug("qaQuestionContentDTO found:" + qaQuestionContentDTO); + qaQuestionContentDTO.setQuestion(newQuestion); qaQuestionContentDTO.setFeedback(feedback); qaQuestionContentDTO.setDisplayOrder(editableQuestionIndex); listQuestionContentDTO = AuthoringUtil.reorderUpdateListQuestionContentDTO(listQuestionContentDTO, qaQuestionContentDTO, editableQuestionIndex); - QaMonitoringAction.logger.debug("post reorderUpdateListQuestionContentDTO listQuestionContentDTO: " - + listQuestionContentDTO); } else { QaMonitoringAction.logger.debug("duplicate question entry, not adding"); } @@ -2486,13 +2427,10 @@ Iterator listIterator = listQuestionContentDTO.iterator(); while (listIterator.hasNext()) { qaQuestionContentDTO = (QaQuestionContentDTO) listIterator.next(); - QaMonitoringAction.logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO); - QaMonitoringAction.logger.debug("qaQuestionContentDTO question:" - + qaQuestionContentDTO.getQuestion()); String question = qaQuestionContentDTO.getQuestion(); String displayOrder = qaQuestionContentDTO.getDisplayOrder(); - QaMonitoringAction.logger.debug("displayOrder:" + displayOrder); + if (displayOrder != null && !displayOrder.equals("")) { if (displayOrder.equals(editableQuestionIndex)) { @@ -2501,30 +2439,28 @@ } } - QaMonitoringAction.logger.debug("qaQuestionContentDTO found:" + qaQuestionContentDTO); + qaQuestionContentDTO.setQuestion(newQuestion); qaQuestionContentDTO.setFeedback(feedback); qaQuestionContentDTO.setDisplayOrder(editableQuestionIndex); listQuestionContentDTO = AuthoringUtil.reorderUpdateListQuestionContentDTO(listQuestionContentDTO, qaQuestionContentDTO, editableQuestionIndex); - QaMonitoringAction.logger.debug("post reorderUpdateListQuestionContentDTO listQuestionContentDTO: " - + listQuestionContentDTO); } } else { QaMonitoringAction.logger.debug("entry blank, not adding"); } request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO); sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO); - QaMonitoringAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO); + String richTextTitle = request.getParameter(QaAppConstants.TITLE); String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS); - QaMonitoringAction.logger.debug("richTextTitle: " + richTextTitle); - QaMonitoringAction.logger.debug("richTextInstructions: " + richTextInstructions); + + qaGeneralAuthoringDTO.setActivityTitle(richTextTitle); qaAuthoringForm.setTitle(richTextTitle); @@ -2552,15 +2488,13 @@ qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr); qaAuthoringForm.setCurrentTab("3"); - QaMonitoringAction.logger.debug("qaGeneralAuthoringDTO now: " + qaGeneralAuthoringDTO); + request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO); QaMonitoringAction.logger.debug("httpSessionID: " + httpSessionID); - QaMonitoringAction.logger.debug("sessionMap: " + sessionMap); + request.getSession().setAttribute(httpSessionID, sessionMap); - QaMonitoringAction.logger.debug("qaGeneralAuthoringDTO.getMapQuestionContent(); " - + qaGeneralAuthoringDTO.getMapQuestionContent()); request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size())); @@ -2581,11 +2515,11 @@ qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - QaMonitoringAction.logger.debug("attachmentList: " + attachmentList); + qaGeneralMonitoringDTO.setAttachmentList(attachmentList); - QaMonitoringAction.logger.debug("final qaGeneralMonitoringDTO: " + qaGeneralMonitoringDTO); + - QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + qaGeneralMonitoringDTO); + request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, qaGeneralMonitoringDTO); prepareReflectionData(request, qaContent, qaService, null, false, "All"); @@ -2598,7 +2532,7 @@ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); String userExceptionNoToolSessions = qaGeneralMonitoringDTO.getUserExceptionNoToolSessions(); - QaMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions); + if (userExceptionNoToolSessions.equals("true")) { QaMonitoringAction.logger.debug("there are no online student activity but there are reflections : "); @@ -2624,13 +2558,13 @@ QaMonitoringAction.logger.debug("dispathcing addSingleQuestion"); IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaMonitoringAction.logger.debug("qaService: " + qaService); + String httpSessionID = request.getParameter("httpSessionID"); QaMonitoringAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - QaMonitoringAction.logger.debug("sessionMap: " + sessionMap); + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID); @@ -2646,33 +2580,33 @@ QaMonitoringAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr); QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaMonitoringAction.logger.debug("qaContent: " + qaContent); + if (qaContent == null) { QaMonitoringAction.logger.debug("using defaultContentIdStr: " + defaultContentIdStr); qaContent = qaService.loadQa(new Long(defaultContentIdStr).longValue()); } - QaMonitoringAction.logger.debug("final qaContent: " + qaContent); + QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO(); - QaMonitoringAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); + qaGeneralAuthoringDTO.setContentFolderID(contentFolderID); qaGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString()); AuthoringUtil authoringUtil = new AuthoringUtil(); List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY); - QaMonitoringAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO); + String newQuestion = request.getParameter("newQuestion"); - QaMonitoringAction.logger.debug("newQuestion: " + newQuestion); + String feedback = request.getParameter("feedback"); - QaMonitoringAction.logger.debug("feedback: " + feedback); + int listSize = listQuestionContentDTO.size(); - QaMonitoringAction.logger.debug("listSize: " + listSize); + if (newQuestion != null && newQuestion.length() > 0) { boolean duplicates = AuthoringUtil.checkDuplicateQuestions(listQuestionContentDTO, newQuestion); @@ -2685,7 +2619,7 @@ qaQuestionContentDTO.setQuestion(newQuestion); listQuestionContentDTO.add(qaQuestionContentDTO); - QaMonitoringAction.logger.debug("updated listQuestionContentDTO: " + listQuestionContentDTO); + } else { QaMonitoringAction.logger.debug("entry duplicate, not adding"); } @@ -2699,8 +2633,8 @@ String richTextTitle = request.getParameter(QaAppConstants.TITLE); String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS); - QaMonitoringAction.logger.debug("richTextTitle: " + richTextTitle); - QaMonitoringAction.logger.debug("richTextInstructions: " + richTextInstructions); + + qaGeneralAuthoringDTO.setActivityTitle(richTextTitle); qaAuthoringForm.setTitle(richTextTitle); @@ -2726,17 +2660,14 @@ qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr); qaAuthoringForm.setCurrentTab("3"); - QaMonitoringAction.logger.debug("qaGeneralAuthoringDTO now: " + qaGeneralAuthoringDTO); + request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO); QaMonitoringAction.logger.debug("httpSessionID: " + httpSessionID); - QaMonitoringAction.logger.debug("sessionMap: " + sessionMap); + request.getSession().setAttribute(httpSessionID, sessionMap); - QaMonitoringAction.logger.debug("qaGeneralAuthoringDTO.getMapQuestionContent(); " - + qaGeneralAuthoringDTO.getMapQuestionContent()); - request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size())); /* start monitoring code */ @@ -2755,12 +2686,12 @@ qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - QaMonitoringAction.logger.debug("attachmentList: " + attachmentList); + qaGeneralMonitoringDTO.setAttachmentList(attachmentList); - QaMonitoringAction.logger.debug("final qaGeneralMonitoringDTO: " + qaGeneralMonitoringDTO); + qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); - QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + qaGeneralMonitoringDTO); + request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, qaGeneralMonitoringDTO); prepareReflectionData(request, qaContent, qaService, null, false, "All"); @@ -2799,13 +2730,13 @@ QaMonitoringAction.logger.debug("dispathcing newQuestionBox"); IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaMonitoringAction.logger.debug("qaService: " + qaService); + String httpSessionID = request.getParameter("httpSessionID"); QaMonitoringAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - QaMonitoringAction.logger.debug("sessionMap: " + sessionMap); + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID); @@ -2821,23 +2752,23 @@ QaMonitoringAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr); QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaMonitoringAction.logger.debug("qaContent: " + qaContent); + if (qaContent == null) { QaMonitoringAction.logger.debug("using defaultContentIdStr: " + defaultContentIdStr); qaContent = qaService.loadQa(new Long(defaultContentIdStr).longValue()); } - QaMonitoringAction.logger.debug("final qaContent: " + qaContent); + QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO(); - QaMonitoringAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); + qaGeneralAuthoringDTO.setContentFolderID(contentFolderID); String richTextTitle = request.getParameter(QaAppConstants.TITLE); String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS); - QaMonitoringAction.logger.debug("richTextTitle: " + richTextTitle); - QaMonitoringAction.logger.debug("richTextInstructions: " + richTextInstructions); + + qaGeneralAuthoringDTO.setActivityTitle(richTextTitle); qaAuthoringForm.setTitle(richTextTitle); @@ -2847,7 +2778,7 @@ defaultContentIdStr, activeModule, sessionMap, httpSessionID); List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY); - QaMonitoringAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO); + request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size())); @@ -2867,12 +2798,12 @@ qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - QaMonitoringAction.logger.debug("attachmentList: " + attachmentList); + qaGeneralMonitoringDTO.setAttachmentList(attachmentList); - QaMonitoringAction.logger.debug("final qaGeneralMonitoringDTO: " + qaGeneralMonitoringDTO); + qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); - QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + qaGeneralMonitoringDTO); + request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, qaGeneralMonitoringDTO); prepareReflectionData(request, qaContent, qaService, null, false, "All"); @@ -2912,44 +2843,44 @@ QaMonitoringAction.logger.debug("dispathcing newEditableQuestionBox"); IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaMonitoringAction.logger.debug("qaService: " + qaService); + String httpSessionID = request.getParameter("httpSessionID"); QaMonitoringAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - QaMonitoringAction.logger.debug("sessionMap: " + sessionMap); + String questionIndex = request.getParameter("questionIndex"); QaMonitoringAction.logger.debug("questionIndex: " + questionIndex); qaAuthoringForm.setEditableQuestionIndex(questionIndex); List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY); - QaMonitoringAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO); + String editableQuestion = ""; String editableFeedback = ""; Iterator listIterator = listQuestionContentDTO.iterator(); while (listIterator.hasNext()) { QaQuestionContentDTO qaQuestionContentDTO = (QaQuestionContentDTO) listIterator.next(); - QaMonitoringAction.logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO); - QaMonitoringAction.logger.debug("qaQuestionContentDTO question:" + qaQuestionContentDTO.getQuestion()); + + String question = qaQuestionContentDTO.getQuestion(); String displayOrder = qaQuestionContentDTO.getDisplayOrder(); if (displayOrder != null && !displayOrder.equals("")) { if (displayOrder.equals(questionIndex)) { editableFeedback = qaQuestionContentDTO.getFeedback(); editableQuestion = qaQuestionContentDTO.getQuestion(); - QaMonitoringAction.logger.debug("editableFeedback found :" + editableFeedback); + break; } } } - QaMonitoringAction.logger.debug("editableFeedback found :" + editableFeedback); - QaMonitoringAction.logger.debug("editableQuestion found :" + editableQuestion); + + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID); @@ -2965,23 +2896,23 @@ QaMonitoringAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr); QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaMonitoringAction.logger.debug("qaContent: " + qaContent); + if (qaContent == null) { QaMonitoringAction.logger.debug("using defaultContentIdStr: " + defaultContentIdStr); qaContent = qaService.loadQa(new Long(defaultContentIdStr).longValue()); } - QaMonitoringAction.logger.debug("final qaContent: " + qaContent); + QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO(); - QaMonitoringAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); + qaGeneralAuthoringDTO.setContentFolderID(contentFolderID); String richTextTitle = request.getParameter(QaAppConstants.TITLE); String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS); - QaMonitoringAction.logger.debug("richTextTitle: " + richTextTitle); - QaMonitoringAction.logger.debug("richTextInstructions: " + richTextInstructions); + + qaGeneralAuthoringDTO.setActivityTitle(richTextTitle); qaAuthoringForm.setTitle(richTextTitle); @@ -2994,7 +2925,7 @@ qaGeneralAuthoringDTO.setEditableQuestionFeedback(editableFeedback); qaAuthoringForm.setFeedback(editableFeedback); - QaMonitoringAction.logger.debug("qaGeneralAuthoringDTO now: " + qaGeneralAuthoringDTO); + request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO); request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size())); @@ -3015,12 +2946,12 @@ qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - QaMonitoringAction.logger.debug("attachmentList: " + attachmentList); + qaGeneralMonitoringDTO.setAttachmentList(attachmentList); - QaMonitoringAction.logger.debug("final qaGeneralMonitoringDTO: " + qaGeneralMonitoringDTO); + qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); - QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + qaGeneralMonitoringDTO); + request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, qaGeneralMonitoringDTO); prepareReflectionData(request, qaContent, qaService, null, false, "All"); @@ -3061,26 +2992,26 @@ QaMonitoringAction.logger.debug("dispathcing removeQuestion"); IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaMonitoringAction.logger.debug("qaService: " + qaService); + String httpSessionID = request.getParameter("httpSessionID"); QaMonitoringAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - QaMonitoringAction.logger.debug("sessionMap: " + sessionMap); + String questionIndex = request.getParameter("questionIndex"); QaMonitoringAction.logger.debug("questionIndex: " + questionIndex); List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY); - QaMonitoringAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO); + QaQuestionContentDTO qaQuestionContentDTO = null; Iterator listIterator = listQuestionContentDTO.iterator(); while (listIterator.hasNext()) { qaQuestionContentDTO = (QaQuestionContentDTO) listIterator.next(); - QaMonitoringAction.logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO); - QaMonitoringAction.logger.debug("qaQuestionContentDTO question:" + qaQuestionContentDTO.getQuestion()); + + String question = qaQuestionContentDTO.getQuestion(); String displayOrder = qaQuestionContentDTO.getDisplayOrder(); @@ -3094,12 +3025,12 @@ } } - QaMonitoringAction.logger.debug("qaQuestionContentDTO found:" + qaQuestionContentDTO); + qaQuestionContentDTO.setQuestion(""); - QaMonitoringAction.logger.debug("listQuestionContentDTO after remove:" + listQuestionContentDTO); + listQuestionContentDTO = AuthoringUtil.reorderListQuestionContentDTO(listQuestionContentDTO, questionIndex); - QaMonitoringAction.logger.debug("listQuestionContentDTO reordered:" + listQuestionContentDTO); + sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO); @@ -3111,10 +3042,10 @@ QaMonitoringAction.logger.debug("activeModule: " + activeModule); String richTextTitle = request.getParameter(QaAppConstants.TITLE); - QaMonitoringAction.logger.debug("richTextTitle: " + richTextTitle); + String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS); - QaMonitoringAction.logger.debug("richTextInstructions: " + richTextInstructions); + sessionMap.put(QaAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); @@ -3126,16 +3057,16 @@ QaMonitoringAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr); QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaMonitoringAction.logger.debug("qaContent: " + qaContent); + if (qaContent == null) { QaMonitoringAction.logger.debug("using defaultContentIdStr: " + defaultContentIdStr); qaContent = qaService.loadQa(new Long(defaultContentIdStr).longValue()); } - QaMonitoringAction.logger.debug("final qaContent: " + qaContent); + QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO(); - QaMonitoringAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); + qaGeneralAuthoringDTO.setContentFolderID(contentFolderID); qaGeneralAuthoringDTO.setActivityTitle(richTextTitle); @@ -3163,10 +3094,10 @@ qaAuthoringForm.setCurrentTab("3"); request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO); - QaMonitoringAction.logger.debug("qaQuestionContentDTO now: " + qaQuestionContentDTO); - QaMonitoringAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO); + + - QaMonitoringAction.logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); + request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO); request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size())); @@ -3186,12 +3117,12 @@ qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - QaMonitoringAction.logger.debug("attachmentList: " + attachmentList); + qaGeneralMonitoringDTO.setAttachmentList(attachmentList); - QaMonitoringAction.logger.debug("final qaGeneralMonitoringDTO: " + qaGeneralMonitoringDTO); + qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); - QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + qaGeneralMonitoringDTO); + request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, qaGeneralMonitoringDTO); prepareReflectionData(request, qaContent, qaService, null, false, "All"); @@ -3231,25 +3162,25 @@ QaMonitoringAction.logger.debug("dispathcing moveQuestionDown"); IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaMonitoringAction.logger.debug("qaService: " + qaService); + String httpSessionID = request.getParameter("httpSessionID"); QaMonitoringAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - QaMonitoringAction.logger.debug("sessionMap: " + sessionMap); + String questionIndex = request.getParameter("questionIndex"); QaMonitoringAction.logger.debug("questionIndex: " + questionIndex); List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY); - QaMonitoringAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO); + listQuestionContentDTO = AuthoringUtil.swapNodes(listQuestionContentDTO, questionIndex, "down", null); - QaMonitoringAction.logger.debug("listQuestionContentDTO after swap: " + listQuestionContentDTO); + listQuestionContentDTO = AuthoringUtil.reorderSimpleListQuestionContentDTO(listQuestionContentDTO); - QaMonitoringAction.logger.debug("listQuestionContentDTO after reordersimple: " + listQuestionContentDTO); + sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO); @@ -3261,10 +3192,10 @@ QaMonitoringAction.logger.debug("activeModule: " + activeModule); String richTextTitle = request.getParameter(QaAppConstants.TITLE); - QaMonitoringAction.logger.debug("richTextTitle: " + richTextTitle); + String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS); - QaMonitoringAction.logger.debug("richTextInstructions: " + richTextInstructions); + sessionMap.put(QaAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); @@ -3276,16 +3207,16 @@ QaMonitoringAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr); QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaMonitoringAction.logger.debug("qaContent: " + qaContent); + if (qaContent == null) { QaMonitoringAction.logger.debug("using defaultContentIdStr: " + defaultContentIdStr); qaContent = qaService.loadQa(new Long(defaultContentIdStr).longValue()); } - QaMonitoringAction.logger.debug("final qaContent: " + qaContent); + QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO(); - QaMonitoringAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); + qaGeneralAuthoringDTO.setContentFolderID(contentFolderID); qaGeneralAuthoringDTO.setActivityTitle(richTextTitle); @@ -3312,9 +3243,9 @@ qaAuthoringForm.setCurrentTab("3"); request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO); - QaMonitoringAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO); + - QaMonitoringAction.logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); + request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO); request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size())); @@ -3334,12 +3265,12 @@ qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - QaMonitoringAction.logger.debug("attachmentList: " + attachmentList); + qaGeneralMonitoringDTO.setAttachmentList(attachmentList); - QaMonitoringAction.logger.debug("final qaGeneralMonitoringDTO: " + qaGeneralMonitoringDTO); + qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); - QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + qaGeneralMonitoringDTO); + request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, qaGeneralMonitoringDTO); prepareReflectionData(request, qaContent, qaService, null, false, "All"); @@ -3380,25 +3311,25 @@ QaMonitoringAction.logger.debug("dispathcing moveQuestionDown"); IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - QaMonitoringAction.logger.debug("qaService: " + qaService); + String httpSessionID = request.getParameter("httpSessionID"); QaMonitoringAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - QaMonitoringAction.logger.debug("sessionMap: " + sessionMap); + String questionIndex = request.getParameter("questionIndex"); QaMonitoringAction.logger.debug("questionIndex: " + questionIndex); List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY); - QaMonitoringAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO); + listQuestionContentDTO = AuthoringUtil.swapNodes(listQuestionContentDTO, questionIndex, "up", null); - QaMonitoringAction.logger.debug("listQuestionContentDTO after swap: " + listQuestionContentDTO); + listQuestionContentDTO = AuthoringUtil.reorderSimpleListQuestionContentDTO(listQuestionContentDTO); - QaMonitoringAction.logger.debug("listQuestionContentDTO after reordersimple: " + listQuestionContentDTO); + sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO); @@ -3410,10 +3341,10 @@ QaMonitoringAction.logger.debug("activeModule: " + activeModule); String richTextTitle = request.getParameter(QaAppConstants.TITLE); - QaMonitoringAction.logger.debug("richTextTitle: " + richTextTitle); + String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS); - QaMonitoringAction.logger.debug("richTextInstructions: " + richTextInstructions); + sessionMap.put(QaAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); @@ -3425,16 +3356,16 @@ QaMonitoringAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr); QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaMonitoringAction.logger.debug("qaContent: " + qaContent); + if (qaContent == null) { QaMonitoringAction.logger.debug("using defaultContentIdStr: " + defaultContentIdStr); qaContent = qaService.loadQa(new Long(defaultContentIdStr).longValue()); } - QaMonitoringAction.logger.debug("final qaContent: " + qaContent); + QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO(); - QaMonitoringAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); + qaGeneralAuthoringDTO.setContentFolderID(contentFolderID); qaGeneralAuthoringDTO.setActivityTitle(richTextTitle); @@ -3462,9 +3393,9 @@ qaAuthoringForm.setCurrentTab("3"); request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO); - QaMonitoringAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO); + - QaMonitoringAction.logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); + request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO); request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size())); @@ -3484,12 +3415,12 @@ qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - QaMonitoringAction.logger.debug("attachmentList: " + attachmentList); + qaGeneralMonitoringDTO.setAttachmentList(attachmentList); - QaMonitoringAction.logger.debug("final qaGeneralMonitoringDTO: " + qaGeneralMonitoringDTO); + qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); - QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + qaGeneralMonitoringDTO); + request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, qaGeneralMonitoringDTO); prepareReflectionData(request, qaContent, qaService, null, false, "All"); @@ -3521,7 +3452,7 @@ public void prepareReflectionData(HttpServletRequest request, QaContent qaContent, IQaService qaService, String userID, boolean exportMode, String currentSessionId) { - QaMonitoringAction.logger.debug("starting prepareReflectionData: " + qaContent); + QaMonitoringAction.logger.debug("currentSessionId: " + currentSessionId); QaMonitoringAction.logger.debug("userID: " + userID); QaMonitoringAction.logger.debug("exportMode: " + exportMode); @@ -3535,7 +3466,7 @@ reflectionsContainerDTO = getReflectionList(qaContent, userID, qaService); - QaMonitoringAction.logger.debug("reflectionsContainerDTO: " + reflectionsContainerDTO); + request.setAttribute(QaAppConstants.REFLECTIONS_CONTAINER_DTO, reflectionsContainerDTO); if (exportMode) { @@ -3560,18 +3491,18 @@ QaMonitoringAction.logger.debug("all users mode"); for (Iterator sessionIter = qaContent.getQaSessions().iterator(); sessionIter.hasNext();) { QaSession qaSession = (QaSession) sessionIter.next(); - QaMonitoringAction.logger.debug("qaSession: " + qaSession); + QaMonitoringAction.logger.debug("qaSession sessionId: " + qaSession.getQaSessionId()); for (Iterator userIter = qaSession.getQaQueUsers().iterator(); userIter.hasNext();) { QaQueUsr user = (QaQueUsr) userIter.next(); - QaMonitoringAction.logger.debug("user: " + user); + QaMonitoringAction.logger.debug("user: " + user.getUsername()); NotebookEntry notebookEntry = qaService.getEntry(qaSession.getQaSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, QaAppConstants.MY_SIGNATURE, new Integer(user .getQueUsrId().toString())); - QaMonitoringAction.logger.debug("notebookEntry: " + notebookEntry); + if (notebookEntry != null) { ReflectionDTO reflectionDTO = new ReflectionDTO(); @@ -3589,18 +3520,18 @@ QaMonitoringAction.logger.debug("single user mode"); for (Iterator sessionIter = qaContent.getQaSessions().iterator(); sessionIter.hasNext();) { QaSession qaSession = (QaSession) sessionIter.next(); - QaMonitoringAction.logger.debug("qaSession: " + qaSession); + for (Iterator userIter = qaSession.getQaQueUsers().iterator(); userIter.hasNext();) { QaQueUsr user = (QaQueUsr) userIter.next(); - QaMonitoringAction.logger.debug("user: " + user); + QaMonitoringAction.logger.debug("user: " + user.getUsername()); if (user.getQueUsrId().toString().equals(userID)) { QaMonitoringAction.logger.debug("getting reflection for user with userID: " + userID); NotebookEntry notebookEntry = qaService.getEntry(qaSession.getQaSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, QaAppConstants.MY_SIGNATURE, new Integer(user .getQueUsrId().toString())); - QaMonitoringAction.logger.debug("notebookEntry: " + notebookEntry); + if (notebookEntry != null) { ReflectionDTO reflectionDTO = new ReflectionDTO(); @@ -3642,20 +3573,20 @@ QaMonitoringAction.logger.debug("all users mode"); for (Iterator sessionIter = qaContent.getQaSessions().iterator(); sessionIter.hasNext();) { QaSession qaSession = (QaSession) sessionIter.next(); - QaMonitoringAction.logger.debug("qaSession: " + qaSession); + QaMonitoringAction.logger.debug("qaSession sessionId: " + qaSession.getQaSessionId()); if (currentSessionId.equals(qaSession.getQaSessionId())) { for (Iterator userIter = qaSession.getQaQueUsers().iterator(); userIter.hasNext();) { QaQueUsr user = (QaQueUsr) userIter.next(); - QaMonitoringAction.logger.debug("user: " + user); + QaMonitoringAction.logger.debug("user: " + user.getUsername()); NotebookEntry notebookEntry = qaService.getEntry(qaSession.getQaSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, QaAppConstants.MY_SIGNATURE, new Integer(user .getQueUsrId().toString())); - QaMonitoringAction.logger.debug("notebookEntry: " + notebookEntry); + if (notebookEntry != null) { ReflectionDTO reflectionDTO = new ReflectionDTO(); @@ -3674,20 +3605,20 @@ QaMonitoringAction.logger.debug("single user mode"); for (Iterator sessionIter = qaContent.getQaSessions().iterator(); sessionIter.hasNext();) { QaSession qaSession = (QaSession) sessionIter.next(); - QaMonitoringAction.logger.debug("qaSession: " + qaSession); + if (currentSessionId.equals(qaSession.getQaSessionId())) { for (Iterator userIter = qaSession.getQaQueUsers().iterator(); userIter.hasNext();) { QaQueUsr user = (QaQueUsr) userIter.next(); - QaMonitoringAction.logger.debug("user: " + user); + QaMonitoringAction.logger.debug("user: " + user.getUsername()); if (user.getQueUsrId().toString().equals(userID)) { QaMonitoringAction.logger.debug("getting reflection for user with userID: " + userID); NotebookEntry notebookEntry = qaService.getEntry(qaSession.getQaSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, QaAppConstants.MY_SIGNATURE, new Integer(user .getQueUsrId().toString())); - QaMonitoringAction.logger.debug("notebookEntry: " + notebookEntry); + if (notebookEntry != null) { ReflectionDTO reflectionDTO = new ReflectionDTO(); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java =================================================================== diff -u -rc527318c8c79f72151f6261342c5cc1a830d1e4d -r328cd4dbe60d9e5c588e13cc16b7e7414893b0af --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java (.../QaMonitoringStarterAction.java) (revision c527318c8c79f72151f6261342c5cc1a830d1e4d) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java (.../QaMonitoringStarterAction.java) (revision 328cd4dbe60d9e5c588e13cc16b7e7414893b0af) @@ -83,18 +83,18 @@ QaUtils.cleanUpSessionAbsolute(request); QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form; - logger.debug("qaMonitoringForm: " + qaMonitoringForm); + IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - logger.debug("qaService: " + qaService); + qaMonitoringForm.setQaService(qaService); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); logger.debug("contentFolderID: " + contentFolderID); qaMonitoringForm.setContentFolderID(contentFolderID); ActionForward validateParameters = validateParameters(request, mapping, qaMonitoringForm); - logger.debug("validateParamaters: " + validateParameters); + if (validateParameters != null) { return validateParameters; } @@ -119,13 +119,13 @@ qaMonitoringAction.initInstructionsContent(mapping, form, request, response); logger.debug("calling initStatsContent."); qaMonitoringAction.initStatsContent(mapping, form, request, response, generalMonitoringDTO); - logger.debug("post initStatsContent." + generalMonitoringDTO); + String toolContentID = qaMonitoringForm.getToolContentID(); logger.debug("toolContentID: " + toolContentID); QaContent qaContent = qaService.loadQa(new Long(toolContentID).longValue()); - logger.debug("existing qaContent:" + qaContent); + logger.debug("existing qaContent:" + qaContent.getUid()); /*true means there is at least 1 response*/ if (qaService.studentActivityOccurredGlobal(qaContent)) { @@ -145,7 +145,7 @@ generalMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - logger.debug("attachmentList: " + attachmentList); + generalMonitoringDTO.setAttachmentList(attachmentList); generalMonitoringDTO.setDeletedAttachmentList(new ArrayList()); /** ...till here * */ @@ -160,8 +160,8 @@ qaMonitoringAction.prepareReflectionData(request, qaContent, qaService, null, false, "All"); - logger.debug("final qaMonitoringForm: " + qaMonitoringForm); - logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO); + + request.setAttribute(QA_GENERAL_MONITORING_DTO, generalMonitoringDTO); /*for Edit Activity screen, BasicTab-ViewOnly*/ @@ -182,17 +182,13 @@ QaQueContent qaQueContent = (QaQueContent) queIterator.next(); if (qaQueContent != null) { - logger.debug("question: " + qaQueContent.getQuestion()); - logger.debug("displayorder: " + new Integer(qaQueContent.getDisplayOrder()).toString()); - logger.debug("feedback: " + qaQueContent.getFeedback()); - qaQuestionContentDTO.setQuestion(qaQueContent.getQuestion()); qaQuestionContentDTO.setDisplayOrder(new Integer(qaQueContent.getDisplayOrder()).toString()); qaQuestionContentDTO.setFeedback(qaQueContent.getFeedback()); listQuestionContentDTO.add(qaQuestionContentDTO); } } - logger.debug("listQuestionContentDTO: " + listQuestionContentDTO); + request.setAttribute(LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO); sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO); @@ -239,15 +235,15 @@ public boolean initialiseMonitoringData(ActionMapping mapping, QaMonitoringForm qaMonitoringForm, HttpServletRequest request, HttpServletResponse response, IQaService qaService, GeneralMonitoringDTO generalMonitoringDTO) { - logger.debug("start initializing monitoring data...: " + qaService); + logger.debug("start initializing monitoring data..."); generalMonitoringDTO.setEditResponse(new Boolean(false).toString()); generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); String toolContentID = qaMonitoringForm.getToolContentID(); logger.debug("toolContentID:" + toolContentID); QaContent qaContent = qaService.loadQa(new Long(toolContentID).longValue()); - logger.debug("existing qaContent:" + qaContent); + logger.debug("existing qaContent:" + qaContent.getUid()); if (qaContent == null) { QaUtils.cleanUpSessionAbsolute(request); @@ -258,7 +254,7 @@ logger.debug("refreshing summary data..."); GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent); - logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); + qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, false, "All"); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java =================================================================== diff -u -rc527318c8c79f72151f6261342c5cc1a830d1e4d -r328cd4dbe60d9e5c588e13cc16b7e7414893b0af --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java (.../QaStarterAction.java) (revision c527318c8c79f72151f6261342c5cc1a830d1e4d) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java (.../QaStarterAction.java) (revision 328cd4dbe60d9e5c588e13cc16b7e7414893b0af) @@ -150,7 +150,6 @@ import org.lamsfoundation.lams.tool.qa.QaApplicationException; import org.lamsfoundation.lams.tool.qa.QaComparator; import org.lamsfoundation.lams.tool.qa.QaCondition; -import org.lamsfoundation.lams.tool.qa.QaConfigItem; import org.lamsfoundation.lams.tool.qa.QaContent; import org.lamsfoundation.lams.tool.qa.QaGeneralAuthoringDTO; import org.lamsfoundation.lams.tool.qa.QaQueContent; @@ -181,7 +180,7 @@ QaUtils.cleanUpSessionAbsolute(request); QaStarterAction.logger.debug("init authoring mode."); QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form; - QaStarterAction.logger.debug("qaAuthoringForm: " + qaAuthoringForm); + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); QaStarterAction.logger.debug("contentFolderID: " + contentFolderID); @@ -203,7 +202,7 @@ QaStarterAction.logger.debug("obtaining qaService via proxy"); qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); } - QaStarterAction.logger.debug("qaService: " + qaService); + qaGeneralAuthoringDTO.setCurrentTab("1"); QaStarterAction.logger.debug("setting currrent tab to 1:"); @@ -329,10 +328,10 @@ QaStarterAction.logger.debug("getting existing content"); /* it is possible that the content is in use by learners. */ qaContent = qaService.loadQa(new Long(strToolContentID).longValue()); - QaStarterAction.logger.debug("qaContent: " + qaContent); + if (qaService.studentActivityOccurredGlobal(qaContent)) { QaUtils.cleanUpSessionAbsolute(request); - QaStarterAction.logger.debug("student activity occurred on this content:" + qaContent); + persistError(request, "error.content.inUse"); QaStarterAction.logger.debug("add error.content.inUse to ActionMessages."); return mapping.findForward(QaAppConstants.ERROR_LIST); @@ -343,11 +342,6 @@ QaStarterAction.logger.debug("post retrive content :" + sessionMap); } - QaStarterAction.logger.debug("qaGeneralAuthoringDTO.getOnlineInstructions() :" - + qaGeneralAuthoringDTO.getOnlineInstructions()); - QaStarterAction.logger.debug("qaGeneralAuthoringDTO.getOfflineInstructions():" - + qaGeneralAuthoringDTO.getOfflineInstructions()); - if (qaGeneralAuthoringDTO.getOnlineInstructions() == null || qaGeneralAuthoringDTO.getOnlineInstructions().length() == 0) { qaGeneralAuthoringDTO.setOnlineInstructions(QaAppConstants.DEFAULT_ONLINE_INST); @@ -368,22 +362,22 @@ sessionMap.put(QaAppConstants.ATTR_QA_AUTHORING_FORM, qaAuthoringForm); - QaStarterAction.logger.debug("final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); + QaStarterAction.logger.debug("will return to jsp with: " + sourceMcStarter); String destination = QaUtils.getDestination(sourceMcStarter, requestedModule); QaStarterAction.logger.debug("destination: " + destination); Map mapQuestionContentLocal = qaGeneralAuthoringDTO.getMapQuestionContent(); - QaStarterAction.logger.debug("mapQuestionContentLocal: " + mapQuestionContentLocal); + - QaStarterAction.logger.debug("mapQuestionContent: " + mapQuestionContent); + sessionMap.put(QaAppConstants.MAP_QUESTION_CONTENT_KEY, mapQuestionContent); QaStarterAction.logger.debug("persisting sessionMap into session: " + sessionMap); request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); - QaStarterAction.logger.debug("before fwding to jsp, qaAuthoringForm : " + qaAuthoringForm); - QaStarterAction.logger.debug("final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO); + + request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO); return mapping.findForward(destination); @@ -406,7 +400,7 @@ protected QaContent retrieveContent(HttpServletRequest request, ActionMapping mapping, QaAuthoringForm qaAuthoringForm, Map mapQuestionContent, long toolContentID, boolean isDefaultContent, IQaService qaService, QaGeneralAuthoringDTO qaGeneralAuthoringDTO, SessionMap sessionMap) { - QaStarterAction.logger.debug("starting retrieveContent: " + qaService); + QaStarterAction.logger.debug("toolContentID: " + toolContentID); QaStarterAction.logger.debug("isDefaultContent: " + isDefaultContent); @@ -415,7 +409,7 @@ if (isDefaultContent && qaContent.getConditions().isEmpty()) { qaContent.getConditions().add(qaService.createDefaultComplexCondition(qaContent)); } - QaStarterAction.logger.debug("QaContent: " + qaContent); + QaUtils.populateAuthoringDTO(request, qaContent, qaGeneralAuthoringDTO); @@ -460,15 +454,15 @@ mapQuestionContent.clear(); Iterator queIterator = qaContent.getQaQueContents().iterator(); Long mapIndex = new Long(1); - QaStarterAction.logger.debug("mapQuestionContent: " + mapQuestionContent); + while (queIterator.hasNext()) { QaQuestionContentDTO qaQuestionContentDTO = new QaQuestionContentDTO(); QaQueContent qaQueContent = (QaQueContent) queIterator.next(); if (qaQueContent != null) { - QaStarterAction.logger.debug("question: " + qaQueContent.getQuestion()); - QaStarterAction.logger.debug("displayorder: " + new Integer(qaQueContent.getDisplayOrder()).toString()); - QaStarterAction.logger.debug("feedback: " + qaQueContent.getFeedback()); + + + mapQuestionContent.put(mapIndex.toString(), qaQueContent.getQuestion()); @@ -485,11 +479,11 @@ mapIndex = new Long(mapIndex.longValue() + 1); } } - QaStarterAction.logger.debug("Map initialized with existing contentid to: " + mapQuestionContent); + request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(mapQuestionContent.size())); - QaStarterAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO); + request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO); sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO); @@ -512,11 +506,11 @@ } - QaStarterAction.logger.debug("mapQuestionContent is:" + mapQuestionContent); + qaGeneralAuthoringDTO.setMapQuestionContent(mapQuestionContent); - QaStarterAction.logger.debug("qaContent.getOnlineInstructions():" + qaContent.getOnlineInstructions()); - QaStarterAction.logger.debug("qaContent.getOfflineInstructions():" + qaContent.getOfflineInstructions()); + + qaGeneralAuthoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions()); qaGeneralAuthoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); @@ -528,7 +522,7 @@ QaStarterAction.logger.debug("ACTIVITY_TITLE_KEY set to:" + sessionMap.get(QaAppConstants.ACTIVITY_TITLE_KEY)); qaAuthoringForm.resetUserAction(); - QaStarterAction.logger.debug("returning qaContent:" + qaContent); + return qaContent; } @@ -546,7 +540,7 @@ */ public boolean readSignature(HttpServletRequest request, ActionMapping mapping, IQaService qaService, QaGeneralAuthoringDTO qaGeneralAuthoringDTO, QaAuthoringForm qaAuthoringForm) { - QaStarterAction.logger.debug("qaService: " + qaService); + /* * retrieve the default content id based on tool signature */ @@ -578,10 +572,10 @@ persistError(request, "error.defaultContent.notSetup"); return false; } - QaStarterAction.logger.debug("using qaContent: " + qaContent); + QaStarterAction.logger.debug("using qaContent uid: " + qaContent.getUid()); contentUID = qaContent.getUid().longValue(); - QaStarterAction.logger.debug("contentUID: " + contentUID); + } catch (Exception e) { QaStarterAction.logger.debug("Exception occured: No default question content"); persistError(request, "error.defaultContent.notSetup");