Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUsrAttemptDAO.java =================================================================== diff -u -r81d3515d29fd57e3b9e08cc37481fd0becbd8b10 -r1eadfd07c1afcebfb2b87c43a11c92041698ee3c --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUsrAttemptDAO.java (.../IVoteUsrAttemptDAO.java) (revision 81d3515d29fd57e3b9e08cc37481fd0becbd8b10) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUsrAttemptDAO.java (.../IVoteUsrAttemptDAO.java) (revision 1eadfd07c1afcebfb2b87c43a11c92041698ee3c) @@ -47,7 +47,7 @@ Set getUserEntries(final Long voteContentUid); - Set getSessionUserEntriesSet(final Long voteSessionUid); + List getSessionOpenTextUserEntries(final Long voteSessionUid); VoteUsrAttempt getAttemptByUID(Long uid); @@ -69,7 +69,7 @@ Set getAttemptsForUserAndSession(final Long queUsrId, final Long sessionUid); - Set getAttemptsForUserAndSessionUseOpenAnswer(final Long queUsrId, final Long sessionUid); + List getAttemptsForUserAndSessionUseOpenAnswer(final Long queUsrId, final Long sessionUid); List getAttemptsForUserAndQuestionContent(final Long queUsrId, final Long voteQueContentId); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java =================================================================== diff -u -r81d3515d29fd57e3b9e08cc37481fd0becbd8b10 -r1eadfd07c1afcebfb2b87c43a11c92041698ee3c --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java (.../VoteUsrAttemptDAO.java) (revision 81d3515d29fd57e3b9e08cc37481fd0becbd8b10) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java (.../VoteUsrAttemptDAO.java) (revision 1eadfd07c1afcebfb2b87c43a11c92041698ee3c) @@ -31,7 +31,6 @@ import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.lang.StringUtils; import org.hibernate.FlushMode; -import org.hibernate.Hibernate; import org.hibernate.SQLQuery; import org.hibernate.transform.Transformers; import org.hibernate.type.BooleanType; @@ -72,8 +71,8 @@ private static final String LOAD_USER_ENTRY_RECORDS = "from voteUsrAttempt in class VoteUsrAttempt where voteUsrAttempt.userEntry=:userEntry and voteUsrAttempt.voteQueContent.uid=1 and voteUsrAttempt.voteQueUsr.voteSession.voteContent.uid=:voteContentUid"; - private static final String LOAD_ENTRIES_BY_SESSION_UID = "select att from VoteUsrAttempt att, VoteQueUsr user, VoteSession ses where " - + "att.voteQueUsr=user and user.voteSession=ses and ses.uid=:voteSessionUid"; + private static final String LOAD_OPEN_TEXT_ENTRIES_BY_SESSION_UID = "select att from VoteUsrAttempt att, VoteQueUsr user, VoteSession ses where " + + "att.voteQueUsr=user and user.voteSession=ses and ses.uid=:voteSessionUid and att.userEntry is not null and att.userEntry <> \'\'"; private static final String COUNT_ENTRIES_BY_SESSION_ID = "select count(*) from VoteUsrAttempt att, VoteQueUsr user, VoteSession ses where " + "att.voteQueUsr=user and user.voteSession=ses and ses.uid=:voteSessionUid"; @@ -129,15 +128,11 @@ } @Override - public Set getSessionUserEntriesSet(final Long voteSessionUid) { - List list = getSessionFactory().getCurrentSession().createQuery(VoteUsrAttemptDAO.LOAD_ENTRIES_BY_SESSION_UID) + public List getSessionOpenTextUserEntries(final Long voteSessionUid) { + return (List) getSession().createQuery(VoteUsrAttemptDAO.LOAD_OPEN_TEXT_ENTRIES_BY_SESSION_UID) .setLong("voteSessionUid", voteSessionUid).list(); - - Set sessionUserEntries = new HashSet(); - sessionUserEntries.addAll(list); - return sessionUserEntries; } - + @Override public void removeAttemptsForUserandSession(final Long queUsrId, final Long sessionUid) { String strGetUser = "from voteUsrAttempt in class VoteUsrAttempt where voteUsrAttempt.queUsrId=:queUsrId and voteUsrAttempt.voteQueUsr.voteSession.uid=:sessionUid"; @@ -231,35 +226,13 @@ } @Override - public Set getAttemptsForUserAndSessionUseOpenAnswer(final Long queUsrId, final Long sessionUid) { + public List getAttemptsForUserAndSessionUseOpenAnswer(final Long queUsrId, final Long sessionUid) { - List list = getSessionFactory().getCurrentSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_USER_AND_SESSION) + return getSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_USER_AND_SESSION) .setLong("queUsrId", queUsrId.longValue()).setLong("sessionUid", sessionUid.longValue()).list(); - String openAnswer = ""; - Set userEntries = new HashSet(); - if ((list != null) && (list.size() > 0)) { - Iterator listIterator = list.iterator(); - while (listIterator.hasNext()) { - VoteUsrAttempt attempt = listIterator.next(); + } - Long questionUid = attempt.getVoteQueContent().getUid(); - if (!questionUid.toString().equals("1")) { - userEntries.add(attempt.getVoteQueContent().getQuestion()); - } else { - // this is a user entered vote - if (attempt.getUserEntry().length() > 0) { - openAnswer = attempt.getUserEntry(); - // adding openAnswer to userEntries - userEntries.add(openAnswer); - } - - } - } - } - return userEntries; - } - @Override public int getSessionEntriesCount(final Long voteSessionUid) { List result = getSessionFactory().getCurrentSession().createQuery(VoteUsrAttemptDAO.COUNT_ENTRIES_BY_SESSION_ID) Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java =================================================================== diff -u -r81d3515d29fd57e3b9e08cc37481fd0becbd8b10 -r1eadfd07c1afcebfb2b87c43a11c92041698ee3c --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java (.../VoteServicePOJO.java) (revision 81d3515d29fd57e3b9e08cc37481fd0becbd8b10) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java (.../VoteServicePOJO.java) (revision 1eadfd07c1afcebfb2b87c43a11c92041698ee3c) @@ -26,6 +26,7 @@ import java.util.Collection; import java.util.Date; import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; @@ -235,10 +236,13 @@ VoteContent voteContent = this.getVoteContent(toolContentID); int entriesCount = 0; - Set userEntries = null; + List userEntries = null; if (toolSessionUid != null) { entriesCount = voteUsrAttemptDAO.getSessionEntriesCount(toolSessionUid); - userEntries = voteUsrAttemptDAO.getSessionUserEntriesSet(toolSessionUid); + if ( voteContent.isAllowText() ) + userEntries = voteUsrAttemptDAO.getSessionOpenTextUserEntries(toolSessionUid); + else + userEntries = new ArrayList(0); } Long mapIndex = 1L; @@ -723,7 +727,31 @@ @Override public Set getAttemptsForUserAndSessionUseOpenAnswer(final Long userUid, final Long sessionUid) { - return voteUsrAttemptDAO.getAttemptsForUserAndSessionUseOpenAnswer(userUid, sessionUid); + List list = voteUsrAttemptDAO.getAttemptsForUserAndSessionUseOpenAnswer(userUid, sessionUid); + + String openAnswer = ""; + Set userEntries = new HashSet(); + if ((list != null) && (list.size() > 0)) { + Iterator listIterator = list.iterator(); + while (listIterator.hasNext()) { + VoteUsrAttempt attempt = listIterator.next(); + + Long questionUid = attempt.getVoteQueContent().getUid(); + if (!questionUid.toString().equals("1")) { + userEntries.add(attempt.getVoteQueContent().getQuestion()); + } else { + // this is a user entered vote + if (attempt.getUserEntry().length() > 0) { + if ( attempt.isVisible() ) + userEntries.add(attempt.getUserEntry()); + else + userEntries.add(getMessageService().getMessage("label.hidden")); + } + + } + } + } + return userEntries; } @Override Index: lams_tool_vote/web/export/ExportContent.jsp =================================================================== diff -u -r43437f9c52f60b4fe545162b3ed72e6ddf911777 -r1eadfd07c1afcebfb2b87c43a11c92041698ee3c --- lams_tool_vote/web/export/ExportContent.jsp (.../ExportContent.jsp) (revision 43437f9c52f60b4fe545162b3ed72e6ddf911777) +++ lams_tool_vote/web/export/ExportContent.jsp (.../ExportContent.jsp) (revision 1eadfd07c1afcebfb2b87c43a11c92041698ee3c) @@ -44,7 +44,10 @@ - + + + + Index: lams_tool_vote/web/learning/AllNominations.jsp =================================================================== diff -u -r2ef18e4c87e2e7929950dbeb990c6715ef16c0c2 -r1eadfd07c1afcebfb2b87c43a11c92041698ee3c --- lams_tool_vote/web/learning/AllNominations.jsp (.../AllNominations.jsp) (revision 2ef18e4c87e2e7929950dbeb990c6715ef16c0c2) +++ lams_tool_vote/web/learning/AllNominations.jsp (.../AllNominations.jsp) (revision 1eadfd07c1afcebfb2b87c43a11c92041698ee3c) @@ -165,11 +165,16 @@ - -
- -
-
+
+ + + + + + () + + +
 
Index: lams_tool_vote/web/learning/RevisitedDisplay.jsp =================================================================== diff -u -r0cf0d00e80ef05535a52247a471dd7db8d566fac -r1eadfd07c1afcebfb2b87c43a11c92041698ee3c --- lams_tool_vote/web/learning/RevisitedDisplay.jsp (.../RevisitedDisplay.jsp) (revision 0cf0d00e80ef05535a52247a471dd7db8d566fac) +++ lams_tool_vote/web/learning/RevisitedDisplay.jsp (.../RevisitedDisplay.jsp) (revision 1eadfd07c1afcebfb2b87c43a11c92041698ee3c) @@ -90,7 +90,14 @@
+ + + + + () + +
 
Index: lams_tool_vote/web/learning/mobile/AllNominations.jsp =================================================================== diff -u -r0cf0d00e80ef05535a52247a471dd7db8d566fac -r1eadfd07c1afcebfb2b87c43a11c92041698ee3c --- lams_tool_vote/web/learning/mobile/AllNominations.jsp (.../AllNominations.jsp) (revision 0cf0d00e80ef05535a52247a471dd7db8d566fac) +++ lams_tool_vote/web/learning/mobile/AllNominations.jsp (.../AllNominations.jsp) (revision 1eadfd07c1afcebfb2b87c43a11c92041698ee3c) @@ -199,11 +199,16 @@ - -
- -
-
+
+ + + + + + () + + +
 
Index: lams_tool_vote/web/learning/mobile/RevisitedDisplay.jsp =================================================================== diff -u -r0cf0d00e80ef05535a52247a471dd7db8d566fac -r1eadfd07c1afcebfb2b87c43a11c92041698ee3c --- lams_tool_vote/web/learning/mobile/RevisitedDisplay.jsp (.../RevisitedDisplay.jsp) (revision 0cf0d00e80ef05535a52247a471dd7db8d566fac) +++ lams_tool_vote/web/learning/mobile/RevisitedDisplay.jsp (.../RevisitedDisplay.jsp) (revision 1eadfd07c1afcebfb2b87c43a11c92041698ee3c) @@ -125,7 +125,14 @@
+ + + + + () + +