Index: lams_tool_vote/conf/language/ApplicationResources.properties =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/conf/language/Attic/ApplicationResources.properties,v diff -u -r1.36 -r1.37 --- lams_tool_vote/conf/language/ApplicationResources.properties 21 May 2006 19:43:03 -0000 1.36 +++ lams_tool_vote/conf/language/ApplicationResources.properties 22 May 2006 14:41:32 -0000 1.37 @@ -115,6 +115,7 @@ label.show =Show label.hide =Hide label.hidden =hidden +label.hiddenLearner =(hidden) label.view.piechart =View Pie Chart label.view.barchart =View Bar Chart label.visible =Visible Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java,v diff -u -r1.20 -r1.21 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java 17 May 2006 13:32:25 -0000 1.20 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java 22 May 2006 14:41:32 -0000 1.21 @@ -109,6 +109,7 @@ public static final String MAP_OPTIONS_CONTENT ="mapOptionsContent"; public static final String MAP_VOTERATES_CONTENT ="mapVoteRatesContent"; public static final String MAP_STANDARD_USER_COUNT ="mapStandardUserCount"; + public static final String MAP_STANDARD_NOMINATIONS_VISIBILITY ="mapStandardNominationsVisibility"; public static final String MAP_STANDARD_NOMINATIONS_CONTENT ="mapStandardNominationsContent"; public static final String MAP_STANDARD_RATES_CONTENT ="mapStandardRatesContent"; public static final String MAP_OPTIONS_CONTENT_FCK ="mapOptionsContentFck"; Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUsrAttemptDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUsrAttemptDAO.java,v diff -u -r1.16 -r1.17 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUsrAttemptDAO.java 21 May 2006 19:43:03 -0000 1.16 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUsrAttemptDAO.java 22 May 2006 14:41:32 -0000 1.17 @@ -51,6 +51,8 @@ public int getAllEntriesCount(); + public boolean isVoteVisibleForSession(final String userEntry, final Long voteSessionUid); + public List getSessionUserEntries(final Long voteSessionUid); public Set getSessionUserEntriesSet(final Long voteSessionUid); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java,v diff -u -r1.22 -r1.23 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java 21 May 2006 19:43:03 -0000 1.22 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java 22 May 2006 14:41:32 -0000 1.23 @@ -339,6 +339,34 @@ } + + public boolean isVoteVisibleForSession(final String userEntry, final Long voteSessionUid) + { + HibernateTemplate templ = this.getHibernateTemplate(); + List list = getSession().createQuery(LOAD_USER_ENTRY_RECORDS) + .setString("userEntry", userEntry) + .list(); + + + List sessionUserEntries= new ArrayList(); + if(list != null && list.size() > 0){ + Iterator listIterator=list.iterator(); + while (listIterator.hasNext()) + { + VoteUsrAttempt attempt=(VoteUsrAttempt)listIterator.next(); + logger.debug("attempt: " + attempt); + if (attempt.getVoteQueUsr().getVoteSession().getUid().toString().equals(voteSessionUid.toString())) + { + boolean isVoteVisible= attempt.isVisible(); + logger.debug("isVoteVisible: " + isVoteVisible); + if (isVoteVisible == false) + return false; + } + } + } + + return true; + } public int getStandardAttemptsForQuestionContentAndContentUid(final Long voteQueContentId, final Long voteContentUid) { 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.23 -r1.24 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java 21 May 2006 19:43:02 -0000 1.23 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java 22 May 2006 14:41:32 -0000 1.24 @@ -67,6 +67,8 @@ public List getUserEnteredVotesForSession(final String userEntry, final Long voteSessionUid); + public boolean isVoteVisibleForSession(final String userEntry, final Long voteSessionUid); + public VoteQueUsr getVoteUserBySession(final Long queUsrId, final Long voteSessionId) throws VoteApplicationException; public VoteQueUsr retrieveVoteQueUsr(Long userId) 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.23 -r1.24 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java 21 May 2006 19:43:02 -0000 1.23 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java 22 May 2006 14:41:32 -0000 1.24 @@ -279,6 +279,21 @@ } } + + public boolean isVoteVisibleForSession(final String userEntry, final Long voteSessionUid) throws VoteApplicationException + { + try + { + return voteUsrAttemptDAO.isVoteVisibleForSession(userEntry, voteSessionUid); + } + catch (DataAccessException e) + { + throw new VoteApplicationException("Exception occured when lams is finding if the open vote is hidden: " + + e.getMessage(), + e); + } + } + public List getSessionUserEntries(final Long voteSessionUid) throws VoteApplicationException { try Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java,v diff -u -r1.22 -r1.23 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java 21 May 2006 19:43:02 -0000 1.22 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java 22 May 2006 14:41:32 -0000 1.23 @@ -832,6 +832,7 @@ Map mapStandardUserCount= new TreeMap(new VoteComparator()); + Map mapStandardNominationsVisibility= new TreeMap(new VoteComparator()); logger.debug("setting existing content data from the db"); mapOptionsContent.clear(); @@ -855,6 +856,7 @@ { logger.debug("getting votesCount based on session: " + toolSessionUid); votesCount=voteService.getStandardAttemptsForQuestionContentAndSessionUid(voteQueContent.getUid(), toolSessionUid); + logger.debug("votesCount for questionContent uid: " + votesCount + " for" + voteQueContent.getUid()); mapStandardUserCount.put(mapIndex.toString(),new Integer(votesCount).toString()); totalStandardVotesCount=totalStandardVotesCount + votesCount; @@ -875,6 +877,7 @@ logger.debug("voteRate" + voteRate); mapVoteRatesContent.put(mapIndex.toString(), new Double(voteRate).toString()); + mapStandardNominationsVisibility.put(mapIndex.toString(), new Boolean(true).toString()); mapIndex=new Long(mapIndex.longValue()+1); } } @@ -887,6 +890,7 @@ mapStandardRatesContent=mapVoteRatesContent; logger.debug("test1: mapStandardRatesContent: " + mapStandardRatesContent); logger.debug("test1: mapStandardUserCount: " + mapStandardUserCount); + logger.debug("test1: mapStandardNominationsVisibility: " + mapStandardNominationsVisibility); Iterator itListQuestions = userEntries.iterator(); int mapVoteRatesSize=mapVoteRatesContent.size(); @@ -918,6 +922,10 @@ { logger.debug("getting userEntryRate based on session: " + toolSessionUid); List voteEntries=voteService.getUserEnteredVotesForSession(userEntry, toolSessionUid); + boolean isVoteVisible=voteService.isVoteVisibleForSession(userEntry, toolSessionUid); + logger.debug("isVoteVisible: " + isVoteVisible); + + logger.debug("voteEntries: " + voteEntries); int individualUserEnteredVoteCount=voteEntries.size(); logger.debug("individualUserEnteredVoteCount: " + individualUserEnteredVoteCount); @@ -928,6 +936,7 @@ mapStandardNominationsContent.put(mapIndex.toString(), userEntry); mapStandardRatesContent.put(mapIndex.toString(), new Double(votesShare).toString()); mapStandardUserCount.put(mapIndex.toString(), new Integer(individualUserEnteredVoteCount).toString()); + mapStandardNominationsVisibility.put(mapIndex.toString(), new Boolean(isVoteVisible).toString()); mapIndex=new Long(mapIndex.longValue()+1); } } @@ -941,7 +950,11 @@ request.getSession().setAttribute(MAP_STANDARD_USER_COUNT, mapStandardUserCount); logger.debug("test2: MAP_STANDARD_USER_COUNT: " + request.getSession().getAttribute(MAP_STANDARD_USER_COUNT)); + + request.getSession().setAttribute(MAP_STANDARD_NOMINATIONS_VISIBILITY, mapStandardNominationsVisibility); + logger.debug("test2: MAP_STANDARD_NOMINATIONS_VISIBILITY: " + request.getSession().getAttribute(MAP_STANDARD_NOMINATIONS_VISIBILITY)); } + public static void prepareChartDataForExportTeacher(HttpServletRequest request, IVoteService voteService, VoteMonitoringForm voteMonitoringForm, Long toolContentId, Long toolSessionUid) Index: lams_tool_vote/web/export/ExportContent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/web/export/ExportContent.jsp,v diff -u -r1.2 -r1.3 --- lams_tool_vote/web/export/ExportContent.jsp 21 May 2006 19:43:02 -0000 1.2 +++ lams_tool_vote/web/export/ExportContent.jsp 22 May 2006 14:41:32 -0000 1.3 @@ -41,14 +41,55 @@