Index: lams_tool_vote/conf/language/ApplicationResources.properties =================================================================== diff -u -r5479e284e329ab77ef2334483a2f4b1cfe162301 -r369b6c2ca857c6b74ee143e081534f50b0b94106 --- lams_tool_vote/conf/language/ApplicationResources.properties (.../ApplicationResources.properties) (revision 5479e284e329ab77ef2334483a2f4b1cfe162301) +++ lams_tool_vote/conf/language/ApplicationResources.properties (.../ApplicationResources.properties) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) @@ -136,6 +136,7 @@ label.nomination.col =Nomination: authoring.msg.cancel.save =Do you want to close this window without saving? button.try.again =Try again +label.group =Group: #======= End labels: Exported 130 labels for en AU ===== Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java =================================================================== diff -u -r80d305915ce2c3952f34ed08e8b4740188dde18c -r369b6c2ca857c6b74ee143e081534f50b0b94106 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java (.../VoteAppConstants.java) (revision 80d305915ce2c3952f34ed08e8b4740188dde18c) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java (.../VoteAppConstants.java) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) @@ -69,11 +69,17 @@ public static final String LOCK_ON_FINISH ="lockOnFinish"; public static final String REPORT_VIEW_ONLY ="reportViewOnly"; public static final String USER_ENTRY ="userEntry"; + public static final String RESPONSE_ID ="responseId"; + public static final String CURRENT_UID ="currentUid"; + public static final String SELECTED_TOOL_SESSION_ID ="selectedToolSessionId"; + public static final String DEFAULT_VOTING_TITLE ="Voting Title"; + public static final String DEFAULT_VOTING_INSTRUCTIONS ="Voting Instructions"; public static final String ATTACHMENT_LIST_KEY = "attachmentListKey"; public static final String DELETED_ATTACHMENT_LIST_KEY = "deletedAttachmentListKey"; public static final String ACTIVITY_TITLE_KEY = "activityTitleKey"; public static final String ACTIVITY_INSTRUCTIONS_KEY = "activityInstructionsKey"; + public static final String VOTE_GENERAL_MONITORING_DTO = "voteGeneralMonitoringDTO"; public static final String AUTHORING ="authoring"; public static final String SOURCE_VOTE_STARTER ="sourceVoteStarter"; @@ -274,6 +280,7 @@ public static final String MODE ="mode"; public static final String LEARNING_MODE ="learningMode"; public static final String EXPORT_USER_ID ="exportUserId"; + public static final String SESSION_VOTES_CHART ="Session Votes Chart"; /* * exception constants Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteGeneralMonitoringDTO.java =================================================================== diff -u --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteGeneralMonitoringDTO.java (revision 0) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteGeneralMonitoringDTO.java (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) @@ -0,0 +1,754 @@ +/*************************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * ***********************************************************************/ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.vote; + + +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang.builder.ToStringBuilder; + + +/** + *

DTO that holds monitoring flow properties + *

