Index: lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteQueUsr.hbm.xml =================================================================== diff -u -r658c9122d9bbb47bd4c3e6a9431cf175ced2870e -r93c2c8a448c8530551612078fac7c7dd63401dfa --- lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteQueUsr.hbm.xml (.../VoteQueUsr.hbm.xml) (revision 658c9122d9bbb47bd4c3e6a9431cf175ced2870e) +++ lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteQueUsr.hbm.xml (.../VoteQueUsr.hbm.xml) (revision 93c2c8a448c8530551612078fac7c7dd63401dfa) @@ -52,7 +52,16 @@ length="1" /> + + + - + @@ -345,7 +345,20 @@ + + + + + + + + + + + + + Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteQueUsr.java =================================================================== diff -u -r212d80935ef5527b600d0dec89f36882164c4e11 -r93c2c8a448c8530551612078fac7c7dd63401dfa --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteQueUsr.java (.../VoteQueUsr.java) (revision 212d80935ef5527b600d0dec89f36882164c4e11) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteQueUsr.java (.../VoteQueUsr.java) (revision 93c2c8a448c8530551612078fac7c7dd63401dfa) @@ -52,6 +52,8 @@ private String fullname; private boolean responseFinalised; + + private boolean finalScreenRequested; private Long voteSessionId; @@ -172,4 +174,16 @@ public void setResponseFinalised(boolean responseFinalised) { this.responseFinalised = responseFinalised; } + /** + * @return Returns the finalScreenRequested. + */ + public boolean isFinalScreenRequested() { + return finalScreenRequested; + } + /** + * @param finalScreenRequested The finalScreenRequested to set. + */ + public void setFinalScreenRequested(boolean finalScreenRequested) { + this.finalScreenRequested = finalScreenRequested; + } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java =================================================================== diff -u -r658c9122d9bbb47bd4c3e6a9431cf175ced2870e -r93c2c8a448c8530551612078fac7c7dd63401dfa --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java (.../VoteLearningAction.java) (revision 658c9122d9bbb47bd4c3e6a9431cf175ced2870e) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java (.../VoteLearningAction.java) (revision 93c2c8a448c8530551612078fac7c7dd63401dfa) @@ -251,6 +251,10 @@ VoteQueUsr existingVoteQueUsr=voteService.getVoteUserBySession(new Long(userID), voteSession.getUid()); logger.debug("existingVoteQueUsr: " + existingVoteQueUsr); + + existingVoteQueUsr.setFinalScreenRequested(true); + voteService.updateVoteUser(existingVoteQueUsr); + logger.debug("final screen requested by: " + existingVoteQueUsr); Set userAttempts=voteService.getAttemptsForUserAndSession(existingVoteQueUsr.getUid(), toolSessionUid); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java =================================================================== diff -u -r658c9122d9bbb47bd4c3e6a9431cf175ced2870e -r93c2c8a448c8530551612078fac7c7dd63401dfa --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java (.../VoteLearningStarterAction.java) (revision 658c9122d9bbb47bd4c3e6a9431cf175ced2870e) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java (.../VoteLearningStarterAction.java) (revision 93c2c8a448c8530551612078fac7c7dd63401dfa) @@ -406,104 +406,113 @@ String learningMode=voteLearningForm.getLearningMode(); logger.debug("users learning mode is: " + learningMode); - /*if the user's session id AND user id exists in the tool tables go to redo questions.*/ - if (voteQueUsr != null) + boolean finalScreenRequested=false; + + /*the user's session id AND user id exists in the tool tables + *goto this screen if the OverAll Results scren has been already called up by this user*/ + if (voteQueUsr != null) { - Long sessionUid=voteQueUsr.getVoteSessionId(); - logger.debug("users sessionUid: " + sessionUid); - VoteSession voteUserSession= voteService.getVoteSessionByUID(sessionUid); - logger.debug("voteUserSession: " + voteUserSession); - String userSessionId=voteUserSession.getVoteSessionId().toString(); - logger.debug("userSessionId: " + userSessionId); - logger.debug("current toolSessionID: " + toolSessionID); + finalScreenRequested=voteQueUsr.isFinalScreenRequested(); + logger.debug("finalScreenRequested:" + finalScreenRequested); + + if (finalScreenRequested) + { + Long sessionUid=voteQueUsr.getVoteSessionId(); + logger.debug("users sessionUid: " + sessionUid); + VoteSession voteUserSession= voteService.getVoteSessionByUID(sessionUid); + logger.debug("voteUserSession: " + voteUserSession); + String userSessionId=voteUserSession.getVoteSessionId().toString(); + logger.debug("userSessionId: " + userSessionId); + logger.debug("current toolSessionID: " + toolSessionID); - if (toolSessionID.toString().equals(userSessionId)) - { - logger.debug("the learner has already responsed to this content, just generate a read-only report. Use redo questions for this."); - - logger.debug("start building MAP_GENERAL_CHECKED_OPTIONS_CONTENT"); - String toolContentId=voteLearningForm.getToolContentID(); - logger.debug("toolContentId: " + toolContentId); + if (toolSessionID.toString().equals(userSessionId)) + { + logger.debug("the learner has already responsed to this content, just generate a read-only report. Use redo questions for this."); + + logger.debug("start building MAP_GENERAL_CHECKED_OPTIONS_CONTENT"); + String toolContentId=voteLearningForm.getToolContentID(); + logger.debug("toolContentId: " + toolContentId); - List attempts=voteService.getAttemptsForUser(voteQueUsr.getUid()); - logger.debug("attempts: " + attempts); - - Map localMapQuestionsContent= new TreeMap(new VoteComparator()); - Iterator listIterator=attempts.iterator(); - int order=0; - while (listIterator.hasNext()) - { - VoteUsrAttempt attempt=(VoteUsrAttempt)listIterator.next(); - logger.debug("attempt: " + attempt); - VoteQueContent voteQueContent=attempt.getVoteQueContent(); - logger.debug("voteQueContent: " + voteQueContent); - order++; - if (voteQueContent != null) - { - String entry=voteQueContent.getQuestion(); - logger.debug("entry: " + entry); - - String voteQueContentId=attempt.getVoteQueContentId().toString(); - logger.debug("voteQueContentId: " + voteQueContentId); - if (entry != null) - { - if (entry.equals("sample nomination") && (voteQueContentId.equals("1"))) - { - logger.debug("this nomination entry points to a user entered nomination: " + attempt.getUserEntry()); - localMapQuestionsContent.put(new Integer(order).toString(), attempt.getUserEntry()); - } - else - { - logger.debug("this nomination entry points to a standard nomination: " + voteQueContent.getQuestion()); - localMapQuestionsContent.put(new Integer(order).toString(),voteQueContent.getQuestion()); - } - } - } - } - request.setAttribute(MAP_GENERAL_CHECKED_OPTIONS_CONTENT, localMapQuestionsContent); - logger.debug("end building MAP_GENERAL_CHECKED_OPTIONS_CONTENT: " + localMapQuestionsContent); - - boolean isResponseFinalised=voteQueUsr.isResponseFinalised(); - logger.debug("isResponseFinalised: " + isResponseFinalised); - if (isResponseFinalised) - { - 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()); - } - - logger.debug("geting user answers for user uid and sessionUid" + voteQueUsr.getUid() + " " + sessionUid); - Set userAttempts=voteService.getAttemptsForUserAndSessionUseOpenAnswer(voteQueUsr.getUid(), sessionUid); - logger.debug("userAttempts: "+ userAttempts); - request.setAttribute(LIST_GENERAL_CHECKED_OPTIONS_CONTENT, userAttempts); + List attempts=voteService.getAttemptsForUser(voteQueUsr.getUid()); + logger.debug("attempts: " + attempts); + + Map localMapQuestionsContent= new TreeMap(new VoteComparator()); + Iterator listIterator=attempts.iterator(); + int order=0; + while (listIterator.hasNext()) + { + VoteUsrAttempt attempt=(VoteUsrAttempt)listIterator.next(); + logger.debug("attempt: " + attempt); + VoteQueContent voteQueContent=attempt.getVoteQueContent(); + logger.debug("voteQueContent: " + voteQueContent); + order++; + if (voteQueContent != null) + { + String entry=voteQueContent.getQuestion(); + logger.debug("entry: " + entry); + + String voteQueContentId=attempt.getVoteQueContentId().toString(); + logger.debug("voteQueContentId: " + voteQueContentId); + if (entry != null) + { + if (entry.equals("sample nomination") && (voteQueContentId.equals("1"))) + { + logger.debug("this nomination entry points to a user entered nomination: " + attempt.getUserEntry()); + localMapQuestionsContent.put(new Integer(order).toString(), attempt.getUserEntry()); + } + else + { + logger.debug("this nomination entry points to a standard nomination: " + voteQueContent.getQuestion()); + localMapQuestionsContent.put(new Integer(order).toString(),voteQueContent.getQuestion()); + } + } + } + } + request.setAttribute(MAP_GENERAL_CHECKED_OPTIONS_CONTENT, localMapQuestionsContent); + logger.debug("end building MAP_GENERAL_CHECKED_OPTIONS_CONTENT: " + localMapQuestionsContent); + + boolean isResponseFinalised=voteQueUsr.isResponseFinalised(); + logger.debug("isResponseFinalised: " + isResponseFinalised); + if (isResponseFinalised) + { + 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()); + } + + logger.debug("geting user answers for user uid and sessionUid" + voteQueUsr.getUid() + " " + sessionUid); + Set userAttempts=voteService.getAttemptsForUserAndSessionUseOpenAnswer(voteQueUsr.getUid(), sessionUid); + logger.debug("userAttempts: "+ userAttempts); + request.setAttribute(LIST_GENERAL_CHECKED_OPTIONS_CONTENT, userAttempts); - - String isContentLockOnFinish=voteLearningForm.getLockOnFinish(); - logger.debug("isContentLockOnFinish: " + isContentLockOnFinish); - 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); - return (mapping.findForward(EXIT_PAGE)); - } - - logger.debug("the user's session id AND user id exists in the tool tables go to redo questions. " + toolSessionID + " voteQueUsr: " + - voteQueUsr + " user id: " + voteQueUsr.getQueUsrId()); - voteLearningForm.setRevisitingUser(new Boolean(true).toString()); - voteGeneralLearnerFlowDTO.setRevisitingUser(new Boolean(true).toString()); - logger.debug("preparing chart data for readonly mode"); - - VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO(); - MonitoringUtil.prepareChartData(request, voteService, null, voteContent.getVoteContentId().toString(), - voteSession.getUid().toString(), voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO); + + String isContentLockOnFinish=voteLearningForm.getLockOnFinish(); + logger.debug("isContentLockOnFinish: " + isContentLockOnFinish); + 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); + return (mapping.findForward(EXIT_PAGE)); + } + + logger.debug("the user's session id AND user id exists in the tool tables go to redo questions. " + toolSessionID + " voteQueUsr: " + + voteQueUsr + " user id: " + voteQueUsr.getQueUsrId()); + voteLearningForm.setRevisitingUser(new Boolean(true).toString()); + voteGeneralLearnerFlowDTO.setRevisitingUser(new Boolean(true).toString()); + logger.debug("preparing chart data for readonly mode"); + + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new 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); - - logger.debug("fwd'ing to: " + ALL_NOMINATIONS); - return (mapping.findForward(ALL_NOMINATIONS)); - } + + logger.debug("view-only voteGeneralLearnerFlowDTO: " + voteGeneralLearnerFlowDTO); + request.setAttribute(VOTE_GENERAL_LEARNER_FLOW_DTO,voteGeneralLearnerFlowDTO); + + logger.debug("fwd'ing to: " + ALL_NOMINATIONS); + return (mapping.findForward(ALL_NOMINATIONS)); + } + } } else if (learningMode.equals("teacher")) {