Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java =================================================================== diff -u -r2ed86809be97c2553630665e20d6cc21b57c531c -rddc0da3d278fb12ac8374ad59146a8990ea2f3a2 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision 2ed86809be97c2553630665e20d6cc21b57c531c) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision ddc0da3d278fb12ac8374ad59146a8990ea2f3a2) @@ -23,14 +23,17 @@ package org.lamsfoundation.lams.tool.vote.web; import java.util.ArrayList; +import java.util.Date; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.TimeZone; import java.util.TreeMap; import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; import org.apache.log4j.Logger; import org.lamsfoundation.lams.notebook.model.NotebookEntry; @@ -53,7 +56,11 @@ import org.lamsfoundation.lams.tool.vote.pojos.VoteSession; import org.lamsfoundation.lams.tool.vote.pojos.VoteUsrAttempt; import org.lamsfoundation.lams.tool.vote.service.IVoteService; +import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.util.DateUtil; import org.lamsfoundation.lams.util.MessageService; +import org.lamsfoundation.lams.web.session.SessionManager; +import org.lamsfoundation.lams.web.util.AttributeNames; /** * @@ -1224,45 +1231,52 @@ } public static void buildVoteStatsDTO(HttpServletRequest request, IVoteService voteService, VoteContent voteContent) { - logger.debug("building voteStatsDTO: " + voteContent); - VoteStatsDTO voteStatsDTO = new VoteStatsDTO(); int countSessionComplete = 0; int countAllUsers = 0; - logger.debug("finding out about content level notebook entries: " + voteContent); Iterator iteratorSession = voteContent.getVoteSessions().iterator(); while (iteratorSession.hasNext()) { VoteSession voteSession = (VoteSession) iteratorSession.next(); - logger.debug("voteSession: " + voteSession); if (voteSession != null) { - logger.debug("voteSession id: " + voteSession.getVoteSessionId()); - if (voteSession.getSessionStatus().equals(COMPLETED)) { ++countSessionComplete; } Iterator iteratorUser = voteSession.getVoteQueUsers().iterator(); while (iteratorUser.hasNext()) { VoteQueUsr voteQueUsr = (VoteQueUsr) iteratorUser.next(); - logger.debug("voteQueUsr: " + voteQueUsr); - if (voteQueUsr != null) { - logger.debug("voteQueUsr foundid"); ++countAllUsers; } } } } - logger.debug("countAllUsers: " + countAllUsers); - logger.debug("countSessionComplete: " + countSessionComplete); + VoteStatsDTO voteStatsDTO = new VoteStatsDTO(); voteStatsDTO.setCountAllUsers(new Integer(countAllUsers).toString()); voteStatsDTO.setCountSessionComplete(new Integer(countSessionComplete).toString()); - - logger.debug("voteStatsDTO: " + voteStatsDTO); - request.setAttribute(VOTE_STATS_DTO, voteStatsDTO); + + // setting up the advanced summary for LDEV-1662 + request.setAttribute("lockOnFinish", voteContent.isLockOnFinish()); + request.setAttribute("allowText", voteContent.isAllowText()); + request.setAttribute("maxNominationCount", voteContent.getMaxNominationCount()); + request.setAttribute("minNominationCount", voteContent.getMinNominationCount()); + request.setAttribute("showResults", voteContent.isShowResults()); + request.setAttribute("reflect", voteContent.isReflect()); + request.setAttribute("reflectionSubject", voteContent.getReflectionSubject()); + request.setAttribute("toolContentID", voteContent.getVoteContentId()); + + // setting up the SubmissionDeadline + if (voteContent.getSubmissionDeadline() != null) { + Date submissionDeadline = voteContent.getSubmissionDeadline(); + HttpSession ss = SessionManager.getSession(); + UserDTO teacher = (UserDTO) ss.getAttribute(AttributeNames.USER); + TimeZone teacherTimeZone = teacher.getTimeZone(); + Date tzSubmissionDeadline = DateUtil.convertToTimeZoneFromDefault(teacherTimeZone, submissionDeadline); + request.setAttribute(VoteAppConstants.ATTR_SUBMISSION_DEADLINE, tzSubmissionDeadline.getTime()); + } } public static void generateGroupsSessionData(HttpServletRequest request, IVoteService voteService, Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java =================================================================== diff -u -r70f38fdf684aea01a6f938aaa70b8bf31dc98f00 -rddc0da3d278fb12ac8374ad59146a8990ea2f3a2 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java (.../VoteMonitoringAction.java) (revision 70f38fdf684aea01a6f938aaa70b8bf31dc98f00) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java (.../VoteMonitoringAction.java) (revision ddc0da3d278fb12ac8374ad59146a8990ea2f3a2) @@ -731,16 +731,6 @@ VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); VoteMonitoringAction.logger.debug("existing voteContent:" + voteContent); - if (voteContent.getSubmissionDeadline() != null) { - Date submissionDeadline = voteContent.getSubmissionDeadline(); - HttpSession ss = SessionManager.getSession(); - UserDTO teacher = (UserDTO) ss.getAttribute(AttributeNames.USER); - TimeZone teacherTimeZone = teacher.getTimeZone(); - Date tzSubmissionDeadline = DateUtil.convertToTimeZoneFromDefault(teacherTimeZone, submissionDeadline); - request.setAttribute(VoteAppConstants.ATTR_SUBMISSION_DEADLINE, tzSubmissionDeadline.getTime()); - } - - /* this section is related to summary tab. Starts here. */ Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, voteContent, voteService); VoteMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java =================================================================== diff -u -r618abc7cca98f08ef288878ab371a3693492d835 -rddc0da3d278fb12ac8374ad59146a8990ea2f3a2 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java (.../VoteMonitoringStarterAction.java) (revision 618abc7cca98f08ef288878ab371a3693492d835) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java (.../VoteMonitoringStarterAction.java) (revision ddc0da3d278fb12ac8374ad59146a8990ea2f3a2) @@ -380,23 +380,13 @@ voteGeneralMonitoringDTO.setOfflineInstructions(voteContent.getOfflineInstructions()); List attachmentList = voteService.retrieveVoteUploadedFiles(voteContent); - logger.debug("attachmentList: " + attachmentList); voteGeneralMonitoringDTO.setAttachmentList(attachmentList); voteGeneralMonitoringDTO.setDeletedAttachmentList(new ArrayList()); /** ...till here **/ - // setting up the advanced summary for LDEV-1662 - request.setAttribute("lockOnFinish", voteContent.isLockOnFinish()); - request.setAttribute("allowText", voteContent.isAllowText()); - request.setAttribute("maxNominationCount", voteContent.getMaxNominationCount()); - request.setAttribute("minNominationCount", voteContent.getMinNominationCount()); - request.setAttribute("showResults", voteContent.isShowResults()); - request.setAttribute("reflect", voteContent.isReflect()); - request.setAttribute("reflectionSubject", voteContent.getReflectionSubject()); + MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); - MonitoringUtil.buildVoteStatsDTO(request,voteService, voteContent); - - return true; + return true; } Index: lams_tool_vote/web/monitoring/SummaryContent.jsp =================================================================== diff -u -r57a242c8553eeec5781c2106493aa9f34efa5489 -rddc0da3d278fb12ac8374ad59146a8990ea2f3a2 --- lams_tool_vote/web/monitoring/SummaryContent.jsp (.../SummaryContent.jsp) (revision 57a242c8553eeec5781c2106493aa9f34efa5489) +++ lams_tool_vote/web/monitoring/SummaryContent.jsp (.../SummaryContent.jsp) (revision ddc0da3d278fb12ac8374ad59146a8990ea2f3a2) @@ -27,85 +27,25 @@ - + + + - - -