+ * + * @author Ozgur Demirtas + */ +public class VoteGeneralMonitoringDTO implements Comparable +{ + protected String currentMonitoringTab; + protected String sbmtSuccess; + protected String defineLaterInEditMode; + protected String requestLearningReport; + protected String userExceptionNoToolSessions; + protected String userExceptionContentInUse; + protected String userExceptionContentDoesNotExist; + protected String userExceptionNoStudentActivity; + protected String isMonitoredContentInUse; + + protected String activeModule; + protected String currentTab; + protected String activityTitle; + protected String activityInstructions; + protected String defaultOptionContent; + protected String countAllUsers; + protected String countSessionComplete; + protected String isPortfolioExport; + protected String groupName; + protected String currentMonitoredToolSession; + protected Long selectionCase; + protected String existsOpenVotes; + protected String isToolSessionChanged; + protected String responseId; + protected String currentUid; + + protected String toolContentID; + protected Map mapOptionsContent; + protected Map summaryToolSessions; + protected Map summaryToolSessionsId; + protected List listMonitoredAnswersContainerDto; + protected List listUserEntries; + protected String selectedToolSessionId; + + protected String richTextOnlineInstructions; + protected String richTextOfflineInstructions; + protected List listOfflineFilesMetadata; + protected List listUploadedOfflineFileNames; + protected List listOnlineFilesMetadata; + protected List listUploadedOnlineFileNames; + protected String showOpenVotesSection; + + protected List listVoteAllSessionsDTO; + protected Map mapStandardNominationsContent; + protected Map mapStandardNominationsHTMLedContent; + protected Map mapStandardRatesContent; + protected Map mapStandardUserCount; + protected Map mapStandardQuestionUid; + protected Map mapStandardToolSessionUid; + + protected String sessionUserCount; + protected String completedSessionUserCount; + protected String completedSessionUserPercent; + protected List mapStudentsVoted; + + /** + * @return Returns the listOfflineFilesMetadata. + */ + public List getListOfflineFilesMetadata() { + return listOfflineFilesMetadata; + } + /** + * @param listOfflineFilesMetadata The listOfflineFilesMetadata to set. + */ + public void setListOfflineFilesMetadata(List listOfflineFilesMetadata) { + this.listOfflineFilesMetadata = listOfflineFilesMetadata; + } + /** + * @return Returns the listOnlineFilesMetadata. + */ + public List getListOnlineFilesMetadata() { + return listOnlineFilesMetadata; + } + /** + * @param listOnlineFilesMetadata The listOnlineFilesMetadata to set. + */ + public void setListOnlineFilesMetadata(List listOnlineFilesMetadata) { + this.listOnlineFilesMetadata = listOnlineFilesMetadata; + } + /** + * @return Returns the listUploadedOfflineFileNames. + */ + public List getListUploadedOfflineFileNames() { + return listUploadedOfflineFileNames; + } + /** + * @param listUploadedOfflineFileNames The listUploadedOfflineFileNames to set. + */ + public void setListUploadedOfflineFileNames( + List listUploadedOfflineFileNames) { + this.listUploadedOfflineFileNames = listUploadedOfflineFileNames; + } + /** + * @return Returns the listUploadedOnlineFileNames. + */ + public List getListUploadedOnlineFileNames() { + return listUploadedOnlineFileNames; + } + /** + * @param listUploadedOnlineFileNames The listUploadedOnlineFileNames to set. + */ + public void setListUploadedOnlineFileNames(List listUploadedOnlineFileNames) { + this.listUploadedOnlineFileNames = listUploadedOnlineFileNames; + } + /** + * @return Returns the richTextOfflineInstructions. + */ + public String getRichTextOfflineInstructions() { + return richTextOfflineInstructions; + } + /** + * @param richTextOfflineInstructions The richTextOfflineInstructions to set. + */ + public void setRichTextOfflineInstructions( + String richTextOfflineInstructions) { + this.richTextOfflineInstructions = richTextOfflineInstructions; + } + /** + * @return Returns the richTextOnlineInstructions. + */ + public String getRichTextOnlineInstructions() { + return richTextOnlineInstructions; + } + /** + * @param richTextOnlineInstructions The richTextOnlineInstructions to set. + */ + public void setRichTextOnlineInstructions(String richTextOnlineInstructions) { + this.richTextOnlineInstructions = richTextOnlineInstructions; + } + /** + * @return Returns the userExceptionContentDoesNotExist. + */ + public String getUserExceptionContentDoesNotExist() { + return userExceptionContentDoesNotExist; + } + /** + * @param userExceptionContentDoesNotExist The userExceptionContentDoesNotExist to set. + */ + public void setUserExceptionContentDoesNotExist( + String userExceptionContentDoesNotExist) { + this.userExceptionContentDoesNotExist = userExceptionContentDoesNotExist; + } + /** + * @return Returns the userExceptionNoStudentActivity. + */ + public String getUserExceptionNoStudentActivity() { + return userExceptionNoStudentActivity; + } + /** + * @param userExceptionNoStudentActivity The userExceptionNoStudentActivity to set. + */ + public void setUserExceptionNoStudentActivity( + String userExceptionNoStudentActivity) { + this.userExceptionNoStudentActivity = userExceptionNoStudentActivity; + } + /** + * @return Returns the activeModule. + */ + public String getActiveModule() { + return activeModule; + } + /** + * @param activeModule The activeModule to set. + */ + public void setActiveModule(String activeModule) { + this.activeModule = activeModule; + } + /** + * @return Returns the currentTab. + */ + public String getCurrentTab() { + return currentTab; + } + /** + * @param currentTab The currentTab to set. + */ + public void setCurrentTab(String currentTab) { + this.currentTab = currentTab; + } + /** + * @return Returns the defaultOptionContent. + */ + public String getDefaultOptionContent() { + return defaultOptionContent; + } + /** + * @param defaultOptionContent The defaultOptionContent to set. + */ + public void setDefaultOptionContent(String defaultOptionContent) { + this.defaultOptionContent = defaultOptionContent; + } + /** + * @return Returns the userExceptionContentInUse. + */ + public String getUserExceptionContentInUse() { + return userExceptionContentInUse; + } + /** + * @param userExceptionContentInUse The userExceptionContentInUse to set. + */ + public void setUserExceptionContentInUse(String userExceptionContentInUse) { + this.userExceptionContentInUse = userExceptionContentInUse; + } + /** + * @return Returns the activityInstructions. + */ + public String getActivityInstructions() { + return activityInstructions; + } + /** + * @param activityInstructions The activityInstructions to set. + */ + public void setActivityInstructions(String activityInstructions) { + this.activityInstructions = activityInstructions; + } + /** + * @return Returns the activityTitle. + */ + public String getActivityTitle() { + return activityTitle; + } + /** + * @param activityTitle The activityTitle to set. + */ + public void setActivityTitle(String activityTitle) { + this.activityTitle = activityTitle; + } + /** + * @return Returns the currentMonitoringTab. + */ + public String getCurrentMonitoringTab() { + return currentMonitoringTab; + } + /** + * @param currentMonitoringTab The currentMonitoringTab to set. + */ + public void setCurrentMonitoringTab(String currentMonitoringTab) { + this.currentMonitoringTab = currentMonitoringTab; + } + /** + * @return Returns the defineLaterInEditMode. + */ + public String getDefineLaterInEditMode() { + return defineLaterInEditMode; + } + /** + * @param defineLaterInEditMode The defineLaterInEditMode to set. + */ + public void setDefineLaterInEditMode(String defineLaterInEditMode) { + this.defineLaterInEditMode = defineLaterInEditMode; + } + /** + * @return Returns the requestLearningReport. + */ + public String getRequestLearningReport() { + return requestLearningReport; + } + /** + * @param requestLearningReport The requestLearningReport to set. + */ + public void setRequestLearningReport(String requestLearningReport) { + this.requestLearningReport = requestLearningReport; + } + /** + * @return Returns the sbmtSuccess. + */ + public String getSbmtSuccess() { + return sbmtSuccess; + } + /** + * @param sbmtSuccess The sbmtSuccess to set. + */ + public void setSbmtSuccess(String sbmtSuccess) { + this.sbmtSuccess = sbmtSuccess; + } + /** + * @return Returns the userExceptionNoToolSessions. + */ + public String getUserExceptionNoToolSessions() { + return userExceptionNoToolSessions; + } + /** + * @param userExceptionNoToolSessions The userExceptionNoToolSessions to set. + */ + public void setUserExceptionNoToolSessions( + String userExceptionNoToolSessions) { + this.userExceptionNoToolSessions = userExceptionNoToolSessions; + } + /** + * @return Returns the isMonitoredContentInUse. + */ + public String getIsMonitoredContentInUse() { + return isMonitoredContentInUse; + } + /** + * @param isMonitoredContentInUse The isMonitoredContentInUse to set. + */ + public void setIsMonitoredContentInUse(String isMonitoredContentInUse) { + this.isMonitoredContentInUse = isMonitoredContentInUse; + } + + + /** + * @return Returns the mapOptionsContent. + */ + public Map getMapOptionsContent() { + return mapOptionsContent; + } + /** + * @param mapOptionsContent The mapOptionsContent to set. + */ + public void setMapOptionsContent(Map mapOptionsContent) { + this.mapOptionsContent = mapOptionsContent; + } + + /** + * @return Returns the countAllUsers. + */ + public String getCountAllUsers() { + return countAllUsers; + } + /** + * @param countAllUsers The countAllUsers to set. + */ + public void setCountAllUsers(String countAllUsers) { + this.countAllUsers = countAllUsers; + } + /** + * @return Returns the countSessionComplete. + */ + public String getCountSessionComplete() { + return countSessionComplete; + } + /** + * @param countSessionComplete The countSessionComplete to set. + */ + public void setCountSessionComplete(String countSessionComplete) { + this.countSessionComplete = countSessionComplete; + } + /** + * @return Returns the isPortfolioExport. + */ + public String getIsPortfolioExport() { + return isPortfolioExport; + } + /** + * @param isPortfolioExport The isPortfolioExport to set. + */ + public void setIsPortfolioExport(String isPortfolioExport) { + this.isPortfolioExport = isPortfolioExport; + } + /** + * @return Returns the summaryToolSessions. + */ + public Map getSummaryToolSessions() { + return summaryToolSessions; + } + /** + * @param summaryToolSessions The summaryToolSessions to set. + */ + public void setSummaryToolSessions(Map summaryToolSessions) { + this.summaryToolSessions = summaryToolSessions; + } + /** + * @return Returns the summaryToolSessionsId. + */ + public Map getSummaryToolSessionsId() { + return summaryToolSessionsId; + } + /** + * @param summaryToolSessionsId The summaryToolSessionsId to set. + */ + public void setSummaryToolSessionsId(Map summaryToolSessionsId) { + this.summaryToolSessionsId = summaryToolSessionsId; + } + /** + * @return Returns the selectionCase. + */ + public Long getSelectionCase() { + return selectionCase; + } + /** + * @param selectionCase The selectionCase to set. + */ + public void setSelectionCase(Long selectionCase) { + this.selectionCase = selectionCase; + } + /** + * @return Returns the currentMonitoredToolSession. + */ + public String getCurrentMonitoredToolSession() { + return currentMonitoredToolSession; + } + /** + * @param currentMonitoredToolSession The currentMonitoredToolSession to set. + */ + public void setCurrentMonitoredToolSession( + String currentMonitoredToolSession) { + this.currentMonitoredToolSession = currentMonitoredToolSession; + } + /** + * @return Returns the groupName. + */ + public String getGroupName() { + return groupName; + } + /** + * @param groupName The groupName to set. + */ + public void setGroupName(String groupName) { + this.groupName = groupName; + } + /** + * @return Returns the listMonitoredAnswersContainerDto. + */ + public List getListMonitoredAnswersContainerDto() { + return listMonitoredAnswersContainerDto; + } + /** + * @param listMonitoredAnswersContainerDto The listMonitoredAnswersContainerDto to set. + */ + public void setListMonitoredAnswersContainerDto( + List listMonitoredAnswersContainerDto) { + this.listMonitoredAnswersContainerDto = listMonitoredAnswersContainerDto; + } + /** + * @return Returns the listUserEntries. + */ + public List getListUserEntries() { + return listUserEntries; + } + /** + * @param listUserEntries The listUserEntries to set. + */ + public void setListUserEntries(List listUserEntries) { + this.listUserEntries = listUserEntries; + } + /** + * @return Returns the existsOpenVotes. + */ + public String getExistsOpenVotes() { + return existsOpenVotes; + } + /** + * @param existsOpenVotes The existsOpenVotes to set. + */ + public void setExistsOpenVotes(String existsOpenVotes) { + this.existsOpenVotes = existsOpenVotes; + } + /** + * @return Returns the selectedToolSessionId. + */ + public String getSelectedToolSessionId() { + return selectedToolSessionId; + } + /** + * @param selectedToolSessionId The selectedToolSessionId to set. + */ + public void setSelectedToolSessionId(String selectedToolSessionId) { + this.selectedToolSessionId = selectedToolSessionId; + } + /** + * @return Returns the listVoteAllSessionsDTO. + */ + public List getListVoteAllSessionsDTO() { + return listVoteAllSessionsDTO; + } + /** + * @param listVoteAllSessionsDTO The listVoteAllSessionsDTO to set. + */ + public void setListVoteAllSessionsDTO(List listVoteAllSessionsDTO) { + this.listVoteAllSessionsDTO = listVoteAllSessionsDTO; + } + /** + * @return Returns the mapStandardNominationsContent. + */ + public Map getMapStandardNominationsContent() { + return mapStandardNominationsContent; + } + /** + * @param mapStandardNominationsContent The mapStandardNominationsContent to set. + */ + public void setMapStandardNominationsContent( + Map mapStandardNominationsContent) { + this.mapStandardNominationsContent = mapStandardNominationsContent; + } + /** + * @return Returns the mapStandardNominationsHTMLedContent. + */ + public Map getMapStandardNominationsHTMLedContent() { + return mapStandardNominationsHTMLedContent; + } + /** + * @param mapStandardNominationsHTMLedContent The mapStandardNominationsHTMLedContent to set. + */ + public void setMapStandardNominationsHTMLedContent( + Map mapStandardNominationsHTMLedContent) { + this.mapStandardNominationsHTMLedContent = mapStandardNominationsHTMLedContent; + } + /** + * @return Returns the mapStandardQuestionUid. + */ + public Map getMapStandardQuestionUid() { + return mapStandardQuestionUid; + } + /** + * @param mapStandardQuestionUid The mapStandardQuestionUid to set. + */ + public void setMapStandardQuestionUid(Map mapStandardQuestionUid) { + this.mapStandardQuestionUid = mapStandardQuestionUid; + } + /** + * @return Returns the mapStandardRatesContent. + */ + public Map getMapStandardRatesContent() { + return mapStandardRatesContent; + } + /** + * @param mapStandardRatesContent The mapStandardRatesContent to set. + */ + public void setMapStandardRatesContent(Map mapStandardRatesContent) { + this.mapStandardRatesContent = mapStandardRatesContent; + } + /** + * @return Returns the mapStandardToolSessionUid. + */ + public Map getMapStandardToolSessionUid() { + return mapStandardToolSessionUid; + } + /** + * @param mapStandardToolSessionUid The mapStandardToolSessionUid to set. + */ + public void setMapStandardToolSessionUid(Map mapStandardToolSessionUid) { + this.mapStandardToolSessionUid = mapStandardToolSessionUid; + } + /** + * @return Returns the mapStandardUserCount. + */ + public Map getMapStandardUserCount() { + return mapStandardUserCount; + } + /** + * @param mapStandardUserCount The mapStandardUserCount to set. + */ + public void setMapStandardUserCount(Map mapStandardUserCount) { + this.mapStandardUserCount = mapStandardUserCount; + } + /** + * @return Returns the showOpenVotesSection. + */ + public String getShowOpenVotesSection() { + return showOpenVotesSection; + } + /** + * @param showOpenVotesSection The showOpenVotesSection to set. + */ + public void setShowOpenVotesSection(String showOpenVotesSection) { + this.showOpenVotesSection = showOpenVotesSection; + } + /** + * @param mapStudentsVoted The mapStudentsVoted to set. + */ + public void setMapStudentsVoted(List mapStudentsVoted) { + this.mapStudentsVoted = mapStudentsVoted; + } + /** + * @return Returns the mapStudentsVoted. + */ + public List getMapStudentsVoted() { + return mapStudentsVoted; + } + /** + * @return Returns the currentUid. + */ + public String getCurrentUid() { + return currentUid; + } + /** + * @param currentUid The currentUid to set. + */ + public void setCurrentUid(String currentUid) { + this.currentUid = currentUid; + } + /** + * @return Returns the isToolSessionChanged. + */ + public String getIsToolSessionChanged() { + return isToolSessionChanged; + } + /** + * @param isToolSessionChanged The isToolSessionChanged to set. + */ + public void setIsToolSessionChanged(String isToolSessionChanged) { + this.isToolSessionChanged = isToolSessionChanged; + } + /** + * @return Returns the responseId. + */ + public String getResponseId() { + return responseId; + } + /** + * @param responseId The responseId to set. + */ + public void setResponseId(String responseId) { + this.responseId = responseId; + } + /** + * @return Returns the toolContentID. + */ + public String getToolContentID() { + return toolContentID; + } + /** + * @param toolContentID The toolContentID to set. + */ + public void setToolContentID(String toolContentID) { + this.toolContentID = toolContentID; + } + /** + * @return Returns the completedSessionUserCount. + */ + public String getCompletedSessionUserCount() { + return completedSessionUserCount; + } + /** + * @param completedSessionUserCount The completedSessionUserCount to set. + */ + public void setCompletedSessionUserCount(String completedSessionUserCount) { + this.completedSessionUserCount = completedSessionUserCount; + } + /** + * @return Returns the completedSessionUserPercent. + */ + public String getCompletedSessionUserPercent() { + return completedSessionUserPercent; + } + /** + * @param completedSessionUserPercent The completedSessionUserPercent to set. + */ + public void setCompletedSessionUserPercent( + String completedSessionUserPercent) { + this.completedSessionUserPercent = completedSessionUserPercent; + } + /** + * @return Returns the sessionUserCount. + */ + public String getSessionUserCount() { + return sessionUserCount; + } + /** + * @param sessionUserCount The sessionUserCount to set. + */ + public void setSessionUserCount(String sessionUserCount) { + this.sessionUserCount = sessionUserCount; + } + + public String toString() { + return new ToStringBuilder(this) + .append("toolContentID: ", toolContentID) + .append("activeModule: ", activeModule) + .append("currentMonitoringTab: ", currentMonitoringTab) + .append("selectionCase: ", selectionCase) + .append("isToolSessionChanged: ", isToolSessionChanged) + .append("currentTab: ", currentTab) + .append("sbmtSuccess: ", sbmtSuccess) + .append("defineLaterInEditMode: ", defineLaterInEditMode) + .append("requestLearningReport: ", requestLearningReport) + .append("userExceptionNoToolSessions: ", userExceptionNoToolSessions) + .append("userExceptionContentDoesNotExist: ", userExceptionContentDoesNotExist) + .append("userExceptionNoStudentActivity: ", userExceptionNoStudentActivity) + .append("isMonitoredContentInUse: ", isMonitoredContentInUse) + .append("activityTitle: ", activityTitle) + .append("activityInstructions: ", activityInstructions) + .append("userExceptionContentInUse: ", userExceptionContentInUse) + .append("defaultOptionContent: ", defaultOptionContent) + .append("countAllUsers: ", countAllUsers) + .append("countSessionComplete: ", countSessionComplete) + .append("isPortfolioExport: ", isPortfolioExport) + .append("summaryToolSessions: ", summaryToolSessions) + .append("summaryToolSessionsId: ", summaryToolSessionsId) + .append("currentMonitoredToolSession: ", currentMonitoredToolSession) + .append("groupName: ", groupName) + .append("listMonitoredAnswersContainerDto: ", listMonitoredAnswersContainerDto) + .append("listUserEntries: ", listUserEntries) + .append("existsOpenVotes: ", existsOpenVotes) + .append("selectedToolSessionId: ", selectedToolSessionId) + .append("listVoteAllSessionsDTO: ", listVoteAllSessionsDTO) + .append("richTextOnlineInstructions: ", richTextOnlineInstructions) + .append("richTextOfflineInstructions: ", richTextOfflineInstructions) + .append("listOfflineFilesMetadata: ", listOfflineFilesMetadata) + .append("listUploadedOfflineFileNames: ", listUploadedOfflineFileNames) + .append("listOnlineFilesMetadata: ", listOnlineFilesMetadata) + .append("listUploadedOnlineFileNames: ", listUploadedOnlineFileNames) + .append("showOpenVotesSection: ", showOpenVotesSection) + .append("mapStudentsVoted: ", mapStudentsVoted) + .append("responseId: ", responseId) + .append("currentUid: ", currentUid) + .append("sessionUserCount: ", sessionUserCount) + .append("completedSessionUserCount: ", completedSessionUserCount) + .append("completedSessionUserPercent: ", completedSessionUserPercent) + .toString(); + } + + public int compareTo(Object o) + { + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = (VoteGeneralMonitoringDTO) o; + + if (voteGeneralMonitoringDTO == null) + return 1; + else + return 0; + } + +} Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java =================================================================== diff -u -r1447dc2ae2077d18831a17b7c2f309390adb0687 -r369b6c2ca857c6b74ee143e081534f50b0b94106 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java (.../VoteUtils.java) (revision 1447dc2ae2077d18831a17b7c2f309390adb0687) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java (.../VoteUtils.java) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) @@ -42,6 +42,7 @@ import org.lamsfoundation.lams.usermanagement.dto.UserDTO; import org.lamsfoundation.lams.web.session.SessionManager; import org.lamsfoundation.lams.web.util.AttributeNames; +import org.lamsfoundation.lams.web.util.SessionMap; /** @@ -54,20 +55,7 @@ static Logger logger = Logger.getLogger(VoteUtils.class.getName()); /** - * returns the service object from the session cache - * IVoteService getToolService(HttpServletRequest request) * - * @param request - * @return - */ - public static IVoteService getToolService(HttpServletRequest request) - { - IVoteService voteService=(IVoteService)request.getSession().getAttribute(TOOL_SERVICE); - return voteService; - } - - /** - * * getGMTDateTime(HttpServletRequest request) * * @param request @@ -129,7 +117,6 @@ { TimeZone timeZone=TimeZone.getDefault(); logger.debug("current timezone: " + timeZone.getDisplayName()); - request.getSession().setAttribute(TIMEZONE, timeZone.getDisplayName()); logger.debug("current timezone id: " + timeZone.getID()); } @@ -147,9 +134,9 @@ * @return boolean * determine whether a specific toolContentId exists in the db */ - public static boolean existsContent(Long toolContentId, HttpServletRequest request) + public static boolean existsContent(Long toolContentId, HttpServletRequest request, IVoteService voteService) { - IVoteService voteService =VoteUtils.getToolService(request); + logger.debug("voteService: " + voteService); VoteContent voteContent=voteService.retrieveVote(toolContentId); logger.debug("retrieving voteContent: " + voteContent); @@ -166,10 +153,10 @@ * @param toolSessionId * @return boolean */ - public static boolean existsSession(Long toolSessionId, HttpServletRequest request) + public static boolean existsSession(Long toolSessionId, HttpServletRequest request, IVoteService voteService) { - logger.debug("existsSession"); - IVoteService voteService =VoteUtils.getToolService(request); + logger.debug("voteService: " + voteService); + VoteSession voteSession=voteService.retrieveVoteSession(toolSessionId); logger.debug("voteSession:" + voteSession); @@ -187,9 +174,6 @@ /*should never be null anyway as default content MUST exist in the db*/ if(defaultVoteContent == null) throw new NullPointerException("Default VoteContent cannot be null"); - - //voteAuthoringForm.setTitle(defaultVoteContent.getTitle()); - //voteAuthoringForm.setInstructions(defaultVoteContent.getInstructions()); voteGeneralAuthoringDTO.setActivityTitle(defaultVoteContent.getTitle()); voteGeneralAuthoringDTO.setActivityInstructions(defaultVoteContent.getInstructions()); @@ -247,9 +231,10 @@ } - public static void saveRichText(HttpServletRequest request, VoteGeneralAuthoringDTO voteGeneralAuthoringDTO) + public static void saveRichText(HttpServletRequest request, VoteGeneralAuthoringDTO voteGeneralAuthoringDTO, + SessionMap sessionMap) { - logger.debug("doing persistRichText: "); + logger.debug("doing saveRichText, sessionMap: " + sessionMap); String richTextTitle = request.getParameter(TITLE); String richTextInstructions = request.getParameter(INSTRUCTIONS); @@ -259,7 +244,6 @@ if (richTextTitle != null) { - //request.getSession().setAttribute(ACTIVITY_TITLE, richTextTitle); voteGeneralAuthoringDTO.setActivityTitle(richTextTitle); } String noHTMLTitle = stripHTML(richTextTitle); @@ -268,7 +252,6 @@ if (richTextInstructions != null) { - //request.getSession().setAttribute(ACTIVITY_INSTRUCTIONS, richTextInstructions); voteGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); } @@ -277,17 +260,17 @@ if ((richTextOfflineInstructions != null) && (richTextOfflineInstructions.length() > 0)) { - //request.getSession().setAttribute(RICHTEXT_OFFLINEINSTRUCTIONS,richTextOfflineInstructions); voteGeneralAuthoringDTO.setRichTextOfflineInstructions(richTextOfflineInstructions); + sessionMap.put(OFFLINE_INSTRUCTIONS_KEY,richTextOfflineInstructions); } String richTextOnlineInstructions=request.getParameter(RICHTEXT_ONLINEINSTRUCTIONS); logger.debug("read parameter richTextOnlineInstructions: " + richTextOnlineInstructions); if ((richTextOnlineInstructions != null) && (richTextOnlineInstructions.length() > 0)) { - //request.getSession().setAttribute(RICHTEXT_ONLINEINSTRUCTIONS,richTextOnlineInstructions); voteGeneralAuthoringDTO.setRichTextOnlineInstructions(richTextOnlineInstructions); + sessionMap.put(ONLINE_INSTRUCTIONS_KEY,richTextOnlineInstructions); } } @@ -473,10 +456,6 @@ public static void setDefineLater(HttpServletRequest request, boolean value, IVoteService voteService, String toolContentID) { - //IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); - //logger.debug("voteService:" + voteService); - - //Long toolContentId=(Long)request.getSession().getAttribute(TOOL_CONTENT_ID); logger.debug("toolContentID:" + toolContentID); VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); @@ -497,9 +476,6 @@ */ public static void cleanUpSessionAbsolute(HttpServletRequest request) { - request.getSession().removeAttribute(MY_SIGNATURE); - - cleanUpUserExceptions(request); logger.debug("completely cleaned the session."); } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/AuthoringUtil.java =================================================================== diff -u -r80d305915ce2c3952f34ed08e8b4740188dde18c -r369b6c2ca857c6b74ee143e081534f50b0b94106 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision 80d305915ce2c3952f34ed08e8b4740188dde18c) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) @@ -268,7 +268,6 @@ if (fileName.length() > 0) { - //List listUploadedOfflineFileNames=(List)request.getSession().getAttribute(LIST_UPLOADED_OFFLINE_FILENAMES); List listUploadedOfflineFileNames=(List)sessionMap.get(LIST_UPLOADED_OFFLINE_FILENAMES_KEY); logger.debug("listUploadedOfflineFileNames:" + listUploadedOfflineFileNames); int index=findFileNameIndex(listUploadedOfflineFileNames, fileName); @@ -277,7 +276,6 @@ { listUploadedOfflineFileNames.add(fileName); logger.debug("listUploadedOfflineFileNames after add :" + listUploadedOfflineFileNames); - //request.getSession().setAttribute(LIST_UPLOADED_OFFLINE_FILENAMES,listUploadedOfflineFileNames); sessionMap.put(LIST_UPLOADED_OFFLINE_FILENAMES_KEY, listUploadedOfflineFileNames); } } @@ -313,7 +311,6 @@ if (fileName.length() > 0) { - //List listUploadedOnlineFileNames=(List)request.getSession().getAttribute(LIST_UPLOADED_ONLINE_FILENAMES); List listUploadedOnlineFileNames=(List)sessionMap.get(LIST_UPLOADED_ONLINE_FILENAMES_KEY); logger.debug("listUploadedOnlineFileNames:" + listUploadedOnlineFileNames); int index=findFileNameIndex(listUploadedOnlineFileNames, fileName); @@ -322,7 +319,6 @@ { listUploadedOnlineFileNames.add(fileName); logger.debug("listUploadedOnlineFileNames after add :" + listUploadedOnlineFileNames); - //request.getSession().setAttribute(LIST_UPLOADED_ONLINE_FILENAMES,listUploadedOnlineFileNames); sessionMap.put(LIST_UPLOADED_ONLINE_FILENAMES_KEY, listUploadedOnlineFileNames); } } @@ -424,29 +420,25 @@ if (offlineFile.equals("1")) { logger.debug("will remove an offline file"); - //List listUploadedOfflineFileNames=(List)request.getSession().getAttribute(LIST_UPLOADED_OFFLINE_FILENAMES); List listUploadedOfflineFileNames=(List)sessionMap.get(LIST_UPLOADED_OFFLINE_FILENAMES_KEY); logger.debug("listUploadedOfflineFileNames:" + listUploadedOfflineFileNames); listUploadedOfflineFileNames.remove(filename); logger.debug("removed offline filename:" + filename); logger.debug("listUploadedOfflineFileNames after remove :" + listUploadedOfflineFileNames); - //request.getSession().setAttribute(LIST_UPLOADED_OFFLINE_FILENAMES,listUploadedOfflineFileNames); sessionMap.put(LIST_UPLOADED_OFFLINE_FILENAMES_KEY, listUploadedOfflineFileNames); } else { logger.debug("will remove an online file"); - //List listUploadedOnlineFileNames=(List)request.getSession().getAttribute(LIST_UPLOADED_ONLINE_FILENAMES); List listUploadedOnlineFileNames=(List)sessionMap.get(LIST_UPLOADED_ONLINE_FILENAMES_KEY); logger.debug("listUploadedOnlineFileNames:" + listUploadedOnlineFileNames); listUploadedOnlineFileNames.remove(filename); logger.debug("removed online filename:" + filename); logger.debug("listUploadedOnlineFileNames after remove :" + listUploadedOnlineFileNames); - //request.getSession().setAttribute(LIST_UPLOADED_ONLINE_FILENAMES,listUploadedOnlineFileNames); sessionMap.put(LIST_UPLOADED_ONLINE_FILENAMES_KEY, listUploadedOnlineFileNames); } } @@ -522,12 +514,10 @@ if (isOfflineFile) { - //listFilesMetaData =(List)request.getSession().getAttribute(LIST_OFFLINEFILES_METADATA); listFilesMetaData =(List)sessionMap.get(LIST_OFFLINEFILES_METADATA_KEY); } else { - //listFilesMetaData =(List)request.getSession().getAttribute(LIST_ONLINEFILES_METADATA); listFilesMetaData =(List)sessionMap.get(LIST_ONLINEFILES_METADATA_KEY); } @@ -636,8 +626,7 @@ List allOnlineFilenames=voteService.retrieveVoteUploadedOnlineFilesName(voteContent.getUid()); logger.debug("allOnlineFilenames:" + allOnlineFilenames); - - //List listOnlineFilesMetaData =(List)request.getSession().getAttribute(LIST_ONLINEFILES_METADATA); + List listOnlineFilesMetaData =(List)sessionMap.get(LIST_ONLINEFILES_METADATA_KEY); logger.debug("listOnlineFilesMetaData:" + listOnlineFilesMetaData); @@ -705,7 +694,6 @@ logger.debug("pre-delete map content: " + mapOptionsContent); logger.debug("optIndex: " + optIndex); - //String defLater=(String)request.getSession().getAttribute(ACTIVE_MODULE); String defLater=voteAuthoringForm.getActiveModule(); logger.debug("defLater: " + defLater); @@ -727,20 +715,13 @@ mapOptionsContent.remove(new Long(longOptIndex).toString()); logger.debug("removed the question content with index: " + longOptIndex); - //request.getSession().setAttribute("mapOptionsContent", mapOptionsContent); - logger.debug("post-delete count " + mapOptionsContent.size()); logger.debug("post-delete map content: " + mapOptionsContent); } protected Map repopulateMap(Map mapOptionsContent, HttpServletRequest request) { - //logger.debug("optIndex: " + request.getSession().getAttribute("optIndex")); - //long optIndex= new Long(request.getSession().getAttribute("optIndex").toString()).longValue(); - //logger.debug("optIndex: " + optIndex); - - logger.debug("starting repopulateMap"); int intOptionIndex= mapOptionsContent.size(); logger.debug("intOptionIndex: " + intOptionIndex); @@ -791,7 +772,6 @@ } mapOptionsContent=(TreeMap)mapFinalOptionsContent; - //request.getSession().setAttribute("mapOptionsContent", mapOptionsContent); logger.debug("final mapOptionsContent:" + mapOptionsContent); return mapOptionsContent; } @@ -804,18 +784,7 @@ String toolContentID=voteAuthoringForm.getToolContentID(); logger.debug("toolContentID: " + toolContentID); - /* - if ((toolContentID == null) || toolContentID.equals("")) - { - logger.debug("getting toolContentID from session."); - Long longToolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - toolContentID=longToolContentId.toString(); - logger.debug("toolContentID: " + toolContentID); - } - logger.debug("final toolContentID: " + toolContentID); - */ - VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); logger.debug("voteContent: " + voteContent); @@ -911,12 +880,10 @@ String maxNomcount= voteAuthoringForm.getMaxNominationCount(); logger.debug("maxNomcount: " + maxNomcount); - - //String richTextOfflineInstructions=(String)request.getSession().getAttribute(RICHTEXT_OFFLINEINSTRUCTIONS); + String richTextOfflineInstructions=(String)sessionMap.get(OFFLINE_INSTRUCTIONS_KEY); logger.debug("richTextOfflineInstructions: " + richTextOfflineInstructions); - //String richTextOnlineInstructions=(String)request.getSession().getAttribute(RICHTEXT_ONLINEINSTRUCTIONS); String richTextOnlineInstructions=(String)sessionMap.get(ONLINE_INSTRUCTIONS_KEY); logger.debug("richTextOnlineInstructions: " + richTextOnlineInstructions); @@ -927,7 +894,6 @@ } logger.debug("setCommonContent: " + setCommonContent); - //String activeModule=(String)request.getSession().getAttribute(ACTIVE_MODULE); String activeModule=voteAuthoringForm.getActiveModule(); logger.debug("activeModule: " + activeModule); @@ -972,8 +938,6 @@ logger.debug("userId: " + userId); - //Long toolContentIDLong =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - //logger.debug("toolContentIDLong: " + toolContentIDLong); String toolContentID =voteAuthoringForm.getToolContentID(); logger.debug("toolContentID: " + toolContentID); @@ -1100,14 +1064,4 @@ } return voteContent; } - - /** - * cleans up authoring http session - * cleanupAuthoringSession(HttpServletRequest request) - * @param request - */ - public static void cleanupAuthoringSession(HttpServletRequest request) - { - - } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java =================================================================== diff -u -r793f2f3e75e63dda9c5b717317c8ad9553546e93 -r369b6c2ca857c6b74ee143e081534f50b0b94106 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java (.../ExportServlet.java) (revision 793f2f3e75e63dda9c5b717317c8ad9553546e93) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java (.../ExportServlet.java) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) @@ -41,6 +41,7 @@ import org.lamsfoundation.lams.tool.ToolAccessMode; import org.lamsfoundation.lams.tool.vote.VoteAppConstants; import org.lamsfoundation.lams.tool.vote.VoteApplicationException; +import org.lamsfoundation.lams.tool.vote.VoteGeneralMonitoringDTO; import org.lamsfoundation.lams.tool.vote.pojos.VoteContent; import org.lamsfoundation.lams.tool.vote.pojos.VoteQueUsr; import org.lamsfoundation.lams.tool.vote.pojos.VoteSession; @@ -62,7 +63,6 @@ public String doExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) { logger.debug("dispathcing doExport"); - request.getSession().setAttribute(IS_PORTFOLIO_EXPORT, new Boolean(true).toString()); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath(); if (StringUtils.equals(mode,ToolAccessMode.LEARNER.toString())){ @@ -123,10 +123,11 @@ throw new VoteApplicationException(error); } + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO(); logger.debug("calling learning mode toolSessionID:" + toolSessionID + " userID: " + userID ); VoteMonitoringAction voteMonitoringAction= new VoteMonitoringAction(); voteMonitoringAction.refreshSummaryData(request, content, voteService, true, true, - toolSessionID.toString(), userID.toString() , true, null); + toolSessionID.toString(), userID.toString() , true, null, voteGeneralMonitoringDTO); MonitoringUtil.prepareChartDataForExportTeacher(request, voteService, null, content.getVoteContentId(), voteSession.getUid()); logger.debug("post prepareChartDataForExport"); @@ -160,9 +161,10 @@ throw new VoteApplicationException(error); } + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO(); VoteMonitoringAction voteMonitoringAction= new VoteMonitoringAction(); logger.debug("starting refreshSummaryData."); - voteMonitoringAction.refreshSummaryData(request, content, voteService, true, false, null, null, false, null); + voteMonitoringAction.refreshSummaryData(request, content, voteService, true, false, null, null, false, null, voteGeneralMonitoringDTO); logger.debug("teacher uses content id: " + content.getVoteContentId()); MonitoringUtil.prepareChartDataForExportTeacher(request, voteService, null, content.getVoteContentId(), null); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java =================================================================== diff -u -r80d305915ce2c3952f34ed08e8b4740188dde18c -r369b6c2ca857c6b74ee143e081534f50b0b94106 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision 80d305915ce2c3952f34ed08e8b4740188dde18c) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) @@ -47,6 +47,7 @@ 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.tool.vote.VoteGeneralMonitoringDTO; /** * @@ -96,7 +97,8 @@ * @return */ public static List buildGroupsQuestionData(HttpServletRequest request, VoteContent voteContent, - boolean isUserNamesVisible, boolean isLearnerRequest, String currentSessionId, String userId, IVoteService voteService) + boolean isUserNamesVisible, boolean isLearnerRequest, String currentSessionId, String userId, + IVoteService voteService) { logger.debug("isUserNamesVisible: " + isUserNamesVisible); logger.debug("isLearnerRequest: " + isLearnerRequest); @@ -232,8 +234,8 @@ } - public static Map populateSessionUsersAttempts(HttpServletRequest request, VoteContent voteContent, Long sessionId, List listUsers, String questionUid, - boolean isUserNamesVisible, boolean isLearnerRequest, String userId, IVoteService voteService) + public static Map populateSessionUsersAttempts(HttpServletRequest request, VoteContent voteContent, Long sessionId, List listUsers, + String questionUid, boolean isUserNamesVisible, boolean isLearnerRequest, String userId, IVoteService voteService) { logger.debug("doing populateSessionUsersAttempts for: " +questionUid); logger.debug("isUserNamesVisible: " + isUserNamesVisible); @@ -669,7 +671,8 @@ * @param toolContentID * @return */ - public static List prepareChartDTO(HttpServletRequest request, IVoteService voteService, VoteMonitoringForm voteMonitoringForm, Long toolContentID) + public static List prepareChartDTO(HttpServletRequest request, IVoteService voteService, VoteMonitoringForm voteMonitoringForm, + Long toolContentID) { logger.debug("start preparing ChartDTO with voteMonitoringForm: " + voteMonitoringForm); logger.debug("start preparing ChartDTO with toolContentID: " + toolContentID); @@ -874,7 +877,8 @@ * @param toolSessionUid */ public static void prepareChartData(HttpServletRequest request, IVoteService voteService, VoteMonitoringForm voteMonitoringForm, - String toolContentID, String toolSessionUid, VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO) + String toolContentID, String toolSessionUid, VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO, + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) { logger.debug("starting prepareChartData, voteGeneralLearnerFlowDTO: " + voteGeneralLearnerFlowDTO); logger.debug("starting prepareChartData, toolContentID: " + toolContentID); @@ -917,16 +921,30 @@ logger.debug("potentialUserCount: " + potentialUserCount); voteMonitoringForm.setSessionUserCount(Integer.toString(potentialUserCount)); voteMonitoringForm.setCompletedSessionUserCount(new Integer(completedSessionUserCount).toString()); - + + if (voteGeneralMonitoringDTO != null) + { + voteGeneralMonitoringDTO.setSessionUserCount(Integer.toString(potentialUserCount)); + voteGeneralMonitoringDTO.setCompletedSessionUserCount(new Integer(completedSessionUserCount).toString()); + } + if (potentialUserCount != 0) { double completedPercent=(completedSessionUserCount*100) / potentialUserCount; logger.debug("completed percent: " + completedPercent); - voteMonitoringForm.setCompletedSessionUserPercent(new Double(completedPercent).toString()); + voteMonitoringForm.setCompletedSessionUserPercent(new Double(completedPercent).toString()); + if (voteGeneralMonitoringDTO != null) + { + voteGeneralMonitoringDTO.setCompletedSessionUserPercent(new Double(completedPercent).toString()); + } } else { voteMonitoringForm.setCompletedSessionUserPercent("Not Available"); + if (voteGeneralMonitoringDTO != null) + { + voteGeneralMonitoringDTO.setCompletedSessionUserPercent("Not Available"); + } } } } @@ -1055,20 +1073,20 @@ request.getSession().setAttribute(MAP_STANDARD_NOMINATIONS_CONTENT, mapStandardNominationsContent); logger.debug("test2: MAP_STANDARD_NOMINATIONS_CONTENT: " + request.getSession().getAttribute(MAP_STANDARD_NOMINATIONS_CONTENT)); - - request.getSession().setAttribute(MAP_STANDARD_NOMINATIONS_HTMLED_CONTENT, mapStandardNominationsHTMLedContent); - logger.debug("test2: MAP_STANDARD_NOMINATIONS_HTMLED_CONTENT: " + request.getSession().getAttribute(MAP_STANDARD_NOMINATIONS_HTMLED_CONTENT)); request.getSession().setAttribute(MAP_STANDARD_RATES_CONTENT, mapStandardRatesContent); logger.debug("test2: MAP_STANDARD_RATES_CONTENT: " + request.getSession().getAttribute(MAP_STANDARD_RATES_CONTENT)); + + //request.getSession().setAttribute(MAP_STANDARD_NOMINATIONS_HTMLED_CONTENT, mapStandardNominationsHTMLedContent); + logger.debug("test2: MAP_STANDARD_NOMINATIONS_HTMLED_CONTENT: " + request.getSession().getAttribute(MAP_STANDARD_NOMINATIONS_HTMLED_CONTENT)); - request.getSession().setAttribute(MAP_STANDARD_USER_COUNT, mapStandardUserCount); + //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("mapStandardQuestionUid", mapStandardQuestionUid); + //request.getSession().setAttribute("mapStandardQuestionUid", mapStandardQuestionUid); logger.debug("test2: mapStandardQuestionUid: " + request.getSession().getAttribute("mapStandardQuestionUid")); - request.getSession().setAttribute("mapStandardToolSessionUid", mapStandardToolSessionUid); + //request.getSession().setAttribute("mapStandardToolSessionUid", mapStandardToolSessionUid); logger.debug("test2: mapStandardToolSessionUid: " + request.getSession().getAttribute("mapStandardToolSessionUid")); @@ -1082,9 +1100,22 @@ voteGeneralLearnerFlowDTO.setMapStandardToolSessionUid(mapStandardToolSessionUid); voteGeneralLearnerFlowDTO.setMapStandardQuestionUid(mapStandardQuestionUid); } + + if (voteGeneralMonitoringDTO !=null) + { + voteGeneralMonitoringDTO.setMapStandardNominationsContent(mapStandardNominationsContent); + voteGeneralMonitoringDTO.setMapStandardNominationsHTMLedContent(mapStandardNominationsHTMLedContent); + voteGeneralMonitoringDTO.setMapStandardRatesContent(mapStandardRatesContent); + voteGeneralMonitoringDTO.setMapStandardUserCount(mapStandardUserCount); + voteGeneralMonitoringDTO.setMapStandardToolSessionUid(mapStandardToolSessionUid); + voteGeneralMonitoringDTO.setMapStandardQuestionUid(mapStandardQuestionUid); + } logger.debug("end of prepareChartData, voteGeneralLearnerFlowDTO: " + voteGeneralLearnerFlowDTO); request.setAttribute(VOTE_GENERAL_LEARNER_FLOW_DTO,voteGeneralLearnerFlowDTO); + + logger.debug("end of prepareChartData, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + request.setAttribute(VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); } /** Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java =================================================================== diff -u -rd346fbfa5d8f9e63112a62e184355b9f51eed493 -r369b6c2ca857c6b74ee143e081534f50b0b94106 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java (.../VoteAction.java) (revision d346fbfa5d8f9e63112a62e184355b9f51eed493) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java (.../VoteAction.java) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) @@ -162,7 +162,8 @@ VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); repopulateRequestParameters(request, voteAuthoringForm, voteGeneralAuthoringDTO); - VoteUtils.saveRichText(request, voteGeneralAuthoringDTO); + SessionMap sessionMap= new SessionMap(); + VoteUtils.saveRichText(request, voteGeneralAuthoringDTO,sessionMap); voteAuthoringForm.resetUserAction(); return null; } @@ -172,43 +173,44 @@ HttpServletResponse response) { logger.debug("doing isNewNominationAdded"); - - IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("voteService :" +voteService); - + VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; logger.debug("voteAuthoringForm :" +voteAuthoringForm); + + IVoteService voteService=null; + if (getServlet() != null) + voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + else + voteService = voteAuthoringForm.getVoteService(); + logger.debug("voteService :" +voteService); VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); repopulateRequestParameters(request, voteAuthoringForm,voteGeneralAuthoringDTO); String httpSessionID=voteAuthoringForm.getHttpSessionID(); logger.debug("httpSessionID: " + httpSessionID); - - SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID); - logger.debug("sessionMap: " + sessionMap); + /* if httpSessionID is null that indicates the request is from Monitoring interface*/ + SessionMap sessionMap=null; + if (httpSessionID == null) + { + sessionMap = new SessionMap(); + voteAuthoringForm.setHttpSessionID(sessionMap.getSessionID()); + } + else + { + sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID); + logger.debug("sessionMap: " + sessionMap); + } + logger.debug("final sessionMap: " + sessionMap); voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); voteGeneralAuthoringDTO.setSubmissionAttempt(new Boolean(false).toString()); AuthoringUtil authoringUtil= new AuthoringUtil(); - Map mapOptionsContent=(Map)sessionMap.get(MAP_OPTIONS_CONTENT_KEY); - logger.debug("mapOptionsContent: " + mapOptionsContent); - - VoteUtils.saveRichText(request, voteGeneralAuthoringDTO); - - mapOptionsContent=authoringUtil.reconstructOptionContentMapForAdd(mapOptionsContent, request); - logger.debug("final mapOptionsContent: " + mapOptionsContent); - int maxIndex=mapOptionsContent.size(); - logger.debug("maxIndex: " + maxIndex); - voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); - - String firstEntry=(String)mapOptionsContent.get("1"); - logger.debug("firstEntry: " + firstEntry); - voteGeneralAuthoringDTO.setDefaultOptionContent(firstEntry); - + VoteUtils.saveRichText(request, voteGeneralAuthoringDTO, sessionMap); + String toolContentID=voteAuthoringForm.getToolContentID(); logger.debug("toolContentID: " + toolContentID); @@ -229,7 +231,24 @@ logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); } } + + Map mapOptionsContent= new TreeMap(new VoteComparator()); + mapOptionsContent=AuthoringUtil.repopulateMap(request, "optionContent"); + logger.debug("mapOptionsContent : " + mapOptionsContent); + logger.debug("mapOptionsContent size: " + mapOptionsContent.size()); + + + mapOptionsContent=authoringUtil.reconstructOptionContentMapForAdd(mapOptionsContent, request); + logger.debug("final mapOptionsContent: " + mapOptionsContent); + + int maxIndex=mapOptionsContent.size(); + logger.debug("maxIndex: " + maxIndex); + voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); + String firstEntry=(String)mapOptionsContent.get("1"); + logger.debug("firstEntry: " + firstEntry); + voteGeneralAuthoringDTO.setDefaultOptionContent(firstEntry); + logger.debug("active module is: " + voteAuthoringForm.getActiveModule()); logger.debug("before fwd: mapOptionsContent: " + mapOptionsContent); voteGeneralAuthoringDTO.setMapOptionsContent(mapOptionsContent); @@ -248,6 +267,9 @@ logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); request.setAttribute(VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); + httpSessionID=voteAuthoringForm.getHttpSessionID(); + logger.debug("httpSessionID: " + httpSessionID); + logger.debug("persisting sessionMap into session: " + sessionMap); request.getSession().setAttribute(httpSessionID, sessionMap); @@ -285,12 +307,16 @@ public boolean isNominationRemoved(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { logger.debug("starting isNominationRemoved"); - - IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("voteService :" +voteService); - VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; + VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; logger.debug("voteAuthoringForm :" +voteAuthoringForm); + + IVoteService voteService=null; + if (getServlet() != null) + voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + else + voteService = voteAuthoringForm.getVoteService(); + logger.debug("voteService :" +voteService); VoteGeneralAuthoringDTO voteGeneralAuthoringDTO= new VoteGeneralAuthoringDTO(); @@ -299,28 +325,26 @@ String httpSessionID=voteAuthoringForm.getHttpSessionID(); logger.debug("httpSessionID: " + httpSessionID); - SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID); - logger.debug("sessionMap: " + sessionMap); + /* if httpSessionID is null that indicates the request is from Monitoring interface*/ + SessionMap sessionMap=null; + if (httpSessionID == null) + { + sessionMap = new SessionMap(); + voteAuthoringForm.setHttpSessionID(sessionMap.getSessionID()); + } + else + { + sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID); + logger.debug("sessionMap: " + sessionMap); + } + logger.debug("final sessionMap: " + sessionMap); voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); voteGeneralAuthoringDTO.setSubmissionAttempt(new Boolean(false).toString()); - - VoteUtils.saveRichText(request, voteGeneralAuthoringDTO); - - AuthoringUtil authoringUtil= new AuthoringUtil(); - //Map mapOptionsContent=(Map)request.getSession().getAttribute(MAP_OPTIONS_CONTENT); - Map mapOptionsContent=(Map)sessionMap.get(MAP_OPTIONS_CONTENT_KEY); - logger.debug("mapOptionsContent: " + mapOptionsContent); - - authoringUtil.reconstructOptionContentMapForRemove(mapOptionsContent, request, voteAuthoringForm); - - int maxIndex=mapOptionsContent.size(); - voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); - - String firstEntry=(String)mapOptionsContent.get("1"); - logger.debug("firstEntry: " + firstEntry); - voteGeneralAuthoringDTO.setDefaultOptionContent(firstEntry); - + + AuthoringUtil authoringUtil= new AuthoringUtil(); + VoteUtils.saveRichText(request, voteGeneralAuthoringDTO,sessionMap); + String toolContentID =voteAuthoringForm.getToolContentID(); logger.debug("toolContentID: " + toolContentID); @@ -339,7 +363,22 @@ logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); } } - + + + Map mapOptionsContent= new TreeMap(new VoteComparator()); + mapOptionsContent=AuthoringUtil.repopulateMap(request, "optionContent"); + logger.debug("mapOptionsContent : " + mapOptionsContent); + logger.debug("mapOptionsContent size: " + mapOptionsContent.size()); + + authoringUtil.reconstructOptionContentMapForRemove(mapOptionsContent, request, voteAuthoringForm); + + int maxIndex=mapOptionsContent.size(); + voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); + + String firstEntry=(String)mapOptionsContent.get("1"); + logger.debug("firstEntry: " + firstEntry); + voteGeneralAuthoringDTO.setDefaultOptionContent(firstEntry); + logger.debug("active module is: " + voteAuthoringForm.getActiveModule()); logger.debug("before fwd: mapOptionsContent: " + mapOptionsContent); voteGeneralAuthoringDTO.setMapOptionsContent(mapOptionsContent); @@ -358,6 +397,9 @@ logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); request.setAttribute(VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); + httpSessionID=voteAuthoringForm.getHttpSessionID(); + logger.debug("httpSessionID: " + httpSessionID); + logger.debug("persisting sessionMap into session: " + sessionMap); request.getSession().setAttribute(httpSessionID, sessionMap); @@ -397,11 +439,15 @@ logger.debug("doing submitContent.."); boolean validationErrors=false; - IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("voteService :" +voteService); - VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; logger.debug("voteAuthoringForm :" +voteAuthoringForm); + + IVoteService voteService=null; + if (getServlet() != null) + voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + else + voteService = voteAuthoringForm.getVoteService(); + logger.debug("voteService :" +voteService); VoteGeneralAuthoringDTO voteGeneralAuthoringDTO= new VoteGeneralAuthoringDTO(); @@ -410,13 +456,24 @@ String httpSessionID=voteAuthoringForm.getHttpSessionID(); logger.debug("httpSessionID: " + httpSessionID); - SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID); - logger.debug("sessionMap: " + sessionMap); + /* if httpSessionID is null that indicates the request is from Monitoring interface*/ + SessionMap sessionMap=null; + if (httpSessionID == null) + { + sessionMap = new SessionMap(); + voteAuthoringForm.setHttpSessionID(sessionMap.getSessionID()); + logger.debug("created new sessionMap with : " + sessionMap.getSessionID()); + //voteGeneralAuthoringDTO.setActiveModule(MONITORING); + } + else + { + sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID); + logger.debug("sessionMap: " + sessionMap); + } voteAuthoringForm.setSubmissionAttempt(new Boolean(true).toString()); voteGeneralAuthoringDTO.setSubmissionAttempt(new Boolean(true).toString()); - //request.setAttribute(VALIDATION_ERROR, new Boolean(false).toString()); voteGeneralAuthoringDTO.setValidationError(new Boolean(false).toString()); String toolContentID=voteAuthoringForm.getToolContentID(); @@ -441,16 +498,15 @@ } } - VoteUtils.saveRichText(request, voteGeneralAuthoringDTO); + VoteUtils.saveRichText(request, voteGeneralAuthoringDTO,sessionMap); ActionMessages errors= new ActionMessages(); - //errors=validateSubmit(request, errors, voteAuthoringForm); /* + errors=validateSubmit(request, errors, voteAuthoringForm); if (errors.size() > 0) { logger.debug("returning back to from to fix errors:"); voteGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString()); - //request.setAttribute(VALIDATION_ERROR, new Boolean(true).toString()); voteGeneralAuthoringDTO.setValidationError(new Boolean(true).toString()); return false; } @@ -461,14 +517,12 @@ List deletedAttachmentList = (List)sessionMap.get(DELETED_ATTACHMENT_LIST_KEY); logger.debug("deletedAttachmentList :" +deletedAttachmentList); - - Map mapOptionsContent=(Map)sessionMap.get(MAP_OPTIONS_CONTENT_KEY); - logger.debug("mapOptionsContent: " + mapOptionsContent); - - if (mapOptionsContent == null) - mapOptionsContent= new TreeMap(new VoteComparator()); - logger.debug("mapOptionsContent :" +mapOptionsContent); + Map mapOptionsContent= new TreeMap(new VoteComparator()); + mapOptionsContent=AuthoringUtil.repopulateMap(request, "optionContent"); + logger.debug("mapOptionsContent : " + mapOptionsContent); + logger.debug("mapOptionsContent size: " + mapOptionsContent.size()); + boolean nominationsDuplicate=AuthoringUtil.verifyDuplicateNominations(mapOptionsContent); logger.debug("nominationsDuplicate :" +nominationsDuplicate); @@ -596,9 +650,13 @@ voteGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(false).toString()); + logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); request.setAttribute(VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); + httpSessionID=voteAuthoringForm.getHttpSessionID(); + logger.debug("httpSessionID: " + httpSessionID); + logger.debug("persisting sessionMap into session: " + sessionMap); request.getSession().setAttribute(httpSessionID, sessionMap); @@ -649,32 +707,70 @@ { logger.debug("starting isMoveNominationDown..."); - IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("voteService: " + voteService); + VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; + logger.debug("voteAuthoringForm :" +voteAuthoringForm); + IVoteService voteService=null; + if (getServlet() != null) + voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + else + voteService = voteAuthoringForm.getVoteService(); + logger.debug("voteService :" +voteService); + VoteUtils.cleanUpUserExceptions(request); - VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; - logger.debug("voteAuthoringForm :" +voteAuthoringForm); VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); repopulateRequestParameters(request, voteAuthoringForm, voteGeneralAuthoringDTO); + + String toolContentID=voteAuthoringForm.getToolContentID(); + logger.debug("toolContentID: " + toolContentID); + + VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); + logger.debug("voteContent: " + voteContent); + + /*true means there is at least 1 response*/ + if (voteContent != null) + { + if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) + { + voteGeneralAuthoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); + logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); + } + else + { + voteGeneralAuthoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); + logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); + } + } + String httpSessionID=voteAuthoringForm.getHttpSessionID(); logger.debug("httpSessionID: " + httpSessionID); - SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID); - logger.debug("sessionMap: " + sessionMap); + /* if httpSessionID is null that indicates the request is from Monitoring interface*/ + SessionMap sessionMap=null; + if (httpSessionID == null) + { + sessionMap = new SessionMap(); + voteAuthoringForm.setHttpSessionID(sessionMap.getSessionID()); + } + else + { + sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID); + logger.debug("sessionMap: " + sessionMap); + } + logger.debug("final sessionMap: " + sessionMap); voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); voteGeneralAuthoringDTO.setSubmissionAttempt(new Boolean(false).toString()); - VoteUtils.saveRichText(request, voteGeneralAuthoringDTO); - - Map mapOptionsContent=AuthoringUtil.repopulateMap(request, "optionContent"); - logger.debug("mapOptionsContent before move down: " + mapOptionsContent); - logger.debug("mapOptionsContent size move down: " + mapOptionsContent.size()); - + VoteUtils.saveRichText(request, voteGeneralAuthoringDTO, sessionMap); + Map mapOptionsContent= new TreeMap(new VoteComparator()); + mapOptionsContent=AuthoringUtil.repopulateMap(request, "optionContent"); + logger.debug("mapOptionsContent : " + mapOptionsContent); + logger.debug("mapOptionsContent size: " + mapOptionsContent.size()); + /* perform a move down if there are at least 2 nominations*/ if (mapOptionsContent.size() > 1) { @@ -687,46 +783,20 @@ { mapOptionsContent= AuthoringUtil.shiftMap(mapOptionsContent, optIndex,movableOptionEntry, "down"); logger.debug("mapOptionsContent after move down: " + mapOptionsContent); - //request.getSession().setAttribute(MAP_OPTIONS_CONTENT, mapOptionsContent); sessionMap.put(MAP_OPTIONS_CONTENT_KEY, mapOptionsContent); - //logger.debug("updated Options Map: " + request.getSession().getAttribute(MAP_OPTIONS_CONTENT)); } } voteAuthoringForm.resetUserAction(); - mapOptionsContent=(Map)sessionMap.get(MAP_OPTIONS_CONTENT_KEY); - logger.debug("mapOptionsContent: " + mapOptionsContent); int maxIndex=mapOptionsContent.size(); voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); String firstEntry=(String)mapOptionsContent.get("1"); logger.debug("firstEntry: " + firstEntry); voteGeneralAuthoringDTO.setDefaultOptionContent(firstEntry); - - String toolContentID=voteAuthoringForm.getToolContentID(); - logger.debug("toolContentID: " + toolContentID); - - VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); - logger.debug("voteContent: " + voteContent); - /*true means there is at least 1 response*/ - if (voteContent != null) - { - if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) - { - voteGeneralAuthoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); - logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); - } - else - { - voteGeneralAuthoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); - logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); - } - } - - logger.debug("active module is: " + voteAuthoringForm.getActiveModule()); logger.debug("before fwd: mapOptionsContent: " + mapOptionsContent); voteGeneralAuthoringDTO.setMapOptionsContent(mapOptionsContent); @@ -744,6 +814,9 @@ logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); request.setAttribute(VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); + httpSessionID=voteAuthoringForm.getHttpSessionID(); + logger.debug("httpSessionID: " + httpSessionID); + logger.debug("persisting sessionMap into session: " + sessionMap); request.getSession().setAttribute(httpSessionID, sessionMap); @@ -796,25 +869,61 @@ HttpServletResponse response) { logger.debug("starting isMoveNominationUp..."); - - IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("voteService: " + voteService); - - VoteUtils.cleanUpUserExceptions(request); - VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; + VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; logger.debug("voteAuthoringForm :" +voteAuthoringForm); + + IVoteService voteService=null; + if (getServlet() != null) + voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + else + voteService = voteAuthoringForm.getVoteService(); + logger.debug("voteService :" +voteService); + VoteUtils.cleanUpUserExceptions(request); + VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); repopulateRequestParameters(request, voteAuthoringForm, voteGeneralAuthoringDTO); + + String toolContentID=voteAuthoringForm.getToolContentID(); + logger.debug("toolContentID: " + toolContentID); + VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); + logger.debug("voteContent: " + voteContent); + + + /*true means there is at least 1 response*/ + if (voteContent != null) + { + if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) + { + voteGeneralAuthoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); + logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); + } + else + { + voteGeneralAuthoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); + logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); + } + } + String httpSessionID=voteAuthoringForm.getHttpSessionID(); logger.debug("httpSessionID: " + httpSessionID); - - SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID); - logger.debug("sessionMap: " + sessionMap); - + /* if httpSessionID is null that indicates the request is from Monitoring interface*/ + SessionMap sessionMap=null; + if (httpSessionID == null) + { + sessionMap = new SessionMap(); + voteAuthoringForm.setHttpSessionID(sessionMap.getSessionID()); + } + else + { + sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID); + logger.debug("sessionMap: " + sessionMap); + + } + voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); voteGeneralAuthoringDTO.setSubmissionAttempt(new Boolean(false).toString()); @@ -824,12 +933,14 @@ String destination=VoteUtils.getDestination(sourceVoteStarter); logger.debug("destination: " + destination); - VoteUtils.saveRichText(request, voteGeneralAuthoringDTO); - - Map mapOptionsContent=AuthoringUtil.repopulateMap(request, "optionContent"); - logger.debug("mapOptionsContent before move down: " + mapOptionsContent); - logger.debug("mapOptionsContent size move down: " + mapOptionsContent.size()); + VoteUtils.saveRichText(request, voteGeneralAuthoringDTO, sessionMap); + + Map mapOptionsContent= new TreeMap(new VoteComparator()); + mapOptionsContent=AuthoringUtil.repopulateMap(request, "optionContent"); + logger.debug("mapOptionsContent : " + mapOptionsContent); + logger.debug("mapOptionsContent size: " + mapOptionsContent.size()); + /* perform a move down if there are at least 2 nominations */ if (mapOptionsContent.size() > 1) { @@ -848,6 +959,7 @@ voteAuthoringForm.resetUserAction(); + mapOptionsContent=(Map)sessionMap.get(MAP_OPTIONS_CONTENT_KEY); logger.debug("mapOptionsContent: " + mapOptionsContent); @@ -857,28 +969,8 @@ String firstEntry=(String)mapOptionsContent.get("1"); logger.debug("firstEntry: " + firstEntry); voteGeneralAuthoringDTO.setDefaultOptionContent(firstEntry); - - String toolContentID=voteAuthoringForm.getToolContentID(); - logger.debug("toolContentID: " + toolContentID); - VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); - logger.debug("voteContent: " + voteContent); - /*true means there is at least 1 response*/ - if (voteContent != null) - { - if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) - { - voteGeneralAuthoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); - logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); - } - else - { - voteGeneralAuthoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); - logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); - } - } - - logger.debug("active module is: " + voteAuthoringForm.getActiveModule()); + logger.debug("active module is: " + voteAuthoringForm.getActiveModule()); logger.debug("before fwd: mapOptionsContent: " + mapOptionsContent); voteGeneralAuthoringDTO.setMapOptionsContent(mapOptionsContent); @@ -896,6 +988,9 @@ logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); request.setAttribute(VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); + httpSessionID=voteAuthoringForm.getHttpSessionID(); + logger.debug("httpSessionID: " + httpSessionID); + logger.debug("persisting sessionMap into session: " + sessionMap); request.getSession().setAttribute(httpSessionID, sessionMap); @@ -1027,7 +1122,7 @@ String destination=VoteUtils.getDestination(sourceVoteStarter); logger.debug("destination: " + destination); - VoteUtils.saveRichText(request, voteGeneralAuthoringDTO); + VoteUtils.saveRichText(request, voteGeneralAuthoringDTO, sessionMap); logger.debug("will uploadFile for offline file:"); VoteAttachmentDTO voteAttachmentDTO=AuthoringUtil.uploadFile(request, voteService, voteAuthoringForm, true, sessionMap); @@ -1140,7 +1235,7 @@ String destination=VoteUtils.getDestination(sourceVoteStarter); logger.debug("destination: " + destination); - VoteUtils.saveRichText(request, voteGeneralAuthoringDTO); + VoteUtils.saveRichText(request, voteGeneralAuthoringDTO, sessionMap); logger.debug("will uploadFile for online file:"); VoteAttachmentDTO voteAttachmentDTO=AuthoringUtil.uploadFile(request, voteService, voteAuthoringForm, false, sessionMap); @@ -1251,7 +1346,7 @@ String destination=VoteUtils.getDestination(sourceVoteStarter); logger.debug("destination: " + destination); - VoteUtils.saveRichText(request, voteGeneralAuthoringDTO); + VoteUtils.saveRichText(request, voteGeneralAuthoringDTO, sessionMap); String uuid =voteAuthoringForm.getUuid(); logger.debug("uuid:" + uuid); @@ -1340,7 +1435,7 @@ String destination=VoteUtils.getDestination(sourceVoteStarter); logger.debug("destination: " + destination); - VoteUtils.saveRichText(request, voteGeneralAuthoringDTO); + VoteUtils.saveRichText(request, voteGeneralAuthoringDTO, sessionMap); String uuid =voteAuthoringForm.getUuid(); logger.debug("uuid:" + uuid); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteChartGenerator.java =================================================================== diff -u -r80d305915ce2c3952f34ed08e8b4740188dde18c -r369b6c2ca857c6b74ee143e081534f50b0b94106 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteChartGenerator.java (.../VoteChartGenerator.java) (revision 80d305915ce2c3952f34ed08e8b4740188dde18c) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteChartGenerator.java (.../VoteChartGenerator.java) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) @@ -40,9 +40,11 @@ import org.jfree.data.category.DefaultCategoryDataset; import org.jfree.data.general.DefaultPieDataset; import org.lamsfoundation.lams.tool.vote.VoteAppConstants; +import org.lamsfoundation.lams.tool.vote.VoteGeneralMonitoringDTO; import org.lamsfoundation.lams.tool.vote.pojos.VoteContent; import org.lamsfoundation.lams.tool.vote.pojos.VoteSession; import org.lamsfoundation.lams.tool.vote.service.IVoteService; +import org.lamsfoundation.lams.tool.vote.service.VoteServiceProxy; /** *

Enables generation of enerates JFreeCharts

@@ -70,25 +72,24 @@ String currentSessionId=request.getParameter("currentSessionId"); logger.debug("currentSessionId: " + currentSessionId); + logger.debug("getServletContext() is : " + getServletContext()); if (currentSessionId != null) { logger.debug("currentSessionId is specified, generating data for all sessions dto: "); - IVoteService voteService=null; - voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); + + IVoteService voteService = VoteServiceProxy.getVoteService(getServletContext()); logger.debug("voteService: " + voteService); - Long toolContentID =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentID: " + toolContentID); - - VoteContent voteContent=voteService.retrieveVote(toolContentID); - logger.debug("existing voteContent:" + voteContent); - VoteSession voteSession=voteService.retrieveVoteSession(new Long(currentSessionId)); logger.debug("voteSession uid:" + voteSession.getUid()); + VoteContent voteContent=voteSession.getVoteContent(); + logger.debug("existing voteContent:" + voteContent); + + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO(); MonitoringUtil.prepareChartData(request, voteService, null, voteContent.getVoteContentId().toString(), - voteSession.getUid().toString(), null); + voteSession.getUid().toString(), null, voteGeneralMonitoringDTO); logger.debug("creating maps MAP_STANDARD_NOMINATIONS_CONTENT and MAP_STANDARD_RATES_CONTENT: " + currentSessionId); logger.debug("post prepareChartData : MAP_STANDARD_NOMINATIONS_CONTENT: " + request.getSession().getAttribute(MAP_STANDARD_NOMINATIONS_CONTENT)); @@ -159,7 +160,7 @@ } JFreeChart chart=null; - chart=ChartFactory.createPieChart3D("Session Votes Chart", data, true, true, false); + chart=ChartFactory.createPieChart3D(SESSION_VOTES_CHART , data, true, true, false); logger.debug("chart: " + chart) ; return chart; @@ -188,7 +189,7 @@ } JFreeChart chart=null; - chart=ChartFactory.createBarChart3D("Session Votes Chart", "Open Vote", "Percentage", + chart=ChartFactory.createBarChart3D(SESSION_VOTES_CHART , "Open Vote", "Percentage", data, PlotOrientation.VERTICAL, true, true, false); logger.debug("chart: " + chart) ; return chart; Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java =================================================================== diff -u -r80d305915ce2c3952f34ed08e8b4740188dde18c -r369b6c2ca857c6b74ee143e081534f50b0b94106 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java (.../VoteLearningAction.java) (revision 80d305915ce2c3952f34ed08e8b4740188dde18c) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java (.../VoteLearningAction.java) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) @@ -47,6 +47,7 @@ import org.lamsfoundation.lams.tool.vote.VoteApplicationException; import org.lamsfoundation.lams.tool.vote.VoteComparator; import org.lamsfoundation.lams.tool.vote.VoteGeneralLearnerFlowDTO; +import org.lamsfoundation.lams.tool.vote.VoteGeneralMonitoringDTO; import org.lamsfoundation.lams.tool.vote.VoteUtils; import org.lamsfoundation.lams.tool.vote.pojos.VoteContent; import org.lamsfoundation.lams.tool.vote.pojos.VoteQueContent; @@ -258,8 +259,10 @@ logger.debug("voteSession uid:" + voteSession.getUid()); logger.debug("calling prepareChartData:" + voteContent.getVoteContentId() + " " + voteSession.getUid()); + + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO(); MonitoringUtil.prepareChartData(request, voteService, null, voteContent.getVoteContentId().toString(), - voteSession.getUid().toString(), voteGeneralLearnerFlowDTO); + voteSession.getUid().toString(), voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO); logger.debug("end of prepareChartData:" + voteContent.getVoteContentId() + " " + voteSession.getUid()); voteLearningForm.resetCommands(); @@ -706,9 +709,10 @@ voteLearningForm.setNominationsSubmited(new Boolean(true).toString()); voteGeneralLearnerFlowDTO.setNominationsSubmited(new Boolean(true).toString()); - + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO(); logger.debug("calling prepareChartData: " + toolContentID); - MonitoringUtil.prepareChartData(request, voteService, null, toolContentID.toString(), toolSessionUid.toString(), voteGeneralLearnerFlowDTO); + MonitoringUtil.prepareChartData(request, voteService, null, toolContentID.toString(), toolSessionUid.toString(), + voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO); logger.debug("fwding to INDIVIDUAL_REPORT: " + INDIVIDUAL_REPORT); voteLearningForm.resetCommands(); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java =================================================================== diff -u -r176368e713ee9dee5b8c206e3f979dfc839f95cd -r369b6c2ca857c6b74ee143e081534f50b0b94106 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java (.../VoteLearningStarterAction.java) (revision 176368e713ee9dee5b8c206e3f979dfc839f95cd) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java (.../VoteLearningStarterAction.java) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) @@ -170,6 +170,7 @@ import org.lamsfoundation.lams.tool.vote.VoteApplicationException; import org.lamsfoundation.lams.tool.vote.VoteComparator; import org.lamsfoundation.lams.tool.vote.VoteGeneralLearnerFlowDTO; +import org.lamsfoundation.lams.tool.vote.VoteGeneralMonitoringDTO; import org.lamsfoundation.lams.tool.vote.VoteUtils; import org.lamsfoundation.lams.tool.vote.pojos.VoteContent; import org.lamsfoundation.lams.tool.vote.pojos.VoteQueContent; @@ -331,9 +332,11 @@ logger.debug("currentToolSessionId: " + currentToolSessionId); /* the report should have only this user's entries(with userId)*/ + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO(); + VoteMonitoringAction voteMonitoringAction= new VoteMonitoringAction(); voteMonitoringAction.refreshSummaryData(request, voteContent, voteService, true, true, currentToolSessionId.toString(), - learnerProgressUserId, true, voteGeneralLearnerFlowDTO); + learnerProgressUserId, true, voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO); voteGeneralLearnerFlowDTO.setRequestLearningReport(new Boolean(true).toString()); voteGeneralLearnerFlowDTO.setRequestLearningReportProgress(new Boolean(true).toString()); @@ -498,8 +501,11 @@ voteLearningForm.setRevisitingUser(new Boolean(true).toString()); voteGeneralLearnerFlowDTO.setRevisitingUser(new Boolean(true).toString()); logger.debug("preparing chart data for readonly mode"); - MonitoringUtil.prepareChartData(request, voteService, null, voteContent.getVoteContentId().toString(), toolSessionID, voteGeneralLearnerFlowDTO); + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO(); + MonitoringUtil.prepareChartData(request, voteService, null, voteContent.getVoteContentId().toString(), toolSessionID, + voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO); + logger.debug("view-only voteGeneralLearnerFlowDTO: " + voteGeneralLearnerFlowDTO); request.setAttribute(VOTE_GENERAL_LEARNER_FLOW_DTO,voteGeneralLearnerFlowDTO); @@ -574,9 +580,6 @@ voteLearningForm.setLockOnFinish(new Boolean(voteContent.isLockOnFinish()).toString()); voteLearningForm.setVoteChangable(new Boolean(voteContent.isVoteChangable()).toString()); - logger.debug("ACTIVITY_TITLE: " + voteContent.getTitle()); - logger.debug("ACTIVITY_INSTRUCTIONS: " + voteContent.getInstructions()); - voteGeneralLearnerFlowDTO.setActivityTitle(voteContent.getTitle()); voteGeneralLearnerFlowDTO.setActivityInstructions(voteContent.getInstructions()); voteGeneralLearnerFlowDTO.setActivityRunOffline(new Boolean(voteContent.isRunOffline()).toString()); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java =================================================================== diff -u -r80d305915ce2c3952f34ed08e8b4740188dde18c -r369b6c2ca857c6b74ee143e081534f50b0b94106 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java (.../VoteMonitoringAction.java) (revision 80d305915ce2c3952f34ed08e8b4740188dde18c) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java (.../VoteMonitoringAction.java) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) @@ -28,6 +28,7 @@ import java.util.List; import java.util.Map; import java.util.Set; +import java.util.TreeMap; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; @@ -40,11 +41,15 @@ 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.VoteComparator; +import org.lamsfoundation.lams.tool.vote.VoteGeneralAuthoringDTO; import org.lamsfoundation.lams.tool.vote.VoteGeneralLearnerFlowDTO; +import org.lamsfoundation.lams.tool.vote.VoteGeneralMonitoringDTO; import org.lamsfoundation.lams.tool.vote.VoteMonitoredAnswersDTO; import org.lamsfoundation.lams.tool.vote.VoteMonitoredUserDTO; 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.VoteSession; import org.lamsfoundation.lams.tool.vote.pojos.VoteUsrAttempt; import org.lamsfoundation.lams.tool.vote.service.IVoteService; @@ -108,53 +113,55 @@ { VoteUtils.cleanUpUserExceptions(request); logger.debug("dispatching unspecified..."); - request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(false).toString()); - VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; return null; } + - public ActionForward submitSession(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, + HttpServletResponse response, + IVoteService voteService, + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO + ) throws IOException, ServletException { - logger.debug("dispatching submitSession..."); - logger.debug("test3: MAP_STANDARD_NOMINATIONS_CONTENT: " + request.getSession().getAttribute(MAP_STANDARD_NOMINATIONS_CONTENT)); - logger.debug("test3: MAP_STANDARD_RATES_CONTENT: " + request.getSession().getAttribute(MAP_STANDARD_RATES_CONTENT)); - - IVoteService voteService=null; + logger.debug("calling submitSession...voteGeneralMonitoringDTO:" + voteGeneralMonitoringDTO); + commonSubmitSessionCode(form, request, voteService,voteGeneralMonitoringDTO); + logger.debug("post commonSubmitSessionCode: " +voteGeneralMonitoringDTO); + return (mapping.findForward(LOAD_MONITORING)); + } + - voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); - logger.debug("voteService: " + voteService); - - if (voteService == null) - { - logger.debug("will retrieve voteService"); - voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("retrieving voteService from session: " + voteService); - } - VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; + protected void commonSubmitSessionCode(ActionForm form, HttpServletRequest request,IVoteService voteService, + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) throws IOException, ServletException + { + logger.debug("starting commonSubmitSessionCode...voteGeneralMonitoringDTO:" + voteGeneralMonitoringDTO); + logger.debug("voteService:" + voteService); + VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; + + repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); + logger.debug("done repopulateRequestParameters"); + String currentMonitoredToolSession=voteMonitoringForm.getSelectedToolSessionId(); logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession); - Long toolContentID =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + String toolContentID =voteMonitoringForm.getToolContentID(); logger.debug("toolContentID: " + toolContentID); - VoteContent voteContent=voteService.retrieveVote(toolContentID); + VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); logger.debug("existing voteContent:" + voteContent); - /* SELECTION_CASE == 1 indicates a selected group other than "All" */ + if (currentMonitoredToolSession.equals("All")) { - request.getSession().setAttribute(SELECTION_CASE, new Long(2)); + voteGeneralMonitoringDTO.setSelectionCase(new Long(2)); + logger.debug("generate DTO for All sessions: "); List listVoteAllSessionsDTO=MonitoringUtil.prepareChartDTO(request, voteService, voteMonitoringForm, voteContent.getVoteContentId()); logger.debug("listVoteAllSessionsDTO: " + listVoteAllSessionsDTO); - - request.getSession().setAttribute(LIST_VOTE_ALLSESSIONS_DTO, listVoteAllSessionsDTO); + voteGeneralMonitoringDTO.setListVoteAllSessionsDTO(listVoteAllSessionsDTO); } else { @@ -164,35 +171,118 @@ VoteSession voteSession=voteService.retrieveVoteSession(new Long(currentMonitoredToolSession)); logger.debug("voteSession uid:" + voteSession.getUid()); MonitoringUtil.prepareChartData(request, voteService, voteMonitoringForm, voteContent.getVoteContentId().toString(), - voteSession.getUid().toString(), null); + voteSession.getUid().toString(), null, voteGeneralMonitoringDTO); + + logger.debug("post prepareChartData, voteGeneralMonitoringDTO:" + voteGeneralMonitoringDTO); - refreshSummaryData(request, voteContent, voteService, true, false, currentMonitoredToolSession, null, true, null); - request.getSession().setAttribute(SELECTION_CASE, new Long(1)); - + refreshSummaryData(request, voteContent, voteService, true, false, currentMonitoredToolSession, null, true, null, + voteGeneralMonitoringDTO); + logger.debug("post refreshSummaryData, voteGeneralMonitoringDTO:" + voteGeneralMonitoringDTO); + voteGeneralMonitoringDTO.setSelectionCase(new Long(1)); } - logger.debug("SELECTION_CASE: " + request.getSession().getAttribute(SELECTION_CASE)); + logger.debug("SELECTION_CASE: " + voteGeneralMonitoringDTO.getSelectionCase()); - - request.getSession().setAttribute(CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession); - logger.debug("CURRENT_MONITORED_TOOL_SESSION: " + request.getSession().getAttribute(CURRENT_MONITORED_TOOL_SESSION)); - + voteGeneralMonitoringDTO.setCurrentMonitoredToolSession(currentMonitoredToolSession); voteMonitoringForm.setSbmtSuccess(new Boolean(false).toString()); - request.getSession().setAttribute(REQUEST_LEARNING_REPORT, new Boolean(false).toString()); + voteGeneralMonitoringDTO.setSbmtSuccess(new Boolean(false).toString()); + voteGeneralMonitoringDTO.setRequestLearningReport(new Boolean(false).toString()); - logger.debug("test4: MAP_STANDARD_NOMINATIONS_CONTENT: " + request.getSession().getAttribute(MAP_STANDARD_NOMINATIONS_CONTENT)); - logger.debug("test4: MAP_STANDARD_RATES_CONTENT: " + request.getSession().getAttribute(MAP_STANDARD_RATES_CONTENT)); + + Map summaryToolSessions=MonitoringUtil.populateToolSessions(request, voteContent, voteService); + logger.debug("summaryToolSessions: " + summaryToolSessions); + voteGeneralMonitoringDTO.setSummaryToolSessions(summaryToolSessions); - logger.debug("test4: LIST_VOTE_ALLSESSIONS_DTO: " + request.getSession().getAttribute(LIST_VOTE_ALLSESSIONS_DTO)); - return (mapping.findForward(LOAD_MONITORING)); + Map summaryToolSessionsId=MonitoringUtil.populateToolSessionsId(request, voteContent, voteService); + logger.debug("summaryToolSessionsId: " + summaryToolSessionsId); + voteGeneralMonitoringDTO.setSummaryToolSessionsId(summaryToolSessionsId); + + logger.debug("calling initInstructionsContent."); + initInstructionsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initInstructionsContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + logger.debug("calling initStatsContent."); + initStatsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initStatsContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + + /*setting editable screen properties*/ + VoteGeneralAuthoringDTO voteGeneralAuthoringDTO= new VoteGeneralAuthoringDTO(); + voteGeneralAuthoringDTO.setActivityTitle(voteContent.getTitle()); + voteGeneralAuthoringDTO.setActivityInstructions(voteContent.getInstructions()); + + Map mapOptionsContent= new TreeMap(new VoteComparator()); + Iterator queIterator=voteContent.getVoteQueContents().iterator(); + Long mapIndex=new Long(1); + logger.debug("mapOptionsContent: " + mapOptionsContent); + while (queIterator.hasNext()) + { + VoteQueContent voteQueContent=(VoteQueContent) queIterator.next(); + if (voteQueContent != null) + { + logger.debug("question: " + voteQueContent.getQuestion()); + mapOptionsContent.put(mapIndex.toString(),voteQueContent.getQuestion()); + /** + * make the first entry the default(first) one for jsp + */ + if (mapIndex.longValue() == 1) + { + voteGeneralAuthoringDTO.setDefaultOptionContent(voteQueContent.getQuestion()); + } + + mapIndex=new Long(mapIndex.longValue()+1); + } + } + + logger.debug("mapOptionsContent: " + mapOptionsContent); + int maxIndex=mapOptionsContent.size(); + logger.debug("maxIndex: " + maxIndex); + voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); + + voteGeneralAuthoringDTO.setMapOptionsContent(mapOptionsContent); + + boolean isContentInUse=VoteUtils.isContentInUse(voteContent); + logger.debug("isContentInUse:" + isContentInUse); + voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(false).toString()); + if (isContentInUse == true) + { + logger.debug("monitoring url does not allow editActivity since the content is in use."); + voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString()); + } + + logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); + request.setAttribute(VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); + + logger.debug("end of commonSubmitSessionCode, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + request.setAttribute(VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); + } + + + public ActionForward submitSession(ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) + throws IOException,ServletException + { + logger.debug("dispathcing submitSession.."); + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("voteService: " +voteService); + + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO= new VoteGeneralMonitoringDTO(); + + commonSubmitSessionCode(form, request, voteService,voteGeneralMonitoringDTO); + logger.debug("post commonSubmitSessionCode: " +voteGeneralMonitoringDTO); + + return (mapping.findForward(LOAD_MONITORING)); } public void refreshSummaryData(HttpServletRequest request, VoteContent voteContent, IVoteService voteService, boolean isUserNamesVisible, boolean isLearnerRequest, String currentSessionId, String userId, - boolean showUserEntriesBySession, VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO) + boolean showUserEntriesBySession, VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO, + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) { logger.debug("doing refreshSummaryData." + voteGeneralLearnerFlowDTO); - logger.debug("voteService." + voteService); + logger.debug("voteGeneralMonitoringDTO:" + voteGeneralMonitoringDTO); if (voteService == null) { @@ -208,72 +298,81 @@ /* this section is related to summary tab. Starts here. */ Map summaryToolSessions=MonitoringUtil.populateToolSessions(request, voteContent, voteService); logger.debug("summaryToolSessions: " + summaryToolSessions); - request.getSession().setAttribute(SUMMARY_TOOL_SESSIONS, summaryToolSessions); - if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(false).toString()); - logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); + if (voteGeneralMonitoringDTO != null) + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); + logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); } else { - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString()); - logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); - logger.debug("error.noLearnerActivity must be displayed"); + if (voteGeneralMonitoringDTO != null) + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); + logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); } - Map summaryToolSessionsId=MonitoringUtil.populateToolSessionsId(request, voteContent, voteService); logger.debug("summaryToolSessionsId: " + summaryToolSessionsId); - request.getSession().setAttribute(SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId); - - /* SELECTION_CASE == 2 indicates start up */ - request.getSession().setAttribute(SELECTION_CASE, new Long(2)); - logger.debug("SELECTION_CASE: " + request.getSession().getAttribute(SELECTION_CASE)); - - /* Default to All for tool Sessions so that all tool sessions' summary information gets displayed when the module starts up */ - request.getSession().setAttribute(CURRENT_MONITORED_TOOL_SESSION, "All"); - logger.debug("CURRENT_MONITORED_TOOL_SESSION: " + request.getSession().getAttribute(CURRENT_MONITORED_TOOL_SESSION)); - logger.debug("currentSessionId: " + currentSessionId); if ((currentSessionId != null) && (!currentSessionId.equals("All"))) { VoteSession voteSession= voteService.retrieveVoteSession(new Long(currentSessionId)); logger.debug("voteSession:" + voteSession); - request.getSession().setAttribute(GROUP_NAME,voteSession.getSession_name()); + if (voteGeneralMonitoringDTO != null) + voteGeneralMonitoringDTO.setGroupName(voteSession.getSession_name()); } logger.debug("using allUsersData to retrieve data: " + isUserNamesVisible); List listMonitoredAnswersContainerDTO=MonitoringUtil.buildGroupsQuestionData(request, voteContent, isUserNamesVisible, isLearnerRequest, currentSessionId, userId, voteService); - request.getSession().setAttribute(LIST_MONITORED_ANSWERS_CONTAINER_DTO, listMonitoredAnswersContainerDTO); - - - logger.debug("LIST_MONITORED_ANSWERS_CONTAINER_DTO: " + request.getSession().getAttribute(LIST_MONITORED_ANSWERS_CONTAINER_DTO)); + logger.debug("listMonitoredAnswersContainerDTO: " + listMonitoredAnswersContainerDTO); /* ends here. */ logger.debug("decide processing user entered values based on isLearnerRequest: " + isLearnerRequest); List listUserEntries=processUserEnteredNominations(voteService, voteContent, currentSessionId, showUserEntriesBySession, userId, isLearnerRequest); logger.debug("listUserEntries: " + listUserEntries); - request.getSession().setAttribute(LIST_USER_ENTRIES, listUserEntries); - request.getSession().setAttribute(EXISTS_OPEN_VOTES, new Boolean(false).toString()); - if (listUserEntries.size() > 0) - { - request.getSession().setAttribute(EXISTS_OPEN_VOTES, new Boolean(true).toString()); - } - if (voteGeneralLearnerFlowDTO !=null) { logger.debug("placing dtos within the voteGeneralLearnerFlowDTO: "); voteGeneralLearnerFlowDTO.setListMonitoredAnswersContainerDto(listMonitoredAnswersContainerDTO); voteGeneralLearnerFlowDTO.setListUserEntries(listUserEntries);; } + if (voteGeneralMonitoringDTO != null) + { + voteGeneralMonitoringDTO.setSummaryToolSessions(summaryToolSessions); + voteGeneralMonitoringDTO.setSummaryToolSessionsId(summaryToolSessionsId); + voteGeneralMonitoringDTO.setSelectionCase(new Long(2)); + voteGeneralMonitoringDTO.setCurrentMonitoredToolSession("All"); + voteGeneralMonitoringDTO.setListMonitoredAnswersContainerDto(listMonitoredAnswersContainerDTO); + voteGeneralMonitoringDTO.setListUserEntries(listUserEntries); + + voteGeneralMonitoringDTO.setExistsOpenVotes(new Boolean(false).toString()); + if (listUserEntries.size() > 0) + { + voteGeneralMonitoringDTO.setExistsOpenVotes(new Boolean(true).toString()); + } + } + logger.debug("final voteGeneralLearnerFlowDTO: " + voteGeneralLearnerFlowDTO); + logger.debug("final voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + boolean isContentInUse=VoteUtils.isContentInUse(voteContent); + logger.debug("isContentInUse:" + isContentInUse); + voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(false).toString()); + if (isContentInUse == true) + { + logger.debug("monitoring url does not allow editActivity since the content is in use."); + voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString()); + } + + logger.debug("end of refreshSummaryData, voteGeneralMonitoringDTO" + voteGeneralMonitoringDTO); + request.setAttribute(VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); + } @@ -285,7 +384,7 @@ logger.debug("start getting user entries, userId: " + userId); logger.debug("start getting user entries, voteContent: " + voteContent); logger.debug("start getting user entries, voteContent id: " + voteContent.getVoteContentId()); - + Set userEntries=voteService.getUserEntries(); logger.debug("userEntries: " + userEntries); @@ -423,64 +522,57 @@ } - public void initSummaryContent(ActionMapping mapping, - ActionForm form, + public void initSummaryContent(String toolContentID, HttpServletRequest request, - HttpServletResponse response) throws IOException, + IVoteService voteService, + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) throws IOException, ServletException { - logger.debug("start initSummaryContent..."); - logger.debug("dispatching getSummary..." + request); + logger.debug("start initSummaryContent...toolContentID: " + toolContentID); + logger.debug("dispatching getSummary...voteGeneralMonitoringDTO:" + voteGeneralMonitoringDTO); - IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); logger.debug("voteService: " + voteService); - if (voteService == null) - { - logger.debug("will retrieve voteService"); - voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("retrieving voteService from session: " + voteService); - } - - Long toolContentID =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); logger.debug("toolContentID: " + toolContentID); - VoteContent voteContent=voteService.retrieveVote(toolContentID); + VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); logger.debug("existing voteContent:" + voteContent); /* this section is related to summary tab. Starts here. */ Map summaryToolSessions=MonitoringUtil.populateToolSessions(request, voteContent, voteService); logger.debug("summaryToolSessions: " + summaryToolSessions); - request.getSession().setAttribute(SUMMARY_TOOL_SESSIONS, summaryToolSessions); - logger.debug("SUMMARY_TOOL_SESSIONS: " + request.getSession().getAttribute(SUMMARY_TOOL_SESSIONS)); + voteGeneralMonitoringDTO.setSummaryToolSessions(summaryToolSessions); + + Map summaryToolSessionsId=MonitoringUtil.populateToolSessionsId(request, voteContent, voteService); + logger.debug("summaryToolSessionsId: " + summaryToolSessionsId); + voteGeneralMonitoringDTO.setSummaryToolSessionsId(summaryToolSessionsId); /* ends here. */ /*true means there is at least 1 response*/ if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(false).toString()); + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); } else { - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString()); + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); } - request.getSession().setAttribute(CURRENT_MONITORING_TAB, "summary"); + voteGeneralMonitoringDTO.setCurrentMonitoringTab("summary"); logger.debug("end initSummaryContent..."); } - public void initInstructionsContent(ActionMapping mapping, - ActionForm form, + public void initInstructionsContent(String toolContentID, HttpServletRequest request, - HttpServletResponse response) throws IOException, + IVoteService voteService, + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) throws IOException, ServletException { logger.debug("starting initInstructionsContent..."); - logger.debug("dispatching getInstructions..." + request); + logger.debug("dispatching getInstructions.., voteGeneralMonitoringDTO:" + voteGeneralMonitoringDTO); - IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); logger.debug("voteService: " + voteService); if (voteService == null) { @@ -489,129 +581,127 @@ logger.debug("retrieving voteService from session: " + voteService); } - Long toolContentID =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); logger.debug("toolContentID: " + toolContentID); - VoteContent voteContent=voteService.retrieveVote(toolContentID); + VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); logger.debug("existing voteContent:" + voteContent); if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(false).toString()); + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); } else { - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString()); + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); } - refreshInstructionsData(request, voteContent, voteService); + refreshInstructionsData(request, voteContent, voteService, voteGeneralMonitoringDTO); + logger.debug("post refreshInstructionsData, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); - request.getSession().setAttribute(CURRENT_MONITORING_TAB, "instructions"); + voteGeneralMonitoringDTO.setCurrentMonitoringTab("instructions"); logger.debug("ending initInstructionsContent..."); } - public void refreshInstructionsData(HttpServletRequest request, VoteContent voteContent, IVoteService voteService) + public void refreshInstructionsData(HttpServletRequest request, VoteContent voteContent, + IVoteService voteService, VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) { - request.getSession().setAttribute(RICHTEXT_ONLINEINSTRUCTIONS,voteContent.getOnlineInstructions()); - request.getSession().setAttribute(RICHTEXT_OFFLINEINSTRUCTIONS,voteContent.getOfflineInstructions()); + logger.debug("starting refreshInstructionsData, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + voteGeneralMonitoringDTO.setRichTextOfflineInstructions(voteContent.getOfflineInstructions()); + voteGeneralMonitoringDTO.setRichTextOnlineInstructions(voteContent.getOnlineInstructions()); /*process offline files metadata*/ List listOfflineFilesMetaData=voteService.getOfflineFilesMetaData(voteContent.getUid()); logger.debug("existing listOfflineFilesMetaData, to be structured as VoteAttachmentDTO: " + listOfflineFilesMetaData); listOfflineFilesMetaData=AuthoringUtil.populateMetaDataAsAttachments(listOfflineFilesMetaData); logger.debug("populated listOfflineFilesMetaData: " + listOfflineFilesMetaData); - request.getSession().setAttribute(LIST_OFFLINEFILES_METADATA, listOfflineFilesMetaData); + voteGeneralMonitoringDTO.setListOfflineFilesMetadata(listOfflineFilesMetaData); List listUploadedOfflineFileNames=AuthoringUtil.populateMetaDataAsFilenames(listOfflineFilesMetaData); logger.debug("returned from db listUploadedOfflineFileNames: " + listUploadedOfflineFileNames); - request.getSession().setAttribute(LIST_UPLOADED_OFFLINE_FILENAMES, listUploadedOfflineFileNames); + voteGeneralMonitoringDTO.setListUploadedOfflineFileNames(listUploadedOfflineFileNames); /*process online files metadata*/ List listOnlineFilesMetaData=voteService.getOnlineFilesMetaData(voteContent.getUid()); logger.debug("existing listOnlineFilesMetaData, to be structured as VoteAttachmentDTO: " + listOnlineFilesMetaData); listOnlineFilesMetaData=AuthoringUtil.populateMetaDataAsAttachments(listOnlineFilesMetaData); logger.debug("populated listOnlineFilesMetaData: " + listOnlineFilesMetaData); - request.getSession().setAttribute(LIST_ONLINEFILES_METADATA, listOnlineFilesMetaData); + voteGeneralMonitoringDTO.setListOnlineFilesMetadata(listOnlineFilesMetaData); List listUploadedOnlineFileNames=AuthoringUtil.populateMetaDataAsFilenames(listOnlineFilesMetaData); logger.debug("returned from db listUploadedOnlineFileNames: " + listUploadedOnlineFileNames); - request.getSession().setAttribute(LIST_UPLOADED_ONLINE_FILENAMES, listUploadedOnlineFileNames); + voteGeneralMonitoringDTO.setListUploadedOnlineFileNames(listUploadedOnlineFileNames); + + logger.debug("end of refreshInstructionsData, voteGeneralMonitoringDTO" + voteGeneralMonitoringDTO); + request.setAttribute(VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); } - public void initStatsContent(ActionMapping mapping, - ActionForm form, + public void initStatsContent(String toolContentID, HttpServletRequest request, - HttpServletResponse response) throws IOException, + IVoteService voteService, + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) throws IOException, ServletException { - logger.debug("starting initStatsContent..."); + logger.debug("starting initStatsContent...:" + toolContentID); logger.debug("dispatching getStats..." + request); - - IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); logger.debug("voteService: " + voteService); - if (voteService == null) - { - logger.debug("will retrieve voteService"); - voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("retrieving voteService from session: " + voteService); - } - - Long toolContentID =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentID: " + toolContentID); - - VoteContent voteContent=voteService.retrieveVote(toolContentID); + + VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); logger.debug("existing voteContent:" + voteContent); - if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(false).toString()); + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); } else { - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString()); + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); } - refreshStatsData(request); + refreshStatsData(request, voteService,voteGeneralMonitoringDTO); + logger.debug("post refreshStatsData, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO ); - request.getSession().setAttribute(CURRENT_MONITORING_TAB, "stats"); + voteGeneralMonitoringDTO.setCurrentMonitoringTab("stats"); logger.debug("ending initStatsContent..."); } - public void refreshStatsData(HttpServletRequest request) + + public void refreshStatsData(HttpServletRequest request, IVoteService voteService, + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) { + logger.debug("starting refreshStatsData: " + voteService); /* it is possible that no users has ever logged in for the activity yet*/ - IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); - logger.debug("voteService: " + voteService); if (voteService == null) { logger.debug("will retrieve voteService"); voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); logger.debug("retrieving voteService from session: " + voteService); } - int countAllUsers=voteService.getTotalNumberOfUsers(); logger.debug("countAllUsers: " + countAllUsers); if (countAllUsers == 0) { logger.debug("error: countAllUsers is 0"); - request.getSession().setAttribute(USER_EXCEPTION_NO_STUDENT_ACTIVITY, new Boolean(true)); + voteGeneralMonitoringDTO.setUserExceptionNoStudentActivity(new Boolean(true).toString()); } - request.getSession().setAttribute(COUNT_ALL_USERS, new Integer(countAllUsers).toString()); + voteGeneralMonitoringDTO.setCountAllUsers(new Integer(countAllUsers).toString()); int countSessionComplete=voteService.countSessionComplete(); logger.debug("countSessionComplete: " + countSessionComplete); - request.getSession().setAttribute(COUNT_SESSION_COMPLETE, new Integer(countSessionComplete).toString()); + voteGeneralMonitoringDTO.setCountSessionComplete(new Integer(countSessionComplete).toString()); + + logger.debug("end of refreshStatsData, voteGeneralMonitoringDTO" + voteGeneralMonitoringDTO); + request.setAttribute(VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); } + public ActionForward editActivityQuestions(ActionMapping mapping, ActionForm form, HttpServletRequest request, @@ -621,34 +711,41 @@ { logger.debug("dispatching editActivityQuestions..."); - IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); - if (voteService == null) - voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("voteService :" +voteService); - - VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("voteService :" +voteService); + + VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; logger.debug("voteMonitoringForm :" +voteMonitoringForm); + voteMonitoringForm.setVoteService(voteService); + logger.debug("voteMonitoringForm :" +voteMonitoringForm); - request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(false).toString()); - request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(true)); + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); + + repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); + logger.debug("done repopulateRequestParameters"); + + voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(false).toString()); + voteGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); - Long toolContentID =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + String toolContentID =voteMonitoringForm.getToolContentID(); logger.debug("toolContentID: " + toolContentID); - VoteUtils.setDefineLater(request, true, voteService, toolContentID.toString()); + VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); - VoteContent voteContent=voteService.retrieveVote(toolContentID); + VoteUtils.setDefineLater(request, true, voteService, toolContentID.toString()); + logger.debug("voteContent: " + voteContent); + /*true means there is at least 1 response*/ if (voteContent != null) { if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(false).toString()); - logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); + logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); } else { - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString()); + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); } } @@ -657,23 +754,86 @@ logger.debug("SOURCE_VOTE_STARTER: monitoring"); voteMonitoringForm.setSbmtSuccess(new Boolean(false).toString()); + voteGeneralMonitoringDTO.setSbmtSuccess(new Boolean(false).toString()); logger.debug("submit success is false"); + + + initSummaryContent(toolContentID , request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initSummaryContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + logger.debug("calling initInstructionsContent."); + initInstructionsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initInstructionsContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + logger.debug("calling initStatsContent."); + initStatsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initStatsContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + + /*setting editable screen properties*/ + VoteGeneralAuthoringDTO voteGeneralAuthoringDTO= new VoteGeneralAuthoringDTO(); + voteGeneralAuthoringDTO.setActivityTitle(voteContent.getTitle()); + voteGeneralAuthoringDTO.setActivityInstructions(voteContent.getInstructions()); + + Map mapOptionsContent= new TreeMap(new VoteComparator()); + Iterator queIterator=voteContent.getVoteQueContents().iterator(); + Long mapIndex=new Long(1); + logger.debug("mapOptionsContent: " + mapOptionsContent); + while (queIterator.hasNext()) + { + VoteQueContent voteQueContent=(VoteQueContent) queIterator.next(); + if (voteQueContent != null) + { + logger.debug("question: " + voteQueContent.getQuestion()); + mapOptionsContent.put(mapIndex.toString(),voteQueContent.getQuestion()); + /** + * make the first entry the default(first) one for jsp + */ + if (mapIndex.longValue() == 1) + { + voteGeneralAuthoringDTO.setDefaultOptionContent(voteQueContent.getQuestion()); + } + + mapIndex=new Long(mapIndex.longValue()+1); + } + } + + logger.debug("mapOptionsContent: " + mapOptionsContent); + int maxIndex=mapOptionsContent.size(); + logger.debug("maxIndex: " + maxIndex); + voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); + + voteGeneralAuthoringDTO.setMapOptionsContent(mapOptionsContent); + voteGeneralAuthoringDTO.setActiveModule(MONITORING); + + logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); + request.setAttribute(VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); + return (mapping.findForward(LOAD_MONITORING)); } public ActionForward submitAllContent(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { logger.debug("dispatching proxy submitAllContent..."); - request.getSession().setAttribute(ACTIVE_MODULE, MONITORING); + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("voteService :" +voteService); + + VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; + logger.debug("voteMonitoringForm :" +voteMonitoringForm); + voteMonitoringForm.setVoteService(voteService); + + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); + + repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); + logger.debug("done repopulateRequestParameters"); + request.setAttribute(SOURCE_VOTE_STARTER, "monitoring"); logger.debug("SOURCE_VOTE_STARTER: monitoring"); VoteAction voteAction= new VoteAction(); - VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; - logger.debug("voteMonitoringForm :" +voteMonitoringForm); voteMonitoringForm.setSbmtSuccess(new Boolean(false).toString()); voteMonitoringForm.setActiveModule(DEFINE_LATER); @@ -691,8 +851,29 @@ if (isContentSubmitted == true) voteMonitoringForm.setSbmtSuccess(new Boolean(true).toString()); - request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(false)); logger.debug("final submit status :" +voteMonitoringForm.getSbmtSuccess()); + + + String toolContentID =voteMonitoringForm.getToolContentID(); + logger.debug("toolContentID: " + toolContentID); + + initSummaryContent(toolContentID , request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initSummaryContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + logger.debug("calling initInstructionsContent."); + initInstructionsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initInstructionsContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + logger.debug("calling initStatsContent."); + initStatsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initStatsContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + + voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(false).toString()); + + logger.debug("voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + request.setAttribute(VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); + return (mapping.findForward(destination)); } @@ -701,12 +882,23 @@ throws IOException, ServletException { logger.debug("dispatching proxy addNewNomination..."); + + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("voteService :" +voteService); + + VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; + logger.debug("voteMonitoringForm :" +voteMonitoringForm); + voteMonitoringForm.setVoteService(voteService); + request.setAttribute(SOURCE_VOTE_STARTER, "monitoring"); logger.debug("SOURCE_VOTE_STARTER: monitoring"); - - VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; + + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); + voteMonitoringForm.setSbmtSuccess(new Boolean(false).toString()); + + repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); /* determine whether the request is from Monitoring url Edit Activity*/ String sourceVoteStarter = (String) request.getAttribute(SOURCE_VOTE_STARTER); @@ -718,6 +910,27 @@ boolean isNewNominationAdded=voteAction.isNewNominationAdded(mapping, form, request, response); logger.debug("isNewNominationAdded:" + isNewNominationAdded); + + String toolContentID =voteMonitoringForm.getToolContentID(); + logger.debug("toolContentID: " + toolContentID); + + initSummaryContent(toolContentID , request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initSummaryContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + logger.debug("calling initInstructionsContent."); + initInstructionsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initInstructionsContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + logger.debug("calling initStatsContent."); + initStatsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initStatsContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(false).toString()); + voteGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); + + logger.debug("voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + request.setAttribute(VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); + return (mapping.findForward(destination)); } @@ -726,14 +939,26 @@ throws IOException, ServletException { logger.debug("dispatching proxy removeNomination..."); + + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("voteService :" +voteService); + VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; + logger.debug("voteMonitoringForm :" +voteMonitoringForm); + voteMonitoringForm.setVoteService(voteService); + + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); + + repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); + logger.debug("voteMonitoringForm: " + voteMonitoringForm); String optIndex=voteMonitoringForm.getOptIndex() ; logger.debug("optIndex: " + optIndex); request.getSession().setAttribute(REMOVABLE_QUESTION_INDEX, optIndex); request.setAttribute(SOURCE_VOTE_STARTER, "monitoring"); logger.debug("SOURCE_VOTE_STARTER: monitoring"); + VoteAction voteAction= new VoteAction(); @@ -745,7 +970,28 @@ boolean isNominationRemoved=voteAction.isNominationRemoved(mapping, form, request, response); logger.debug("isNominationRemoved :" +isNominationRemoved); + + String toolContentID =voteMonitoringForm.getToolContentID(); + logger.debug("toolContentID: " + toolContentID); + initSummaryContent(toolContentID , request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initSummaryContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + logger.debug("calling initInstructionsContent."); + initInstructionsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initInstructionsContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + logger.debug("calling initStatsContent."); + initStatsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initStatsContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(false).toString()); + voteGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); + + logger.debug("voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + request.setAttribute(VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); + + return (mapping.findForward(destination)); } @@ -758,9 +1004,19 @@ { logger.debug("dispatching proxy moveNominationDown..."); + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("voteService :" +voteService); + + VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; + logger.debug("voteMonitoringForm :" +voteMonitoringForm); + voteMonitoringForm.setVoteService(voteService); + + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); + request.setAttribute(SOURCE_VOTE_STARTER, "monitoring"); logger.debug("SOURCE_VOTE_STARTER: monitoring"); + repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); VoteAction voteAction= new VoteAction(); /* determine whether the request is from Monitoring url Edit Activity*/ @@ -771,7 +1027,27 @@ boolean isMoveNominationDown=voteAction.isMoveNominationDown(mapping, form, request, response); logger.debug("isMoveNominationDown :" +isMoveNominationDown); + + String toolContentID =voteMonitoringForm.getToolContentID(); + logger.debug("toolContentID: " + toolContentID); + initSummaryContent(toolContentID , request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initSummaryContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + logger.debug("calling initInstructionsContent."); + initInstructionsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initInstructionsContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + logger.debug("calling initStatsContent."); + initStatsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initStatsContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(false).toString()); + voteGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); + + logger.debug("voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + request.setAttribute(VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); + return (mapping.findForward(destination)); } @@ -783,7 +1059,16 @@ ServletException { logger.debug("dispatching proxy moveNominationUp..."); + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("voteService :" +voteService); + + VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; + logger.debug("voteMonitoringForm :" +voteMonitoringForm); + voteMonitoringForm.setVoteService(voteService); + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); + repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); + request.setAttribute(SOURCE_VOTE_STARTER, "monitoring"); logger.debug("SOURCE_VOTE_STARTER: monitoring"); @@ -796,7 +1081,27 @@ VoteAction voteAction= new VoteAction(); boolean isMoveNominationUp=voteAction.isMoveNominationUp(mapping, form, request, response); logger.debug("isMoveNominationUp:" + isMoveNominationUp); + + String toolContentID =voteMonitoringForm.getToolContentID(); + logger.debug("toolContentID: " + toolContentID); + + initSummaryContent(toolContentID , request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initSummaryContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + logger.debug("calling initInstructionsContent."); + initInstructionsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initInstructionsContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + logger.debug("calling initStatsContent."); + initStatsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initStatsContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(false).toString()); + voteGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); + + logger.debug("voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + request.setAttribute(VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); + return (mapping.findForward(destination)); } @@ -825,15 +1130,17 @@ ServletException, ToolException { logger.debug("dispatching proxy endLearning to learning module..."); - IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); - logger.debug("voteService: " + voteService); - if (voteService == null) - { - logger.debug("will retrieve voteService"); - voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("retrieving voteService from session: " + voteService); - } + + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("voteService :" +voteService); + + VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; + logger.debug("voteMonitoringForm :" +voteMonitoringForm); + voteMonitoringForm.setVoteService(voteService); + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); + repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); + VoteLearningAction voteLearningAction= new VoteLearningAction(); return null; } @@ -846,45 +1153,75 @@ ServletException, ToolException { logger.debug("dispatching viewOpenVotes..."); - IVoteService voteService=null; - voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); - - if (voteService == null) + + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("voteService :" +voteService); + + VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; + logger.debug("voteMonitoringForm :" +voteMonitoringForm); + voteMonitoringForm.setVoteService(voteService); + + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO(); + + repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); + + if (voteService == null) { logger.debug("will retrieve voteService"); voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); } logger.debug("voteService: " + voteService); - - VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; + voteMonitoringForm.setShowOpenVotesSection(new Boolean(true).toString()); + voteGeneralMonitoringDTO.setShowOpenVotesSection(new Boolean(true).toString()); logger.debug("showOpen votes set to true: "); - Long toolContentID =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + String toolContentID =voteMonitoringForm.getToolContentID(); logger.debug("toolContentID: " + toolContentID); - - VoteContent voteContent=voteService.retrieveVote(toolContentID); + + VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); logger.debug("existing voteContent:" + voteContent); String currentMonitoredToolSession=voteMonitoringForm.getSelectedToolSessionId(); logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession); - refreshSummaryData(request, voteContent, voteService, true, false, currentMonitoredToolSession, null, true, null); + refreshSummaryData(request, voteContent, voteService, true, false, currentMonitoredToolSession, + null, true, null,voteGeneralMonitoringDTO); + + initSummaryContent(toolContentID , request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initSummaryContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + logger.debug("calling initInstructionsContent."); + initInstructionsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initInstructionsContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + logger.debug("calling initStatsContent."); + initStatsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initStatsContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + logger.debug("voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + request.setAttribute(VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); + + if (currentMonitoredToolSession.equals("All")) { - request.getSession().setAttribute(SELECTION_CASE, new Long(2)); + voteGeneralMonitoringDTO.setSelectionCase(new Long(2)); } else { - request.getSession().setAttribute(SELECTION_CASE, new Long(1)); + voteGeneralMonitoringDTO.setSelectionCase(new Long(1)); } - logger.debug("SELECTION_CASE: " + request.getSession().getAttribute(SELECTION_CASE)); - request.getSession().setAttribute(CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession); - logger.debug("CURRENT_MONITORED_TOOL_SESSION: " + request.getSession().getAttribute(CURRENT_MONITORED_TOOL_SESSION)); - + voteGeneralMonitoringDTO.setCurrentMonitoredToolSession(currentMonitoredToolSession); + voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString()); + + logger.debug("ending editActivityQuestions, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + request.setAttribute(VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); + + logger.debug("ending viewOpenVotes, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + logger.debug("fwd'ing to LOAD_MONITORING: " + LOAD_MONITORING); return (mapping.findForward(LOAD_MONITORING)); } @@ -896,20 +1233,42 @@ ServletException, ToolException { logger.debug("dispatching closeOpenVotes..."); - IVoteService voteService=null; - voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); - - if (voteService == null) - { - logger.debug("will retrieve voteService"); - voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - } - logger.debug("voteService: " + voteService); - + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("voteService :" +voteService); + VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; + logger.debug("voteMonitoringForm :" +voteMonitoringForm); + voteMonitoringForm.setVoteService(voteService); + + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO(); + + repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); + voteMonitoringForm.setShowOpenVotesSection(new Boolean(false).toString()); + voteGeneralMonitoringDTO.setShowOpenVotesSection(new Boolean(false).toString()); logger.debug("showOpen votes set to false: "); + + String toolContentID =voteMonitoringForm.getToolContentID(); + logger.debug("toolContentID: " + toolContentID); + + initSummaryContent(toolContentID , request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initSummaryContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + logger.debug("calling initInstructionsContent."); + initInstructionsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initInstructionsContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + logger.debug("calling initStatsContent."); + initStatsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initStatsContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString()); + + logger.debug("voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + request.setAttribute(VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); + + logger.debug("ending closeOpenVotes, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); return (mapping.findForward(LOAD_MONITORING)); } @@ -923,125 +1282,163 @@ ServletException, ToolException { logger.debug("dispatching hideOpenVote..."); - IVoteService voteService=null; - voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); - - if (voteService == null) - { - logger.debug("will retrieve voteService"); - voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - } - logger.debug("voteService: " + voteService); - + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("voteService :" +voteService); + VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; + logger.debug("voteMonitoringForm :" +voteMonitoringForm); + voteMonitoringForm.setVoteService(voteService); + + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO= new VoteGeneralMonitoringDTO(); + + repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); + String currentUid=voteMonitoringForm.getCurrentUid(); logger.debug("currentUid: " + currentUid); + VoteUsrAttempt voteUsrAttempt =voteService.getAttemptByUID(new Long(currentUid)); logger.debug("voteUsrAttempt: " + voteUsrAttempt); + voteUsrAttempt.setVisible(false); voteService.updateVoteUsrAttempt(voteUsrAttempt); logger.debug("hiding the user entry : " + voteUsrAttempt.getUserEntry()); voteService.hideOpenVote(voteUsrAttempt); - Long toolContentID =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentID: " + toolContentID); + String toolContentID=voteMonitoringForm.getToolContentID(); + logger.debug("toolContentID: " + toolContentID); - VoteContent voteContent=voteService.retrieveVote(toolContentID); + VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); logger.debug("existing voteContent:" + voteContent); + initSummaryContent(toolContentID , request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initSummaryContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + logger.debug("calling initInstructionsContent."); + initInstructionsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initInstructionsContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + logger.debug("calling initStatsContent."); + initStatsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initStatsContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + String currentMonitoredToolSession=voteMonitoringForm.getSelectedToolSessionId(); logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession); - refreshSummaryData(request, voteContent, voteService, true, false, currentMonitoredToolSession, null, true, null); + refreshSummaryData(request, voteContent, voteService, true, false, currentMonitoredToolSession, null, true, null, voteGeneralMonitoringDTO); if (currentMonitoredToolSession.equals("All")) { - request.getSession().setAttribute(SELECTION_CASE, new Long(2)); + voteGeneralMonitoringDTO.setSelectionCase(new Long(2)); } else { - request.getSession().setAttribute(SELECTION_CASE, new Long(1)); + voteGeneralMonitoringDTO.setSelectionCase(new Long(1)); } - logger.debug("SELECTION_CASE: " + request.getSession().getAttribute(SELECTION_CASE)); - request.getSession().setAttribute(CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession); - logger.debug("CURRENT_MONITORED_TOOL_SESSION: " + request.getSession().getAttribute(CURRENT_MONITORED_TOOL_SESSION)); - - //return (mapping.findForward(LOAD_MONITORING)); + + voteGeneralMonitoringDTO.setCurrentMonitoredToolSession(currentMonitoredToolSession); + + voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString()); + + logger.debug("voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + request.setAttribute(VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); + logger.debug("submitting session to refresh the data from the database: "); - return submitSession(mapping, form, request, response); - + return submitSession(mapping, form, request, response, voteService, voteGeneralMonitoringDTO); } + public ActionForward showOpenVote(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, ToolException { logger.debug("dispatching showOpenVote..."); - IVoteService voteService=null; - voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); - - if (voteService == null) - { - logger.debug("will retrieve voteService"); - voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - } - logger.debug("voteService: " + voteService); - + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("voteService :" +voteService); + VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; + logger.debug("voteMonitoringForm :" +voteMonitoringForm); + voteMonitoringForm.setVoteService(voteService); + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO= new VoteGeneralMonitoringDTO(); + + repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); + String currentUid=voteMonitoringForm.getCurrentUid(); logger.debug("currentUid: " + currentUid); + VoteUsrAttempt voteUsrAttempt =voteService.getAttemptByUID(new Long(currentUid)); logger.debug("voteUsrAttempt: " + voteUsrAttempt); voteUsrAttempt.setVisible(true); + voteService.updateVoteUsrAttempt(voteUsrAttempt); voteService.showOpenVote(voteUsrAttempt); logger.debug("voteUsrAttempt: " + voteUsrAttempt); - Long toolContentID =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentID: " + toolContentID); + String toolContentID=voteMonitoringForm.getToolContentID(); + logger.debug("toolContentID: " + toolContentID); - VoteContent voteContent=voteService.retrieveVote(toolContentID); + VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); logger.debug("existing voteContent:" + voteContent); + + initSummaryContent(toolContentID , request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initSummaryContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + logger.debug("calling initInstructionsContent."); + initInstructionsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initInstructionsContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + + logger.debug("calling initStatsContent."); + initStatsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initStatsContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + String currentMonitoredToolSession=voteMonitoringForm.getSelectedToolSessionId(); logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession); - refreshSummaryData(request, voteContent, voteService, true, false, currentMonitoredToolSession, null, true, null); + refreshSummaryData(request, voteContent, voteService, true, false, currentMonitoredToolSession, null, + true, null, voteGeneralMonitoringDTO); if (currentMonitoredToolSession.equals("All")) { - request.getSession().setAttribute(SELECTION_CASE, new Long(2)); + voteGeneralMonitoringDTO.setSelectionCase(new Long(2)); } else { - request.getSession().setAttribute(SELECTION_CASE, new Long(1)); + voteGeneralMonitoringDTO.setSelectionCase(new Long(1)); } - logger.debug("SELECTION_CASE: " + request.getSession().getAttribute(SELECTION_CASE)); - request.getSession().setAttribute(CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession); - logger.debug("CURRENT_MONITORED_TOOL_SESSION: " + request.getSession().getAttribute(CURRENT_MONITORED_TOOL_SESSION)); - + voteGeneralMonitoringDTO.setCurrentMonitoredToolSession(currentMonitoredToolSession); + voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString()); + logger.debug("submitting session to refresh the data from the database: "); - return submitSession(mapping, form, request, response); - } + return submitSession(mapping, form, request, response, voteService, voteGeneralMonitoringDTO); + } + public ActionForward getVoteNomination(ActionMapping mapping, ActionForm form, HttpServletRequest request,HttpServletResponse response) throws IOException, ServletException, ToolException { logger.debug("dispatching getVoteNomination..."); + + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("voteService :" +voteService); + + VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; + logger.debug("voteMonitoringForm :" +voteMonitoringForm); + voteMonitoringForm.setVoteService(voteService); + + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO= new VoteGeneralMonitoringDTO(); + repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); + String questionUid=request.getParameter("questionUid"); String sessionUid=request.getParameter("sessionUid"); logger.debug("questionUid: " + questionUid); logger.debug("sessionUid: " + sessionUid); - - IVoteService voteService=null; - voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); - logger.debug("voteService: " + voteService); List userNames=voteService.getStandardAttemptUsersForQuestionContentAndSessionUid(new Long(questionUid), new Long(sessionUid)); logger.debug("userNames: " + userNames); @@ -1058,11 +1455,50 @@ } logger.debug("listVoteAllSessionsDTO: " + listVotedLearnersDTO); - request.getSession().setAttribute(MAP_STUDENTS_VOTED,listVotedLearnersDTO); - + voteGeneralMonitoringDTO.setMapStudentsVoted(listVotedLearnersDTO); + voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString()); + logger.debug("ending getVoteNomination, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + request.setAttribute(VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); + logger.debug("fdwing to: " + VOTE_NOMINATION_VIEWER); return (mapping.findForward(VOTE_NOMINATION_VIEWER)); } + + + protected void repopulateRequestParameters(HttpServletRequest request, VoteMonitoringForm voteMonitoringForm, + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) + { + logger.debug("starting repopulateRequestParameters"); + + String toolContentID=request.getParameter(TOOL_CONTENT_ID); + logger.debug("toolContentID: " + toolContentID); + voteMonitoringForm.setToolContentID(toolContentID); + voteGeneralMonitoringDTO.setToolContentID(toolContentID); + + String activeModule=request.getParameter(ACTIVE_MODULE); + logger.debug("activeModule: " + activeModule); + voteMonitoringForm.setActiveModule(activeModule); + voteGeneralMonitoringDTO.setActiveModule(activeModule); + + String defineLaterInEditMode=request.getParameter(DEFINE_LATER_IN_EDIT_MODE); + logger.debug("defineLaterInEditMode: " + defineLaterInEditMode); + voteMonitoringForm.setDefineLaterInEditMode(defineLaterInEditMode); + voteGeneralMonitoringDTO.setDefineLaterInEditMode(defineLaterInEditMode); + String isToolSessionChanged=request.getParameter(IS_TOOL_SESSION_CHANGED); + logger.debug("isToolSessionChanged: " + isToolSessionChanged); + voteMonitoringForm.setIsToolSessionChanged(isToolSessionChanged); + voteGeneralMonitoringDTO.setIsToolSessionChanged(isToolSessionChanged); + + String responseId=request.getParameter(RESPONSE_ID); + logger.debug("responseId: " + responseId); + voteMonitoringForm.setResponseId(responseId); + voteGeneralMonitoringDTO.setResponseId(responseId); + + String currentUid=request.getParameter(CURRENT_UID); + logger.debug("currentUid: " + currentUid); + voteMonitoringForm.setCurrentUid(currentUid); + voteGeneralMonitoringDTO.setCurrentUid(currentUid); + } } \ No newline at end of file Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringForm.java =================================================================== diff -u -r796f0357fbc2197eb4fda5397cc0c01c6de41d0d -r369b6c2ca857c6b74ee143e081534f50b0b94106 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringForm.java (.../VoteMonitoringForm.java) (revision 796f0357fbc2197eb4fda5397cc0c01c6de41d0d) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringForm.java (.../VoteMonitoringForm.java) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) @@ -58,9 +58,24 @@ protected String existsOpenVotes; + protected String toolContentID; + protected String defineLaterInEditMode; + /** + * @return Returns the toolContentID. + */ + public String getToolContentID() { + return toolContentID; + } + /** + * @param toolContentID The toolContentID to set. + */ + public void setToolContentID(String toolContentID) { + this.toolContentID = toolContentID; + } + /** * @return Returns the currentUid. */ public String getCurrentUid() { @@ -219,4 +234,16 @@ public void setExistsOpenVotes(String existsOpenVotes) { this.existsOpenVotes = existsOpenVotes; } + /** + * @return Returns the defineLaterInEditMode. + */ + public String getDefineLaterInEditMode() { + return defineLaterInEditMode; + } + /** + * @param defineLaterInEditMode The defineLaterInEditMode to set. + */ + public void setDefineLaterInEditMode(String defineLaterInEditMode) { + this.defineLaterInEditMode = defineLaterInEditMode; + } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java =================================================================== diff -u -r80d305915ce2c3952f34ed08e8b4740188dde18c -r369b6c2ca857c6b74ee143e081534f50b0b94106 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java (.../VoteMonitoringStarterAction.java) (revision 80d305915ce2c3952f34ed08e8b4740188dde18c) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java (.../VoteMonitoringStarterAction.java) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) @@ -42,6 +42,8 @@ import org.lamsfoundation.lams.tool.vote.VoteAppConstants; import org.lamsfoundation.lams.tool.vote.VoteApplicationException; import org.lamsfoundation.lams.tool.vote.VoteComparator; +import org.lamsfoundation.lams.tool.vote.VoteGeneralAuthoringDTO; +import org.lamsfoundation.lams.tool.vote.VoteGeneralMonitoringDTO; import org.lamsfoundation.lams.tool.vote.VoteUtils; import org.lamsfoundation.lams.tool.vote.pojos.VoteContent; import org.lamsfoundation.lams.tool.vote.pojos.VoteQueContent; @@ -55,6 +57,37 @@ *

Starts up the monitoring module

* * @author Ozgur Demirtas + * + + + + + + + + + + + + * */ public class VoteMonitoringStarterAction extends Action implements VoteAppConstants { @@ -65,142 +98,166 @@ { logger.debug("init VoteMonitoringStarterAction..."); VoteUtils.cleanUpSessionAbsolute(request); + + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("voteService: " + voteService); + VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; + logger.debug("voteMonitoringForm: " + voteMonitoringForm); - ActionForward validateParameters=validateParameters(request, mapping); + VoteGeneralAuthoringDTO voteGeneralAuthoringDTO= new VoteGeneralAuthoringDTO(); + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO(); + + ActionForward validateParameters=validateParameters(request, mapping, voteMonitoringForm); logger.debug("validateParamaters: " + validateParameters); + if (validateParameters != null) { return validateParameters; } - boolean initData=initialiseMonitoringData(mapping, form, request, response); + boolean initData=initialiseMonitoringData(mapping, form, request, response, + voteService, voteGeneralMonitoringDTO); logger.debug("initData: " + initData); if (initData == false) return (mapping.findForward(ERROR_LIST)); - VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; - logger.debug("voteMonitoringForm: " + voteMonitoringForm); voteMonitoringForm.setCurrentTab("1"); + voteGeneralMonitoringDTO.setCurrentTab("1"); logger.debug("setting current tab to 1: "); + String toolContentID=voteMonitoringForm.getToolContentID(); + logger.debug("toolContentID: " + toolContentID); - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString()); - request.getSession().setAttribute(COUNT_ALL_USERS, new Integer(0).toString()); - request.getSession().setAttribute(COUNT_SESSION_COMPLETE, new Integer(0).toString()); + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); + //Come back to fix here + voteGeneralMonitoringDTO.setCountAllUsers(new Integer(0).toString()); + voteGeneralMonitoringDTO.setCountSessionComplete(new Integer(0).toString()); VoteMonitoringAction voteMonitoringAction= new VoteMonitoringAction(); + logger.debug("calling initSummaryContent."); - voteMonitoringAction.initSummaryContent(mapping, form, request, response); + voteMonitoringAction.initSummaryContent(toolContentID , request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initSummaryContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + logger.debug("calling initInstructionsContent."); - voteMonitoringAction.initInstructionsContent(mapping, form, request, response); + voteMonitoringAction.initInstructionsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initInstructionsContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + logger.debug("calling initStatsContent."); - voteMonitoringAction.initStatsContent(mapping, form, request, response); + voteMonitoringAction.initStatsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); + logger.debug("post initStatsContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); - - IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - Long toolContentID =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentID: " + toolContentID); - + VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); + logger.debug("voteContent: " + voteContent); - VoteContent voteContent=voteService.retrieveVote(toolContentID); /*true means there is at least 1 response*/ if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(false).toString()); - logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); + logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); } else { - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString()); + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); } - - request.getSession().setAttribute(ACTIVE_MODULE, MONITORING); voteMonitoringForm.setActiveModule(MONITORING); + voteGeneralMonitoringDTO.setActiveModule(MONITORING); + voteMonitoringForm.setSelectedToolSessionId("All"); + voteGeneralMonitoringDTO.setSelectedToolSessionId("All"); + voteMonitoringForm.setSbmtSuccess(new Boolean(false).toString()); - request.getSession().setAttribute(REQUEST_LEARNING_REPORT, new Boolean(false).toString()); - request.getSession().setAttribute(IS_PORTFOLIO_EXPORT, new Boolean(false).toString()); + voteGeneralMonitoringDTO.setSbmtSuccess(new Boolean(false).toString()); + + voteGeneralMonitoringDTO.setRequestLearningReport(new Boolean(false).toString()); voteMonitoringForm.setShowOpenVotesSection(new Boolean(false).toString()); + voteGeneralMonitoringDTO.setIsPortfolioExport(new Boolean(false).toString()); logger.debug("calling submitSession:" + toolContentID); - return voteMonitoringAction.submitSession(mapping, form, request, response); + request.setAttribute(VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); + + /*this section is needed for Edit Activity screen, from here... */ + logger.debug("for copy using voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); + voteGeneralAuthoringDTO.setActivityTitle(voteGeneralMonitoringDTO.getActivityTitle()); + voteGeneralAuthoringDTO.setActivityInstructions(voteGeneralMonitoringDTO.getActivityInstructions()); + voteGeneralAuthoringDTO.setDefaultOptionContent(voteGeneralMonitoringDTO.getDefaultOptionContent()); + voteGeneralAuthoringDTO.setMapOptionsContent(voteGeneralMonitoringDTO.getMapOptionsContent()); + voteGeneralAuthoringDTO.setActiveModule(MONITORING); + + Map mapOptionsContent=voteGeneralMonitoringDTO.getMapOptionsContent(); + logger.debug("mapOptionsContent: " + mapOptionsContent); + int maxIndex=mapOptionsContent.size(); + logger.debug("maxIndex: " + maxIndex); + voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); + + logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); + request.setAttribute(VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); + /*...till here */ + + logger.debug("calling submitSession with selectedToolSessionId" + voteMonitoringForm.getSelectedToolSessionId()); + return voteMonitoringAction.submitSession(mapping, voteMonitoringForm, request, response, voteService, voteGeneralMonitoringDTO); } - public boolean initialiseMonitoringData(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) + public boolean initialiseMonitoringData(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response, + IVoteService voteService, VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) { - logger.debug("start initializing monitoring data..."); - + logger.debug("start initializing monitoring data...voteService: " + voteService); VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; - - IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - request.getSession().setAttribute(TOOL_SERVICE, voteService); - - request.getSession().setAttribute(CURRENT_MONITORING_TAB, "summary"); voteMonitoringForm.setSbmtSuccess(new Boolean(false).toString()); - request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(false)); - request.getSession().setAttribute(REQUEST_LEARNING_REPORT, new Boolean(false).toString()); + + voteGeneralMonitoringDTO.setCurrentMonitoringTab("summary"); + voteGeneralMonitoringDTO.setSbmtSuccess(new Boolean(false).toString()); + voteGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(false).toString()); + voteGeneralMonitoringDTO.setRequestLearningReport(new Boolean(false).toString()); + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString()); VoteUtils.saveTimeZone(request); /* we have made sure TOOL_CONTENT_ID is passed */ - Long toolContentID =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + String toolContentID=voteMonitoringForm.getToolContentID(); logger.debug("toolContentID: " + toolContentID); - VoteContent voteContent=voteService.retrieveVote(toolContentID); + VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); logger.debug("existing voteContent:" + voteContent); if (voteContent == null) { VoteUtils.cleanUpSessionAbsolute(request); - request.getSession().setAttribute(USER_EXCEPTION_CONTENT_DOESNOTEXIST, new Boolean(true).toString()); + voteGeneralMonitoringDTO.setUserExceptionContentDoesNotExist(new Boolean(true).toString()); persistInRequestError(request, "error.content.doesNotExist"); return false; } boolean isContentInUse=VoteUtils.isContentInUse(voteContent); logger.debug("isContentInUse:" + isContentInUse); - - - request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(false).toString()); + voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(false).toString()); if (isContentInUse == true) { logger.debug("monitoring url does not allow editActivity since the content is in use."); persistInRequestError(request,"error.content.inUse"); - request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(true).toString()); + voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString()); } - - if (voteContent.getTitle() == null) - { - request.getSession().setAttribute(ACTIVITY_TITLE, "Voting Title"); - request.getSession().setAttribute(ACTIVITY_INSTRUCTIONS, "Voting Instructions"); - } - else - { - request.getSession().setAttribute(ACTIVITY_TITLE, voteContent.getTitle()); - request.getSession().setAttribute(ACTIVITY_INSTRUCTIONS, voteContent.getInstructions()); - } + voteGeneralMonitoringDTO.setActivityTitle(voteContent.getTitle()); + voteGeneralMonitoringDTO.setActivityInstructions(voteContent.getInstructions()); - logger.debug("checking student activity on the standard nominations:" + voteContent); if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { VoteUtils.cleanUpSessionAbsolute(request); logger.debug("student activity occurred on this content:" + voteContent); - request.getSession().setAttribute(USER_EXCEPTION_CONTENT_IN_USE, new Boolean(true).toString()); - - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(false).toString()); + voteGeneralMonitoringDTO.setUserExceptionContentInUse(new Boolean(true).toString()); + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); } else { - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString()); + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); logger.debug("error.noLearnerActivity must be displayed"); } @@ -222,40 +279,42 @@ { logger.debug("question: " + voteQueContent.getQuestion()); mapOptionsContent.put(mapIndex.toString(),voteQueContent.getQuestion()); - /** - * make the first entry the default(first) one for jsp - */ - if (mapIndex.longValue() == 1) + + if (mapIndex.longValue() == 1) { - request.getSession().setAttribute(DEFAULT_OPTION_CONTENT, voteQueContent.getQuestion()); + voteGeneralMonitoringDTO.setDefaultOptionContent(voteQueContent.getQuestion()); } mapIndex=new Long(mapIndex.longValue()+1); } } logger.debug("Map initialized with existing contentid to: " + mapOptionsContent); - request.getSession().setAttribute(MAP_OPTIONS_CONTENT, mapOptionsContent); - logger.debug("starter initialized the Comparable Map: " + request.getSession().getAttribute(MAP_OPTIONS_CONTENT) ); + voteGeneralMonitoringDTO.setMapOptionsContent(mapOptionsContent); /* ends here*/ VoteMonitoringAction voteMonitoringAction= new VoteMonitoringAction(); logger.debug("refreshing summary data..."); - voteMonitoringAction.refreshSummaryData(request, voteContent, voteService, true, false, null, null, false, null); + voteMonitoringAction.refreshSummaryData(request, voteContent, voteService, true, false, + null, null, false, null, voteGeneralMonitoringDTO); + logger.debug("post refreshSummaryData, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); logger.debug("refreshing stats data..."); - voteMonitoringAction.refreshStatsData(request); + voteMonitoringAction.refreshStatsData(request, voteService, voteGeneralMonitoringDTO); + logger.debug("post refreshStatsData, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); logger.debug("refreshing instructions data..."); - voteMonitoringAction.refreshInstructionsData(request, voteContent, voteService); + voteMonitoringAction.refreshInstructionsData(request, voteContent, voteService, voteGeneralMonitoringDTO); logger.debug("end initializing monitoring data..."); - request.getSession().setAttribute(EXISTS_OPEN_VOTES, new Boolean(false).toString()); + voteGeneralMonitoringDTO.setExistsOpenVotes(new Boolean(false).toString()); + + logger.debug("post refreshes, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); return true; } - protected ActionForward validateParameters(HttpServletRequest request, ActionMapping mapping) + protected ActionForward validateParameters(HttpServletRequest request, ActionMapping mapping, VoteMonitoringForm voteMonitoringForm) { logger.debug("start validating monitoring parameters..."); @@ -274,7 +333,7 @@ { long toolContentID=new Long(strToolContentId).longValue(); logger.debug("passed TOOL_CONTENT_ID : " + new Long(toolContentID)); - request.getSession().setAttribute(TOOL_CONTENT_ID,new Long(toolContentID)); + voteMonitoringForm.setToolContentID(strToolContentId); } catch(NumberFormatException e) { Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java =================================================================== diff -u -r1447dc2ae2077d18831a17b7c2f309390adb0687 -r369b6c2ca857c6b74ee143e081534f50b0b94106 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java (.../VoteStarterAction.java) (revision 1447dc2ae2077d18831a17b7c2f309390adb0687) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java (.../VoteStarterAction.java) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) @@ -406,7 +406,6 @@ VoteAuthoringForm voteAuthoringForm) { logger.debug("start reading tool signature: " + voteService); - //request.getSession().setAttribute(TOOL_SERVICE, voteService); /* * retrieve the default content id based on tool signature */ @@ -492,7 +491,7 @@ if (voteContent.getTitle() == null) { - voteGeneralAuthoringDTO.setActivityTitle("Voting Title"); + voteGeneralAuthoringDTO.setActivityTitle(DEFAULT_VOTING_TITLE); } else { @@ -502,7 +501,7 @@ if (voteContent.getInstructions() == null) { - voteGeneralAuthoringDTO.setActivityInstructions("Voting Instructions"); + voteGeneralAuthoringDTO.setActivityInstructions(DEFAULT_VOTING_INSTRUCTIONS); } else { @@ -586,15 +585,11 @@ List listUploadedOnlineFileNames=AuthoringUtil.populateMetaDataAsFilenames(listOnlineFilesMetaData); logger.debug("returned from db listUploadedOnlineFileNames: " + listUploadedOnlineFileNames); - //request.getSession().setAttribute(LIST_UPLOADED_ONLINE_FILENAMES, listUploadedOnlineFileNames); + voteGeneralAuthoringDTO.setListUploadedOnlineFileNames(listUploadedOnlineFileNames); sessionMap.put(LIST_UPLOADED_ONLINE_FILENAMES_KEY, listUploadedOnlineFileNames); - - /* - * load nominations page - */ voteAuthoringForm.resetUserAction(); } Index: lams_tool_vote/web/WEB-INF/struts-config.xml =================================================================== diff -u -r80d305915ce2c3952f34ed08e8b4740188dde18c -r369b6c2ca857c6b74ee143e081534f50b0b94106 --- lams_tool_vote/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 80d305915ce2c3952f34ed08e8b4740188dde18c) +++ lams_tool_vote/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) @@ -297,7 +297,7 @@ -

-
+ images/success.gif" align="left" width=20 height=20> Index: lams_tool_vote/web/authoring/BasicContentViewOnly.jsp =================================================================== diff -u -r1447dc2ae2077d18831a17b7c2f309390adb0687 -r369b6c2ca857c6b74ee143e081534f50b0b94106 --- lams_tool_vote/web/authoring/BasicContentViewOnly.jsp (.../BasicContentViewOnly.jsp) (revision 1447dc2ae2077d18831a17b7c2f309390adb0687) +++ lams_tool_vote/web/authoring/BasicContentViewOnly.jsp (.../BasicContentViewOnly.jsp) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) @@ -30,17 +30,20 @@
+ - + - - - + + - + + + + - + + + + @@ -293,7 +299,10 @@ - + + + +
- + +
- + +
+
Index: lams_tool_vote/web/export/ExportContent.jsp =================================================================== diff -u -r418f65577010d4ad648867396f4e14cd36d2c723 -r369b6c2ca857c6b74ee143e081534f50b0b94106 --- lams_tool_vote/web/export/ExportContent.jsp (.../ExportContent.jsp) (revision 418f65577010d4ad648867396f4e14cd36d2c723) +++ lams_tool_vote/web/export/ExportContent.jsp (.../ExportContent.jsp) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) @@ -255,12 +255,18 @@ - +
Index: lams_tool_vote/web/monitoring/AllSessionsSummary.jsp =================================================================== diff -u -r418f65577010d4ad648867396f4e14cd36d2c723 -r369b6c2ca857c6b74ee143e081534f50b0b94106 --- lams_tool_vote/web/monitoring/AllSessionsSummary.jsp (.../AllSessionsSummary.jsp) (revision 418f65577010d4ad648867396f4e14cd36d2c723) +++ lams_tool_vote/web/monitoring/AllSessionsSummary.jsp (.../AllSessionsSummary.jsp) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) @@ -33,21 +33,89 @@ - +
- - + - - @@ -56,7 +124,7 @@ - + Index: lams_tool_vote/web/monitoring/Edit.jsp =================================================================== diff -u -r418f65577010d4ad648867396f4e14cd36d2c723 -r369b6c2ca857c6b74ee143e081534f50b0b94106 --- lams_tool_vote/web/monitoring/Edit.jsp (.../Edit.jsp) (revision 418f65577010d4ad648867396f4e14cd36d2c723) +++ lams_tool_vote/web/monitoring/Edit.jsp (.../Edit.jsp) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) @@ -31,17 +31,17 @@ - - + + - + - +
- + + + + + + + +
+ +
+
- + + + + + + +
+ +
+
@@ -85,7 +153,7 @@
- +
Index: lams_tool_vote/web/monitoring/IndividualSessionSummary.jsp =================================================================== diff -u -r418f65577010d4ad648867396f4e14cd36d2c723 -r369b6c2ca857c6b74ee143e081534f50b0b94106 --- lams_tool_vote/web/monitoring/IndividualSessionSummary.jsp (.../IndividualSessionSummary.jsp) (revision 418f65577010d4ad648867396f4e14cd36d2c723) +++ lams_tool_vote/web/monitoring/IndividualSessionSummary.jsp (.../IndividualSessionSummary.jsp) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) @@ -32,21 +32,89 @@ - +
- - - - @@ -62,13 +130,13 @@ - + - @@ -78,7 +146,7 @@ @@ -122,7 +190,7 @@ - + - + Index: lams_tool_vote/web/monitoring/Instructions.jsp =================================================================== diff -u -r2a5c5ae4d68939c91b7eb7a77ae5ffc60a87ebf5 -r369b6c2ca857c6b74ee143e081534f50b0b94106 --- lams_tool_vote/web/monitoring/Instructions.jsp (.../Instructions.jsp) (revision 2a5c5ae4d68939c91b7eb7a77ae5ffc60a87ebf5) +++ lams_tool_vote/web/monitoring/Instructions.jsp (.../Instructions.jsp) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) @@ -32,19 +32,19 @@ -
- + + + + + + + +
+ +
+
+
- + + + + + + +
+ +
+
-  ( ) + +  ( )
- +
@@ -132,17 +200,17 @@ - + - + - + @@ -171,7 +239,7 @@ - +  ( ) @@ -216,7 +284,7 @@
+
- +
- +
@@ -76,14 +76,14 @@
- +
- +
Index: lams_tool_vote/web/monitoring/LearnerRep.jsp =================================================================== diff -u -r418f65577010d4ad648867396f4e14cd36d2c723 -r369b6c2ca857c6b74ee143e081534f50b0b94106 --- lams_tool_vote/web/monitoring/LearnerRep.jsp (.../LearnerRep.jsp) (revision 418f65577010d4ad648867396f4e14cd36d2c723) +++ lams_tool_vote/web/monitoring/LearnerRep.jsp (.../LearnerRep.jsp) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) @@ -52,7 +52,7 @@ - +
@@ -65,7 +65,7 @@ -
+
Index: lams_tool_vote/web/monitoring/MonitoringMaincontent.jsp =================================================================== diff -u -re48a67de27af42221ddce80419f05c1be4680430 -r369b6c2ca857c6b74ee143e081534f50b0b94106 --- lams_tool_vote/web/monitoring/MonitoringMaincontent.jsp (.../MonitoringMaincontent.jsp) (revision e48a67de27af42221ddce80419f05c1be4680430) +++ lams_tool_vote/web/monitoring/MonitoringMaincontent.jsp (.../MonitoringMaincontent.jsp) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) @@ -64,9 +64,9 @@ initEditor("instructions"); initEditor("optionContent0"); - - - + + + initEditor(""); @@ -147,14 +147,9 @@ - -
+ +

