Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieServiceImpl.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieServiceImpl.java,v diff -u -r1.43 -r1.44 --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieServiceImpl.java 11 Feb 2014 14:00:13 -0000 1.43 +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieServiceImpl.java 27 Mar 2014 08:01:52 -0000 1.44 @@ -155,18 +155,10 @@ @Override public Scratchie getScratchieByContentId(Long contentId) { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered getScratchieByContentId(), getting Scratchie by content ID: " + contentId); - } Scratchie rs = scratchieDao.getByContentId(contentId); if (rs == null) { ScratchieServiceImpl.log.debug("Could not find the content by given ID:" + contentId); } - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leafing getScratchieByContentId(), retrieved Scratchie by content ID: " + contentId); - } return rs; } @@ -187,24 +179,12 @@ @Override public List getAuthoredItems(Long scratchieUid) { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered getAuthoredItems(), getting ScratchieItems by Scratchie UID: " + scratchieUid); - } List res = scratchieItemDao.getAuthoringItems(scratchieUid); - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving getAuthoredItems(), retrieved ScratchieItems by Scratchie UID: " + scratchieUid); - } return res; } @Override public void createUser(ScratchieUser scratchieUser) { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered createUser(), saving ScratchieUser login: " + scratchieUser.getLoginName()); - } scratchieUserDao.saveObject(scratchieUser); } @@ -216,58 +196,31 @@ @Override public void saveOrUpdateScratchie(Scratchie scratchie) { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered saveOrUpdateScratchie(), saving Scratchie UID: " + scratchie.getUid()); - } scratchieDao.saveObject(scratchie); } @Override public void deleteScratchieItem(Long uid) { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered deleteScratchieItem(), deleting ScratchieItem UID: " + uid); - } scratchieItemDao.removeObject(ScratchieItem.class, uid); } @Override public ScratchieUser checkLeaderSelectToolForSessionLeader(ScratchieUser user, Long toolSessionId) { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: checkLeaderSelectToolForSessionLeader(), for ScratchieUser ID: " + user.getUserId() - + " and ScratchieSession ID: " + toolSessionId); - } if ((user == null) || (toolSessionId == null)) { return null; } - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting ScratchieSession by ID: " + toolSessionId); - } ScratchieSession scratchieSession = getScratchieSessionBySessionId(toolSessionId); ScratchieUser leader = scratchieSession.getGroupLeader(); // check leader select tool for a leader only in case scratchie tool doesn't know it. As otherwise it will screw // up previous scratches done if (leader == null) { - - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting LeaderUserId by toolSessionId: " + toolSessionId + " and userId: " - + user.getUserId().intValue()); - } Long leaderUserId = toolService.getLeaderUserId(toolSessionId, user.getUserId().intValue()); if (leaderUserId != null) { leader = getUserByIDAndSession(leaderUserId, toolSessionId); // create new user in a DB if (leader == null) { ScratchieServiceImpl.log.debug("creating new user with userId: " + leaderUserId); - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" - + Thread.activeCount() + "]: getting User by ID: " + leaderUserId); - } User leaderDto = (User) getUserManagementService().findById(User.class, leaderUserId.intValue()); leader = new ScratchieUser(leaderDto.getUserDTO(), scratchieSession); this.createUser(leader); @@ -278,11 +231,6 @@ saveOrUpdateScratchieSession(scratchieSession); } } - - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving checkLeaderSelectToolForSessionLeader()"); - } return leader; } @@ -314,85 +262,39 @@ @Override public Scratchie getScratchieBySessionId(Long sessionId) { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered getScratchieBySessionId(), getting ScratchieSession by ID: " + sessionId); - } ScratchieSession session = scratchieSessionDao.getSessionBySessionId(sessionId); // to skip CGLib problem Long contentId = session.getScratchie().getContentId(); - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting Scratchie by content ID: " + contentId); - } - Scratchie res = scratchieDao.getByContentId(contentId); - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving getScratchieBySessionId(), retrieved Scratchie by ScratchieSession ID: " + sessionId - + " and content ID: " + contentId); - } - return res; + return scratchieDao.getByContentId(contentId); } @Override public ScratchieSession getScratchieSessionBySessionId(Long sessionId) { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered getScratchieSessionBySessionId(), getting ScratchieSession by ID: " + sessionId); - } - ScratchieSession res = scratchieSessionDao.getSessionBySessionId(sessionId); - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving getScratchieSessionBySessionId(), session retrieved by ID: " + sessionId); - } - return res; + return scratchieSessionDao.getSessionBySessionId(sessionId); } @Override public void saveOrUpdateScratchieSession(ScratchieSession resSession) { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered saveOrUpdateScratchieSession(), saving ScratchieSession with ID: " - + resSession.getSessionId()); - } scratchieSessionDao.saveObject(resSession); } @Override public void recordItemScratched(Long sessionId, Long answerUid) { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered recordItemScratched(), getting ScratchieAnswer by UID: " + answerUid); - } ScratchieAnswer answer = this.getScratchieAnswerByUid(answerUid); if (answer == null) { return; } - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting ScratchieAnswerVisitLog by ScratchieAnswer UID : " + answerUid + " and sessionId: " - + sessionId); - } ScratchieAnswerVisitLog log = scratchieAnswerVisitDao.getLog(answerUid, sessionId); if (log == null) { log = new ScratchieAnswerVisitLog(); log.setScratchieAnswer(answer); log.setSessionId(sessionId); log.setAccessDate(new Timestamp(new Date().getTime())); - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: saving ScratchieAnswerVisitLog for ScratchieAnswer UID : " + answerUid - + " and ScratchieSession ID: " + sessionId); - } scratchieAnswerVisitDao.saveObject(log); } this.recalculateMarkForSession(sessionId, false); - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving recordItemScratched() for ScratchieAnswer UID: " + answerUid); - } } /** @@ -403,11 +305,6 @@ */ @Override public void recalculateMarkForSession(Long sessionId, boolean isPropagateToGradebook) { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered recalculateMarkForSession(), getting ScratchieAnswerVisitLog by sessionId : " - + sessionId); - } List userLogs = scratchieAnswerVisitDao.getLogsBySession(sessionId); ScratchieSession session = this.getScratchieSessionBySessionId(sessionId); Scratchie scratchie = session.getScratchie(); @@ -429,76 +326,32 @@ if (isPropagateToGradebook) { List users = this.getUsersBySession(sessionId); for (ScratchieUser user : users) { - - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" - + Thread.activeCount() - + "]: using GradebookService to update ActivityMark for ScratchieUser ID: " - + user.getUserId() + " and ScratchieSession ID: " + user.getSession().getSessionId()); - } gradebookService.updateActivityMark(new Double(mark), null, user.getUserId().intValue(), user .getSession().getSessionId(), false); } } - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving recalculateMarkForSession() for sessionId: " + sessionId); - } } @Override public ScratchieAnswer getScratchieAnswerByUid(Long answerUid) { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving getScratchieAnswerByUid() for UID: " + answerUid); - } ScratchieAnswer res = (ScratchieAnswer) userManagementService.findById(ScratchieAnswer.class, answerUid); - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving getScratchieAnswerByUid() for UID: " + answerUid); - } return res; } @Override public void setScratchingFinished(Long toolSessionId) { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered setScratchingFinished() for session ID: " + toolSessionId); - } ScratchieSession session = this.getScratchieSessionBySessionId(toolSessionId); session.setScratchingFinished(true); - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: saving Scratchiesession uid: " + session.getUid()); - } - scratchieSessionDao.saveObject(session); - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving setScratchingFinished() for session ID: " + toolSessionId); - } + scratchieSessionDao.saveObject(session); } @Override public String finishToolSession(Long toolSessionId, Long userId) throws ScratchieApplicationException { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered finishToolSession() for user ID: " + userId + " and session ID: " + toolSessionId); - } String nextUrl = null; try { - - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting ScratchieUser by user ID: " + userId + " and session ID: " + toolSessionId); - } ScratchieUser user = scratchieUserDao.getUserByUserIDAndSessionID(userId, toolSessionId); user.setSessionFinished(true); - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: saving ScratchieUser with user ID: " + userId); - } scratchieUserDao.saveObject(user); nextUrl = this.leaveToolSession(toolSessionId, userId); @@ -507,86 +360,40 @@ } catch (ToolException e) { throw new ScratchieApplicationException(e); } - - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving finishToolSession() for user ID: " + userId + " and session ID: " + toolSessionId); - } return nextUrl; } @Override public ScratchieItem getScratchieItemByUid(Long itemUid) { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered getScratchieItemByUid(), getting ScratchieItem UID: " + itemUid); - } return scratchieItemDao.getByUid(itemUid); } @Override public Set getAllLeaders(Long contentId) { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered getAllLeaders() for content ID: " + contentId); - } - Set leaders = new TreeSet(); - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting ScratchieSession with content ID: " + contentId); - } List sessionList = scratchieSessionDao.getByContentId(contentId); for (ScratchieSession session : sessionList) { ScratchieUser leader = session.getGroupLeader(); if (leader != null) { leaders.add(leader); } } - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving getAllLeaders() for content ID: " + contentId); - } return leaders; } @Override public List getUsersBySession(Long toolSessionId) { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log - .debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered getUsersBySession(), getting ScratchieUsers by ScratchieSession ID: " - + toolSessionId); - } - List res = scratchieUserDao.getBySessionID(toolSessionId); - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving getUsersBySession(), retrieved ScratchieUsers by ScratchieSession ID: " - + toolSessionId); - } - return res; + return scratchieUserDao.getBySessionID(toolSessionId); } @Override public void saveUser(ScratchieUser user) { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered saveUser(), saving ScratchieUser ID: " + user.getUserId()); - } scratchieUserDao.saveObject(user); } @Override public List getMonitoringSummary(Long contentId, boolean isIncludeOnlyLeaders) { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered getMonitoringSummary() for content ID: " + contentId); - } List groupSummaryList = new ArrayList(); - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting ScratchieSessions with content ID: " + contentId); - } List sessionList = scratchieSessionDao.getByContentId(contentId); for (ScratchieSession session : sessionList) { @@ -598,10 +405,6 @@ int totalAttempts = scratchieAnswerVisitDao.getLogCountTotal(sessionId); groupSummary.setTotalAttempts(totalAttempts); - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting ScratchieUsers with session ID: " + sessionId); - } List sessionUsers = scratchieUserDao.getBySessionID(sessionId); List usersToShow = new LinkedList(); for (ScratchieUser user : sessionUsers) { @@ -616,36 +419,18 @@ groupSummary.setUsers(usersToShow); groupSummaryList.add(groupSummary); } - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving getMonitoringSummary() for content ID: " + contentId); - } return groupSummaryList; } @Override public void getScratchesOrder(Collection items, Long sessionId) { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered getScratchesOrder() for toolSessionId: " + sessionId); - } for (ScratchieItem item : items) { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting ScratchieAnswerVisitLogs by toolSessionId: " + sessionId + ") and item UID: " - + item.getUid()); - } List itemLogs = scratchieAnswerVisitDao.getLogsBySessionAndItem(sessionId, item.getUid()); for (ScratchieAnswer answer : (Set) item.getAnswers()) { int attemptNumber; - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" - + Thread.activeCount() + "]: getting ScratchieAnswerVisitLog by toolSessionId: " - + sessionId + " ans answer UID: " + answer.getUid()); - } ScratchieAnswerVisitLog log = scratchieAnswerVisitDao.getLog(answer.getUid(), sessionId); if (log == null) { // -1 if there is no log @@ -658,18 +443,10 @@ answer.setAttemptOrder(attemptNumber); } } - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving getScratchesOrder() for sessionId: " + sessionId); - } } @Override public Set getItemsWithIndicatedScratches(Long toolSessionId) { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered getItemsWithIndicatedScratches() for session ID: " + toolSessionId); - } List userLogs = scratchieAnswerVisitDao.getLogsBySession(toolSessionId); Scratchie scratchie = this.getScratchieBySessionId(toolSessionId); @@ -698,10 +475,6 @@ boolean isItemUnraveled = this.isItemUnraveled(item, userLogs); item.setUnraveled(isItemUnraveled); } - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving getItemsWithIndicatedScratches() for session ID: " + toolSessionId); - } return items; } @@ -776,23 +549,10 @@ @Override public List getQuestionSummary(Long contentId, Long itemUid) { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered getQuestionSummary() for content ID: " + contentId + " and item UID: " + itemUid); - } List groupSummaryList = new ArrayList(); - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting ScratchieItem by UID: " + itemUid); - } ScratchieItem item = scratchieItemDao.getByUid(itemUid); Collection answers = item.getAnswers(); - - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting ScratchieSession by content ID: " + contentId); - } List sessionList = scratchieSessionDao.getByContentId(contentId); for (ScratchieSession session : sessionList) { Long sessionId = session.getSessionId(); @@ -810,18 +570,9 @@ answer.setAttempts(attempts); answerMap.put(dbAnswer.getUid(), answer); } - - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting ScratchieAnswerVisitLog by item UID: " + itemUid); - } List sessionAttempts = scratchieAnswerVisitDao.getLogsBySessionAndItem(sessionId, itemUid); - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting ScratchieUsers by session ID: " + sessionId); - } List users = scratchieUserDao.getBySessionID(sessionId); // calculate attempts table @@ -876,10 +627,6 @@ groupSummaryTotal.setAnswers(sortedAnswers); groupSummaryList.add(0, groupSummaryTotal); } - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving getQuestionSummary() for content ID: " + contentId + " and item UID: " + itemUid); - } return groupSummaryList; } @@ -941,16 +688,7 @@ @Override public ScratchieUser getUser(Long uid) { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered getUser() for UID: " + uid); - } - ScratchieUser res = (ScratchieUser) scratchieUserDao.getObject(ScratchieUser.class, uid); - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving getUser() for UID: " + uid); - } - return res; + return (ScratchieUser) scratchieUserDao.getObject(ScratchieUser.class, uid); } @Override @@ -1620,16 +1358,7 @@ @Override public boolean isGroupedActivity(long toolContentID) { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered isGroupedActivity() for content ID: " + toolContentID); - } - boolean res = toolService.isGroupedActivity(toolContentID); - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving isGroupedActivity() for content ID: " + toolContentID); - } - return res; + return toolService.isGroupedActivity(toolContentID); } // ***************************************************************************** @@ -1851,38 +1580,16 @@ @Override public void createToolSession(Long toolSessionId, String toolSessionName, Long toolContentId) throws ToolException { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered createToolSession() for session ID: " + toolSessionId + " and content ID: " - + toolContentId); - } ScratchieSession session = new ScratchieSession(); session.setSessionId(toolSessionId); session.setSessionName(toolSessionName); - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting Scratchie by content ID: " + toolContentId); - } Scratchie scratchie = scratchieDao.getByContentId(toolContentId); session.setScratchie(scratchie); - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: creating ScratchieSession with ID: " + toolSessionId); - } scratchieSessionDao.saveObject(session); - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving createToolSession() for session ID: " + toolSessionId + " and content ID: " - + toolContentId); - } } @Override public String leaveToolSession(Long toolSessionId, Long learnerId) throws DataMissingException, ToolException { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered leaveToolSession() for user ID: " + learnerId + " and session ID: " + toolSessionId); - } if (toolSessionId == null) { ScratchieServiceImpl.log.error("Fail to leave tool Session based on null tool session id."); throw new ToolException("Fail to remove tool Session based on null tool session id."); @@ -1891,35 +1598,17 @@ ScratchieServiceImpl.log.error("Fail to leave tool Session based on null learner."); throw new ToolException("Fail to remove tool Session based on null learner."); } - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting ScratchieSession with ID: " + toolSessionId); - } ScratchieSession session = scratchieSessionDao.getSessionBySessionId(toolSessionId); if (session != null) { session.setStatus(ScratchieConstants.COMPLETED); - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: saving ScratchieSession with ID: " + toolSessionId); - } scratchieSessionDao.saveObject(session); } else { ScratchieServiceImpl.log.error("Fail to leave tool Session.Could not find shared scratchie " + "session by given session id: " + toolSessionId); throw new DataMissingException("Fail to leave tool Session." + "Could not find shared scratchie session by given session id: " + toolSessionId); } - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: calling LearnerService.completeToolSession() for user ID: " + learnerId + " and session ID: " - + toolSessionId); - } - String res = learnerService.completeToolSession(toolSessionId, learnerId); - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving leaveToolSession() for user ID: " + learnerId + " and session ID: " + toolSessionId); - } - return res; + return learnerService.completeToolSession(toolSessionId, learnerId); } @Override Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/action/LearningAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/action/LearningAction.java,v diff -u -r1.39 -r1.40 --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/action/LearningAction.java 17 Jan 2014 22:12:28 -0000 1.39 +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/action/LearningAction.java 27 Mar 2014 08:01:52 -0000 1.40 @@ -134,24 +134,12 @@ */ private ActionForward start(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ScratchieApplicationException { - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered start()"); - } initializeScratchieService(); ToolAccessMode mode = WebUtil.readToolAccessModeParam(request, AttributeNames.PARAM_MODE, true); final Long toolSessionId = new Long(request.getParameter(ScratchieConstants.PARAM_TOOL_SESSION_ID)); - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting ScratchieSession by ID: " + toolSessionId); - } ScratchieSession toolSession = LearningAction.service.getScratchieSessionBySessionId(toolSessionId); // get back the scratchie and item list and display them on page - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting Scratchi by session ID: " + toolSessionId); - } final Scratchie scratchie = LearningAction.service.getScratchieBySessionId(toolSessionId); boolean isReflectOnActivity = scratchie.isReflectOnActivity(); @@ -164,11 +152,6 @@ user = getCurrentUser(toolSessionId); } - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: trying to execute checkLeaderSelectToolForSessionLeader for user ID: " + user.getUserId() - + " and session ID: " + toolSessionId); - } final ScratchieUser groupLeader = (ScratchieUser) tryExecute(new Callable() { @Override public Object call() throws ScratchieApplicationException { @@ -180,10 +163,6 @@ if ((groupLeader == null) && !mode.isTeacher()) { // get group users and store it to request as DTO objects - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting ScratchieUsers by session ID: " + toolSessionId); - } List groupUsers = LearningAction.service.getUsersBySession(toolSessionId); List groupUserDtos = new ArrayList(); for (ScratchieUser groupUser : groupUsers) { @@ -195,20 +174,12 @@ request.setAttribute(ScratchieConstants.ATTR_GROUP_USERS, groupUserDtos); request.setAttribute(ScratchieConstants.PARAM_TOOL_SESSION_ID, toolSessionId); request.setAttribute(ScratchieConstants.ATTR_SCRATCHIE, scratchie); - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving start(), waiting for leader"); - } return mapping.findForward("waitforleader"); } // initial Session Map SessionMap sessionMap = new SessionMap(); request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: setting sessionMapID to " + sessionMap.getSessionID()); - } request.setAttribute(ScratchieConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); // get notebook entry @@ -239,20 +210,12 @@ // add define later support if (scratchie.isDefineLater()) { - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving start()"); - } return mapping.findForward("defineLater"); } // set contentInUse flag to true! scratchie.setContentInUse(true); scratchie.setDefineLater(false); - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: trying to execute saveOrUpdateScratchie() with content ID: " + scratchie.getContentId()); - } tryExecute(new Callable() { @Override public Object call() throws ScratchieApplicationException { @@ -279,27 +242,15 @@ // calculate whether submission deadline has passed, and if so forward to "submissionDeadline" if (currentLearnerDate.after(tzSubmissionDeadline)) { - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving start()"); - } return mapping.findForward("submissionDeadline"); } } // set scratched flag for display purpose - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting ScratchieItems for session ID: " + toolSessionId); - } Collection items = LearningAction.service.getItemsWithIndicatedScratches(toolSessionId); // for teacher in monitoring display the number of attempt. if (mode.isTeacher()) { - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting Scratches order for toolSessionId: " + toolSessionId); - } LearningAction.service.getScratchesOrder(items, toolSessionId); } @@ -333,19 +284,10 @@ ActionRedirect redirect = new ActionRedirect(mapping.findForwardConfig("showResults")); redirect.addParameter(ScratchieConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); redirect.addParameter(AttributeNames.ATTR_MODE, mode); - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving start()"); - } return redirect; //show learning.jsp page } else { - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving start()"); - } - sessionMap.put(ScratchieConstants.ATTR_IS_SCRATCHING_FINISHED, (Boolean) isScratchingFinished); sessionMap.put(ScratchieConstants.ATTR_IS_WAITING_FOR_LEADER_TO_SUBMIT_NOTEBOOK, (Boolean) isWaitingForLeaderToSubmitNotebook); @@ -361,32 +303,15 @@ */ private ActionForward refreshQuestionList(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ScratchieApplicationException { - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered refreshQuestionList()"); - } initializeScratchieService(); String sessionMapID = request.getParameter(ScratchieConstants.ATTR_SESSION_MAP_ID); - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: sessionMapID is " + sessionMapID); - } SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); request.setAttribute(ScratchieConstants.ATTR_SESSION_MAP_ID, sessionMapID); Long toolSessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID); - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting ScratchieSession by ID: " + toolSessionId); - } ScratchieSession toolSession = LearningAction.service.getScratchieSessionBySessionId(toolSessionId); // set scratched flag for display purpose - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting ScratchieItems by session ID: " + toolSessionId - + " and putting them in sessionMap(!)"); - } Set items = LearningAction.service.getItemsWithIndicatedScratches(toolSessionId); sessionMap.put(ScratchieConstants.ATTR_ITEM_LIST, items); @@ -398,10 +323,6 @@ // refresh ScratchingFinished status sessionMap.put(ScratchieConstants.ATTR_IS_SCRATCHING_FINISHED, toolSession.isScratchingFinished()); - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving refreshQuestionList()"); - } return mapping.findForward(ScratchieConstants.SUCCESS); } @@ -410,10 +331,6 @@ */ private ActionForward checkLeaderSubmittedNotebook(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws JSONException, IOException { - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered checkLeaderSubmittedNotebook()"); - } initializeScratchieService(); // get back SessionMap @@ -439,10 +356,6 @@ response.setContentType("application/x-json;charset=utf-8"); response.getWriter().print(JSONObject); - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving checkLeaderSubmittedNotebook()"); - } return null; } @@ -451,17 +364,9 @@ */ private ActionForward isAnswerCorrect(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws JSONException, IOException { - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered isAnswerCorrect()"); - } initializeScratchieService(); Long answerUid = NumberUtils.createLong(request.getParameter(ScratchieConstants.PARAM_ANSWER_UID)); - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting ScratchieAnswer by UID: " + answerUid); - } ScratchieAnswer answer = LearningAction.service.getScratchieAnswerByUid(answerUid); if (answer == null) { return mapping.findForward(ScratchieConstants.ERROR); @@ -472,10 +377,6 @@ response.setContentType("application/x-json;charset=utf-8"); response.getWriter().print(JSONObject); - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving isAnswerCorrect()"); - } return null; } @@ -486,52 +387,27 @@ */ private ActionForward recordItemScratched(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws JSONException, IOException, ScratchieApplicationException { - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered recordItemScratched()"); - } initializeScratchieService(); String sessionMapID = WebUtil.readStrParam(request, ScratchieConstants.ATTR_SESSION_MAP_ID); - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: sessionMapID is " + sessionMapID); - } SessionMap sessionMap = (SessionMap) request.getSession().getAttribute( sessionMapID); final Long toolSessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID); - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting ScratchieSession by ID: " + toolSessionId); - } ScratchieSession toolSession = LearningAction.service.getScratchieSessionBySessionId(toolSessionId); ScratchieUser leader = this.getCurrentUser(toolSessionId); // only leaders are allowed to scratch answers if (!toolSession.isUserGroupLeader(leader.getUid())) { - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving recordItemScratched(), it is not a leader"); - } return null; } final Long answerUid = NumberUtils.createLong(request.getParameter(ScratchieConstants.PARAM_ANSWER_UID)); - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: trying to execute recordItemScratched() for leader ID: " + leader.getUserId() - + " and answer UID: " + answerUid); - } tryExecute(new Callable() { @Override public Object call() throws ScratchieApplicationException { LearningAction.service.recordItemScratched(toolSessionId, answerUid); return null; } }); - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving recordItemScratched()"); - } return null; } @@ -547,36 +423,20 @@ */ private ActionForward showResults(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ScratchieApplicationException { - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered showResults()"); - } initializeScratchieService(); // get back SessionMap String sessionMapID = request.getParameter(ScratchieConstants.ATTR_SESSION_MAP_ID); - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: sessionMapID is " + sessionMapID); - } SessionMap sessionMap = (SessionMap) request.getSession().getAttribute( sessionMapID); request.setAttribute(ScratchieConstants.ATTR_SESSION_MAP_ID, sessionMapID); boolean isReflectOnActivity = (Boolean) sessionMap.get(ScratchieConstants.ATTR_REFLECTION_ON); final Long toolSessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID); - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting ScratchiSession by ID " + toolSessionId); - } ScratchieSession toolSession = LearningAction.service.getScratchieSessionBySessionId(toolSessionId); Long userUid = (Long) sessionMap.get(ScratchieConstants.ATTR_USER_UID); // in case of the leader (and if he hasn't done this when accessing notebook) we should let all other learners see Next Activity button if (toolSession.isUserGroupLeader(userUid) && !toolSession.isScratchingFinished()) { - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: trying to execute setScratchingFinished() for session ID: " + toolSessionId); - } tryExecute(new Callable() { @Override public Object call() throws ScratchieApplicationException { @@ -594,10 +454,6 @@ // Create reflectList if reflection is enabled. if (isReflectOnActivity) { - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting reflections by content ID: " + toolSession.getScratchie().getContentId()); - } List reflections = LearningAction.service.getReflectionList(toolSession.getScratchie() .getContentId(), false); @@ -618,10 +474,6 @@ request.setAttribute(ScratchieConstants.ATTR_REFLECTIONS, reflections); } - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving showResults()"); - } return mapping.findForward(ScratchieConstants.SUCCESS); } @@ -636,17 +488,9 @@ */ private ActionForward finish(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered finish()"); - } initializeScratchieService(); // get back SessionMap String sessionMapID = request.getParameter(ScratchieConstants.ATTR_SESSION_MAP_ID); - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: sessionMapID is " + sessionMapID); - } SessionMap sessionMap = (SessionMap) request.getSession().getAttribute( sessionMapID); final Long toolSessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID); @@ -657,11 +501,6 @@ String nextActivityUrl = null; try { - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: trying to execute finishToolSession() for user ID: " + userId + " and session ID: " - + toolSessionId); - } nextActivityUrl = (String) tryExecute(new Callable() { @Override public Object call() throws ScratchieApplicationException { @@ -673,10 +512,6 @@ } catch (ScratchieApplicationException e) { LearningAction.log.error("Failed get next activity url:" + e.getMessage()); } - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving finish()"); - } return mapping.findForward(ScratchieConstants.SUCCESS); } @@ -718,10 +553,6 @@ // in case of the leader we should let all other learners see Next Activity button if (toolSession.isUserGroupLeader(userUid) && !toolSession.isScratchingFinished()) { - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: trying to execute setScratchingFinished() for session ID: " + toolSessionId); - } tryExecute(new Callable() { @Override public Object call() throws ScratchieApplicationException { @@ -802,10 +633,6 @@ for (int i = 0; i < MAX_TRANSACTION_RETRIES; i++) { try { returnValue = command.call(); - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: successfully called command"); - } break; } catch (CannotAcquireLockException e) { if (i == (MAX_TRANSACTION_RETRIES - 1)) { @@ -833,26 +660,12 @@ HttpSession ss = SessionManager.getSession(); // get back login user DTO UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log - .debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting current ScratchieUser with ID: " + user.getUserID() + " and session ID: " - + sessionId); - } ScratchieUser scratchieUser = LearningAction.service.getUserByIDAndSession(user.getUserID().longValue(), sessionId); if (scratchieUser == null) { - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting Scratchie by session ID: " + sessionId); - } ScratchieSession session = LearningAction.service.getScratchieSessionBySessionId(sessionId); final ScratchieUser newScratchieUser = new ScratchieUser(user, session); - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: creating ScratchieUser with ID: " + user.getUserID() + " and session ID: " + sessionId); - } tryExecute(new Callable() { @Override public Object call() throws ScratchieApplicationException { @@ -867,10 +680,6 @@ } private ScratchieUser getSpecifiedUser(Long sessionId, Integer userId) { - if (LearningAction.log.isDebugEnabled()) { - LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: getting specified ScratchieUser with ID: " + userId + " and session ID: " + sessionId); - } ScratchieUser scratchieUser = LearningAction.service.getUserByIDAndSession(userId.longValue(), sessionId); if (scratchieUser == null) { LearningAction.log