Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaQuestionDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaQuestionDAO.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaQuestionDAO.java 16 Mar 2011 19:53:07 -0000 1.1.2.1 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaQuestionDAO.java 18 Mar 2011 17:58:14 -0000 1.1.2.2 @@ -43,11 +43,11 @@ public void removeQaQueContent(QaQuestion qaQuestion); - public List getAllQuestionEntries(final long qaContentId); + public List getAllQuestionEntries(final long contentUid); - public QaQuestion getQuestionContentByQuestionText(final String question, Long qaContentId); + public QaQuestion getQuestionContentByQuestionText(final String question, Long contentUid); - public QaQuestion getQuestionByDisplayOrder(Long displayOrder, Long qaContentId); + public QaQuestion getQuestionByDisplayOrder(Long displayOrder, Long contentUid); - public List getAllQuestionEntriesSorted(final long qaContentId); + public List getAllQuestionEntriesSorted(final long �ontentUid); } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaQuestionDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaQuestionDAO.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaQuestionDAO.java 16 Mar 2011 19:53:07 -0000 1.1.2.1 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaQuestionDAO.java 18 Mar 2011 17:58:14 -0000 1.1.2.2 @@ -39,16 +39,16 @@ * */ public class QaQuestionDAO extends HibernateDaoSupport implements IQaQuestionDAO { - private static final String LOAD_QUESTION_BY_CONTENT_ID = "from qaQuestion in class QaQuestion where qaQuestion.qaContent.qaContentId=:qaContentId"; - private static final String LOAD_QUESTION_CONTENT_BY_QUESTION_TEXT = "from qaQuestion in class QaQuestion where qaQuestion.question=:question and qaQuestion.qaContent.qaContentId=:qaContentId"; - private static final String LOAD_QUESTION_CONTENT_BY_DISPLAY_ORDER = "from qaQuestion in class QaQuestion where qaQuestion.displayOrder=:displayOrder and qaQuestion.qaContent.qaContentId=:qaContentId"; - private static final String SORT_QUESTION_CONTENT_BY_DISPLAY_ORDER = "from qaQuestion in class QaQuestion where qaQuestion.qaContent.qaContentId=:qaContentId order by qaQuestion.displayOrder"; + private static final String LOAD_QUESTION_BY_CONTENT_UID = "from qaQuestion in class QaQuestion where qaQuestion.qaContent.uid=:uid"; + private static final String LOAD_QUESTION_CONTENT_BY_QUESTION_TEXT = "from qaQuestion in class QaQuestion where qaQuestion.question=:question and qaQuestion.qaContent.uid=:uid"; + private static final String LOAD_QUESTION_CONTENT_BY_DISPLAY_ORDER = "from qaQuestion in class QaQuestion where qaQuestion.displayOrder=:displayOrder and qaQuestion.qaContent.uid=:uid"; + private static final String SORT_QUESTION_CONTENT_BY_DISPLAY_ORDER = "from qaQuestion in class QaQuestion where qaQuestion.qaContent.uid=:uid order by qaQuestion.displayOrder"; - public QaQuestion getQuestionContentByQuestionText(final String question, Long qaContentId) { + public QaQuestion getQuestionContentByQuestionText(final String question, Long contentUid) { HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(QaQuestionDAO.LOAD_QUESTION_CONTENT_BY_QUESTION_TEXT).setString( - "question", question).setLong("qaContentId", qaContentId.longValue()).list(); + "question", question).setLong("uid", contentUid.longValue()).list(); if (list != null && list.size() > 0) { QaQuestion qa = (QaQuestion) list.get(0); @@ -57,9 +57,9 @@ return null; } - public QaQuestion getQuestionByDisplayOrder(Long displayOrder, Long qaContentId) { + public QaQuestion getQuestionByDisplayOrder(Long displayOrder, Long contentUid) { List list = getSession().createQuery(QaQuestionDAO.LOAD_QUESTION_CONTENT_BY_DISPLAY_ORDER).setLong( - "displayOrder", displayOrder.longValue()).setLong("qaContentId", qaContentId.longValue()).list(); + "displayOrder", displayOrder.longValue()).setLong("uid", contentUid.longValue()).list(); if (list != null && list.size() > 0) { QaQuestion qa = (QaQuestion) list.get(0); @@ -68,18 +68,18 @@ return null; } - public List getAllQuestionEntriesSorted(final long qaContentId) { + public List getAllQuestionEntriesSorted(final long contentUid) { HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(QaQuestionDAO.SORT_QUESTION_CONTENT_BY_DISPLAY_ORDER).setLong( - "qaContentId", qaContentId).list(); + "uid", contentUid).list(); return list; } - public List getAllQuestionEntries(final long qaContentId) { + public List getAllQuestionEntries(final long contentUid) { HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(QaQuestionDAO.LOAD_QUESTION_BY_CONTENT_ID).setLong( - "qaContentId", qaContentId).list(); + List list = getSession().createQuery(QaQuestionDAO.LOAD_QUESTION_BY_CONTENT_UID).setLong( + "uid", contentUid).list(); return list; } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java,v diff -u -r1.88.8.2 -r1.88.8.3 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java 16 Mar 2011 19:55:28 -0000 1.88.8.2 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java 18 Mar 2011 17:58:14 -0000 1.88.8.3 @@ -315,11 +315,17 @@ QaQueUsr user = getUserByIdAndSession(userId, new Long(toolSessionID)); QaSession session = getSessionById(new Long(toolSessionID)); + //set content in use QaContent qaContent = session.getQaContent(); + if (! qaContent.isContentLocked()) { + qaContent.setContentLocked(true); + updateQa(qaContent); + } + QaQuestion question = getQuestionByContentAndDisplayOrder(new Long(questionDisplayOrder), - qaContent.getQaContentId()); + qaContent.getUid()); - logger.debug("newAnswer " + newAnswer); + QaUsrResp response = getResponseByUserAndQuestion(user.getQueUsrId(), question.getUid()); // if response doesn't exist if (response == null) { @@ -474,9 +480,9 @@ } } - public List getAllQuestionEntriesSorted(final long qaContentId) throws QaApplicationException { + public List getAllQuestionEntriesSorted(final long contentUid) throws QaApplicationException { try { - return qaQuestionDAO.getAllQuestionEntriesSorted(qaContentId); + return qaQuestionDAO.getAllQuestionEntriesSorted(contentUid); } catch (DataAccessException e) { throw new QaApplicationException("Exception occured when lams is getting all question entries: " + e.getMessage(), e); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/AuthoringUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/AuthoringUtil.java,v diff -u -r1.49.4.1.4.6 -r1.49.4.1.4.7 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/AuthoringUtil.java 16 Mar 2011 19:56:50 -0000 1.49.4.1.4.6 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/AuthoringUtil.java 18 Mar 2011 17:58:14 -0000 1.49.4.1.4.7 @@ -509,8 +509,6 @@ */ protected QaContent createQuestionContent(List listQuestionContentDTO, IQaService qaService, QaContent qaContent) { - AuthoringUtil.logger.debug("createQuestionContent: content uid is: " + qaContent.getUid()); - int displayOrder = 0; for ( QaQuestionDTO questionContentDTO : listQuestionContentDTO ) { Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java,v diff -u -r1.18.8.2 -r1.18.8.3 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java 16 Mar 2011 19:56:48 -0000 1.18.8.2 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java 18 Mar 2011 17:58:13 -0000 1.18.8.3 @@ -151,8 +151,6 @@ } public void teacher(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) { - logger.debug("starting teacher mode..."); - IQaService qaService = QaServiceProxy.getQaService(getServletContext()); if (toolContentID == null) { @@ -170,25 +168,17 @@ } QaMonitoringAction qaMonitoringAction = new QaMonitoringAction(); - logger.debug("start refreshSummaryData for teacher mode."); - GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(content); 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); request.getSession().setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); - request.getSession().setAttribute(PORTFOLIO_EXPORT_MODE, "teacher"); qaMonitoringAction.prepareReflectionData(request, content, qaService, null, true, "All"); request.setAttribute("currentMonitoredToolSession", "All"); MonitoringUtil.generateGroupsSessionData(request, qaService, content, true); - - logger.debug("ending teacher mode: "); } } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/LearningUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/LearningUtil.java,v diff -u -r1.41.8.3 -r1.41.8.4 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/LearningUtil.java 16 Mar 2011 19:56:49 -0000 1.41.8.3 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/LearningUtil.java 18 Mar 2011 17:58:14 -0000 1.41.8.4 @@ -186,18 +186,6 @@ return userFeedback; } - - /** - * content with id has been marked LOCKED and updated in the db - * - * @param toolContentID - * @param qaService - */ - public static void setContentInUse(long toolContentID, IQaService qaService) { - QaContent qaContent = qaService.getQa(toolContentID); - qaContent.setContentLocked(true); - qaService.updateQa(qaContent); - } /** */ Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java,v diff -u -r1.28.8.3 -r1.28.8.4 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java 16 Mar 2011 19:56:48 -0000 1.28.8.3 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java 18 Mar 2011 17:58:13 -0000 1.28.8.4 @@ -1758,7 +1758,7 @@ qaAuthoringForm.setDefineLaterInEditMode(new Boolean(true).toString()); qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); - boolean isContentInUse = QaUtils.isContentInUse(qaContent); + boolean isContentInUse = qaContent.isContentLocked(); qaGeneralAuthoringDTO.setMonitoredContentInUse(new Boolean(false).toString()); if (isContentInUse == true) { Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java,v diff -u -r1.37.4.1.4.3 -r1.37.4.1.4.4 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java 16 Mar 2011 19:56:49 -0000 1.37.4.1.4.3 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java 18 Mar 2011 17:58:13 -0000 1.37.4.1.4.4 @@ -362,14 +362,10 @@ String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); String userID = request.getParameter("userID"); QaSession qaSession = qaService.getSessionById(new Long(toolSessionID).longValue()); - Long toolContentID = qaSession.getQaContent().getQaContentId(); QaContent qaContent = qaSession.getQaContent(); String httpSessionID = qaLearningForm.getHttpSessionID(); - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - Map mapAnswers = (Map) sessionMap.get(MAP_ALL_RESULTS_KEY); -// LearningUtil.storeResponses(mapAnswers, qaService, toolContentID, new Long(toolSessionID)); //mark response as finalised QaQueUsr qaQueUsr = getCurrentUser(toolSessionID); qaQueUsr.setResponseFinalized(true); @@ -378,9 +374,6 @@ qaLearningForm.resetUserActions(); qaLearningForm.setSubmitAnswersContent(null); - //content has been set in use - LearningUtil.setContentInUse(toolContentID, qaService); - if (qaContent.isShowOtherAnswers()) { GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent); generalLearnerFlowDTO.setHttpSessionID(httpSessionID); @@ -474,8 +467,6 @@ QaSession qaSession = qaService.getSessionById(new Long(toolSessionID).longValue()); - String toolContentID = qaSession.getQaContent().getQaContentId().toString(); - QaContent qaContent = qaSession.getQaContent(); GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent); @@ -496,8 +487,6 @@ qaLearningForm.resetUserActions(); qaLearningForm.setSubmitAnswersContent(null); - LearningUtil.setContentInUse(new Long(toolContentID).longValue(), qaService); - QaMonitoringAction qaMonitoringAction = new QaMonitoringAction(); qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, isUserNamesVisible, true, toolSessionID, userID, generalLearnerFlowDTO, false, toolSessionID); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java,v diff -u -r1.61.8.4 -r1.61.8.5 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java 16 Mar 2011 19:56:49 -0000 1.61.8.4 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java 18 Mar 2011 17:58:13 -0000 1.61.8.5 @@ -201,8 +201,7 @@ generalMonitoringDTO.setEditResponse(new Boolean(false).toString()); EditActivityDTO editActivityDTO = new EditActivityDTO(); - boolean isContentInUse = QaUtils.isContentInUse(qaContent); - QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); + boolean isContentInUse = qaContent.isContentLocked(); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } @@ -321,7 +320,7 @@ prepareEditActivityScreenData(request, qaContent); EditActivityDTO editActivityDTO = new EditActivityDTO(); - boolean isContentInUse = QaUtils.isContentInUse(qaContent); + boolean isContentInUse = qaContent.isContentLocked(); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); @@ -406,8 +405,6 @@ * "in use" and content in use is not modifiable */ QaContent qaContent = qaService.getQa(new Long(strToolContentID).longValue()); - QaMonitoringAction.logger.debug("qaContent:" + qaContent.getUid()); - Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService); request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions); @@ -436,8 +433,7 @@ request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO); EditActivityDTO editActivityDTO = new EditActivityDTO(); - boolean isContentInUse = QaUtils.isContentInUse(qaContent); - QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); + boolean isContentInUse = qaContent.isContentLocked(); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } @@ -558,8 +554,7 @@ generalMonitoringDTO.setEditResponse(new Boolean(false).toString()); EditActivityDTO editActivityDTO = new EditActivityDTO(); - boolean isContentInUse = QaUtils.isContentInUse(qaContent); - QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); + boolean isContentInUse = qaContent.isContentLocked(); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } @@ -797,8 +792,7 @@ prepareEditActivityScreenData(request, qaContent); EditActivityDTO editActivityDTO = new EditActivityDTO(); - boolean isContentInUse = QaUtils.isContentInUse(qaContent); - QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); + boolean isContentInUse = qaContent.isContentLocked(); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } @@ -907,8 +901,7 @@ prepareEditActivityScreenData(request, qaContent); EditActivityDTO editActivityDTO = new EditActivityDTO(); - boolean isContentInUse = QaUtils.isContentInUse(qaContent); - QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); + boolean isContentInUse = qaContent.isContentLocked(); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } @@ -998,8 +991,7 @@ prepareEditActivityScreenData(request, qaContent); EditActivityDTO editActivityDTO = new EditActivityDTO(); - boolean isContentInUse = QaUtils.isContentInUse(qaContent); - QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); + boolean isContentInUse = qaContent.isContentLocked(); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } @@ -1117,8 +1109,7 @@ prepareEditActivityScreenData(request, qaContent); EditActivityDTO editActivityDTO = new EditActivityDTO(); - boolean isContentInUse = QaUtils.isContentInUse(qaContent); - QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); + boolean isContentInUse = qaContent.isContentLocked(); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } @@ -1215,8 +1206,7 @@ prepareEditActivityScreenData(request, qaContent); EditActivityDTO editActivityDTO = new EditActivityDTO(); - boolean isContentInUse = QaUtils.isContentInUse(qaContent); - QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); + boolean isContentInUse = qaContent.isContentLocked(); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } @@ -1314,8 +1304,7 @@ prepareEditActivityScreenData(request, qaContent); EditActivityDTO editActivityDTO = new EditActivityDTO(); - boolean isContentInUse = QaUtils.isContentInUse(qaContent); - QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); + boolean isContentInUse = qaContent.isContentLocked(); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } @@ -1377,8 +1366,7 @@ prepareEditActivityScreenData(request, qaContent); EditActivityDTO editActivityDTO = new EditActivityDTO(); - boolean isContentInUse = QaUtils.isContentInUse(qaContent); - QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); + boolean isContentInUse = qaContent.isContentLocked(); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } @@ -1456,9 +1444,7 @@ generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } - boolean isContentInUse = QaUtils.isContentInUse(qaContent); - QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); - + boolean isContentInUse = qaContent.isContentLocked(); generalMonitoringDTO.setMonitoredContentInUse(new Boolean(false).toString()); if (isContentInUse == true) { @@ -1585,8 +1571,7 @@ prepareEditActivityScreenData(request, qaContent); EditActivityDTO editActivityDTO = new EditActivityDTO(); - boolean isContentInUse = QaUtils.isContentInUse(qaContent); - QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); + boolean isContentInUse = qaContent.isContentLocked(); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } @@ -1688,8 +1673,7 @@ prepareEditActivityScreenData(request, qaContent); EditActivityDTO editActivityDTO = new EditActivityDTO(); - boolean isContentInUse = QaUtils.isContentInUse(qaContent); - QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); + boolean isContentInUse = qaContent.isContentLocked(); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } @@ -1777,7 +1761,7 @@ prepareEditActivityScreenData(request, qaContent); EditActivityDTO editActivityDTO = new EditActivityDTO(); - boolean isContentInUse = QaUtils.isContentInUse(qaContent); + boolean isContentInUse = qaContent.isContentLocked(); QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); @@ -1869,7 +1853,7 @@ prepareEditActivityScreenData(request, qaContent); EditActivityDTO editActivityDTO = new EditActivityDTO(); - boolean isContentInUse = QaUtils.isContentInUse(qaContent); + boolean isContentInUse = qaContent.isContentLocked(); QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); @@ -1956,8 +1940,7 @@ prepareEditActivityScreenData(request, qaContent); EditActivityDTO editActivityDTO = new EditActivityDTO(); - boolean isContentInUse = QaUtils.isContentInUse(qaContent); - QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); + boolean isContentInUse = qaContent.isContentLocked(); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java,v diff -u -r1.53.8.3 -r1.53.8.4 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java 16 Mar 2011 19:56:50 -0000 1.53.8.3 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java 18 Mar 2011 17:58:13 -0000 1.53.8.4 @@ -118,19 +118,12 @@ generalMonitoringDTO.setContentFolderID(contentFolderID); QaMonitoringAction qaMonitoringAction = new QaMonitoringAction(); - logger.debug("calling initSummaryContent."); qaMonitoringAction.initSummaryContent(mapping, form, request, response); - logger.debug("calling initInstructionsContent."); qaMonitoringAction.initInstructionsContent(mapping, form, request, response); - logger.debug("calling initStatsContent."); qaMonitoringAction.initStatsContent(mapping, form, request, response, generalMonitoringDTO); - String toolContentID = qaMonitoringForm.getToolContentID(); - logger.debug("toolContentID: " + toolContentID); - QaContent qaContent = qaService.getQa(new Long(toolContentID).longValue()); - logger.debug("existing qaContent:" + qaContent.getUid()); /*true means there is at least 1 response*/ if (qaService.isStudentActivityOccurredGlobal(qaContent)) { @@ -156,8 +149,7 @@ /** ...till here * */ EditActivityDTO editActivityDTO = new EditActivityDTO(); - boolean isContentInUse = QaUtils.isContentInUse(qaContent); - logger.debug("isContentInUse:" + isContentInUse); + boolean isContentInUse = qaContent.isContentLocked(); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } @@ -242,34 +234,22 @@ public boolean initialiseMonitoringData(ActionMapping mapping, QaMonitoringForm qaMonitoringForm, HttpServletRequest request, HttpServletResponse response, IQaService qaService, GeneralMonitoringDTO generalMonitoringDTO) { - 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.getQa(new Long(toolContentID).longValue()); - logger.debug("existing qaContent:" + qaContent.getUid()); - if (qaContent == null) { QaUtils.cleanUpSessionAbsolute(request); return false; } QaMonitoringAction qaMonitoringAction = new QaMonitoringAction(); - logger.debug("refreshing summary data..."); - GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent); - - qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, false, "All"); - - logger.debug("refreshing stats data..."); qaMonitoringAction.refreshStatsData(request, qaMonitoringForm, qaService, generalMonitoringDTO); - logger.debug("end initialising monitoring data..."); return true; } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java,v diff -u -r1.71.4.1.4.3 -r1.71.4.1.4.4 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java 16 Mar 2011 19:56:49 -0000 1.71.4.1.4.3 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java 18 Mar 2011 17:58:13 -0000 1.71.4.1.4.4 @@ -512,14 +512,10 @@ public boolean readSignature(HttpServletRequest request, ActionMapping mapping, IQaService qaService, QaGeneralAuthoringDTO qaGeneralAuthoringDTO, QaAuthoringForm qaAuthoringForm) { - /* - * retrieve the default content id based on tool signature - */ + // retrieve the default content id based on tool signature long defaultContentID = 0; try { - QaStarterAction.logger.debug("attempt retrieving tool with signatute : " + QaAppConstants.MY_SIGNATURE); defaultContentID = qaService.getToolDefaultContentIdBySignature(QaAppConstants.MY_SIGNATURE); - QaStarterAction.logger.debug("retrieved tool default contentId: " + defaultContentID); if (defaultContentID == 0) { QaStarterAction.logger.debug("default content id has not been setup"); return false; @@ -530,30 +526,20 @@ return false; } - /* - * retrieve uid of the content based on default content id determined above - */ - long contentUID = 0; + // retrieve uid of the content based on default content id determined above try { - QaStarterAction.logger.debug("retrieve uid of the content based on default content id determined above: " - + defaultContentID); QaContent qaContent = qaService.getQa(defaultContentID); if (qaContent == null) { - QaStarterAction.logger.debug("Exception occured: No default content"); + QaStarterAction.logger.error("Exception occured: No default content"); persistError(request, "error.defaultContent.notSetup"); return false; } - - QaStarterAction.logger.debug("using qaContent uid: " + qaContent.getUid()); - contentUID = qaContent.getUid().longValue(); - } catch (Exception e) { - QaStarterAction.logger.debug("Exception occured: No default question content"); + QaStarterAction.logger.error("Exception occured: No default question content"); persistError(request, "error.defaultContent.notSetup"); return false; } - QaStarterAction.logger.debug("QA tool has the default content id: " + defaultContentID); qaGeneralAuthoringDTO.setDefaultContentIdStr(new Long(defaultContentID).toString()); qaAuthoringForm.setDefaultContentIdStr(new Long(defaultContentID).toString());