Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/dbupdates/patch20131212.sql =================================================================== diff -u -r5f17c3cb67da973c8210adb711298bd363d4ceed -rc01bd4b6b818ad0e3bd91a9743a300f2a36f2047 --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/dbupdates/patch20131212.sql (.../patch20131212.sql) (revision 5f17c3cb67da973c8210adb711298bd363d4ceed) +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/dbupdates/patch20131212.sql (.../patch20131212.sql) (revision c01bd4b6b818ad0e3bd91a9743a300f2a36f2047) @@ -34,6 +34,13 @@ ALTER TABLE tl_lascrt11_answer_log ADD INDEX sessionIdIndex (session_id), ADD CONSTRAINT sessionIdIndex FOREIGN KEY (session_id) REFERENCES tl_lascrt11_session (session_id); ALTER TABLE tl_lascrt11_scratchie_answer ADD INDEX FK_scratchie_answer_1 (scratchie_item_uid), ADD CONSTRAINT FK_scratchie_answer_1 FOREIGN KEY (scratchie_item_uid) REFERENCES tl_lascrt11_scratchie_item (uid); +--Remove create_by from tl_lascrt11_scratchie +ALTER TABLE table tl_lascrt11_scratchie DROP FOREIGN KEY FK_NEW_610529188_89093BF758092FB; +ALTER TABLE table tl_lascrt11_scratchie DROP INDEX FK_NEW_610529188_89093BF758092FB; +ALTER TABLE table tl_lascrt11_scratchie DROP COLUMN create_by; + +UPDATE lams_tool SET tool_version='20131212' WHERE tool_signature='lascrt11'; + ----------------------Put all sql statements above here------------------------- -- If there were no errors, commit and restore autocommit to on Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/model/Scratchie.java =================================================================== diff -u -r98d6135d78b975d3d7487470795b4a9e5bbf2bc6 -rc01bd4b6b818ad0e3bd91a9743a300f2a36f2047 --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/model/Scratchie.java (.../Scratchie.java) (revision 98d6135d78b975d3d7487470795b4a9e5bbf2bc6) +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/model/Scratchie.java (.../Scratchie.java) (revision c01bd4b6b818ad0e3bd91a9743a300f2a36f2047) @@ -80,8 +80,6 @@ private Date submissionDeadline; - private ScratchieUser createdBy; - // scratchie Items private Set scratchieItems; @@ -117,10 +115,6 @@ toContent = (Scratchie) defaultContent.clone(); toContent.setContentId(contentId); - // reset user info as well - if (toContent.getCreatedBy() != null) { - toContent.getCreatedBy().setScratchie(toContent); - } return toContent; } @@ -155,10 +149,6 @@ } scratchie.attachments = set; } - // clone ReourceUser as well - if (createdBy != null) { - scratchie.setCreatedBy((ScratchieUser) createdBy.clone()); - } } catch (CloneNotSupportedException e) { Scratchie.log.error("When clone " + Scratchie.class + " failed"); } @@ -181,13 +171,13 @@ .append(instructions, genericEntity.instructions) .append(onlineInstructions, genericEntity.onlineInstructions) .append(offlineInstructions, genericEntity.offlineInstructions).append(created, genericEntity.created) - .append(updated, genericEntity.updated).append(createdBy, genericEntity.createdBy).isEquals(); + .append(updated, genericEntity.updated).isEquals(); } @Override public int hashCode() { return new HashCodeBuilder().append(uid).append(title).append(instructions).append(onlineInstructions) - .append(offlineInstructions).append(created).append(updated).append(createdBy).toHashCode(); + .append(offlineInstructions).append(created).append(updated).toHashCode(); } /** @@ -278,24 +268,6 @@ } /** - * @return Returns the userid of the user who created the Share scratchie. - * - * @hibernate.many-to-one cascade="save-update" column="create_by" - * - */ - public ScratchieUser getCreatedBy() { - return createdBy; - } - - /** - * @param createdBy - * The userid of the user who created this Share scratchie. - */ - public void setCreatedBy(ScratchieUser createdBy) { - this.createdBy = createdBy; - } - - /** * @hibernate.id column="uid" generator-class="native" */ public Long getUid() { Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/model/ScratchieSession.java =================================================================== diff -u -r9908e067a5350bea350dea231dbe734558e67be8 -rc01bd4b6b818ad0e3bd91a9743a300f2a36f2047 --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/model/ScratchieSession.java (.../ScratchieSession.java) (revision 9908e067a5350bea350dea231dbe734558e67be8) +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/model/ScratchieSession.java (.../ScratchieSession.java) (revision c01bd4b6b818ad0e3bd91a9743a300f2a36f2047) @@ -27,6 +27,7 @@ import java.util.Set; import org.apache.log4j.Logger; +import org.lamsfoundation.lams.tool.scratchie.ScratchieConstants; /** * Scratchie @@ -197,7 +198,8 @@ } /** - * Indicates whether leader has pressed Submit button in learning. And is shared by all users in a group. + * Indicates whether leader has pressed Continue button in learning thus finishing scratching. And is shared by all + * users in a group. * * @hibernate.property column="scratching_finished" * @return @@ -210,4 +212,9 @@ this.scratchingFinished = scratchingFinished; } + public boolean isSessionFinished() { + boolean isSessionFinished = (status == ScratchieConstants.COMPLETED); + return isSessionFinished; + } + } Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/model/ScratchieUser.java =================================================================== diff -u -r9908e067a5350bea350dea231dbe734558e67be8 -rc01bd4b6b818ad0e3bd91a9743a300f2a36f2047 --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/model/ScratchieUser.java (.../ScratchieUser.java) (revision 9908e067a5350bea350dea231dbe734558e67be8) +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/model/ScratchieUser.java (.../ScratchieUser.java) (revision c01bd4b6b818ad0e3bd91a9743a300f2a36f2047) @@ -63,16 +63,6 @@ this.sessionFinished = false; } - public ScratchieUser(UserDTO user, Scratchie content) { - this.userId = new Long(user.getUserID().intValue()); - this.firstName = user.getFirstName(); - this.lastName = user.getLastName(); - this.loginName = user.getLogin(); - this.session = null; - this.scratchie = content; - this.sessionFinished = false; - } - /** * Clone method from java.lang.Object */ Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/IScratchieService.java =================================================================== diff -u -r9908e067a5350bea350dea231dbe734558e67be8 -rc01bd4b6b818ad0e3bd91a9743a300f2a36f2047 --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/IScratchieService.java (.../IScratchieService.java) (revision 9908e067a5350bea350dea231dbe734558e67be8) +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/IScratchieService.java (.../IScratchieService.java) (revision c01bd4b6b818ad0e3bd91a9743a300f2a36f2047) @@ -103,14 +103,6 @@ void createUser(ScratchieUser scratchieUser); /** - * Get user by given userID and toolContentID. - * - * @param long1 - * @return - */ - ScratchieUser getUserByIDAndContent(Long userID, Long contentId); - - /** * Get user by sessionID and UserID * * @param userId Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieImportContentVersionFilter.java =================================================================== diff -u --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieImportContentVersionFilter.java (revision 0) +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieImportContentVersionFilter.java (revision c01bd4b6b818ad0e3bd91a9743a300f2a36f2047) @@ -0,0 +1,54 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $Id$ */ +package org.lamsfoundation.lams.tool.scratchie.service; + +import org.lamsfoundation.lams.learningdesign.service.ToolContentVersionFilter; +import org.lamsfoundation.lams.tool.scratchie.model.Scratchie; +import org.lamsfoundation.lams.tool.scratchie.model.ScratchieAnswer; +import org.lamsfoundation.lams.tool.scratchie.model.ScratchieSession; +import org.lamsfoundation.lams.tool.scratchie.model.ScratchieUser; + +/** + * Import filter class for different version of Scratchie content. + * + */ +public class ScratchieImportContentVersionFilter extends ToolContentVersionFilter { + + /** + * Import 20131130 version content to 20131212 version tool server. + * + */ + public void up20131130To20131212() { + this.removeField(ScratchieUser.class, "totalAttempts"); + this.removeField(ScratchieUser.class, "scratchingFinished"); + this.removeField(ScratchieUser.class, "mark"); + + this.removeField(Scratchie.class, "createdBy"); + + this.removeField(ScratchieAnswer.class, "scratchieItem"); + + this.addField(ScratchieSession.class, "mark", new Integer(0)); + this.addField(ScratchieSession.class, "scratchingFinished", new Integer(0)); + } +} Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieServiceImpl.java =================================================================== diff -u -r6c7287d8b8db1612f4e3e189c6fbe1bf2bd2cb81 -rc01bd4b6b818ad0e3bd91a9743a300f2a36f2047 --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieServiceImpl.java (.../ScratchieServiceImpl.java) (revision 6c7287d8b8db1612f4e3e189c6fbe1bf2bd2cb81) +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieServiceImpl.java (.../ScratchieServiceImpl.java) (revision c01bd4b6b818ad0e3bd91a9743a300f2a36f2047) @@ -270,22 +270,6 @@ } @Override - public ScratchieUser getUserByIDAndContent(Long userId, Long contentId) { - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: entered getUserByIDAndContent(), getting ScratchieUser by ID: " + userId - + " and content ID: " + contentId); - } - ScratchieUser res = scratchieUserDao.getUserByUserIDAndContentID(userId, contentId); - if (ScratchieServiceImpl.log.isDebugEnabled()) { - ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() - + "]: leaving getUserByIDAndContent(), retrieved ScratchieUser by ID: " + userId - + " and content ID: " + contentId); - } - return res; - } - - @Override public ScratchieUser getUserByIDAndSession(Long userId, Long sessionId) { if (ScratchieServiceImpl.log.isDebugEnabled()) { ScratchieServiceImpl.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() @@ -1952,6 +1936,9 @@ exportContentService.registerFileClassForImport(ScratchieAttachment.class.getName(), "fileUuid", "fileVersionId", "fileName", "fileType", null, null); + // register version filter class + exportContentService.registerImportVersionFilterClass(ScratchieImportContentVersionFilter.class); + Object toolPOJO = exportContentService.importToolContent(toolContentPath, scratchieToolContentHandler, fromVersion, toVersion); if (!(toolPOJO instanceof Scratchie)) { @@ -1973,7 +1960,6 @@ user.setUserId(new Long(newUserUid.longValue())); user.setScratchie(toolContentObj); } - toolContentObj.setCreatedBy(user); scratchieDao.saveObject(toolContentObj); } catch (ImportToolContentException e) { Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/action/AuthoringAction.java =================================================================== diff -u -r98d6135d78b975d3d7487470795b4a9e5bbf2bc6 -rc01bd4b6b818ad0e3bd91a9743a300f2a36f2047 --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/action/AuthoringAction.java (.../AuthoringAction.java) (revision 98d6135d78b975d3d7487470795b4a9e5bbf2bc6) +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/action/AuthoringAction.java (.../AuthoringAction.java) (revision c01bd4b6b818ad0e3bd91a9743a300f2a36f2047) @@ -336,19 +336,6 @@ scratchiePO.setUpdated(new Timestamp(new Date().getTime())); } - // *******************************Handle user******************* - // try to get form system session - HttpSession ss = SessionManager.getSession(); - // get back login user DTO - UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); - ScratchieUser scratchieUser = service.getUserByIDAndContent(new Long(user.getUserID().intValue()), - scratchieForm.getScratchie().getContentId()); - if (scratchieUser == null) { - scratchieUser = new ScratchieUser(user, scratchiePO); - } - - scratchiePO.setCreatedBy(scratchieUser); - // **********************************Handle Authoring Instruction // Attachement ********************* // merge attachment info Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/action/LearningAction.java =================================================================== diff -u -r5a56024b9d5241a08dd08252c5be795a3a024912 -rc01bd4b6b818ad0e3bd91a9743a300f2a36f2047 --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/action/LearningAction.java (.../LearningAction.java) (revision 5a56024b9d5241a08dd08252c5be795a3a024912) +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/action/LearningAction.java (.../LearningAction.java) (revision c01bd4b6b818ad0e3bd91a9743a300f2a36f2047) @@ -150,6 +150,7 @@ + "]: getting Scratchi by session ID: " + toolSessionId); } final Scratchie scratchie = LearningAction.service.getScratchieBySessionId(toolSessionId); + boolean isReflectOnActivity = scratchie.isReflectOnActivity(); final ScratchieUser user; if ((mode != null) && mode.isTeacher()) { @@ -209,7 +210,7 @@ // get notebook entry String entryText = new String(); - if (groupLeader != null) { + if (isReflectOnActivity && (groupLeader != null)) { NotebookEntry notebookEntry = LearningAction.service.getEntry(toolSessionId, CoreNotebookConstants.NOTEBOOK_TOOL, ScratchieConstants.TOOL_SIGNATURE, groupLeader.getUserId() .intValue()); @@ -237,7 +238,7 @@ sessionMap.put(AttributeNames.PARAM_TOOL_SESSION_ID, toolSessionId); sessionMap.put(AttributeNames.ATTR_MODE, mode); // reflection information - sessionMap.put(ScratchieConstants.ATTR_REFLECTION_ON, scratchie.isReflectOnActivity()); + sessionMap.put(ScratchieConstants.ATTR_REFLECTION_ON, isReflectOnActivity); sessionMap.put(ScratchieConstants.ATTR_REFLECTION_INSTRUCTION, scratchie.getReflectInstructions()); sessionMap.put(ScratchieConstants.ATTR_REFLECTION_ENTRY, entryText); @@ -328,11 +329,12 @@ sessionMap.put(ScratchieConstants.ATTR_ITEM_LIST, items); sessionMap.put(ScratchieConstants.ATTR_SCRATCHIE, scratchie); sessionMap.put(ScratchieConstants.ATTR_MAX_SCORE, maxScore); + boolean isScratchingFinished = toolSession.isScratchingFinished(); - sessionMap.put(ScratchieConstants.ATTR_IS_SCRATCHING_FINISHED, isScratchingFinished); // decide whether to show results page or learning one - if (isScratchingFinished && !mode.isTeacher()) { + boolean isShowResults = isScratchingFinished && !mode.isTeacher(); + if (isShowResults) { ActionRedirect redirect = new ActionRedirect(mapping.findForwardConfig("showResults")); redirect.addParameter(ScratchieConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); redirect.addParameter(AttributeNames.ATTR_MODE, mode); @@ -346,6 +348,8 @@ LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() + "]: leaving start()"); } + + sessionMap.put(ScratchieConstants.ATTR_IS_SCRATCHING_FINISHED, (Boolean) isScratchingFinished); return mapping.findForward(ScratchieConstants.SUCCESS); } @@ -394,6 +398,7 @@ // 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()"); @@ -516,6 +521,7 @@ 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()) { @@ -525,8 +531,8 @@ ScratchieSession toolSession = LearningAction.service.getScratchieSessionBySessionId(toolSessionId); Long userUid = (Long) sessionMap.get(ScratchieConstants.ATTR_USER_UID); - // in case of the leader we should let all other learners see Next Activity button - if (toolSession.isUserGroupLeader(userUid)) { + // 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); @@ -547,7 +553,6 @@ request.setAttribute(ScratchieConstants.ATTR_SCORE, (int) percentage); // Create reflectList if reflection is enabled. - boolean isReflectOnActivity = (Boolean) sessionMap.get(ScratchieConstants.ATTR_REFLECTION_ON); if (isReflectOnActivity) { if (LearningAction.log.isDebugEnabled()) { LearningAction.log.debug("LKC:[" + Thread.currentThread().getId() + "|" + Thread.activeCount() @@ -630,31 +635,6 @@ return mapping.findForward(ScratchieConstants.SUCCESS); } - private Object tryExecute(Callable command) throws ScratchieApplicationException { - final int MAX_TRANSACTION_RETRIES = 5; - Object returnValue = null; - - 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)) { - throw new ScratchieApplicationException(e); - } - } catch (Exception e) { - throw new ScratchieApplicationException(e); - } - LearningAction.log.warn("Transaction retry: " + (i + 1)); - } - - return returnValue; - } - /** * Display empty reflection form. * @@ -663,31 +643,49 @@ * @param request * @param response * @return + * @throws ScratchieApplicationException */ private ActionForward newReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { + HttpServletResponse response) throws ScratchieApplicationException { initializeScratchieService(); - // get session value String sessionMapID = WebUtil.readStrParam(request, ScratchieConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); + final Long toolSessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID); + Long userUid = (Long) sessionMap.get(ScratchieConstants.ATTR_USER_UID); - ReflectionForm refForm = (ReflectionForm) form; HttpSession ss = SessionManager.getSession(); UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + ReflectionForm refForm = (ReflectionForm) form; refForm.setUserID(user.getUserID()); refForm.setSessionMapID(sessionMapID); - + // get the existing reflection entry - SessionMap map = (SessionMap) request.getSession().getAttribute(sessionMapID); - Long toolSessionID = (Long) map.get(AttributeNames.PARAM_TOOL_SESSION_ID); - NotebookEntry entry = LearningAction.service.getEntry(toolSessionID, CoreNotebookConstants.NOTEBOOK_TOOL, + NotebookEntry entry = LearningAction.service.getEntry(toolSessionId, CoreNotebookConstants.NOTEBOOK_TOOL, ScratchieConstants.TOOL_SIGNATURE, user.getUserID()); if (entry != null) { refForm.setEntryText(entry.getEntry()); } + + ScratchieSession toolSession = LearningAction.service.getScratchieSessionBySessionId(toolSessionId); + // 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 { + LearningAction.service.setScratchingFinished(toolSessionId); + return null; + } + }); + } + return mapping.findForward(ScratchieConstants.SUCCESS); } @@ -748,6 +746,35 @@ // Private method // ************************************************************************************* + /** + * Tries to execute supplied command. If it fails due to CannotAcquireLockException it tries again, and gives up + * after 5 consecutive fails. + */ + private Object tryExecute(Callable command) throws ScratchieApplicationException { + final int MAX_TRANSACTION_RETRIES = 5; + Object returnValue = null; + + 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)) { + throw new ScratchieApplicationException(e); + } + } catch (Exception e) { + throw new ScratchieApplicationException(e); + } + LearningAction.log.warn("Transaction retry: " + (i + 1)); + } + + return returnValue; + } + private void initializeScratchieService() { if (LearningAction.service == null) { WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet() Index: lams_tool_scratchie/web/pages/learning/learning.jsp =================================================================== diff -u -r0f1d0cc4e194182f9384119b42101bfa18a18085 -rc01bd4b6b818ad0e3bd91a9743a300f2a36f2047 --- lams_tool_scratchie/web/pages/learning/learning.jsp (.../learning.jsp) (revision 0f1d0cc4e194182f9384119b42101bfa18a18085) +++ lams_tool_scratchie/web/pages/learning/learning.jsp (.../learning.jsp) (revision c01bd4b6b818ad0e3bd91a9743a300f2a36f2047) @@ -11,7 +11,6 @@ - @@ -79,8 +78,9 @@ document.location.href=''; } + var refreshIntervalId = null; if (${!isUserLeader && mode != "teacher"}) { - setInterval("refreshQuestionList();",3000);// Auto-Refresh every 3 seconds + refreshIntervalId = setInterval("refreshQuestionList();",3000);// Auto-Refresh every 3 seconds } function refreshQuestionList() { Index: lams_tool_scratchie/web/pages/learning/questionlist.jsp =================================================================== diff -u -rbff78521da917cfaff7cccf024f8cf0a343db734 -rc01bd4b6b818ad0e3bd91a9743a300f2a36f2047 --- lams_tool_scratchie/web/pages/learning/questionlist.jsp (.../questionlist.jsp) (revision bff78521da917cfaff7cccf024f8cf0a343db734) +++ lams_tool_scratchie/web/pages/learning/questionlist.jsp (.../questionlist.jsp) (revision c01bd4b6b818ad0e3bd91a9743a300f2a36f2047) @@ -14,6 +14,13 @@ + +

${item.title}

${item.description}