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.11 -r1.12 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java 24 Apr 2006 15:17:00 -0000 1.11 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java 26 Apr 2006 17:56:11 -0000 1.12 @@ -119,6 +119,7 @@ public static final String MAP_LEARNER_CHECKED_OPTIONS_CONTENT ="mapLearnerCheckedOptionsContent"; public static final String MAP_VIEWONLY_QUESTION_CONTENT_LEARNER ="mapViewOnlyQuestionContentLearner"; public static final String MAP_QUE_ATTEMPTS ="mapQueAttempts"; + public static final String LIST_USER_ENTRIES ="listUserEntries"; public static final String SELECTED_QUESTION ="selectedQuestion"; public static final String SELECTED_QUESTION_INDEX ="selectedQuestionIndex"; Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteMonitoredAnswersDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/Attic/VoteMonitoredAnswersDTO.java,v diff -u -r1.2 -r1.3 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteMonitoredAnswersDTO.java 13 Apr 2006 18:30:38 -0000 1.2 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteMonitoredAnswersDTO.java 26 Apr 2006 17:56:11 -0000 1.3 @@ -36,7 +36,7 @@ */ public class VoteMonitoredAnswersDTO implements Comparable { - private String questionUid; + protected String questionUid; private String question; 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.4 -r1.5 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUsrAttemptDAO.java 23 Apr 2006 20:10:47 -0000 1.4 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUsrAttemptDAO.java 26 Apr 2006 17:56:11 -0000 1.5 @@ -41,6 +41,8 @@ public List getAttemptsForUser(final Long queUsrId); + public List getUserEntries(); + public void removeAttemptsForUser(final Long queUsrId); public int getLastNominationCount(Long userId); 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.5 -r1.6 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java 24 Apr 2006 12:57:15 -0000 1.5 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java 26 Apr 2006 17:56:11 -0000 1.6 @@ -49,6 +49,8 @@ private static final String LOAD_ATTEMPT_FOR_USER_AND_QUESTION_CONTENT = "from voteUsrAttempt in class VoteUsrAttempt where voteUsrAttempt.queUsrId=:queUsrId and voteUsrAttempt.voteQueContentId=:voteQueContentId"; + private static final String LOAD_USER_ENTRIES = "select distinct voteUsrAttempt.userEntry from VoteUsrAttempt voteUsrAttempt"; + public VoteUsrAttempt getVoteUserAttemptByUID(Long uid) { @@ -71,6 +73,14 @@ return list; } + public List getUserEntries() + { + HibernateTemplate templ = this.getHibernateTemplate(); + List list = getSession().createQuery(LOAD_USER_ENTRIES) + .list(); + return list; + } + public void removeAttemptsForUser(final Long queUsrId) { HibernateTemplate templ = this.getHibernateTemplate(); 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.8 -r1.9 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java 24 Apr 2006 12:57:17 -0000 1.8 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java 26 Apr 2006 17:56:11 -0000 1.9 @@ -100,6 +100,8 @@ public void cleanAllQuestions(final Long mcContentUid) throws VoteApplicationException; + public List getUserEntries() throws VoteApplicationException; + public VoteQueContent getQuestionContentByQuestionText(final String question, final Long mcContentUid); public void removeVoteQueContentByUID(Long uid) 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.8 -r1.9 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java 24 Apr 2006 12:57:17 -0000 1.8 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java 26 Apr 2006 17:56:11 -0000 1.9 @@ -231,6 +231,21 @@ } } + + public List getUserEntries() throws VoteApplicationException + { + try + { + return voteUsrAttemptDAO.getUserEntries(); + } + catch (DataAccessException e) + { + throw new VoteApplicationException("Exception occured when lams is getting user entries: " + + e.getMessage(), + e); + } + } + public VoteQueContent getVoteQueContentByUID(Long uid) throws VoteApplicationException { try Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/LearningUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/Attic/LearningUtil.java,v diff -u -r1.7 -r1.8 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/LearningUtil.java 24 Apr 2006 12:57:15 -0000 1.7 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/LearningUtil.java 26 Apr 2006 17:56:10 -0000 1.8 @@ -158,8 +158,6 @@ logger.debug("localVoteQueContent: " + localVoteQueContent); createIndividualOptions(request, localVoteQueContent, voteQueUsr, attempTime, timeZone, userEntry, nominationCount, false); } - - } } } 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.5 -r1.6 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java 24 Apr 2006 12:57:15 -0000 1.5 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java 26 Apr 2006 17:56:10 -0000 1.6 @@ -256,13 +256,13 @@ voteMonitoredUserDTO.setUserEntry(voteUsrResp.getUserEntry()); logger.debug("attempt: " + voteUsrResp); - VoteQueContent localVoteQueContent=voteUsrResp.getVoteQueContent(); - logger.debug("localVoteQueContent: " + localVoteQueContent); - logger.debug("localVoteQueContent question : " + localVoteQueContent.getQuestion()); - voteMonitoredUserDTO.setResponse(localVoteQueContent.getQuestion()); + //VoteQueContent localVoteQueContent=voteUsrResp.getVoteQueContent(); + //logger.debug("localVoteQueContent: " + localVoteQueContent); + //logger.debug("localVoteQueContent question : " + localVoteQueContent.getQuestion()); + //voteMonitoredUserDTO.setResponse(localVoteQueContent.getQuestion()); voteMonitoredUserDTO.setQuestionUid(questionUid); - + /* boolean isSingleUserEntry=voteUsrResp.isSingleUserEntry(); logger.debug("isSingleUserEntry: " + isSingleUserEntry); logger.debug("userEntry: " + voteUsrResp.getUserEntry()); @@ -281,6 +281,25 @@ userEntryVoteMonitoredUserDTO.setResponse(voteUsrResp.getUserEntry()); listMonitoredUserContainerDTO.add(userEntryVoteMonitoredUserDTO); } + */ + + VoteQueContent voteQueContent=voteUsrResp.getVoteQueContent(); + logger.debug("voteQueContent: " + voteQueContent); + String entry=voteQueContent.getQuestion(); + logger.debug("entry: " + entry); + if (entry != null) + { + if (entry.equals("sample nomination")) + { + logger.debug("this nomination entry points to a user entered nomination: " + voteUsrResp.getUserEntry()); + voteMonitoredUserDTO.setResponse(voteUsrResp.getUserEntry()); + } + else + { + logger.debug("this nomination entry points to a standard nomination: " + voteQueContent.getQuestion()); + voteMonitoredUserDTO.setResponse(voteQueContent.getQuestion()); + } + } listMonitoredUserContainerDTO.add(voteMonitoredUserDTO); } } @@ -327,12 +346,13 @@ //voteMonitoredUserDTO.setResponse(voteUsrResp.getUserEntry()); logger.debug("attempt: " + voteUsrResp); - VoteQueContent localVoteQueContent=voteUsrResp.getVoteQueContent(); - logger.debug("localVoteQueContent: " + localVoteQueContent); - logger.debug("localVoteQueContent question : " + localVoteQueContent.getQuestion()); - voteMonitoredUserDTO.setResponse(localVoteQueContent.getQuestion()); + //VoteQueContent localVoteQueContent=voteUsrResp.getVoteQueContent(); + //logger.debug("localVoteQueContent: " + localVoteQueContent); + //logger.debug("localVoteQueContent question : " + localVoteQueContent.getQuestion()); + //voteMonitoredUserDTO.setResponse(localVoteQueContent.getQuestion()); voteMonitoredUserDTO.setQuestionUid(questionUid); - + + /* boolean isSingleUserEntry=voteUsrResp.isSingleUserEntry(); logger.debug("isSingleUserEntry: " + isSingleUserEntry); logger.debug("userEntry: " + voteUsrResp.getUserEntry()); @@ -351,6 +371,25 @@ userEntryVoteMonitoredUserDTO.setResponse(voteUsrResp.getUserEntry()); listMonitoredUserContainerDTO.add(userEntryVoteMonitoredUserDTO); } + */ + + VoteQueContent voteQueContent=voteUsrResp.getVoteQueContent(); + logger.debug("voteQueContent: " + voteQueContent); + String entry=voteQueContent.getQuestion(); + logger.debug("entry: " + entry); + if (entry != null) + { + if (entry.equals("sample nomination")) + { + logger.debug("this nomination entry points to a user entered nomination: " + voteUsrResp.getUserEntry()); + voteMonitoredUserDTO.setResponse(voteUsrResp.getUserEntry()); + } + else + { + logger.debug("this nomination entry points to a standard nomination: " + voteQueContent.getQuestion()); + voteMonitoredUserDTO.setResponse(voteQueContent.getQuestion()); + } + } listMonitoredUserContainerDTO.add(voteMonitoredUserDTO); } } @@ -407,13 +446,14 @@ //voteMonitoredUserDTO.setResponse(voteUsrResp.getUserEntry()); logger.debug("attempt: " + voteUsrResp); - VoteQueContent localVoteQueContent=voteUsrResp.getVoteQueContent(); - logger.debug("localVoteQueContent: " + localVoteQueContent); - logger.debug("localVoteQueContent question : " + localVoteQueContent.getQuestion()); - voteMonitoredUserDTO.setResponse(localVoteQueContent.getQuestion()); + //VoteQueContent localVoteQueContent=voteUsrResp.getVoteQueContent(); + //logger.debug("localVoteQueContent: " + localVoteQueContent); + //logger.debug("localVoteQueContent question : " + localVoteQueContent.getQuestion()); + //voteMonitoredUserDTO.setResponse(localVoteQueContent.getQuestion()); voteMonitoredUserDTO.setQuestionUid(questionUid); voteMonitoredUserDTO.setUserEntry(voteUsrResp.getUserEntry()); + /* boolean isSingleUserEntry=voteUsrResp.isSingleUserEntry(); logger.debug("isSingleUserEntry: " + isSingleUserEntry); logger.debug("userEntry: " + voteUsrResp.getUserEntry()); @@ -432,6 +472,25 @@ userEntryVoteMonitoredUserDTO.setResponse(voteUsrResp.getUserEntry()); listMonitoredUserContainerDTO.add(userEntryVoteMonitoredUserDTO); } + */ + + VoteQueContent voteQueContent=voteUsrResp.getVoteQueContent(); + logger.debug("voteQueContent: " + voteQueContent); + String entry=voteQueContent.getQuestion(); + logger.debug("entry: " + entry); + if (entry != null) + { + if (entry.equals("sample nomination")) + { + logger.debug("this nomination entry points to a user entered nomination: " + voteUsrResp.getUserEntry()); + voteMonitoredUserDTO.setResponse(voteUsrResp.getUserEntry()); + } + else + { + logger.debug("this nomination entry points to a standard nomination: " + voteQueContent.getQuestion()); + voteMonitoredUserDTO.setResponse(voteQueContent.getQuestion()); + } + } listMonitoredUserContainerDTO.add(voteMonitoredUserDTO); } @@ -478,12 +537,13 @@ //voteMonitoredUserDTO.setResponse(voteUsrResp.getUserEntry()); logger.debug("attempt: " + voteUsrResp); - VoteQueContent localVoteQueContent=voteUsrResp.getVoteQueContent(); - logger.debug("localVoteQueContent: " + localVoteQueContent); - logger.debug("localVoteQueContent question : " + localVoteQueContent.getQuestion()); - voteMonitoredUserDTO.setResponse(localVoteQueContent.getQuestion()); + //VoteQueContent localVoteQueContent=voteUsrResp.getVoteQueContent(); + //logger.debug("localVoteQueContent: " + localVoteQueContent); + //logger.debug("localVoteQueContent question : " + localVoteQueContent.getQuestion()); + //voteMonitoredUserDTO.setResponse(localVoteQueContent.getQuestion()); voteMonitoredUserDTO.setQuestionUid(questionUid); + /* boolean isSingleUserEntry=voteUsrResp.isSingleUserEntry(); logger.debug("isSingleUserEntry: " + isSingleUserEntry); logger.debug("userEntry: " + voteUsrResp.getUserEntry()); @@ -502,6 +562,26 @@ userEntryVoteMonitoredUserDTO.setResponse(voteUsrResp.getUserEntry()); listMonitoredUserContainerDTO.add(userEntryVoteMonitoredUserDTO); } + */ + + VoteQueContent voteQueContent=voteUsrResp.getVoteQueContent(); + logger.debug("voteQueContent: " + voteQueContent); + String entry=voteQueContent.getQuestion(); + logger.debug("entry: " + entry); + if (entry != null) + { + if (entry.equals("sample nomination")) + { + logger.debug("this nomination entry points to a user entered nomination: " + voteUsrResp.getUserEntry()); + voteMonitoredUserDTO.setResponse(voteUsrResp.getUserEntry()); + } + else + { + logger.debug("this nomination entry points to a standard nomination: " + voteQueContent.getQuestion()); + voteMonitoredUserDTO.setResponse(voteQueContent.getQuestion()); + } + } + listMonitoredUserContainerDTO.add(voteMonitoredUserDTO); } } 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.11 -r1.12 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java 26 Apr 2006 12:36:13 -0000 1.11 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java 26 Apr 2006 17:56:10 -0000 1.12 @@ -381,8 +381,12 @@ logger.debug("creating attemps with mapGeneralCheckedOptionsContent " + mapGeneralCheckedOptionsContent); voteService.removeAttemptsForUser(voteQueUsr.getUid()); logger.debug("nominations deleted for user: " + voteQueUsr.getUid()); - LearningUtil.createAttempt(request, voteQueUsr, mapGeneralCheckedOptionsContent, userEntry, newNominationCount, false); - + + logger.debug("mapGeneralCheckedOptionsContent size: " + mapGeneralCheckedOptionsContent.size()); + if (mapGeneralCheckedOptionsContent.size() > 0) + { + LearningUtil.createAttempt(request, voteQueUsr, mapGeneralCheckedOptionsContent, userEntry, newNominationCount, false); + } logger.debug("using nominationCount: " + newNominationCount); if ((mapGeneralCheckedOptionsContent.size() == 0 && (userEntryAvailable == true))) Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java,v diff -u -r1.4 -r1.5 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java 20 Apr 2006 16:09:29 -0000 1.4 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java 26 Apr 2006 17:56:10 -0000 1.5 @@ -23,6 +23,8 @@ package org.lamsfoundation.lams.tool.vote.web; import java.io.IOException; +import java.util.Iterator; +import java.util.LinkedList; import java.util.List; import java.util.Map; @@ -40,8 +42,11 @@ import org.lamsfoundation.lams.tool.exception.ToolException; import org.lamsfoundation.lams.tool.vote.VoteAppConstants; import org.lamsfoundation.lams.tool.vote.VoteApplicationException; +import org.lamsfoundation.lams.tool.vote.VoteMonitoredAnswersDTO; import org.lamsfoundation.lams.tool.vote.VoteUtils; import org.lamsfoundation.lams.tool.vote.pojos.VoteContent; +import org.lamsfoundation.lams.tool.vote.pojos.VoteQueContent; +import org.lamsfoundation.lams.tool.vote.pojos.VoteUsrAttempt; import org.lamsfoundation.lams.tool.vote.service.IVoteService; import org.lamsfoundation.lams.tool.vote.service.VoteServiceProxy; import org.lamsfoundation.lams.web.action.LamsDispatchAction; @@ -165,6 +170,31 @@ request.getSession().setAttribute(LIST_MONITORED_ANSWERS_CONTAINER_DTO, listMonitoredAnswersContainerDTO); logger.debug("LIST_MONITORED_ANSWERS_CONTAINER_DTO: " + request.getSession().getAttribute(LIST_MONITORED_ANSWERS_CONTAINER_DTO)); /* ends here. */ + + logger.debug("start getting user entries: "); + List userEntries=voteService.getUserEntries(); + logger.debug("userEntries: " + userEntries); + + List listUserEntries=new LinkedList(); + + Iterator itListQuestions = userEntries.iterator(); + while (itListQuestions.hasNext()) + { + String userEntry =(String)itListQuestions.next(); + logger.debug("userEntry:..." + userEntry); + + if (userEntry != null) + { + VoteMonitoredAnswersDTO voteMonitoredAnswersDTO= new VoteMonitoredAnswersDTO(); + logger.debug("adding uwer entry : " + userEntry); + voteMonitoredAnswersDTO.setQuestion(userEntry); + + listUserEntries.add(voteMonitoredAnswersDTO); + } + } + logger.debug("finish getting user entries: " + listUserEntries); + request.getSession().setAttribute(LIST_USER_ENTRIES, listUserEntries); + } Index: lams_tool_vote/web/monitoring/SummaryContent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/web/monitoring/SummaryContent.jsp,v diff -u -r1.2 -r1.3 --- lams_tool_vote/web/monitoring/SummaryContent.jsp 24 Apr 2006 12:57:15 -0000 1.2 +++ lams_tool_vote/web/monitoring/SummaryContent.jsp 26 Apr 2006 17:56:10 -0000 1.3 @@ -102,7 +102,6 @@ - @@ -126,6 +125,41 @@ + + + + + +     + + + + + + + + + + + + + + + + + + + + + +
other data1 other data2 other data3
+ + +
+ + + + Index: lams_tool_vote/web/monitoring/UserResponses.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/web/monitoring/Attic/UserResponses.jsp,v diff -u -r1.2 -r1.3 --- lams_tool_vote/web/monitoring/UserResponses.jsp 24 Apr 2006 12:57:15 -0000 1.2 +++ lams_tool_vote/web/monitoring/UserResponses.jsp 26 Apr 2006 17:56:10 -0000 1.3 @@ -35,7 +35,6 @@ -