Index: lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteQueUsr.hbm.xml =================================================================== diff -u -rae28185f07883077586773f760d1bde953e2d9bf -r658c9122d9bbb47bd4c3e6a9431cf175ced2870e --- lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteQueUsr.hbm.xml (.../VoteQueUsr.hbm.xml) (revision ae28185f07883077586773f760d1bde953e2d9bf) +++ lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteQueUsr.hbm.xml (.../VoteQueUsr.hbm.xml) (revision 658c9122d9bbb47bd4c3e6a9431cf175ced2870e) @@ -42,7 +42,17 @@ length="100" > + + + + - + @@ -342,6 +342,19 @@ + + + + + + + + + + + + + Index: lams_tool_vote/db/sql/create_lams_tool_vote.sql =================================================================== diff -u -r1447dc2ae2077d18831a17b7c2f309390adb0687 -r658c9122d9bbb47bd4c3e6a9431cf175ced2870e --- lams_tool_vote/db/sql/create_lams_tool_vote.sql (.../create_lams_tool_vote.sql) (revision 1447dc2ae2077d18831a17b7c2f309390adb0687) +++ lams_tool_vote/db/sql/create_lams_tool_vote.sql (.../create_lams_tool_vote.sql) (revision 658c9122d9bbb47bd4c3e6a9431cf175ced2870e) @@ -40,6 +40,7 @@ , vote_session_id BIGINT(20) NOT NULL , username VARCHAR(100) , fullname VARCHAR(20) + , responseFinalised TINYINT(1) NOT NULL DEFAULT 0 , PRIMARY KEY (uid) , INDEX (vote_session_id) , CONSTRAINT FK_tl_lavote11_usr_1 FOREIGN KEY (vote_session_id) @@ -87,6 +88,7 @@ REFERENCES tl_lavote11_content (uid) )TYPE=InnoDB; + INSERT INTO tl_lavote11_content(uid, content_id , title , instructions , creation_date , created_by , run_offline , define_later, offline_instructions, online_instructions, content_in_use, retries) VALUES (1, ${default_content_id} ,'Voting Title','Voting Instructions', NOW(), 1,0, 0, 'offline instructions','online instructions', 0, 0); INSERT INTO tl_lavote11_nomination_content (uid,nomination, display_order, vote_content_id) VALUES (1, 'Sample Nomination 1', 1, 1); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java =================================================================== diff -u -r80d305915ce2c3952f34ed08e8b4740188dde18c -r658c9122d9bbb47bd4c3e6a9431cf175ced2870e --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java (.../IVoteService.java) (revision 80d305915ce2c3952f34ed08e8b4740188dde18c) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java (.../IVoteService.java) (revision 658c9122d9bbb47bd4c3e6a9431cf175ced2870e) @@ -157,6 +157,8 @@ public VoteQueUsr getVoteUserByUID(Long uid) throws VoteApplicationException; + public void updateVoteUser(VoteQueUsr voteUser) throws VoteApplicationException; + public void removeAttemptsForUser(final Long queUsrId) throws VoteApplicationException; public void removeAttemptsForUserandSession(final Long queUsrId, final Long voteSessionId) throws VoteApplicationException; Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java =================================================================== diff -u -r1584ef78e1cf4a5bbdc726bda5345d69be190801 -r658c9122d9bbb47bd4c3e6a9431cf175ced2870e --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java (.../VoteServicePOJO.java) (revision 1584ef78e1cf4a5bbdc726bda5345d69be190801) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java (.../VoteServicePOJO.java) (revision 658c9122d9bbb47bd4c3e6a9431cf175ced2870e) @@ -553,6 +553,20 @@ e); } } + + public void updateVoteUser(VoteQueUsr voteUser) throws VoteApplicationException + { + try + { + voteUserDAO.updateVoteUser(voteUser); + } + catch (DataAccessException e) + { + throw new VoteApplicationException("Exception occured when lams is updating VoteQueUsr: " + + e.getMessage(), + e); + } + } public VoteQueUsr retrieveVoteQueUsr(Long userID) throws VoteApplicationException { Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java =================================================================== diff -u -ra8e5c42d584e4b8b9b67224179acbc53850d279f -r658c9122d9bbb47bd4c3e6a9431cf175ced2870e --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java (.../VoteLearningAction.java) (revision a8e5c42d584e4b8b9b67224179acbc53850d279f) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java (.../VoteLearningAction.java) (revision 658c9122d9bbb47bd4c3e6a9431cf175ced2870e) @@ -458,16 +458,24 @@ logger.debug("toolSessionID: " + toolSessionID); voteLearningForm.setToolSessionID(toolSessionID); + VoteSession voteSession=voteService.retrieveVoteSession(new Long(toolSessionID)); + logger.debug("retrieving voteSession: " + voteSession); + String userID=request.getParameter(USER_ID); logger.debug("userID: " + userID); voteLearningForm.setUserID(userID); + VoteQueUsr voteQueUsr=voteService.getVoteUserBySession(new Long(userID), voteSession.getUid()); + logger.debug("voteQueUsr:" + voteQueUsr); + + voteQueUsr.setResponseFinalised(true); + voteService.updateVoteUser(voteQueUsr); + logger.debug("user's response is finalised:" + voteQueUsr); + String revisitingUser=request.getParameter(REVISITING_USER); logger.debug("revisitingUser: " + revisitingUser); voteLearningForm.setRevisitingUser(revisitingUser); - VoteSession voteSession=voteService.retrieveVoteSession(new Long(toolSessionID)); - logger.debug("retrieving voteSession: " + voteSession); VoteContent voteContent=voteSession.getVoteContent(); logger.debug("retrieving voteContent: " + voteContent); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java =================================================================== diff -u -r4e3a3411068a722de5b8e054ff35b0a94565d969 -r658c9122d9bbb47bd4c3e6a9431cf175ced2870e --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java (.../VoteLearningStarterAction.java) (revision 4e3a3411068a722de5b8e054ff35b0a94565d969) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java (.../VoteLearningStarterAction.java) (revision 658c9122d9bbb47bd4c3e6a9431cf175ced2870e) @@ -463,12 +463,11 @@ request.setAttribute(MAP_GENERAL_CHECKED_OPTIONS_CONTENT, localMapQuestionsContent); logger.debug("end building MAP_GENERAL_CHECKED_OPTIONS_CONTENT: " + localMapQuestionsContent); - boolean isSessionCompleted=isSessionCompleted(userSessionId, voteService); - logger.debug("isSessionCompleted: " + isSessionCompleted); - - if (isSessionCompleted) + boolean isResponseFinalised=voteQueUsr.isResponseFinalised(); + logger.debug("isResponseFinalised: " + isResponseFinalised); + if (isResponseFinalised) { - logger.debug("since the session is completed present a screen which can not be edited"); + logger.debug("since the response is finalised present a screen which can not be edited"); voteLearningForm.setReportViewOnly(new Boolean(true).toString()); voteGeneralLearnerFlowDTO.setReportViewOnly(new Boolean(true).toString()); } @@ -481,7 +480,7 @@ String isContentLockOnFinish=voteLearningForm.getLockOnFinish(); logger.debug("isContentLockOnFinish: " + isContentLockOnFinish); - if ((isContentLockOnFinish.equals(new Boolean(true).toString()) && (isSessionCompleted == true))) + if ((isContentLockOnFinish.equals(new Boolean(true).toString()) && (isResponseFinalised == true))) { logger.debug("user with session id: " + userSessionId + " should not redo votes. session is locked."); logger.debug("fwd'ing to: " + EXIT_PAGE); @@ -495,8 +494,9 @@ logger.debug("preparing chart data for readonly mode"); VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO(); - MonitoringUtil.prepareChartData(request, voteService, null, voteContent.getVoteContentId().toString(), toolSessionID, - voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO); + MonitoringUtil.prepareChartData(request, voteService, null, voteContent.getVoteContentId().toString(), + voteSession.getUid().toString(), voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO); + logger.debug("view-only voteGeneralLearnerFlowDTO: " + voteGeneralLearnerFlowDTO); request.setAttribute(VOTE_GENERAL_LEARNER_FLOW_DTO,voteGeneralLearnerFlowDTO); Index: lams_tool_vote/web/learning/AllNominations.jsp =================================================================== diff -u -ra8e5c42d584e4b8b9b67224179acbc53850d279f -r658c9122d9bbb47bd4c3e6a9431cf175ced2870e --- lams_tool_vote/web/learning/AllNominations.jsp (.../AllNominations.jsp) (revision a8e5c42d584e4b8b9b67224179acbc53850d279f) +++ lams_tool_vote/web/learning/AllNominations.jsp (.../AllNominations.jsp) (revision 658c9122d9bbb47bd4c3e6a9431cf175ced2870e) @@ -191,36 +191,35 @@ - - - + + - - - - + + +
- +
+ + + + + +    + + + + + + + + - + onclick="submitMethod('learnerFinished');"> + - - -    - - - - - - - - - - -