Index: lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteQueUsr.hbm.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/Attic/VoteQueUsr.hbm.xml,v diff -u -r1.2 -r1.3 --- lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteQueUsr.hbm.xml 29 Apr 2006 13:57:56 -0000 1.2 +++ lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteQueUsr.hbm.xml 22 Aug 2006 19:30:17 -0000 1.3 @@ -42,7 +42,17 @@ length="100" > + + + + - + @@ -342,6 +342,19 @@ + + + + + + + + + + + + + Index: lams_tool_vote/db/sql/create_lams_tool_vote.sql =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/db/sql/create_lams_tool_vote.sql,v diff -u -r1.14 -r1.15 --- lams_tool_vote/db/sql/create_lams_tool_vote.sql 14 Aug 2006 18:48:35 -0000 1.14 +++ lams_tool_vote/db/sql/create_lams_tool_vote.sql 22 Aug 2006 19:30:16 -0000 1.15 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java,v diff -u -r1.32 -r1.33 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java 14 Aug 2006 00:07:20 -0000 1.32 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java 22 Aug 2006 19:30:16 -0000 1.33 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java,v diff -u -r1.42 -r1.43 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java 12 Aug 2006 17:50:35 -0000 1.42 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java 22 Aug 2006 19:30:16 -0000 1.43 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java,v diff -u -r1.36 -r1.37 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java 20 Aug 2006 14:47:22 -0000 1.36 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java 22 Aug 2006 19:30:17 -0000 1.37 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java,v diff -u -r1.32 -r1.33 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java 21 Aug 2006 17:17:14 -0000 1.32 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java 22 Aug 2006 19:30:16 -0000 1.33 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/web/learning/AllNominations.jsp,v diff -u -r1.22 -r1.23 --- lams_tool_vote/web/learning/AllNominations.jsp 20 Aug 2006 14:47:21 -0000 1.22 +++ lams_tool_vote/web/learning/AllNominations.jsp 22 Aug 2006 19:30:15 -0000 1.23 @@ -191,36 +191,35 @@ - - - + + - - - - + + +
- +
+ + + + + +    + + + + + + + + - + onclick="submitMethod('learnerFinished');"> + - - -    - - - - - - - - - - -