- - -
-

-
@@ -43,12 +43,12 @@ - - + + - + Index: lams_tool_vote/web/monitoring/SummaryContent.jsp =================================================================== diff -u -r418f65577010d4ad648867396f4e14cd36d2c723 -r369b6c2ca857c6b74ee143e081534f50b0b94106 --- lams_tool_vote/web/monitoring/SummaryContent.jsp (.../SummaryContent.jsp) (revision 418f65577010d4ad648867396f4e14cd36d2c723) +++ lams_tool_vote/web/monitoring/SummaryContent.jsp (.../SummaryContent.jsp) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) @@ -31,7 +31,7 @@ - +
@@ -42,12 +42,12 @@ - - + + - + Index: lams_tool_vote/web/monitoring/VoteNominationViewer.jsp =================================================================== diff -u -r6ccf686e9130dce846ee9229dd7a607277f02437 -r369b6c2ca857c6b74ee143e081534f50b0b94106 --- lams_tool_vote/web/monitoring/VoteNominationViewer.jsp (.../VoteNominationViewer.jsp) (revision 6ccf686e9130dce846ee9229dd7a607277f02437) +++ lams_tool_vote/web/monitoring/VoteNominationViewer.jsp (.../VoteNominationViewer.jsp) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) @@ -36,15 +36,15 @@
- +
- +