Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieServiceImpl.java =================================================================== diff -u -rbeb150b1b726c122ccc5af1ba95083105f9948b8 -r052d4255bd6583c51a3ec2f8907646508bd1061c --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieServiceImpl.java (.../ScratchieServiceImpl.java) (revision beb150b1b726c122ccc5af1ba95083105f9948b8) +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieServiceImpl.java (.../ScratchieServiceImpl.java) (revision 052d4255bd6583c51a3ec2f8907646508bd1061c) @@ -522,8 +522,6 @@ ScratchieSession session = this.getScratchieSessionBySessionId(toolSessionId); session.setScratchingFinished(true); scratchieSessionDao.saveObject(session); - - LearningWebsocketServer.sendCloseRequest(toolSessionId); } @Override Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/action/LearningAction.java =================================================================== diff -u -rbeb150b1b726c122ccc5af1ba95083105f9948b8 -r052d4255bd6583c51a3ec2f8907646508bd1061c --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/action/LearningAction.java (.../LearningAction.java) (revision beb150b1b726c122ccc5af1ba95083105f9948b8) +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/action/LearningAction.java (.../LearningAction.java) (revision 052d4255bd6583c51a3ec2f8907646508bd1061c) @@ -328,13 +328,13 @@ boolean isShowResults = (isScratchingFinished && !isWaitingForLeaderToSubmitNotebook && !isWaitingForLeaderToSubmitBurningQuestions) && !mode.isTeacher(); - // show leader showBurningQuestions page + // show showBurningQuestions page to the leader if (isUserLeader && isScratchingFinished && isWaitingForLeaderToSubmitBurningQuestions) { ActionRedirect redirect = new ActionRedirect(mapping.findForwardConfig("showBurningQuestions")); redirect.addParameter(ScratchieConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); return redirect; - // show leader notebook page + // show notebook page to the leader } else if (isUserLeader && isScratchingFinished && isWaitingForLeaderToSubmitNotebook) { ActionRedirect redirect = new ActionRedirect(mapping.findForwardConfig("newReflection")); redirect.addParameter(ScratchieConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); @@ -483,13 +483,18 @@ final Long toolSessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID); ScratchieSession toolSession = 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 + boolean isUserFinished = (boolean) sessionMap.get(ScratchieConstants.ATTR_USER_FINISHED); + if (toolSession.isUserGroupLeader(userUid) && !toolSession.isScratchingFinished()) { service.setScratchingFinished(toolSessionId); } + // in case of the leader (and if he hasn't done this last time accessing showResults page) we should let all other learners + // see Next Activity button + if (toolSession.isUserGroupLeader(userUid) && !isUserFinished) { + LearningWebsocketServer.sendCloseRequest(toolSessionId); + } + // get updated score from ScratchieSession int score = toolSession.getMark(); int maxScore = (Integer) sessionMap.get(ScratchieConstants.ATTR_MAX_SCORE); Index: lams_tool_scratchie/web/pages/learning/questionlist.jsp =================================================================== diff -u -rdc660d5e57f3257022e196805ba472fd8a42996a -r052d4255bd6583c51a3ec2f8907646508bd1061c --- lams_tool_scratchie/web/pages/learning/questionlist.jsp (.../questionlist.jsp) (revision dc660d5e57f3257022e196805ba472fd8a42996a) +++ lams_tool_scratchie/web/pages/learning/questionlist.jsp (.../questionlist.jsp) (revision 052d4255bd6583c51a3ec2f8907646508bd1061c) @@ -19,7 +19,7 @@