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.48 -r1.48.8.1 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java 18 Feb 2009 23:06:58 -0000 1.48 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java 1 Jun 2011 12:39:10 -0000 1.48.8.1 @@ -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,53 @@ } 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 =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java,v diff -u -r1.44.10.2 -r1.44.10.3 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java 1 Jun 2011 11:36:39 -0000 1.44.10.2 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java 1 Jun 2011 12:39:10 -0000 1.44.10.3 @@ -765,31 +765,13 @@ VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) throws IOException, ServletException { - logger.debug("start initSummaryContent...toolContentID: " + toolContentID); - logger.debug("dispatching getSummary...voteGeneralMonitoringDTO:" + voteGeneralMonitoringDTO); - - logger.debug("voteService: " + voteService); - logger.debug("toolContentID: " + toolContentID); - VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); - 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); - logger.debug("summaryToolSessions: " + summaryToolSessions); voteGeneralMonitoringDTO.setSummaryToolSessions(summaryToolSessions); Map summaryToolSessionsId=MonitoringUtil.populateToolSessionsId(request, voteContent, voteService); - logger.debug("summaryToolSessionsId: " + summaryToolSessionsId); voteGeneralMonitoringDTO.setSummaryToolSessionsId(summaryToolSessionsId); /* ends here. */ Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java,v diff -u -r1.36.10.1 -r1.36.10.2 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java 10 Mar 2010 15:02:10 -0000 1.36.10.1 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java 1 Jun 2011 12:39:10 -0000 1.36.10.2 @@ -379,27 +379,16 @@ voteGeneralMonitoringDTO.setOnlineInstructions(voteContent.getOnlineInstructions()); voteGeneralMonitoringDTO.setOfflineInstructions(voteContent.getOfflineInstructions()); - List attachmentList = voteService.retrieveVoteUploadedFiles(voteContent); - logger.debug("attachmentList: " + attachmentList); - voteGeneralMonitoringDTO.setAttachmentList(attachmentList); - voteGeneralMonitoringDTO.setDeletedAttachmentList(new ArrayList()); - /** ...till here **/ + List attachmentList = voteService.retrieveVoteUploadedFiles(voteContent); + voteGeneralMonitoringDTO.setAttachmentList(attachmentList); + voteGeneralMonitoringDTO.setDeletedAttachmentList(new ArrayList()); + /** ...till here **/ + MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); - // 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()); + return true; + } - MonitoringUtil.buildVoteStatsDTO(request,voteService, voteContent); - return true; - } - - protected ActionForward validateParameters(HttpServletRequest request, ActionMapping mapping, VoteMonitoringForm voteMonitoringForm) { logger.debug("start validating monitoring parameters..."); Index: lams_tool_vote/web/monitoring/SummaryContent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/web/monitoring/SummaryContent.jsp,v diff -u -r1.34.10.2 -r1.34.10.3 --- lams_tool_vote/web/monitoring/SummaryContent.jsp 9 May 2011 12:09:58 -0000 1.34.10.2 +++ lams_tool_vote/web/monitoring/SummaryContent.jsp 1 Jun 2011 12:39:10 -0000 1.34.10.3 @@ -72,7 +72,7 @@ } var reqIDVar = new Date(); - var url = "?dispatch=setSubmissionDeadline&toolContentID=${param.toolContentID}&submissionDeadline=" + var url = "?dispatch=setSubmissionDeadline&toolContentID=${toolContentID}&submissionDeadline=" + date.getTime() + "&reqID=" + reqIDVar.getTime(); $.ajax({ @@ -87,7 +87,7 @@ } function removeSubmissionDeadline() { var reqIDVar = new Date(); - var url = "?dispatch=setSubmissionDeadline&toolContentID=${param.toolContentID}&submissionDeadline=" + var url = "?dispatch=setSubmissionDeadline&toolContentID=${toolContentID}&submissionDeadline=" + "&reqID=" + reqIDVar.getTime(); $.ajax({