Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java =================================================================== diff -u -r5534ee285138a23ab091f9799228254e3459ea8c -r0f6c8333c4187ad33fafc3fc874525e091be8d21 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java (.../IVoteService.java) (revision 5534ee285138a23ab091f9799228254e3459ea8c) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java (.../IVoteService.java) (revision 0f6c8333c4187ad33fafc3fc874525e091be8d21) @@ -97,6 +97,8 @@ public int getAttemptsForQuestionContent(final Long voteQueContentId) throws VoteApplicationException; + public boolean studentActivityOccurredStandardAndOpen(VoteContent voteContent) throws VoteApplicationException; + public int getUserEnteredVotesCountForContent(final Long voteContentUid) throws VoteApplicationException; public int getStandardAttemptsForQuestionContentAndSessionUid(final Long voteQueContentId, final Long voteSessionId) throws VoteApplicationException; Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java =================================================================== diff -u -r5534ee285138a23ab091f9799228254e3459ea8c -r0f6c8333c4187ad33fafc3fc874525e091be8d21 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java (.../VoteServicePOJO.java) (revision 5534ee285138a23ab091f9799228254e3459ea8c) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java (.../VoteServicePOJO.java) (revision 0f6c8333c4187ad33fafc3fc874525e091be8d21) @@ -1278,7 +1278,6 @@ logger.debug("voteContent uid: " + voteContent.getUid()); Iterator questionIterator=voteContent.getVoteQueContents().iterator(); - boolean activityOccurred=false; while (questionIterator.hasNext()) { VoteQueContent voteQueContent=(VoteQueContent)questionIterator.next(); @@ -1289,15 +1288,22 @@ /** * proved the fact that there is at least one attempt for this content. */ - activityOccurred=true; + return true; } - } + } + return false; + } + + public boolean studentActivityOccurredStandardAndOpen(VoteContent voteContent) throws VoteApplicationException + { + logger.debug("voteContent uid: " + voteContent.getUid()); + boolean studentActivityOccurredGlobal= studentActivityOccurredGlobal(voteContent); + logger.debug("studentActivityOccurredGlobal: " + studentActivityOccurredGlobal); - logger.debug("activityOccurred: " + activityOccurred); int userEnteredVotesCount=getUserEnteredVotesCountForContent(voteContent.getUid()); logger.debug("userEnteredVotesCount: " + userEnteredVotesCount); - if ((activityOccurred == true) || (userEnteredVotesCount > 0)) + if ((studentActivityOccurredGlobal == true) || (userEnteredVotesCount > 0)) { return true; } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java =================================================================== diff -u -r22789974b076931e27e1e37ed7d91bd17f4f9cb6 -r0f6c8333c4187ad33fafc3fc874525e091be8d21 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java (.../VoteAction.java) (revision 22789974b076931e27e1e37ed7d91bd17f4f9cb6) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java (.../VoteAction.java) (revision 0f6c8333c4187ad33fafc3fc874525e091be8d21) @@ -166,7 +166,7 @@ /*true means there is at least 1 response*/ if (voteContent != null) { - if (voteService.studentActivityOccurredGlobal(voteContent)) + if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(false).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); @@ -247,7 +247,7 @@ /*true means there is at least 1 response*/ if (voteContent != null) { - if (voteService.studentActivityOccurredGlobal(voteContent)) + if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(false).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); @@ -311,7 +311,7 @@ /*true means there is at least 1 response*/ if (voteContent != null) { - if (voteService.studentActivityOccurredGlobal(voteContent)) + if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(false).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); @@ -530,7 +530,7 @@ /*true means there is at least 1 response*/ if (voteContent != null) { - if (voteService.studentActivityOccurredGlobal(voteContent)) + if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(false).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); @@ -648,7 +648,7 @@ /*true means there is at least 1 response*/ if (voteContent != null) { - if (voteService.studentActivityOccurredGlobal(voteContent)) + if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(false).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java =================================================================== diff -u -r22789974b076931e27e1e37ed7d91bd17f4f9cb6 -r0f6c8333c4187ad33fafc3fc874525e091be8d21 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java (.../VoteMonitoringAction.java) (revision 22789974b076931e27e1e37ed7d91bd17f4f9cb6) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java (.../VoteMonitoringAction.java) (revision 0f6c8333c4187ad33fafc3fc874525e091be8d21) @@ -205,7 +205,7 @@ request.getSession().setAttribute(SUMMARY_TOOL_SESSIONS, summaryToolSessions); - if (voteService.studentActivityOccurredGlobal(voteContent)) + if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(false).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); @@ -414,7 +414,7 @@ /* ends here. */ /*true means there is at least 1 response*/ - if (voteService.studentActivityOccurredGlobal(voteContent)) + if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(false).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); @@ -454,7 +454,7 @@ VoteContent voteContent=voteService.retrieveVote(toolContentId); logger.debug("existing voteContent:" + voteContent); - if (voteService.studentActivityOccurredGlobal(voteContent)) + if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(false).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); @@ -525,7 +525,7 @@ logger.debug("existing voteContent:" + voteContent); - if (voteService.studentActivityOccurredGlobal(voteContent)) + if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(false).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); @@ -601,7 +601,7 @@ /*true means there is at least 1 response*/ if (voteContent != null) { - if (voteService.studentActivityOccurredGlobal(voteContent)) + if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(false).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java =================================================================== diff -u -r5534ee285138a23ab091f9799228254e3459ea8c -r0f6c8333c4187ad33fafc3fc874525e091be8d21 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java (.../VoteMonitoringStarterAction.java) (revision 5534ee285138a23ab091f9799228254e3459ea8c) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java (.../VoteMonitoringStarterAction.java) (revision 0f6c8333c4187ad33fafc3fc874525e091be8d21) @@ -106,7 +106,7 @@ VoteContent voteContent=voteService.retrieveVote(toolContentId); /*true means there is at least 1 response*/ - if (voteService.studentActivityOccurredGlobal(voteContent)) + if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(false).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); @@ -187,7 +187,7 @@ logger.debug("checking student activity on the standard nominations:" + voteContent); - if (voteService.studentActivityOccurredGlobal(voteContent)) + if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { VoteUtils.cleanUpSessionAbsolute(request); logger.debug("student activity occurred on this content:" + voteContent); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java =================================================================== diff -u -r2422ef6cbe87acd7830e1d1da524fe062bc912a6 -r0f6c8333c4187ad33fafc3fc874525e091be8d21 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java (.../VoteStarterAction.java) (revision 2422ef6cbe87acd7830e1d1da524fe062bc912a6) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java (.../VoteStarterAction.java) (revision 0f6c8333c4187ad33fafc3fc874525e091be8d21) @@ -345,7 +345,7 @@ /* it is possible that the content is in use by learners.*/ VoteContent voteContent=voteService.retrieveVote(new Long(strToolContentId)); logger.debug("voteContent: " + voteContent); - if (voteService.studentActivityOccurredGlobal(voteContent)) + if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { VoteUtils.cleanUpSessionAbsolute(request); logger.debug("student activity occurred on this content:" + voteContent);