Fisheye: Tag 1.71 refers to a dead (removed) revision in file `lams_tool_vote/conf/language/ApplicationResources.properties'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `lams_tool_vote/conf/language/ApplicationResources_ar_JO.properties'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `lams_tool_vote/conf/language/ApplicationResources_en_AU.properties'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `lams_tool_vote/conf/language/ApplicationResources_it_IT.properties'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.8 refers to a dead (removed) revision in file `lams_tool_vote/conf/language/ApplicationResources_ko_KR.properties'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.9 refers to a dead (removed) revision in file `lams_tool_vote/conf/language/ApplicationResources_no_NO.properties'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `lams_tool_vote/conf/language/ApplicationResources_pl_PL.properties'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `lams_tool_vote/conf/language/ApplicationResources_vi_VN.properties'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_vote/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/conf/language/lams/ApplicationResources_en_AU.properties,v diff -u -r1.29 -r1.30 --- lams_tool_vote/conf/language/lams/ApplicationResources_en_AU.properties 10 Jan 2014 17:27:30 -0000 1.29 +++ lams_tool_vote/conf/language/lams/ApplicationResources_en_AU.properties 23 Jan 2014 23:53:16 -0000 1.30 @@ -89,8 +89,7 @@ label.learner.progress =Learner Progress Report error.system.vote =A system exception has occured: {0}. Contact your system administrator error.duplicate.nomination =Please correct this: You have entered the same nomination more than once. -label.total.students =Total number of possible learners: -label.total.completed.students =Total number of learners that completed voting: +label.total.number.students.voted =A total of {0} over {1} learners have voted label.open.vote =Open Vote label.total.votes =Total votes label.select.session =Please select a group to view class votes summary Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/SessionDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/Attic/SessionDTO.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/SessionDTO.java 23 Jan 2014 23:53:14 -0000 1.1 @@ -0,0 +1,245 @@ +/*************************************************************************** + * 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 version 2.0 + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * ***********************************************************************/ + +package org.lamsfoundation.lams.tool.vote; + +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang.builder.ToStringBuilder; + +/** + *

+ * DTO that holds summary data for all the sessions + *

+ * + * @author Ozgur Demirtas + */ +public class SessionDTO implements Comparable { + private String sessionUserCount; + private String completedSessionUserCount; + private String sessionId; + private String sessionName; + private Map mapStandardNominationsContent; + private Map mapStandardNominationsHTMLedContent; + + private Map mapStandardQuestionUid; + private Map mapStandardToolSessionUid; + + /** + * @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 mapStandardToolSessionUid. + */ + public Map getMapStandardToolSessionUid() { + return mapStandardToolSessionUid; + } + + /** + * @param mapStandardToolSessionUid + * The mapStandardToolSessionUid to set. + */ + public void setMapStandardToolSessionUid(Map mapStandardToolSessionUid) { + this.mapStandardToolSessionUid = mapStandardToolSessionUid; + } + + private Map mapStandardUserCount; + private Map mapStandardRatesContent; + private List listUserEntries; + private String existsOpenVote; + + /** + * @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 mapStandardRatesContent. + */ + public Map getMapStandardRatesContent() { + return mapStandardRatesContent; + } + + /** + * @param mapStandardRatesContent + * The mapStandardRatesContent to set. + */ + public void setMapStandardRatesContent(Map mapStandardRatesContent) { + this.mapStandardRatesContent = mapStandardRatesContent; + } + + /** + * @return Returns the mapStandardUserCount. + */ + public Map getMapStandardUserCount() { + return mapStandardUserCount; + } + + /** + * @param mapStandardUserCount + * The mapStandardUserCount to set. + */ + public void setMapStandardUserCount(Map mapStandardUserCount) { + this.mapStandardUserCount = mapStandardUserCount; + } + + public String toString() { + return new ToStringBuilder(this).append("sessionId", getSessionId()).toString(); + } + + public int compareTo(Object o) { + SessionDTO sessionDTO = (SessionDTO) o; + + if (sessionDTO == null) + return 1; + else + return (int) (new Long(sessionId).longValue() - new Long(sessionDTO.sessionId).longValue()); + } + + /** + * @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 sessionId. + */ + public String getSessionId() { + return sessionId; + } + + /** + * @param sessionId + * The sessionId to set. + */ + public void setSessionId(String sessionId) { + this.sessionId = sessionId; + } + + /** + * @return Returns the sessionUserCount. + */ + public String getSessionUserCount() { + return sessionUserCount; + } + + /** + * @param sessionUserCount + * The sessionUserCount to set. + */ + public void setSessionUserCount(String sessionUserCount) { + this.sessionUserCount = sessionUserCount; + } + + /** + * @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 existsOpenVote. + */ + public String getExistsOpenVote() { + return existsOpenVote; + } + + /** + * @param existsOpenVote + * The existsOpenVote to set. + */ + public void setExistsOpenVote(String existsOpenVote) { + this.existsOpenVote = existsOpenVote; + } + + /** + * @return Returns the sessionName. + */ + public String getSessionName() { + return sessionName; + } + + /** + * @param sessionName + * The sessionName to set. + */ + public void setSessionName(String sessionName) { + this.sessionName = sessionName; + } +} Fisheye: Tag 1.7 refers to a dead (removed) revision in file `lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAllSessionsDTO.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java,v diff -u -r1.54 -r1.55 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java 17 Jan 2014 22:18:24 -0000 1.54 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java 23 Jan 2014 23:53:14 -0000 1.55 @@ -50,6 +50,7 @@ public static final String LOAD_LEARNER = "loadLearner"; public static final String ALL_NOMINATIONS = "allNominations"; public static final String LOAD_MONITORING_CONTENT = "loadMonitoring"; + public static final String MONITORING_STARTER_REDIRECT = "monitoringStarterRedirect"; public static final String LOAD_MONITORING_CONTENT_EDITACTIVITY = "loadMonitoringEditActivity"; public static final String EXPORT_PORTFOLIO = "exportPortfolio"; public static final String INDIVIDUAL_REPORT = "individualReport"; @@ -74,7 +75,6 @@ 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"; public static final String DEFAULT_VOTING_INSTRUCTIONS = "Instructions"; public static final String NOTEBOOK_ENTRIES_EXIST = "notebookEntriesExist"; @@ -97,7 +97,6 @@ public static final String DEFINE_LATER_EDIT_ACTIVITY = "defineLaterEditActivity"; public static final String ACTIVE_MODULE = "activeModule"; public static final String DEFINE_LATER_IN_EDIT_MODE = "defineLaterInEditMode"; - public static final String SUBMIT_SUCCESS = "sbmtSuccess"; public static final String REQUEST_LEARNING_REPORT = "requestLearningReport"; public static final String REQUEST_LEARNING_REPORT_PROGRESS = "requestLearningReportProgress"; public static final String VOTE_GENERAL_AUTHORING_DTO = "voteGeneralAuthoringDTO"; @@ -211,7 +210,6 @@ public static final String RICHTEXT_TITLE = "richTextTitle"; public static final String RICHTEXT_INSTRUCTIONS = "richTextInstructions"; public static final String RICHTEXT_BLANK = "

 

"; - public static final String LIST_VOTE_ALLSESSIONS_DTO = "listVoteAllSessionsDTO"; public static final String COUNT_SESSION_COMPLETE = "countSessionComplete"; public static final String COUNT_ALL_USERS = "countAllUsers"; @@ -226,8 +224,6 @@ public static final String COMPLETED = "COMPLETED"; public static final String MAP_TOOL_SESSIONS = "mapToolSessions"; - public static final Integer MAX_TOOL_SESSION_COUNT = new Integer(500); - public static final String IS_TOOL_SESSION_CHANGED = "isToolSessionChanged"; public static final String OPTION_OFF = "false"; public static final String ACTIVITY_TITLE = "activityTitle"; public static final String ACTIVITY_INSTRUCTIONS = "activityInstructions"; @@ -258,7 +254,6 @@ public static final String CHECK_ALL_SESSIONS_COMPLETED = "checkAllSessionsCompleted"; public static final String FROM_TOOL_CONTENT_ID = "fromToolContentId"; public static final String TO_TOOL_CONTENT_ID = "toToolContentId"; - public static final String LEARNER_REPORT = "learnerReport"; public static final String MAP_USER_RESPONSES = "mapUserResponses"; public static final String MAP_MAIN_REPORT = "mapMainReport"; public static final String MAP_STATS = "mapStats"; @@ -272,16 +267,11 @@ public static final String MONITORING_REPORT = "monitoringReport"; public static final String MONITORING_ERROR = "monitoringError"; public static final String MAP_MONITORING_QUESTIONS = "mapMonitoringQuestions"; - public static final String SUMMARY_TOOL_SESSIONS = "summaryToolSessions"; - public static final String SUMMARY_TOOL_SESSIONS_ID = "summaryToolSessionsId"; public static final String MONITORED_CONTENT_ID = "monitoredContentId"; public static final String EDITACTIVITY_EDITMODE = "editActivityEditMode"; public static final String VALIDATION_ERROR = "validationError"; public static final String FORM_INDEX = "formIndex"; - public static final String CURRENT_MONITORED_TOOL_SESSION = "currentMonitoredToolSession"; - public static final String SELECTION_CASE = "selectionCase"; public static final String LIST_MONITORED_ANSWERS_CONTAINER_DTO = "listMonitoredAnswersContainerDto"; - public static final String GROUP_NAME = "groupName"; public static final String TIMEZONE = "timeZone"; public static final String PREVIEW_ONLY = "previewOnly"; Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteGeneralAuthoringDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/Attic/VoteGeneralAuthoringDTO.java,v diff -u -r1.9 -r1.10 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteGeneralAuthoringDTO.java 17 Jan 2014 22:18:24 -0000 1.9 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteGeneralAuthoringDTO.java 23 Jan 2014 23:53:14 -0000 1.10 @@ -37,8 +37,6 @@ public class VoteGeneralAuthoringDTO implements Comparable { protected String activeModule; protected String defineLaterInEditMode; - protected String submissionAttempt; - protected String sbmtSuccess; protected String exceptionMaxNominationInvalid; protected String toolContentID; protected String defaultContentId; @@ -78,7 +76,6 @@ protected Map mapNominationContent; protected String editableNominationText; protected String editableNominationFeedback; - protected String isToolSessionChanged; protected String responseId; protected String currentUid; protected List dataFlowObjectNames; @@ -302,36 +299,6 @@ } /** - * @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 submissionAttempt. - */ - public String getSubmissionAttempt() { - return submissionAttempt; - } - - /** - * @param submissionAttempt - * The submissionAttempt to set. - */ - public void setSubmissionAttempt(String submissionAttempt) { - this.submissionAttempt = submissionAttempt; - } - - /** * @return Returns the toolContentID. */ public String getToolContentID() { @@ -508,8 +475,8 @@ public String toString() { return new ToStringBuilder(this).append("activeModule: ", activeModule) .append("contentFolderID: ", contentFolderID).append("editableQuestionText: ", editableQuestionText) - .append("reflectionSubject: ", reflectionSubject).append("submissionAttempt: ", submissionAttempt) - .append("mapNominationContent: ", mapNominationContent).append("sbmtSuccess: ", sbmtSuccess) + .append("reflectionSubject: ", reflectionSubject) + .append("mapNominationContent: ", mapNominationContent) .append("exceptionMaxNominationInvalid: ", exceptionMaxNominationInvalid) .append("toolContentID: ", toolContentID).append("defaultContentId: ", defaultContentId) .append("defaultContentIdStr: ", defaultContentIdStr).append("reflect: ", reflect) @@ -680,21 +647,6 @@ } /** - * @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 currentUid. */ public String getCurrentUid() { Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteGeneralMonitoringDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/Attic/VoteGeneralMonitoringDTO.java,v diff -u -r1.4 -r1.5 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteGeneralMonitoringDTO.java 17 Jan 2014 22:18:24 -0000 1.4 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteGeneralMonitoringDTO.java 23 Jan 2014 23:53:14 -0000 1.5 @@ -22,23 +22,20 @@ /* $$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 + *

+ * DTO that holds monitoring flow properties *

* * @author Ozgur Demirtas */ -public class VoteGeneralMonitoringDTO implements Comparable -{ +public class VoteGeneralMonitoringDTO implements Comparable { protected String currentMonitoringTab; - protected String sbmtSuccess; protected String defineLaterInEditMode; protected String requestLearningReport; protected String userExceptionNoToolSessions; @@ -50,646 +47,588 @@ 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 showOpenVotesSection; - - protected List listVoteAllSessionsDTO; + protected String activityTitle; + protected String activityInstructions; + protected String defaultOptionContent; + protected String countAllUsers; + protected String countSessionComplete; + protected String isPortfolioExport; + protected String existsOpenVotes; + protected String responseId; + protected String currentUid; + + protected String toolContentID; + protected Map mapOptionsContent; + protected List listMonitoredAnswersContainerDto; + protected List listUserEntries; + + protected List sessionDTOs; 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; - + protected String contentFolderID; /** * @return Returns the userExceptionContentDoesNotExist. */ public String getUserExceptionContentDoesNotExist() { - return userExceptionContentDoesNotExist; + return userExceptionContentDoesNotExist; } + /** - * @param userExceptionContentDoesNotExist The userExceptionContentDoesNotExist to set. + * @param userExceptionContentDoesNotExist + * The userExceptionContentDoesNotExist to set. */ - public void setUserExceptionContentDoesNotExist( - String userExceptionContentDoesNotExist) { - this.userExceptionContentDoesNotExist = userExceptionContentDoesNotExist; + public void setUserExceptionContentDoesNotExist(String userExceptionContentDoesNotExist) { + this.userExceptionContentDoesNotExist = userExceptionContentDoesNotExist; } + /** * @return Returns the userExceptionNoStudentActivity. */ public String getUserExceptionNoStudentActivity() { - return userExceptionNoStudentActivity; + return userExceptionNoStudentActivity; } + /** - * @param userExceptionNoStudentActivity The userExceptionNoStudentActivity to set. + * @param userExceptionNoStudentActivity + * The userExceptionNoStudentActivity to set. */ - public void setUserExceptionNoStudentActivity( - String userExceptionNoStudentActivity) { - this.userExceptionNoStudentActivity = userExceptionNoStudentActivity; + public void setUserExceptionNoStudentActivity(String userExceptionNoStudentActivity) { + this.userExceptionNoStudentActivity = userExceptionNoStudentActivity; } + /** * @return Returns the activeModule. */ public String getActiveModule() { - return activeModule; + return activeModule; } + /** - * @param activeModule The activeModule to set. + * @param activeModule + * The activeModule to set. */ public void setActiveModule(String activeModule) { - this.activeModule = activeModule; + this.activeModule = activeModule; } + /** * @return Returns the currentTab. */ public String getCurrentTab() { - return currentTab; + return currentTab; } + /** - * @param currentTab The currentTab to set. + * @param currentTab + * The currentTab to set. */ public void setCurrentTab(String currentTab) { - this.currentTab = currentTab; + this.currentTab = currentTab; } + /** * @return Returns the defaultOptionContent. */ public String getDefaultOptionContent() { - return defaultOptionContent; + return defaultOptionContent; } + /** - * @param defaultOptionContent The defaultOptionContent to set. + * @param defaultOptionContent + * The defaultOptionContent to set. */ public void setDefaultOptionContent(String defaultOptionContent) { - this.defaultOptionContent = defaultOptionContent; + this.defaultOptionContent = defaultOptionContent; } + /** * @return Returns the userExceptionContentInUse. */ public String getUserExceptionContentInUse() { - return userExceptionContentInUse; + return userExceptionContentInUse; } + /** - * @param userExceptionContentInUse The userExceptionContentInUse to set. + * @param userExceptionContentInUse + * The userExceptionContentInUse to set. */ public void setUserExceptionContentInUse(String userExceptionContentInUse) { - this.userExceptionContentInUse = userExceptionContentInUse; + this.userExceptionContentInUse = userExceptionContentInUse; } + /** * @return Returns the activityInstructions. */ public String getActivityInstructions() { - return activityInstructions; + return activityInstructions; } + /** - * @param activityInstructions The activityInstructions to set. + * @param activityInstructions + * The activityInstructions to set. */ public void setActivityInstructions(String activityInstructions) { - this.activityInstructions = activityInstructions; + this.activityInstructions = activityInstructions; } + /** * @return Returns the activityTitle. */ public String getActivityTitle() { - return activityTitle; + return activityTitle; } + /** - * @param activityTitle The activityTitle to set. + * @param activityTitle + * The activityTitle to set. */ public void setActivityTitle(String activityTitle) { - this.activityTitle = activityTitle; + this.activityTitle = activityTitle; } + /** * @return Returns the currentMonitoringTab. */ public String getCurrentMonitoringTab() { - return currentMonitoringTab; + return currentMonitoringTab; } + /** - * @param currentMonitoringTab The currentMonitoringTab to set. + * @param currentMonitoringTab + * The currentMonitoringTab to set. */ public void setCurrentMonitoringTab(String currentMonitoringTab) { - this.currentMonitoringTab = currentMonitoringTab; + this.currentMonitoringTab = currentMonitoringTab; } + /** * @return Returns the defineLaterInEditMode. */ public String getDefineLaterInEditMode() { - return defineLaterInEditMode; + return defineLaterInEditMode; } + /** - * @param defineLaterInEditMode The defineLaterInEditMode to set. + * @param defineLaterInEditMode + * The defineLaterInEditMode to set. */ public void setDefineLaterInEditMode(String defineLaterInEditMode) { - this.defineLaterInEditMode = defineLaterInEditMode; + this.defineLaterInEditMode = defineLaterInEditMode; } + /** * @return Returns the requestLearningReport. */ public String getRequestLearningReport() { - return requestLearningReport; + return requestLearningReport; } + /** - * @param requestLearningReport The requestLearningReport to set. + * @param requestLearningReport + * The requestLearningReport to set. */ public void setRequestLearningReport(String requestLearningReport) { - this.requestLearningReport = 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; + return userExceptionNoToolSessions; } + /** - * @param userExceptionNoToolSessions The userExceptionNoToolSessions to set. + * @param userExceptionNoToolSessions + * The userExceptionNoToolSessions to set. */ - public void setUserExceptionNoToolSessions( - String userExceptionNoToolSessions) { - this.userExceptionNoToolSessions = userExceptionNoToolSessions; + public void setUserExceptionNoToolSessions(String userExceptionNoToolSessions) { + this.userExceptionNoToolSessions = userExceptionNoToolSessions; } + /** * @return Returns the isMonitoredContentInUse. */ public String getIsMonitoredContentInUse() { - return isMonitoredContentInUse; + return isMonitoredContentInUse; } + /** - * @param isMonitoredContentInUse The isMonitoredContentInUse to set. + * @param isMonitoredContentInUse + * The isMonitoredContentInUse to set. */ public void setIsMonitoredContentInUse(String isMonitoredContentInUse) { - this.isMonitoredContentInUse = isMonitoredContentInUse; + this.isMonitoredContentInUse = isMonitoredContentInUse; } - /** * @return Returns the mapOptionsContent. */ public Map getMapOptionsContent() { - return mapOptionsContent; + return mapOptionsContent; } + /** - * @param mapOptionsContent The mapOptionsContent to set. + * @param mapOptionsContent + * The mapOptionsContent to set. */ public void setMapOptionsContent(Map mapOptionsContent) { - this.mapOptionsContent = mapOptionsContent; + this.mapOptionsContent = mapOptionsContent; } - + /** * @return Returns the countAllUsers. */ public String getCountAllUsers() { - return countAllUsers; + return countAllUsers; } + /** - * @param countAllUsers The countAllUsers to set. + * @param countAllUsers + * The countAllUsers to set. */ public void setCountAllUsers(String countAllUsers) { - this.countAllUsers = countAllUsers; + this.countAllUsers = countAllUsers; } + /** * @return Returns the countSessionComplete. */ public String getCountSessionComplete() { - return countSessionComplete; + return countSessionComplete; } + /** - * @param countSessionComplete The countSessionComplete to set. + * @param countSessionComplete + * The countSessionComplete to set. */ public void setCountSessionComplete(String countSessionComplete) { - this.countSessionComplete = countSessionComplete; + this.countSessionComplete = countSessionComplete; } + /** * @return Returns the isPortfolioExport. */ public String getIsPortfolioExport() { - return isPortfolioExport; + return isPortfolioExport; } + /** - * @param isPortfolioExport The isPortfolioExport to set. + * @param isPortfolioExport + * The isPortfolioExport to set. */ public void setIsPortfolioExport(String isPortfolioExport) { - this.isPortfolioExport = 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; + return listMonitoredAnswersContainerDto; } + /** - * @param listMonitoredAnswersContainerDto The listMonitoredAnswersContainerDto to set. + * @param listMonitoredAnswersContainerDto + * The listMonitoredAnswersContainerDto to set. */ - public void setListMonitoredAnswersContainerDto( - List listMonitoredAnswersContainerDto) { - this.listMonitoredAnswersContainerDto = listMonitoredAnswersContainerDto; + public void setListMonitoredAnswersContainerDto(List listMonitoredAnswersContainerDto) { + this.listMonitoredAnswersContainerDto = listMonitoredAnswersContainerDto; } + /** * @return Returns the listUserEntries. */ public List getListUserEntries() { - return listUserEntries; + return listUserEntries; } + /** - * @param listUserEntries The listUserEntries to set. + * @param listUserEntries + * The listUserEntries to set. */ public void setListUserEntries(List listUserEntries) { - this.listUserEntries = listUserEntries; + this.listUserEntries = listUserEntries; } + /** * @return Returns the existsOpenVotes. */ public String getExistsOpenVotes() { - return existsOpenVotes; + return existsOpenVotes; } + /** - * @param existsOpenVotes The existsOpenVotes to set. + * @param existsOpenVotes + * The existsOpenVotes to set. */ public void setExistsOpenVotes(String existsOpenVotes) { - this.existsOpenVotes = existsOpenVotes; + this.existsOpenVotes = existsOpenVotes; } + /** - * @return Returns the selectedToolSessionId. + * @return Returns the sessionDTOs. */ - public String getSelectedToolSessionId() { - return selectedToolSessionId; + public List getSessionDTOs() { + return sessionDTOs; } + /** - * @param selectedToolSessionId The selectedToolSessionId to set. + * @param sessionDTOs + * The sessionDTOs to set. */ - public void setSelectedToolSessionId(String selectedToolSessionId) { - this.selectedToolSessionId = selectedToolSessionId; + public void setSessionDTOs(List sessionDTOs) { + this.sessionDTOs = sessionDTOs; } + /** - * @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; + return mapStandardNominationsContent; } + /** - * @param mapStandardNominationsContent The mapStandardNominationsContent to set. + * @param mapStandardNominationsContent + * The mapStandardNominationsContent to set. */ - public void setMapStandardNominationsContent( - Map mapStandardNominationsContent) { - this.mapStandardNominationsContent = mapStandardNominationsContent; + public void setMapStandardNominationsContent(Map mapStandardNominationsContent) { + this.mapStandardNominationsContent = mapStandardNominationsContent; } + /** * @return Returns the mapStandardNominationsHTMLedContent. */ public Map getMapStandardNominationsHTMLedContent() { - return mapStandardNominationsHTMLedContent; + return mapStandardNominationsHTMLedContent; } + /** - * @param mapStandardNominationsHTMLedContent The mapStandardNominationsHTMLedContent to set. + * @param mapStandardNominationsHTMLedContent + * The mapStandardNominationsHTMLedContent to set. */ - public void setMapStandardNominationsHTMLedContent( - Map mapStandardNominationsHTMLedContent) { - this.mapStandardNominationsHTMLedContent = mapStandardNominationsHTMLedContent; + public void setMapStandardNominationsHTMLedContent(Map mapStandardNominationsHTMLedContent) { + this.mapStandardNominationsHTMLedContent = mapStandardNominationsHTMLedContent; } + /** * @return Returns the mapStandardQuestionUid. */ public Map getMapStandardQuestionUid() { - return mapStandardQuestionUid; + return mapStandardQuestionUid; } + /** - * @param mapStandardQuestionUid The mapStandardQuestionUid to set. + * @param mapStandardQuestionUid + * The mapStandardQuestionUid to set. */ public void setMapStandardQuestionUid(Map mapStandardQuestionUid) { - this.mapStandardQuestionUid = mapStandardQuestionUid; + this.mapStandardQuestionUid = mapStandardQuestionUid; } + /** * @return Returns the mapStandardRatesContent. */ public Map getMapStandardRatesContent() { - return mapStandardRatesContent; + return mapStandardRatesContent; } + /** - * @param mapStandardRatesContent The mapStandardRatesContent to set. + * @param mapStandardRatesContent + * The mapStandardRatesContent to set. */ public void setMapStandardRatesContent(Map mapStandardRatesContent) { - this.mapStandardRatesContent = mapStandardRatesContent; + this.mapStandardRatesContent = mapStandardRatesContent; } + /** * @return Returns the mapStandardToolSessionUid. */ public Map getMapStandardToolSessionUid() { - return mapStandardToolSessionUid; + return mapStandardToolSessionUid; } + /** - * @param mapStandardToolSessionUid The mapStandardToolSessionUid to set. + * @param mapStandardToolSessionUid + * The mapStandardToolSessionUid to set. */ public void setMapStandardToolSessionUid(Map mapStandardToolSessionUid) { - this.mapStandardToolSessionUid = mapStandardToolSessionUid; + this.mapStandardToolSessionUid = mapStandardToolSessionUid; } + /** * @return Returns the mapStandardUserCount. */ public Map getMapStandardUserCount() { - return mapStandardUserCount; + return mapStandardUserCount; } + /** - * @param mapStandardUserCount The mapStandardUserCount to set. + * @param mapStandardUserCount + * The mapStandardUserCount to set. */ public void setMapStandardUserCount(Map mapStandardUserCount) { - this.mapStandardUserCount = mapStandardUserCount; + this.mapStandardUserCount = mapStandardUserCount; } + /** - * @return Returns the showOpenVotesSection. + * @param mapStudentsVoted + * The mapStudentsVoted to set. */ - 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; + this.mapStudentsVoted = mapStudentsVoted; } + /** * @return Returns the mapStudentsVoted. */ public List getMapStudentsVoted() { - return mapStudentsVoted; + return mapStudentsVoted; } + /** * @return Returns the currentUid. */ public String getCurrentUid() { - return currentUid; + return currentUid; } + /** - * @param currentUid The currentUid to set. + * @param currentUid + * The currentUid to set. */ public void setCurrentUid(String currentUid) { - this.currentUid = 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; + return responseId; } + /** - * @param responseId The responseId to set. + * @param responseId + * The responseId to set. */ public void setResponseId(String responseId) { - this.responseId = responseId; + this.responseId = responseId; } + /** * @return Returns the toolContentID. */ public String getToolContentID() { - return toolContentID; + return toolContentID; } + /** - * @param toolContentID The toolContentID to set. + * @param toolContentID + * The toolContentID to set. */ public void setToolContentID(String toolContentID) { - this.toolContentID = toolContentID; + this.toolContentID = toolContentID; } + /** * @return Returns the completedSessionUserCount. */ public String getCompletedSessionUserCount() { - return completedSessionUserCount; + return completedSessionUserCount; } + /** - * @param completedSessionUserCount The completedSessionUserCount to set. + * @param completedSessionUserCount + * The completedSessionUserCount to set. */ public void setCompletedSessionUserCount(String completedSessionUserCount) { - this.completedSessionUserCount = 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; + return sessionUserCount; } + /** - * @param sessionUserCount The sessionUserCount to set. + * @param sessionUserCount + * The sessionUserCount to set. */ public void setSessionUserCount(String sessionUserCount) { - this.sessionUserCount = sessionUserCount; + this.sessionUserCount = sessionUserCount; } - - public String toString() { - return new ToStringBuilder(this) - .append("toolContentID: ", toolContentID) - .append("activeModule: ", activeModule) - .append("monitoredContentInUse: ", monitoredContentInUse) - .append("currentMonitoringTab: ", currentMonitoringTab) - .append("selectionCase: ", selectionCase) - .append("isToolSessionChanged: ", isToolSessionChanged) - .append("currentTab: ", currentTab) - .append("sbmtSuccess: ", sbmtSuccess) - .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("showOpenVotesSection: ", showOpenVotesSection) - .append("mapStudentsVoted: ", mapStudentsVoted) - .append("responseId: ", responseId) - .append("currentUid: ", currentUid) - .append("sessionUserCount: ", sessionUserCount) - .append("completedSessionUserCount: ", completedSessionUserCount) - .append("completedSessionUserPercent: ", completedSessionUserPercent) - .toString(); + + public String toString() { + return new ToStringBuilder(this).append("toolContentID: ", toolContentID) + .append("activeModule: ", activeModule).append("monitoredContentInUse: ", monitoredContentInUse) + .append("currentMonitoringTab: ", currentMonitoringTab).append("currentTab: ", currentTab) + .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("listMonitoredAnswersContainerDto: ", listMonitoredAnswersContainerDto) + .append("listUserEntries: ", listUserEntries).append("existsOpenVotes: ", existsOpenVotes) + .append("sessionDTOs: ", sessionDTOs).append("mapStudentsVoted: ", mapStudentsVoted) + .append("responseId: ", responseId).append("currentUid: ", currentUid) + .append("sessionUserCount: ", sessionUserCount) + .append("completedSessionUserCount: ", completedSessionUserCount).toString(); } - public int compareTo(Object o) - { - VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = (VoteGeneralMonitoringDTO) o; - - if (voteGeneralMonitoringDTO == null) - return 1; - else - return 0; + public int compareTo(Object o) { + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = (VoteGeneralMonitoringDTO) o; + + if (voteGeneralMonitoringDTO == null) + return 1; + else + return 0; } - /** + /** * @return Returns the monitoredContentInUse. */ public String getMonitoredContentInUse() { - return monitoredContentInUse; + return monitoredContentInUse; } + /** - * @param monitoredContentInUse The monitoredContentInUse to set. + * @param monitoredContentInUse + * The monitoredContentInUse to set. */ public void setMonitoredContentInUse(String monitoredContentInUse) { - this.monitoredContentInUse = monitoredContentInUse; + this.monitoredContentInUse = monitoredContentInUse; } + /** * @return Returns the contentFolderID. */ public String getContentFolderID() { - return contentFolderID; + return contentFolderID; } + /** - * @param contentFolderID The contentFolderID to set. + * @param contentFolderID + * The contentFolderID to set. */ public void setContentFolderID(String contentFolderID) { - this.contentFolderID = contentFolderID; + this.contentFolderID = contentFolderID; } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteMonitoredAnswersDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/Attic/VoteMonitoredAnswersDTO.java,v diff -u -r1.7 -r1.8 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteMonitoredAnswersDTO.java 26 Sep 2006 02:26:47 -0000 1.7 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteMonitoredAnswersDTO.java 23 Jan 2014 23:53:14 -0000 1.8 @@ -27,129 +27,143 @@ import org.apache.commons.lang.builder.ToStringBuilder; - /** - *

DTO that holds question/candidate answers data as well as user attempts data for jsp purposes

+ *

+ * DTO that holds question/candidate answers data as well as user attempts data for jsp purposes + *

* * @author Ozgur Demirtas */ -public class VoteMonitoredAnswersDTO implements Comparable -{ - protected String questionUid; - - private String question; - - private String attemptUid; - - private List candidateAnswers; - - private Map questionAttempts; - - - private String sessionId; - +public class VoteMonitoredAnswersDTO implements Comparable { + protected String questionUid; + + private String question; + + private String attemptUid; + + private List candidateAnswers; + + private Map questionAttempts; + + private String sessionId; + private String sessionName; - + /** * @return Returns the sessionId. */ public String getSessionId() { - return sessionId; + return sessionId; } + /** - * @param sessionId The sessionId to set. + * @param sessionId + * The sessionId to set. */ public void setSessionId(String sessionId) { - this.sessionId = sessionId; + this.sessionId = sessionId; } + /** * @return Returns the sessionName. */ public String getSessionName() { - return sessionName; + return sessionName; } + /** - * @param sessionName The sessionName to set. + * @param sessionName + * The sessionName to set. */ public void setSessionName(String sessionName) { - this.sessionName = sessionName; + this.sessionName = sessionName; } - /** - * @return Returns the candidateAnswers. - */ - public List getCandidateAnswers() { - return candidateAnswers; - } - /** - * @param candidateAnswers The candidateAnswers to set. - */ - public void setCandidateAnswers(List candidateAnswers) { - this.candidateAnswers = candidateAnswers; - } - /** - * @return Returns the question. - */ - public String getQuestion() { - return question; - } - /** - * @param question The question to set. - */ - public void setQuestion(String question) { - this.question = question; - } - /** - * @return Returns the questionUid. - */ - public String getQuestionUid() { - return questionUid; - } - /** - * @param questionUid The questionUid to set. - */ - public void setQuestionUid(String questionUid) { - this.questionUid = questionUid; - } - - /** - * @return Returns the questionAttempts. - */ - public Map getQuestionAttempts() { - return questionAttempts; - } - /** - * @param questionAttempts The questionAttempts to set. - */ - public void setQuestionAttempts(Map questionAttempts) { - this.questionAttempts = questionAttempts; - } - - public String toString() { - return new ToStringBuilder(this) - .append("question", getQuestion()) - .toString(); + + /** + * @return Returns the candidateAnswers. + */ + public List getCandidateAnswers() { + return candidateAnswers; } - - public int compareTo(Object o) - { - VoteMonitoredAnswersDTO voteMonitoredAnswersDTO = (VoteMonitoredAnswersDTO) o; - - if (voteMonitoredAnswersDTO == null) - return 1; - else - return (int) (new Long(questionUid).longValue() - new Long(voteMonitoredAnswersDTO.questionUid).longValue()); + + /** + * @param candidateAnswers + * The candidateAnswers to set. + */ + public void setCandidateAnswers(List candidateAnswers) { + this.candidateAnswers = candidateAnswers; } - + /** + * @return Returns the question. + */ + public String getQuestion() { + return question; + } + + /** + * @param question + * The question to set. + */ + public void setQuestion(String question) { + this.question = question; + } + + /** + * @return Returns the questionUid. + */ + public String getQuestionUid() { + return questionUid; + } + + /** + * @param questionUid + * The questionUid to set. + */ + public void setQuestionUid(String questionUid) { + this.questionUid = questionUid; + } + + /** + * @return Returns the questionAttempts. + */ + public Map getQuestionAttempts() { + return questionAttempts; + } + + /** + * @param questionAttempts + * The questionAttempts to set. + */ + public void setQuestionAttempts(Map questionAttempts) { + this.questionAttempts = questionAttempts; + } + + public String toString() { + return new ToStringBuilder(this).append("question", getQuestion()).toString(); + } + + public int compareTo(Object o) { + VoteMonitoredAnswersDTO voteMonitoredAnswersDTO = (VoteMonitoredAnswersDTO) o; + + if (voteMonitoredAnswersDTO == null) + return 1; + else + return (int) (new Long(questionUid).longValue() - new Long(voteMonitoredAnswersDTO.questionUid).longValue()); + } + + /** * @return Returns the attemptUid. */ public String getAttemptUid() { - return attemptUid; + return attemptUid; } + /** - * @param attemptUid The attemptUid to set. + * @param attemptUid + * The attemptUid to set. */ public void setAttemptUid(String attemptUid) { - this.attemptUid = attemptUid; + this.attemptUid = attemptUid; } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/Attic/VoteUtils.java,v diff -u -r1.33 -r1.34 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java 17 Jan 2014 22:18:24 -0000 1.33 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java 23 Jan 2014 23:53:14 -0000 1.34 @@ -288,31 +288,6 @@ } /** - * builds a String based map from a list convertToMap(List sessionsList) - * - * @param sessionsList - * @return Map - */ - public static Map convertToStringMap(List sessionsList, String listType) { - Map map = new TreeMap(new VoteComparator()); - - Iterator listIterator = sessionsList.iterator(); - Long mapIndex = new Long(1); - - while (listIterator.hasNext()) { - if (listType.equals("String")) { - String text = (String) listIterator.next(); - map.put(mapIndex.toString(), text); - } else if (listType.equals("Long")) { - Long LongValue = (Long) listIterator.next(); - map.put(mapIndex.toString(), LongValue.toString()); - } - mapIndex = new Long(mapIndex.longValue() + 1); - } - return map; - } - - /** * find out if the content is in use or not. If it is in use, the author can not modify it. The idea of content * being in use is, once any one learner starts using a particular content that content should become unmodifiable. * Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteSessionDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteSessionDAO.java,v diff -u -r1.6 -r1.7 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteSessionDAO.java 2 Jan 2014 23:12:51 -0000 1.6 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteSessionDAO.java 23 Jan 2014 23:53:16 -0000 1.7 @@ -58,7 +58,7 @@ void addVoteUsers(Long voteSessionId, VoteQueUsr user); - List getSessionsFromContent(VoteContent voteContent); + List getSessionsFromContent(VoteContent voteContent); List getSessionNamesFromContent(VoteContent voteContent); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUserDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUserDAO.java,v diff -u -r1.7 -r1.8 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUserDAO.java 17 Sep 2006 06:29:16 -0000 1.7 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUserDAO.java 23 Jan 2014 23:53:16 -0000 1.8 @@ -20,7 +20,6 @@ * http://www.gnu.org/licenses/gpl.txt * ***********************************************************************/ - package org.lamsfoundation.lams.tool.vote.dao; import java.util.List; @@ -31,34 +30,34 @@ /** * @author Ozgur Demirtas * - *

Interface that defines the contract for VoteQueUsr access

+ *

+ * Interface that defines the contract for VoteQueUsr access + *

*/ public interface IVoteUserDAO { public VoteQueUsr getVoteUserByUID(Long uid); - - public VoteQueUsr findVoteUserById(Long userId); - - public List getVoteUserBySessionOnly(final VoteSession voteSession); - - public VoteQueUsr getVoteUserBySession(final Long queUsrId, final Long voteSessionId); - - public int getCompletedVoteUserBySessionUid(final Long voteSessionUid); - - public List getVoteUserBySessionUid(final Long voteSessionUid); - - public VoteQueUsr getVoteQueUsrById(long voteQueUsrId); - - public void saveVoteUser(VoteQueUsr voteUser); - + + public VoteQueUsr findVoteUserById(Long userId); + + public VoteQueUsr getVoteUserBySession(final Long queUsrId, final Long voteSessionId); + + public int getCompletedVoteUserBySessionUid(final Long voteSessionUid); + + public List getVoteUserBySessionUid(final Long voteSessionUid); + + public VoteQueUsr getVoteQueUsrById(long voteQueUsrId); + + public void saveVoteUser(VoteQueUsr voteUser); + public void updateVoteUser(VoteQueUsr voteUser); - - public List getUserBySessionOnly(final VoteSession voteSession); + public List getUserBySessionOnly(final VoteSession voteSession); + public void removeVoteUserById(Long userId); public void removeVoteUser(VoteQueUsr voteUser); - + public int getNumberOfUsers(VoteSession voteSession); - - public int getTotalNumberOfUsers(); + + public int getTotalNumberOfUsers(); } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteSessionDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteSessionDAO.java,v diff -u -r1.7 -r1.8 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteSessionDAO.java 2 Jan 2014 23:12:51 -0000 1.7 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteSessionDAO.java 23 Jan 2014 23:53:16 -0000 1.8 @@ -140,7 +140,7 @@ } - public List getSessionsFromContent(VoteContent voteContent) { + public List getSessionsFromContent(VoteContent voteContent) { return (getHibernateTemplate().findByNamedParam(GET_SESSIONS_FROM_CONTENT, "voteContent", voteContent)); } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUserDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUserDAO.java,v diff -u -r1.9 -r1.10 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUserDAO.java 4 Jul 2013 15:01:26 -0000 1.9 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUserDAO.java 23 Jan 2014 23:53:16 -0000 1.10 @@ -34,181 +34,134 @@ /** * @author Ozgur Demirtas - *

Hibernate implementation for database access to Voting users (learners) for the voting tool.

+ *

+ * Hibernate implementation for database access to Voting users (learners) for the voting tool. + *

*/ public class VoteUserDAO extends HibernateDaoSupport implements IVoteUserDAO { - - private static final String FIND_VOTE_USR_CONTENT = "from " + VoteQueUsr.class.getName() + " as voteu where que_usr_id=?"; - - private static final String COUNT_USERS_IN_SESSION = "select voteu.queUsrId from VoteQueUsr voteu where voteu.voteSession= :voteSession"; - - private static final String LOAD_USER_FOR_SESSION = "from voteQueUsr in class VoteQueUsr where voteQueUsr.voteSessionId= :voteSessionId"; - - - public VoteQueUsr getVoteUserByUID(Long uid) - { - String query = "from VoteQueUsr user where user.uid=?"; - - List list = getSession().createQuery(query) - .setLong(0,uid.longValue()) - .list(); - - if(list != null && list.size() > 0){ - VoteQueUsr voteu = (VoteQueUsr) list.get(0); - return voteu; - } - return null; + + private static final String FIND_VOTE_USR_CONTENT = "from " + VoteQueUsr.class.getName() + + " as voteu where que_usr_id=?"; + + private static final String COUNT_USERS_IN_SESSION = "select voteu.queUsrId from VoteQueUsr voteu where voteu.voteSession= :voteSession"; + + private static final String LOAD_USER_FOR_SESSION = "from voteQueUsr in class VoteQueUsr where voteQueUsr.voteSessionId= :voteSessionId"; + + public VoteQueUsr getVoteUserByUID(Long uid) { + String query = "from VoteQueUsr user where user.uid=?"; + + List list = getSession().createQuery(query).setLong(0, uid.longValue()).list(); + + if (list != null && list.size() > 0) { + VoteQueUsr voteu = (VoteQueUsr) list.get(0); + return voteu; } - - - public VoteQueUsr findVoteUserById(Long userId) - { - String query = "from VoteQueUsr user where user.queUsrId=?"; - - List list = getSession().createQuery(query) - .setLong(0,userId.longValue()) - .list(); - - if(list != null && list.size() > 0){ - VoteQueUsr voteu = (VoteQueUsr) list.get(0); - return voteu; - } - return null; + return null; + } + + public VoteQueUsr findVoteUserById(Long userId) { + String query = "from VoteQueUsr user where user.queUsrId=?"; + + List list = getSession().createQuery(query).setLong(0, userId.longValue()).list(); + + if (list != null && list.size() > 0) { + VoteQueUsr voteu = (VoteQueUsr) list.get(0); + return voteu; } - - - public List getVoteUserBySessionOnly(final VoteSession voteSession) - { - List list = getSession().createQuery(LOAD_USER_FOR_SESSION) - .setLong("voteSessionId", voteSession.getUid().longValue()) - .list(); - return list; + return null; } - public List getVoteUserBySessionUid(final Long voteSessionUid) - { - List list = getSession().createQuery(LOAD_USER_FOR_SESSION) - .setLong("voteSessionId", voteSessionUid.longValue()) - .list(); - return list; + public List getVoteUserBySessionUid(final Long voteSessionUid) { + List list = getSession().createQuery(LOAD_USER_FOR_SESSION) + .setLong("voteSessionId", voteSessionUid.longValue()).list(); + return list; } - public int getCompletedVoteUserBySessionUid(final Long voteSessionUid) - { - List list = getSession().createQuery(LOAD_USER_FOR_SESSION) - .setLong("voteSessionId", voteSessionUid.longValue()) - .list(); - - int completedSessionUserCount=0; - if(list != null && list.size() > 0){ - Iterator listIterator=list.iterator(); - while (listIterator.hasNext()) - { - VoteQueUsr user=(VoteQueUsr)listIterator.next(); - logger.debug("user: " + user); - if (user.getVoteSession().getSessionStatus().equals("COMPLETED")) - { - ++completedSessionUserCount; - } - } + public int getCompletedVoteUserBySessionUid(final Long voteSessionUid) { + List list = getSession().createQuery(LOAD_USER_FOR_SESSION) + .setLong("voteSessionId", voteSessionUid.longValue()).list(); + + int completedSessionUserCount = 0; + if (list != null && list.size() > 0) { + Iterator listIterator = list.iterator(); + while (listIterator.hasNext()) { + VoteQueUsr user = (VoteQueUsr) listIterator.next(); + logger.debug("user: " + user); + if (user.getVoteSession().getSessionStatus().equals("COMPLETED")) { + ++completedSessionUserCount; } + } + } - return completedSessionUserCount; + return completedSessionUserCount; } - - public VoteQueUsr getVoteUserBySession(final Long queUsrId, final Long voteSessionId) - { - - String strGetUser = "from voteQueUsr in class VoteQueUsr where voteQueUsr.queUsrId=:queUsrId and voteQueUsr.voteSessionId=:voteSessionId"; - List list = getSession().createQuery(strGetUser) - .setLong("queUsrId", queUsrId.longValue()) - .setLong("voteSessionId", voteSessionId.longValue()) - .list(); - - if(list != null && list.size() > 0){ - VoteQueUsr usr = (VoteQueUsr) list.get(0); - return usr; - } - return null; + public VoteQueUsr getVoteUserBySession(final Long queUsrId, final Long voteSessionId) { + + String strGetUser = "from voteQueUsr in class VoteQueUsr where voteQueUsr.queUsrId=:queUsrId and voteQueUsr.voteSessionId=:voteSessionId"; + List list = getSession().createQuery(strGetUser).setLong("queUsrId", queUsrId.longValue()) + .setLong("voteSessionId", voteSessionId.longValue()).list(); + + if (list != null && list.size() > 0) { + VoteQueUsr usr = (VoteQueUsr) list.get(0); + return usr; } + return null; + } - - public VoteQueUsr getVoteQueUsrById(long voteQueUsrId) - { - String query = "from VoteQueUsr user where user.queUsrId=?"; - - List list = getSession().createQuery(query) - .setLong(0,voteQueUsrId) - .list(); - - if(list != null && list.size() > 0){ - VoteQueUsr qu = (VoteQueUsr) list.get(0); - return qu; - } - return null; + public VoteQueUsr getVoteQueUsrById(long voteQueUsrId) { + String query = "from VoteQueUsr user where user.queUsrId=?"; + + List list = getSession().createQuery(query).setLong(0, voteQueUsrId).list(); + + if (list != null && list.size() > 0) { + VoteQueUsr qu = (VoteQueUsr) list.get(0); + return qu; } + return null; + } - - - public void saveVoteUser(VoteQueUsr voteUser) - { - this.getHibernateTemplate().save(voteUser); + public void saveVoteUser(VoteQueUsr voteUser) { + this.getHibernateTemplate().save(voteUser); } - - public void updateVoteUser(VoteQueUsr voteUser) - { - this.getHibernateTemplate().update(voteUser); + public void updateVoteUser(VoteQueUsr voteUser) { + this.getHibernateTemplate().update(voteUser); } - - public void removeVoteUserById(Long userId) - { - HibernateTemplate templ = this.getHibernateTemplate(); - if ( userId != null) { - List list = getSession().createQuery(FIND_VOTE_USR_CONTENT) - .setLong(0,userId.longValue()) - .list(); - - if(list != null && list.size() > 0){ - VoteQueUsr voteu = (VoteQueUsr) list.get(0); - this.getSession().setFlushMode(FlushMode.AUTO); - templ.delete(voteu); - templ.flush(); - } - } - + public void removeVoteUserById(Long userId) { + HibernateTemplate templ = this.getHibernateTemplate(); + if (userId != null) { + List list = getSession().createQuery(FIND_VOTE_USR_CONTENT).setLong(0, userId.longValue()).list(); + + if (list != null && list.size() > 0) { + VoteQueUsr voteu = (VoteQueUsr) list.get(0); + this.getSession().setFlushMode(FlushMode.AUTO); + templ.delete(voteu); + templ.flush(); + } + } + } - - public List getUserBySessionOnly(final VoteSession voteSession) - { - List list = getSession().createQuery(LOAD_USER_FOR_SESSION) - .setLong("voteSessionId", voteSession.getUid().longValue()) - .list(); - return list; + + public List getUserBySessionOnly(final VoteSession voteSession) { + List list = getSession().createQuery(LOAD_USER_FOR_SESSION) + .setLong("voteSessionId", voteSession.getUid().longValue()).list(); + return list; } - + public void removeVoteUser(VoteQueUsr voteUser) { + this.getSession().setFlushMode(FlushMode.AUTO); + this.getHibernateTemplate().delete(voteUser); + } - public void removeVoteUser(VoteQueUsr voteUser) - { - this.getSession().setFlushMode(FlushMode.AUTO); - this.getHibernateTemplate().delete(voteUser); + public int getNumberOfUsers(VoteSession voteSession) { + return (getHibernateTemplate().findByNamedParam(COUNT_USERS_IN_SESSION, "voteSession", voteSession)).size(); } - - public int getNumberOfUsers(VoteSession voteSession) - { - return (getHibernateTemplate().findByNamedParam(COUNT_USERS_IN_SESSION, - "voteSession", - voteSession)).size(); - } - - public int getTotalNumberOfUsers() { - String query="from obj in class VoteQueUsr"; - return this.getHibernateTemplate().find(query).size(); - } - + String query = "from obj in class VoteQueUsr"; + return this.getHibernateTemplate().find(query).size(); + } + } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java,v diff -u -r1.44 -r1.45 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java 17 Jan 2014 22:18:25 -0000 1.44 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java 23 Jan 2014 23:53:16 -0000 1.45 @@ -108,7 +108,7 @@ List getUserRecords(final String userEntry) throws VoteApplicationException; - List getUserBySessionOnly(final VoteSession voteSession) throws VoteApplicationException; + List getUserBySessionOnly(final VoteSession voteSession) throws VoteApplicationException; void hideOpenVote(VoteUsrAttempt voteUsrAttempt) throws VoteApplicationException; @@ -185,8 +185,6 @@ void updateVoteSession(VoteSession voteSession) throws VoteApplicationException; - List getVoteUserBySessionOnly(final VoteSession voteSession) throws VoteApplicationException; - VoteSession getVoteSessionByUID(Long uid) throws VoteApplicationException; /** @@ -257,7 +255,7 @@ List getAllQuestionEntriesSorted(final long voteContentId) throws VoteApplicationException; - List getSessionsFromContent(VoteContent mcContent) throws VoteApplicationException; + List getSessionsFromContent(VoteContent mcContent) throws VoteApplicationException; Set getAttemptsForUserAndSession(final Long queUsrId, final Long voteSessionUid) throws VoteApplicationException; Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java,v diff -u -r1.73 -r1.74 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java 17 Jan 2014 22:18:25 -0000 1.73 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java 23 Jan 2014 23:53:16 -0000 1.74 @@ -426,7 +426,7 @@ } } - public List getUserBySessionOnly(final VoteSession voteSession) throws VoteApplicationException { + public List getUserBySessionOnly(final VoteSession voteSession) throws VoteApplicationException { try { return voteUserDAO.getUserBySessionOnly(voteSession); } catch (DataAccessException e) { @@ -767,15 +767,6 @@ } } - public List getVoteUserBySessionOnly(final VoteSession voteSession) throws VoteApplicationException { - try { - return voteUserDAO.getVoteUserBySessionOnly(voteSession); - } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is retrieving users by session: " - + e.getMessage(), e); - } - } - public VoteContent retrieveVoteBySessionId(Long voteSessionId) throws VoteApplicationException { try { return voteContentDAO.getVoteContentBySession(voteSessionId); @@ -891,7 +882,7 @@ } } - public List getSessionsFromContent(VoteContent voteContent) throws VoteApplicationException { + public List getSessionsFromContent(VoteContent voteContent) throws VoteApplicationException { try { return voteSessionDAO.getSessionsFromContent(voteContent); } catch (DataAccessException e) { Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java,v diff -u -r1.29 -r1.30 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java 17 Jan 2014 22:18:25 -0000 1.29 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java 23 Jan 2014 23:53:16 -0000 1.30 @@ -113,7 +113,7 @@ toolSessionID.toString(), userID.toString(), true, null, voteGeneralMonitoringDTO, exportPortfolioDTO); - voteMonitoringAction.prepareReflectionData(request, content, voteService, userID.toString(), true, ""); + voteMonitoringAction.prepareReflectionData(request, content, voteService, userID.toString(), true); } else { // thise field is needed for the jsp. exportPortfolioDTO.setUserExceptionNoToolSessions("false"); @@ -153,6 +153,6 @@ request.getSession().setAttribute(VoteAppConstants.EXPORT_PORTFOLIO_DTO, exportPortfolioDTO); - voteMonitoringAction.prepareReflectionData(request, content, voteService, null, true, "All"); + voteMonitoringAction.prepareReflectionData(request, content, voteService, null, true); } } \ No newline at end of file Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java,v diff -u -r1.52 -r1.53 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java 2 Jan 2014 23:12:50 -0000 1.52 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java 23 Jan 2014 23:53:16 -0000 1.53 @@ -28,6 +28,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.Set; import java.util.TimeZone; import java.util.TreeMap; @@ -38,7 +39,7 @@ import org.lamsfoundation.lams.notebook.model.NotebookEntry; import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants; import org.lamsfoundation.lams.tool.vote.VoteAllGroupsDTO; -import org.lamsfoundation.lams.tool.vote.VoteAllSessionsDTO; +import org.lamsfoundation.lams.tool.vote.SessionDTO; import org.lamsfoundation.lams.tool.vote.VoteAppConstants; import org.lamsfoundation.lams.tool.vote.VoteComparator; import org.lamsfoundation.lams.tool.vote.VoteGeneralLearnerFlowDTO; @@ -71,132 +72,70 @@ */ public class MonitoringUtil implements VoteAppConstants { - public static Map populateToolSessions(HttpServletRequest request, VoteContent voteContent, IVoteService voteService) { - List sessionsList = voteService.getSessionNamesFromContent(voteContent); - - Map sessionsMap = VoteUtils.convertToStringMap(sessionsList, "String"); - - if (sessionsMap.isEmpty()) { - sessionsMap.put(new Long(1).toString(), "None"); - } else { - sessionsMap.put(new Long(sessionsMap.size() + 1).toString(), "All"); - } - - return sessionsMap; - } - /** - * - * used in presenting user votes data - * - * @param request - * @param voteContent - * @param isUserNamesVisible - * @param isLearnerRequest - * @param currentSessionId - * @param userId - * @param voteService - * @return - */ - public static List buildGroupsQuestionData(HttpServletRequest request, VoteContent voteContent, - boolean isUserNamesVisible, boolean isLearnerRequest, String currentSessionId, String userId, - IVoteService voteService) { - List listQuestions = voteService.getAllQuestionEntries(voteContent.getUid()); - - List listMonitoredAnswersContainerDTO = new LinkedList(); - - Iterator itListQuestions = listQuestions.iterator(); - while (itListQuestions.hasNext()) { - VoteQueContent voteQueContent = (VoteQueContent) itListQuestions.next(); - - if (voteQueContent != null) { - VoteMonitoredAnswersDTO voteMonitoredAnswersDTO = new VoteMonitoredAnswersDTO(); - voteMonitoredAnswersDTO.setQuestionUid(voteQueContent.getUid().toString()); - voteMonitoredAnswersDTO.setQuestion(voteQueContent.getQuestion()); - - Map questionAttemptData = buildGroupsAttemptData(request, voteContent, voteQueContent, voteQueContent - .getUid().toString(), isUserNamesVisible, isLearnerRequest, currentSessionId, userId, - voteService); - voteMonitoredAnswersDTO.setQuestionAttempts(questionAttemptData); - listMonitoredAnswersContainerDTO.add(voteMonitoredAnswersDTO); - - } - } - return listMonitoredAnswersContainerDTO; - } - - /** * groups user's votes - * - * @param request - * @param voteContent - * @param voteQueContent - * @param questionUid - * @param isUserNamesVisible - * @param isLearnerRequest - * @param currentSessionId - * @param userId - * @param voteService - * @return */ - public static Map buildGroupsAttemptData(HttpServletRequest request, VoteContent voteContent, + public static Map buildGroupsAttemptData(HttpServletRequest request, VoteContent voteContent, VoteQueContent voteQueContent, String questionUid, boolean isUserNamesVisible, boolean isLearnerRequest, String currentSessionId, String userId, IVoteService voteService) { - Map mapMonitoredAttemptsContainerDTO = new TreeMap(new VoteComparator()); - List listMonitoredAttemptsContainerDTO = new LinkedList(); + List> listMonitoredAttemptsContainerDTO = new LinkedList>(); - Map summaryToolSessions = populateToolSessionsId(request, voteContent, voteService); + Map summaryToolSessions = populateToolSessionsId(voteContent, voteService); - Iterator itMap = summaryToolSessions.entrySet().iterator(); - - /*request is for monitoring summary */ + /* request is for monitoring summary */ if (!isLearnerRequest) { - while (itMap.hasNext()) { - Map.Entry pairs = (Map.Entry) itMap.next(); + for (Entry pairs : summaryToolSessions.entrySet()) { - if (!(pairs.getValue().toString().equals("None")) && !(pairs.getValue().toString().equals("All"))) { - VoteSession voteSession = voteService.retrieveVoteSession(new Long(pairs.getValue().toString())); + if (!(pairs.getValue().equals("None")) && !(pairs.getValue().equals("All"))) { + VoteSession voteSession = voteService.retrieveVoteSession(new Long(pairs.getValue())); if (voteSession != null) { - List listUsers = voteService.getUserBySessionOnly(voteSession); - Map sessionUsersAttempts = populateSessionUsersAttempts(request, voteContent, voteSession - .getVoteSessionId(), listUsers, questionUid, isUserNamesVisible, isLearnerRequest, - userId, voteService); + List users = voteService.getUserBySessionOnly(voteSession); + Map sessionUsersAttempts = populateSessionUsersAttempts(request, + voteContent, voteSession.getVoteSessionId(), users, questionUid, isUserNamesVisible, + isLearnerRequest, userId, voteService); listMonitoredAttemptsContainerDTO.add(sessionUsersAttempts); } } } + +// //create data for All sessions in total +// if (summaryToolSessions.size() > 1) { +// Map sessionUsersAttempts = populateSessionUsersAttempts(request, +// voteContent, voteSession.getVoteSessionId(), users, questionUid, isUserNamesVisible, +// isLearnerRequest, userId, voteService); +// listMonitoredAttemptsContainerDTO.add(sessionUsersAttempts); +// } + } else { - /*request is for learner report, use only the passed tool session in the report*/ - while (itMap.hasNext()) { - Map.Entry pairs = (Map.Entry) itMap.next(); + /* request is for learner report, use only the passed tool session in the report */ + for (Entry pairs : summaryToolSessions.entrySet()) { if (!(pairs.getValue().toString().equals("None")) && !(pairs.getValue().toString().equals("All"))) { if (currentSessionId.equals(pairs.getValue())) { VoteSession voteSession = voteService .retrieveVoteSession(new Long(pairs.getValue().toString())); if (voteSession != null) { - List listUsers = voteService.getUserBySessionOnly(voteSession); - Map sessionUsersAttempts = populateSessionUsersAttempts(request, voteContent, voteSession - .getVoteSessionId(), listUsers, questionUid, isUserNamesVisible, isLearnerRequest, - userId, voteService); + List listUsers = voteService.getUserBySessionOnly(voteSession); + Map sessionUsersAttempts = populateSessionUsersAttempts( + request, voteContent, voteSession.getVoteSessionId(), listUsers, questionUid, + isUserNamesVisible, isLearnerRequest, userId, voteService); listMonitoredAttemptsContainerDTO.add(sessionUsersAttempts); } } } } } - mapMonitoredAttemptsContainerDTO = convertToMap(listMonitoredAttemptsContainerDTO); + Map mapMonitoredAttemptsContainerDTO = convertToMap(listMonitoredAttemptsContainerDTO); return mapMonitoredAttemptsContainerDTO; } - 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) { - Map mapMonitoredUserContainerDTO = new TreeMap(new VoteStringComparator()); List listMonitoredUserContainerDTO = new LinkedList(); Iterator itUsers = listUsers.iterator(); @@ -206,8 +145,8 @@ VoteQueUsr voteQueUsr = (VoteQueUsr) itUsers.next(); if (voteQueUsr != null) { - List listUserAttempts = voteService.getAttemptsForUserAndQuestionContent(voteQueUsr - .getUid(), new Long(questionUid)); + List listUserAttempts = voteService.getAttemptsForUserAndQuestionContent(voteQueUsr.getUid(), + new Long(questionUid)); Iterator itAttempts = listUserAttempts.iterator(); while (itAttempts.hasNext()) { @@ -231,8 +170,8 @@ String voteQueContentId = voteQuestionUid.toString(); VoteSession localUserSession = voteUsrResp.getVoteQueUsr().getVoteSession(); - if (voteContent.getVoteContentId().toString().equals( - localUserSession.getVoteContentId().toString())) { + if (voteContent.getVoteContentId().toString() + .equals(localUserSession.getVoteContentId().toString())) { if (entry != null) { if (entry.equals("sample nomination") && (voteQueContentId.equals("1"))) { voteMonitoredUserDTO.setResponse(voteUsrResp.getUserEntry()); @@ -248,17 +187,18 @@ } } } else if ((isUserNamesVisible) && (isLearnerRequest)) { - //summary reporting case 2 - //just populating data normally just like monitoring summary, except that the data is ony for a specific session + // summary reporting case 2 + // just populating data normally just like monitoring summary, except that the data is ony for a + // specific session String userID = (String) request.getSession().getAttribute(USER_ID); VoteQueUsr voteQueUsr = voteService.getVoteQueUsrById(new Long(userID).longValue()); while (itUsers.hasNext()) { voteQueUsr = (VoteQueUsr) itUsers.next(); if (voteQueUsr != null) { - List listUserAttempts = voteService.getAttemptsForUserAndQuestionContent(voteQueUsr - .getUid(), new Long(questionUid)); + List listUserAttempts = voteService.getAttemptsForUserAndQuestionContent(voteQueUsr.getUid(), + new Long(questionUid)); Iterator itAttempts = listUserAttempts.iterator(); while (itAttempts.hasNext()) { @@ -280,8 +220,8 @@ String voteQueContentId = voteUsrResp.getVoteQueContentId().toString(); VoteSession localUserSession = voteUsrResp.getVoteQueUsr().getVoteSession(); - if (voteContent.getVoteContentId().toString().equals( - localUserSession.getVoteContentId().toString())) { + if (voteContent.getVoteContentId().toString() + .equals(localUserSession.getVoteContentId().toString())) { if (entry != null) { if (entry.equals("sample nomination") && (voteQueContentId.equals("1"))) { voteMonitoredUserDTO.setResponse(voteUsrResp.getUserEntry()); @@ -297,16 +237,16 @@ } } } else if ((!isUserNamesVisible) && (isLearnerRequest)) { - //summary reporting case 3 - //populating data normally exception are for a specific session and other user names are not visible + // summary reporting case 3 + // populating data normally exception are for a specific session and other user names are not visible String userID = (String) request.getSession().getAttribute(USER_ID); while (itUsers.hasNext()) { VoteQueUsr voteQueUsr = (VoteQueUsr) itUsers.next(); if (voteQueUsr != null) { - List listUserAttempts = voteService.getAttemptsForUserAndQuestionContent(voteQueUsr - .getUid(), new Long(questionUid)); + List listUserAttempts = voteService.getAttemptsForUserAndQuestionContent(voteQueUsr.getUid(), + new Long(questionUid)); Iterator itAttempts = listUserAttempts.iterator(); while (itAttempts.hasNext()) { @@ -336,8 +276,8 @@ String voteQueContentId = voteUsrResp.getVoteQueContentId().toString(); VoteSession localUserSession = voteUsrResp.getVoteQueUsr().getVoteSession(); - if (voteContent.getVoteContentId().toString().equals( - localUserSession.getVoteContentId().toString())) { + if (voteContent.getVoteContentId().toString() + .equals(localUserSession.getVoteContentId().toString())) { if (entry != null) { if (entry.equals("sample nomination") && (voteQueContentId.equals("1"))) { voteMonitoredUserDTO.setResponse(voteUsrResp.getUserEntry()); @@ -355,8 +295,8 @@ } } } else { - //summary reporting case 4 - //request is for learner progress report userId + // summary reporting case 4 + // request is for learner progress report userId while (itUsers.hasNext()) { VoteQueUsr voteQueUsr = (VoteQueUsr) itUsers.next(); @@ -370,7 +310,7 @@ if (voteUsrResp != null) { if (userId.equals(voteQueUsr.getQueUsrId().toString())) { - //this is the user requested , include his name for learner progress + // this is the user requested , include his name for learner progress VoteMonitoredUserDTO voteMonitoredUserDTO = new VoteMonitoredUserDTO(); voteMonitoredUserDTO.setAttemptTime(voteUsrResp.getAttemptTime()); voteMonitoredUserDTO.setTimeZone(voteUsrResp.getTimeZone()); @@ -387,8 +327,8 @@ String voteQueContentId = voteUsrResp.getVoteQueContentId().toString(); VoteSession localUserSession = voteUsrResp.getVoteQueUsr().getVoteSession(); - if (voteContent.getVoteContentId().toString().equals( - localUserSession.getVoteContentId().toString())) { + if (voteContent.getVoteContentId().toString() + .equals(localUserSession.getVoteContentId().toString())) { if (entry != null) { if (entry.equals("sample nomination") && (voteQueContentId.equals("1"))) { voteMonitoredUserDTO.setResponse(voteUsrResp.getUserEntry()); @@ -407,15 +347,19 @@ } - mapMonitoredUserContainerDTO = convertToVoteMonitoredUserDTOMap(listMonitoredUserContainerDTO); + Map mapMonitoredUserContainerDTO = convertToVoteMonitoredUserDTOMap(listMonitoredUserContainerDTO); return mapMonitoredUserContainerDTO; } - public static Map populateToolSessionsId(HttpServletRequest request, VoteContent voteContent, - IVoteService voteService) { - List sessionsList = voteService.getSessionsFromContent(voteContent); + public static Map populateToolSessionsId(VoteContent voteContent, IVoteService voteService) { + List sessionIds = voteService.getSessionsFromContent(voteContent); - Map sessionsMap = VoteUtils.convertToStringMap(sessionsList, "Long"); + Map sessionsMap = new TreeMap(new VoteComparator()); + int mapIndex = 1; + for (Long sessionId : sessionIds) { + sessionsMap.put("" + mapIndex, sessionId.toString()); + mapIndex++; + } if (sessionsMap.isEmpty()) { sessionsMap.put(new Long(1).toString(), "None"); @@ -426,14 +370,14 @@ return sessionsMap; } - public static Map convertToVoteMonitoredUserDTOMap(List list) { - Map map = new TreeMap(new VoteComparator()); + public static Map convertToVoteMonitoredUserDTOMap(List list) { + Map map = new TreeMap(new VoteComparator()); - Iterator listIterator = list.iterator(); + Iterator listIterator = list.iterator(); Long mapIndex = new Long(1); while (listIterator.hasNext()) { - VoteMonitoredUserDTO data = (VoteMonitoredUserDTO) listIterator.next(); + VoteMonitoredUserDTO data = listIterator.next(); map.put(mapIndex.toString(), data); mapIndex = new Long(mapIndex.longValue() + 1); @@ -454,8 +398,8 @@ return total; } - public static Map convertToMap(List list) { - Map map = new TreeMap(new VoteComparator()); + public static Map convertToMap(List list) { + Map map = new TreeMap(new VoteComparator()); Iterator listIterator = list.iterator(); Long mapIndex = new Long(1); @@ -469,158 +413,12 @@ } /** - * Generates chart data for all sessions in the Monitoring Summary. + * Generates chart data for the learner module and monitoring module Summary tab (Individual Sessions mode) * * @param request * @param voteService * @param voteMonitoringForm * @param toolContentID - * @return - */ - public static List prepareChartDTO(HttpServletRequest request, IVoteService voteService, - VoteMonitoringForm voteMonitoringForm, Long toolContentID, MessageService messageService) { - - List listVoteAllSessionsDTO = new LinkedList(); - - VoteContent voteContent = voteService.retrieveVote(toolContentID); - - Iterator itListSessions = voteContent.getVoteSessions().iterator(); - while (itListSessions.hasNext()) { - VoteSession voteSession = (VoteSession) itListSessions.next(); - - Map mapOptionsContent = new TreeMap(new VoteComparator()); - Map mapVoteRatesContent = new TreeMap(new VoteComparator()); - - VoteAllSessionsDTO voteAllSessionsDTO = new VoteAllSessionsDTO(); - voteAllSessionsDTO.setSessionId(voteSession.getVoteSessionId().toString()); - voteAllSessionsDTO.setSessionName(voteSession.getSession_name()); - - int entriesCount = voteService.getSessionEntriesCount(voteSession.getUid()); - Set userEntries = voteService.getSessionUserEntriesSet(voteSession.getUid()); - - int potentialUserCount = voteService.getVoteSessionPotentialLearnersCount(voteSession.getUid()); - voteAllSessionsDTO.setSessionUserCount(Integer.toString(potentialUserCount)); - - int completedSessionUserCount = voteService.getCompletedVoteUserBySessionUid(voteSession.getUid()); - voteAllSessionsDTO.setCompletedSessionUserCount(new Integer(completedSessionUserCount).toString()); - - if (potentialUserCount != 0) { - double completedPercent = (completedSessionUserCount * 100) / potentialUserCount; - - if (completedPercent > 100) - completedPercent = 100; - - voteAllSessionsDTO.setCompletedSessionUserPercent(new Double(completedPercent).toString()); - } else { - voteAllSessionsDTO.setCompletedSessionUserPercent("Not Available"); - } - - Map mapStandardUserCount = new TreeMap(new VoteComparator()); - - mapOptionsContent.clear(); - Iterator queIterator = voteContent.getVoteQueContents().iterator(); - Long mapIndex = new Long(1); - int totalStandardVotesCount = 0; - - Map mapStandardNominationsHTMLedContent = new TreeMap(new VoteComparator()); - Map mapStandardQuestionUid = new TreeMap(new VoteComparator()); - Map mapStandardToolSessionUid = new TreeMap(new VoteComparator()); - - while (queIterator.hasNext()) { - VoteQueContent voteQueContent = (VoteQueContent) queIterator.next(); - if (voteQueContent != null) { - mapStandardNominationsHTMLedContent.put(mapIndex.toString(), voteQueContent.getQuestion()); - String noHTMLNomination = VoteUtils.stripHTML(voteQueContent.getQuestion()); - mapOptionsContent.put(mapIndex.toString(), noHTMLNomination); - - int votesCount = 0; - votesCount = voteService.getStandardAttemptsForQuestionContentAndSessionUid( - voteQueContent.getUid(), voteSession.getUid()); - - mapStandardQuestionUid.put(mapIndex.toString(), voteQueContent.getUid().toString()); - mapStandardToolSessionUid.put(mapIndex.toString(), voteSession.getUid()); - - mapStandardUserCount.put(mapIndex.toString(), new Integer(votesCount).toString()); - totalStandardVotesCount = totalStandardVotesCount + votesCount; - - double voteRate = 0d; - double doubleVotesCount = votesCount * 1d; - double doubleEntriesCount = entriesCount * 1d; - - if (entriesCount != 0) { - voteRate = ((doubleVotesCount * 100) / doubleEntriesCount); - } - String stringVoteRate = new Double(voteRate).toString(); - int lengthVoteRate = stringVoteRate.length(); - if (lengthVoteRate > 5) - stringVoteRate = stringVoteRate.substring(0, 6); - - mapVoteRatesContent.put(mapIndex.toString(), stringVoteRate); - mapIndex = new Long(mapIndex.longValue() + 1); - } - } - Map mapStandardNominationsContent = new TreeMap(new VoteComparator()); - mapStandardNominationsContent = mapOptionsContent; - - Map mapStandardRatesContent = new TreeMap(new VoteComparator()); - mapStandardRatesContent = mapVoteRatesContent; - - Iterator itListQuestions = userEntries.iterator(); - int mapVoteRatesSize = mapVoteRatesContent.size(); - mapIndex = new Long(mapVoteRatesSize + 1); - - double total = MonitoringUtil.calculateTotal(mapVoteRatesContent); - double share = 100d - total; - int userEnteredVotesCount = entriesCount - totalStandardVotesCount; - - if (userEnteredVotesCount != 0) { - share = ((userEnteredVotesCount * 100) / entriesCount); - } else { - share = 0; - } - - if (voteContent.isAllowText()) { - mapStandardNominationsContent.put(mapIndex.toString(), messageService.getMessage("label.open.vote")); - mapStandardNominationsHTMLedContent.put(mapIndex.toString(), messageService - .getMessage("label.open.vote")); - } - mapStandardRatesContent.put(mapIndex.toString(), new Double(share).toString()); - mapStandardUserCount.put(mapIndex.toString(), new Integer(userEnteredVotesCount).toString()); - /** following are needed just for proper iteration in the summary jsp */ - mapStandardQuestionUid.put(mapIndex.toString(), "1"); - mapStandardToolSessionUid.put(mapIndex.toString(), "1"); - - voteAllSessionsDTO.setMapStandardNominationsContent(mapStandardNominationsContent); - voteAllSessionsDTO.setMapStandardNominationsHTMLedContent(mapStandardNominationsHTMLedContent); - voteAllSessionsDTO.setMapStandardUserCount(mapStandardUserCount); - voteAllSessionsDTO.setMapStandardRatesContent(mapStandardRatesContent); - voteAllSessionsDTO.setMapStandardQuestionUid(mapStandardQuestionUid); - voteAllSessionsDTO.setMapStandardToolSessionUid(mapStandardToolSessionUid); - - VoteMonitoringAction voteMonitoringAction = new VoteMonitoringAction(); - List listUserEntries = voteMonitoringAction.processUserEnteredNominations(voteService, voteContent, - voteSession.getVoteSessionId().toString(), true, null, false); - voteAllSessionsDTO.setListUserEntries(listUserEntries); - - if (listUserEntries.size() > 0) - voteAllSessionsDTO.setExistsOpenVote(new Boolean(true).toString()); - else - voteAllSessionsDTO.setExistsOpenVote(new Boolean(false).toString()); - - listVoteAllSessionsDTO.add(voteAllSessionsDTO); - } - - return listVoteAllSessionsDTO; - } - - /** - * Generates chart data for the learner module and monitoring module - * Summary tab (Individual Sessions mode) - * - * @param request - * @param voteService - * @param voteMonitoringForm - * @param toolContentID * @param toolSessionUid */ public static void prepareChartData(HttpServletRequest request, IVoteService voteService, @@ -653,23 +451,6 @@ voteGeneralMonitoringDTO.setCompletedSessionUserCount(new Integer(completedSessionUserCount) .toString()); } - - if (potentialUserCount != 0) { - double completedPercent = (completedSessionUserCount * 100) / potentialUserCount; - if (completedPercent > 100) - completedPercent = 100; - - 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"); - } - } } } @@ -834,7 +615,7 @@ voteStatsDTO.setCountAllUsers(new Integer(countAllUsers).toString()); voteStatsDTO.setCountSessionComplete(new Integer(countSessionComplete).toString()); request.setAttribute(VOTE_STATS_DTO, voteStatsDTO); - + // setting up the advanced summary for LDEV-1662 request.setAttribute("useSelectLeaderToolOuput", voteContent.isUseSelectLeaderToolOuput()); request.setAttribute("lockOnFinish", voteContent.isLockOnFinish()); @@ -845,7 +626,7 @@ request.setAttribute("reflect", voteContent.isReflect()); request.setAttribute("reflectionSubject", voteContent.getReflectionSubject()); request.setAttribute("toolContentID", voteContent.getVoteContentId()); - + // setting up the SubmissionDeadline if (voteContent.getSubmissionDeadline() != null) { Date submissionDeadline = voteContent.getSubmissionDeadline(); @@ -857,134 +638,56 @@ } } - public static void generateGroupsSessionData(HttpServletRequest request, IVoteService voteService, - VoteContent voteContent) { - List listAllGroupsDTO = buildGroupBasedSessionData(request, voteContent, voteService); - request.setAttribute(LIST_ALL_GROUPS_DTO, listAllGroupsDTO); - } + public static Map buildGroupsAttemptData(HttpServletRequest request, VoteContent voteContent, + IVoteService voteService, VoteQueContent voteQueContent, String questionUid, String currentSessionId) { - public static List buildGroupBasedSessionData(HttpServletRequest request, VoteContent voteContent, - IVoteService voteService) { - List listQuestions = voteService.getAllQuestionEntries(voteContent.getUid()); - List listAllGroupsContainerDTO = new LinkedList(); - - Iterator iteratorSession = voteContent.getVoteSessions().iterator(); - while (iteratorSession.hasNext()) { - VoteSession voteSession = (VoteSession) iteratorSession.next(); - String currentSessionId = voteSession.getVoteSessionId().toString(); - - String currentSessionName = voteSession.getSession_name(); - - VoteAllGroupsDTO voteAllGroupsDTO = new VoteAllGroupsDTO(); - List listMonitoredAnswersContainerDTO = new LinkedList(); - - if (voteSession != null) { - Iterator itListQuestions = listQuestions.iterator(); - while (itListQuestions.hasNext()) { - VoteQueContent voteQueContent = (VoteQueContent) itListQuestions.next(); - - if (voteQueContent != null) { - VoteMonitoredAnswersDTO voteMonitoredAnswersDTO = new VoteMonitoredAnswersDTO(); - voteMonitoredAnswersDTO.setQuestionUid(voteQueContent.getUid().toString()); - voteMonitoredAnswersDTO.setQuestion(voteQueContent.getQuestion()); - voteMonitoredAnswersDTO.setSessionId(currentSessionId); - voteMonitoredAnswersDTO.setSessionName(currentSessionName); - - Map questionAttemptData = buildGroupsAttemptData(request, voteContent, voteService, - voteQueContent, voteQueContent.getUid().toString(), true, false, currentSessionId, null); - voteMonitoredAnswersDTO.setQuestionAttempts(questionAttemptData); - - listMonitoredAnswersContainerDTO.add(voteMonitoredAnswersDTO); - } - } - } - voteAllGroupsDTO.setGroupData(listMonitoredAnswersContainerDTO); - voteAllGroupsDTO.setSessionName(currentSessionName); - voteAllGroupsDTO.setSessionId(currentSessionId); - - listAllGroupsContainerDTO.add(voteAllGroupsDTO); - - } - - return listAllGroupsContainerDTO; - } - - public static Map buildGroupsAttemptData(HttpServletRequest request, VoteContent voteContent, - IVoteService voteService, VoteQueContent voteQueContent, String questionUid, boolean isUserNamesVisible, - boolean isLearnerRequest, String currentSessionId, String userId) { - - Map mapMonitoredAttemptsContainerDTO = new TreeMap(new VoteStringComparator()); List listMonitoredAttemptsContainerDTO = new LinkedList(); - Map summaryToolSessions = populateToolSessionsId(request, voteContent, voteService); + Map summaryToolSessions = populateToolSessionsId(voteContent, voteService); Iterator itMap = summaryToolSessions.entrySet().iterator(); - /*request is for monitoring summary */ - if (!isLearnerRequest) { + /* request is for monitoring summary */ - if (currentSessionId != null) { - if (currentSessionId.equals("All")) { - //**summary request is for All** - while (itMap.hasNext()) { - Map.Entry pairs = (Map.Entry) itMap.next(); - if (!(pairs.getValue().toString().equals("None")) - && !(pairs.getValue().toString().equals("All"))) { - VoteSession voteSession = voteService.retrieveVoteSession(new Long(pairs.getValue() - .toString())); - if (voteSession != null) { - List listUsers = voteService.getUserBySessionOnly(voteSession); - Map sessionUsersAttempts = populateSessionUsersAttempts(request, voteService, - voteSession.getVoteSessionId(), listUsers, questionUid, isUserNamesVisible, - isLearnerRequest, userId); - listMonitoredAttemptsContainerDTO.add(sessionUsersAttempts); - } - } - } - } else if (!currentSessionId.equals("All")) { - //**summary request is for currentSessionId** currentSessionId - VoteSession voteSession = voteService.retrieveVoteSession(new Long(currentSessionId.toString())); - - List listUsers = voteService.getUserBySessionOnly(voteSession); - - Map sessionUsersAttempts = populateSessionUsersAttempts(request, voteService, new Long( - currentSessionId), listUsers, questionUid, isUserNamesVisible, isLearnerRequest, userId); - listMonitoredAttemptsContainerDTO.add(sessionUsersAttempts); - } - } - } else { - /*request is for learner report, use only the passed tool session in the report*/ - while (itMap.hasNext()) { - Map.Entry pairs = (Map.Entry) itMap.next(); - - if (!(pairs.getValue().toString().equals("None")) && !(pairs.getValue().toString().equals("All"))) { - - if (currentSessionId.equals(pairs.getValue())) { + if (currentSessionId != null) { + if (currentSessionId.equals("All")) { + // **summary request is for All** + while (itMap.hasNext()) { + Map.Entry pairs = (Map.Entry) itMap.next(); + if (!(pairs.getValue().toString().equals("None")) && !(pairs.getValue().toString().equals("All"))) { VoteSession voteSession = voteService .retrieveVoteSession(new Long(pairs.getValue().toString())); if (voteSession != null) { - List listUsers = voteService.getUserBySessionOnly(voteSession); - Map sessionUsersAttempts = populateSessionUsersAttempts(request, voteService, voteSession - .getVoteSessionId(), listUsers, questionUid, isUserNamesVisible, isLearnerRequest, - userId); + List listUsers = voteService.getUserBySessionOnly(voteSession); + Map sessionUsersAttempts = populateSessionUsersAttempts(request, voteService, + voteSession.getVoteSessionId(), listUsers, questionUid, true, false, null); listMonitoredAttemptsContainerDTO.add(sessionUsersAttempts); } } } + } else if (!currentSessionId.equals("All")) { + // **summary request is for currentSessionId** currentSessionId + VoteSession voteSession = voteService.retrieveVoteSession(new Long(currentSessionId.toString())); + + List listUsers = voteService.getUserBySessionOnly(voteSession); + + Map sessionUsersAttempts = populateSessionUsersAttempts(request, voteService, + new Long(currentSessionId), listUsers, questionUid, true, false, null); + listMonitoredAttemptsContainerDTO.add(sessionUsersAttempts); } } - mapMonitoredAttemptsContainerDTO = convertToMap(listMonitoredAttemptsContainerDTO); + Map mapMonitoredAttemptsContainerDTO = convertToMap(listMonitoredAttemptsContainerDTO); return mapMonitoredAttemptsContainerDTO; } public static Map populateSessionUsersAttempts(HttpServletRequest request, IVoteService voteService, - Long sessionId, List listUsers, String questionUid, boolean isUserNamesVisible, boolean isLearnerRequest, - String userId) { + Long sessionId, List users, String questionUid, boolean isUserNamesVisible, + boolean isLearnerRequest, String userId) { Map mapMonitoredUserContainerDTO = new TreeMap(new VoteStringComparator()); List listMonitoredUserContainerDTO = new LinkedList(); - Iterator itUsers = listUsers.iterator(); + Iterator itUsers = users.iterator(); if (userId == null) { if ((isUserNamesVisible) && (!isLearnerRequest)) { @@ -1002,7 +705,7 @@ if (voteUsrResp != null) { VoteMonitoredUserDTO voteMonitoredUserDTO = new VoteMonitoredUserDTO(); voteMonitoredUserDTO.setAttemptTime(voteUsrResp.getAttemptTime()); - //voteMonitoredUserDTO.setTimeZone(voteUsrResp.getTimezone()); + // voteMonitoredUserDTO.setTimeZone(voteUsrResp.getTimezone()); voteMonitoredUserDTO.setUid(voteUsrResp.getUid().toString()); voteMonitoredUserDTO.setUserName(voteQueUsr.getFullname()); voteMonitoredUserDTO.setQueUsrId(voteQueUsr.getUid().toString()); @@ -1020,7 +723,8 @@ } } } else if ((isUserNamesVisible) && (isLearnerRequest)) { - //just populating data normally just like monitoring summary, except that the data is ony for a specific session + // just populating data normally just like monitoring summary, except that the data is ony for a + // specific session String userID = VoteUtils.getCurrentLearnerID(); VoteQueUsr voteQueUsr = voteService.getVoteQueUsrById(new Long(userID).longValue()); @@ -1039,7 +743,7 @@ if (voteUsrResp != null) { VoteMonitoredUserDTO voteMonitoredUserDTO = new VoteMonitoredUserDTO(); voteMonitoredUserDTO.setAttemptTime(voteUsrResp.getAttemptTime()); - //voteMonitoredUserDTO.setTimeZone(voteUsrResp.getTimezone()); + // voteMonitoredUserDTO.setTimeZone(voteUsrResp.getTimezone()); voteMonitoredUserDTO.setUid(voteUsrResp.getUid().toString()); voteMonitoredUserDTO.setUserName(voteQueUsr.getFullname()); voteMonitoredUserDTO.setQueUsrId(voteQueUsr.getUid().toString()); @@ -1057,8 +761,8 @@ } } } else if ((!isUserNamesVisible) && (isLearnerRequest)) { - //populating data normally exception are for a specific session and other user names are not visible - //getting only current user's data + // populating data normally exception are for a specific session and other user names are not visible + // getting only current user's data String userID = VoteUtils.getCurrentLearnerID(); while (itUsers.hasNext()) { @@ -1075,7 +779,7 @@ if (voteUsrResp != null) { VoteMonitoredUserDTO voteMonitoredUserDTO = new VoteMonitoredUserDTO(); voteMonitoredUserDTO.setAttemptTime(voteUsrResp.getAttemptTime()); - //voteMonitoredUserDTO.setTimeZone(voteUsrResp.getTimezone()); + // voteMonitoredUserDTO.setTimeZone(voteUsrResp.getTimezone()); voteMonitoredUserDTO.setUid(voteUsrResp.getUid().toString()); if (userID.equals(voteQueUsr.getQueUsrId().toString())) { @@ -1100,7 +804,7 @@ } } } else { - //request is for learner progress report + // request is for learner progress report while (itUsers.hasNext()) { VoteQueUsr voteQueUsr = (VoteQueUsr) itUsers.next(); @@ -1116,7 +820,7 @@ if (userId.equals(voteQueUsr.getQueUsrId().toString())) { VoteMonitoredUserDTO voteMonitoredUserDTO = new VoteMonitoredUserDTO(); voteMonitoredUserDTO.setAttemptTime(voteUsrResp.getAttemptTime()); - //voteMonitoredUserDTO.setTimeZone(voteUsrResp.getTimezone()); + // voteMonitoredUserDTO.setTimeZone(voteUsrResp.getTimezone()); voteMonitoredUserDTO.setUid(voteUsrResp.getUid().toString()); voteMonitoredUserDTO.setUserName(voteQueUsr.getFullname()); voteMonitoredUserDTO.setQueUsrId(voteQueUsr.getUid().toString()); @@ -1155,4 +859,28 @@ return map; } + public static void repopulateRequestParameters(HttpServletRequest request, VoteMonitoringForm voteMonitoringForm, + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) { + + String toolContentID = request.getParameter(VoteAppConstants.TOOL_CONTENT_ID); + voteMonitoringForm.setToolContentID(toolContentID); + voteGeneralMonitoringDTO.setToolContentID(toolContentID); + + String activeModule = request.getParameter(VoteAppConstants.ACTIVE_MODULE); + voteMonitoringForm.setActiveModule(activeModule); + voteGeneralMonitoringDTO.setActiveModule(activeModule); + + String defineLaterInEditMode = request.getParameter(VoteAppConstants.DEFINE_LATER_IN_EDIT_MODE); + voteMonitoringForm.setDefineLaterInEditMode(defineLaterInEditMode); + voteGeneralMonitoringDTO.setDefineLaterInEditMode(defineLaterInEditMode); + + String responseId = request.getParameter(VoteAppConstants.RESPONSE_ID); + voteMonitoringForm.setResponseId(responseId); + voteGeneralMonitoringDTO.setResponseId(responseId); + + String currentUid = request.getParameter(VoteAppConstants.CURRENT_UID); + voteMonitoringForm.setCurrentUid(currentUid); + voteGeneralMonitoringDTO.setCurrentUid(currentUid); + } + } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java,v diff -u -r1.44 -r1.45 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java 17 Jan 2014 22:18:25 -0000 1.44 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java 23 Jan 2014 23:53:16 -0000 1.45 @@ -642,8 +642,6 @@ repopulateRequestParameters(request, voteAuthoringForm, voteGeneralAuthoringDTO); - voteGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString()); - AuthoringUtil authoringUtil = new AuthoringUtil(); List listNominationContentDTO = (List) sessionMap.get(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY); @@ -739,8 +737,6 @@ repopulateRequestParameters(request, voteAuthoringForm, voteGeneralAuthoringDTO); - voteGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString()); - AuthoringUtil authoringUtil = new AuthoringUtil(); List listNominationContentDTO = (List) sessionMap.get(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY); @@ -1015,8 +1011,6 @@ } } - voteGeneralAuthoringDTO.setSbmtSuccess(new Integer(1).toString()); - voteAuthoringForm.resetUserAction(); voteGeneralAuthoringDTO.setMapNominationContent(mapNominationContent); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAuthoringForm.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/Attic/VoteAuthoringForm.java,v diff -u -r1.25 -r1.26 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAuthoringForm.java 17 Jan 2014 22:18:25 -0000 1.25 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAuthoringForm.java 23 Jan 2014 23:53:16 -0000 1.26 @@ -97,7 +97,6 @@ protected String defaultContentIdStr; protected String defaultContentId; protected String isDefineLater; - protected String submissionAttempt; protected String defaultOptionContent; protected String httpSessionID; protected IVoteService voteService; @@ -178,8 +177,6 @@ statsMonitoring = null; edit = null; submit = null; - submissionAttempt = null; - sbmtSuccess = null; maxInputs = 0; } @@ -724,21 +721,6 @@ } /** - * @return Returns the submissionAttempt. - */ - public String getSubmissionAttempt() { - return submissionAttempt; - } - - /** - * @param submissionAttempt - * The submissionAttempt to set. - */ - public void setSubmissionAttempt(String submissionAttempt) { - this.submissionAttempt = submissionAttempt; - } - - /** * @return Returns the defineLaterInEditMode. */ public String getDefineLaterInEditMode() { @@ -836,7 +818,6 @@ contentFolderID).append("addSingleQuestion: ", addSingleQuestion).append("editableQuestionIndex: ", editableQuestionIndex).append("feedback: ", feedback).append("editQuestionBoxRequest: ", editQuestionBoxRequest).append("defineLaterInEditMode: ", defineLaterInEditMode).append( - "submissionAttempt: ", submissionAttempt).append("sbmtSuccess: ", sbmtSuccess).append( "exceptionMaxNominationInvalid: ", exceptionMaxNominationInvalid).append("isDefineLater: ", isDefineLater).append("toolContentID: ", toolContentID).append("allowText: ", allowText).append( "showResults: ", showResults).append("lockOnFinish: ", lockOnFinish).append("reflect: ", reflect) Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningForm.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/Attic/VoteLearningForm.java,v diff -u -r1.27 -r1.28 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningForm.java 17 Jan 2014 22:18:25 -0000 1.27 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningForm.java 23 Jan 2014 23:53:16 -0000 1.28 @@ -47,8 +47,6 @@ protected String optionValue; protected String checked; - protected String sbmtSuccess; - protected String userEntry; protected String dispatch; protected String toolContentID; @@ -83,7 +81,6 @@ protected String submitAnswersContent; protected String getNextQuestion; protected String getPreviousQuestion; - protected String endLearning; protected String refreshVotes; protected String submitReflection; protected String forwardtoReflection; @@ -134,7 +131,6 @@ protected void resetUserActions() { this.getNextQuestion = null; this.getPreviousQuestion = null; - this.endLearning = null; this.viewAllResults = null; } @@ -154,21 +150,6 @@ } /** - * @return Returns the endLearning. - */ - public String getEndLearning() { - return endLearning; - } - - /** - * @param endLearning - * The endLearning to set. - */ - public void setEndLearning(String endLearning) { - this.endLearning = endLearning; - } - - /** * @return Returns the getNextQuestion. */ public String getGetNextQuestion() { @@ -777,21 +758,6 @@ this.minNominationCountReached = minNominationCountReached; } - /** - * @return Returns the sbmtSuccess. - */ - public String getSbmtSuccess() { - return sbmtSuccess; - } - - /** - * @param sbmtSuccess - * The sbmtSuccess to set. - */ - public void setSbmtSuccess(String sbmtSuccess) { - this.sbmtSuccess = sbmtSuccess; - } - /** Get the votes based on the checkboxes */ public String[] getCheckedVotes() { return checkedVotes; Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java,v diff -u -r1.54 -r1.55 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java 17 Jan 2014 22:18:25 -0000 1.54 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java 23 Jan 2014 23:53:16 -0000 1.55 @@ -20,125 +20,7 @@ * http://www.gnu.org/licenses/gpl.txt * ***********************************************************************/ -/** - * - * @author Ozgur Demirtas - * - * /&userId=&toolSessionID=123&mode=teacher - * Tool Session: - * - * A tool session is the concept by which which the tool and the LAMS core manage a set of learners interacting with the tool. - * The tool session id (toolSessionID) is generated by the LAMS core and given to the tool. - * A tool session represents the use of a tool for a particulate activity for a group of learners. - * So if an activity is ungrouped, then one tool session exist for for a tool activity in a learning design. - * - * More details on the tool session id are covered under monitoring. - * When thinking about the tool content id and the tool session id, it might be helpful to think about the tool content id - * relating to the definition of an activity, whereas the tool session id relates to the runtime participation in the activity. - - * - * Learner URL: - * The learner url display the screen(s) that the learner uses to participate in the activity. - * When the learner accessed this user, it will have a tool access mode ToolAccessMode.LEARNER. - * - * It is the responsibility of the tool to record the progress of the user. - * If the tool is a multistage tool, for example asking a series of questions, the tool must keep track of what the learner has already done. - * If the user logs out and comes back to the tool later, then the tool should resume from where the learner stopped. - * When the user is completed with tool, then the tool notifies the progress engine by calling - * org.lamsfoundation.lams.learning.service.completeToolSession(Long toolSessionID, User learner). - * - * - * If the tool has a LockOnFinish flag, then the tool should lock learner's entries once they have completed the activity. - * If they return to the activity (e.g. via the progress bar) then the entries should be read only. - * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * - */ - -/** - * - * Note: Because of Voting learning reporting structure, Show Learner Report is always ON even if in authoring it is set to false. - */ - package org.lamsfoundation.lams.tool.vote.web; import java.io.IOException; @@ -189,6 +71,12 @@ import org.lamsfoundation.lams.web.session.SessionManager; import org.lamsfoundation.lams.web.util.AttributeNames; +/** + * + * @author Ozgur Demirtas + * + * Note: Because of Voting learning reporting structure, Show Learner Report is always ON even if in authoring it is set to false. + */ public class VoteLearningStarterAction extends Action implements VoteAppConstants { private static Logger logger = Logger.getLogger(VoteLearningStarterAction.class.getName()); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java,v diff -u -r1.51 -r1.52 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java 17 Jan 2014 22:18:25 -0000 1.51 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java 23 Jan 2014 23:53:16 -0000 1.52 @@ -42,12 +42,15 @@ import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionMessage; import org.apache.struts.action.ActionMessages; +import org.apache.struts.action.ActionRedirect; import org.lamsfoundation.lams.notebook.model.NotebookEntry; import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants; import org.lamsfoundation.lams.tool.exception.ToolException; import org.lamsfoundation.lams.tool.vote.EditActivityDTO; import org.lamsfoundation.lams.tool.vote.ExportPortfolioDTO; import org.lamsfoundation.lams.tool.vote.ReflectionDTO; +import org.lamsfoundation.lams.tool.vote.VoteAllGroupsDTO; +import org.lamsfoundation.lams.tool.vote.SessionDTO; import org.lamsfoundation.lams.tool.vote.VoteAppConstants; import org.lamsfoundation.lams.tool.vote.VoteComparator; import org.lamsfoundation.lams.tool.vote.VoteGeneralAuthoringDTO; @@ -86,154 +89,12 @@ return null; } - public ActionForward submitSession(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response, IVoteService voteService, MessageService messageService, - VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) throws IOException, ServletException { - commonSubmitSessionCode(form, request, voteService, messageService, voteGeneralMonitoringDTO); - return mapping.findForward(VoteAppConstants.LOAD_MONITORING); - } - - protected void commonSubmitSessionCode(ActionForm form, HttpServletRequest request, IVoteService voteService, - MessageService messageService, VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) throws IOException, - ServletException { - VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; - - repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); - String currentMonitoredToolSession = voteMonitoringForm.getSelectedToolSessionId(); - String toolContentID = voteMonitoringForm.getToolContentID(); - VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); - if (currentMonitoredToolSession.equals("All")) { - voteGeneralMonitoringDTO.setSelectionCase(new Long(2)); - request.setAttribute(VoteAppConstants.SELECTION_CASE, new Long(2)); - - List listVoteAllSessionsDTO = MonitoringUtil.prepareChartDTO(request, voteService, voteMonitoringForm, - voteContent.getVoteContentId(), messageService); - voteGeneralMonitoringDTO.setListVoteAllSessionsDTO(listVoteAllSessionsDTO); - } else { - request.setAttribute(VoteAppConstants.SELECTION_CASE, new Long(1)); - - VoteSession voteSession = voteService.retrieveVoteSession(new Long(currentMonitoredToolSession)); - MonitoringUtil.prepareChartData(request, voteService, voteMonitoringForm, voteContent.getVoteContentId() - .toString(), voteSession.getUid().toString(), null, voteGeneralMonitoringDTO, getMessageService()); - - refreshSummaryData(request, voteContent, voteService, true, false, currentMonitoredToolSession, null, true, - null, voteGeneralMonitoringDTO, null); - voteGeneralMonitoringDTO.setGroupName(voteSession.getSession_name()); - voteGeneralMonitoringDTO.setSelectionCase(new Long(1)); - } - request.setAttribute(VoteAppConstants.CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession); - - boolean isGroupedActivity = voteService.isGroupedActivity(new Long(toolContentID)); - request.setAttribute("isGroupedActivity", isGroupedActivity); - - voteGeneralMonitoringDTO.setCurrentMonitoredToolSession(currentMonitoredToolSession); - voteMonitoringForm.setSbmtSuccess(new Boolean(false).toString()); - voteGeneralMonitoringDTO.setSbmtSuccess(new Boolean(false).toString()); - voteGeneralMonitoringDTO.setRequestLearningReport(new Boolean(false).toString()); - - Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, voteContent, voteService); - voteGeneralMonitoringDTO.setSummaryToolSessions(summaryToolSessions); - - Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, voteContent, voteService); - voteGeneralMonitoringDTO.setSummaryToolSessionsId(summaryToolSessionsId); - - // initInstructionsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); - initStatsContent(toolContentID, request, voteService, 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); - while (queIterator.hasNext()) { - VoteQueContent voteQueContent = (VoteQueContent) queIterator.next(); - if (voteQueContent != null) { - 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); - } - } - - int maxIndex = mapOptionsContent.size(); - voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); - - voteGeneralAuthoringDTO.setMapOptionsContent(mapOptionsContent); - - boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(false).toString()); - if (isContentInUse == true) { - //monitoring url does not allow editActivity since the content is in use - voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString()); - } - - request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); - - // prepareReflectionData(request, voteContent, voteService, null,false); - prepareReflectionData(request, voteContent, voteService, null, false, "All"); - - if (voteService.studentActivityOccurredGlobal(voteContent)) { - voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); - } else { - voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); - } - - request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); - - EditActivityDTO editActivityDTO = new EditActivityDTO(); - if (isContentInUse == true) { - editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); - } - request.setAttribute(VoteAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO); - - /* find out if there are any reflection entries, from here */ - boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); - if (notebookEntriesExist) { - request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); - - String userExceptionNoToolSessions = voteGeneralMonitoringDTO.getUserExceptionNoToolSessions(); - - if (userExceptionNoToolSessions.equals("true")) { - //there are no online student activity but there are reflections - request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); - } - } else { - request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString()); - } - /* ... till here */ - - MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); - - } - - public ActionForward submitSession(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException { - IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); - - commonSubmitSessionCode(form, request, voteService, getMessageService(), voteGeneralMonitoringDTO); - - return mapping.findForward(VoteAppConstants.LOAD_MONITORING); - } - - public void refreshSummaryData(HttpServletRequest request, VoteContent voteContent, IVoteService voteService, + public static void refreshSummaryData(HttpServletRequest request, VoteContent voteContent, IVoteService voteService, boolean isUserNamesVisible, boolean isLearnerRequest, String currentSessionId, String userId, boolean showUserEntriesBySession, VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO, VoteGeneralMonitoringDTO voteGeneralMonitoringDTO, ExportPortfolioDTO exportPortfolioDTO) { - if (voteService == null) { - voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - } - /* this section is related to summary tab. Starts here. */ - Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, voteContent, voteService); if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { if (voteGeneralMonitoringDTO != null) { @@ -249,20 +110,28 @@ if (exportPortfolioDTO != null) { exportPortfolioDTO.setUserExceptionNoToolSessions(userExceptionNoToolSessions); } + + List listQuestions = voteService.getAllQuestionEntries(voteContent.getUid()); - Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, voteContent, voteService); + List listMonitoredAnswersContainerDTO = new LinkedList(); - if (currentSessionId != null && !currentSessionId.equals("All")) { - VoteSession voteSession = voteService.retrieveVoteSession(new Long(currentSessionId)); - if (voteGeneralMonitoringDTO != null) { - voteGeneralMonitoringDTO.setGroupName(voteSession.getSession_name()); + Iterator itListQuestions = listQuestions.iterator(); + while (itListQuestions.hasNext()) { + VoteQueContent voteQueContent = (VoteQueContent) itListQuestions.next(); + + if (voteQueContent != null) { + VoteMonitoredAnswersDTO voteMonitoredAnswersDTO = new VoteMonitoredAnswersDTO(); + voteMonitoredAnswersDTO.setQuestionUid(voteQueContent.getUid().toString()); + voteMonitoredAnswersDTO.setQuestion(voteQueContent.getQuestion()); + + Map questionAttemptData = MonitoringUtil.buildGroupsAttemptData(request, voteContent, voteQueContent, + voteQueContent.getUid().toString(), isUserNamesVisible, isLearnerRequest, currentSessionId, + userId, voteService); + voteMonitoredAnswersDTO.setQuestionAttempts(questionAttemptData); + listMonitoredAnswersContainerDTO.add(voteMonitoredAnswersDTO); + } - } else { - voteGeneralMonitoringDTO.setGroupName("All Groups"); } - - List listMonitoredAnswersContainerDTO = MonitoringUtil.buildGroupsQuestionData(request, voteContent, - isUserNamesVisible, isLearnerRequest, currentSessionId, userId, voteService); /* ends here. */ List listUserEntries = processUserEnteredNominations(voteService, voteContent, currentSessionId, @@ -279,10 +148,6 @@ } if (voteGeneralMonitoringDTO != null) { - voteGeneralMonitoringDTO.setSummaryToolSessions(summaryToolSessions); - voteGeneralMonitoringDTO.setSummaryToolSessionsId(summaryToolSessionsId); - voteGeneralMonitoringDTO.setSelectionCase(new Long(2)); - voteGeneralMonitoringDTO.setCurrentMonitoredToolSession("All"); voteGeneralMonitoringDTO.setListMonitoredAnswersContainerDto(listMonitoredAnswersContainerDTO); voteGeneralMonitoringDTO.setListUserEntries(listUserEntries); @@ -300,7 +165,7 @@ } // prepareReflectionData(request, voteContent, voteService, null,false); - prepareReflectionData(request, voteContent, voteService, null, false, "All"); + prepareReflectionData(request, voteContent, voteService, null, false); if (voteService.studentActivityOccurredGlobal(voteContent)) { voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); @@ -338,7 +203,7 @@ } - public List processUserEnteredNominations(IVoteService voteService, VoteContent voteContent, + public static List processUserEnteredNominations(IVoteService voteService, VoteContent voteContent, String currentSessionId, boolean showUserEntriesBySession, String userId, boolean showUserEntriesByUserId) { Set userEntries = voteService.getUserEntries(); @@ -423,7 +288,7 @@ } if (listMonitoredUserContainerDTO.size() > 0) { - Map mapMonitoredUserContainerDTO = MonitoringUtil + Map mapMonitoredUserContainerDTO = MonitoringUtil .convertToVoteMonitoredUserDTOMap(listMonitoredUserContainerDTO); voteMonitoredAnswersDTO.setQuestionAttempts(mapMonitoredUserContainerDTO); @@ -435,336 +300,16 @@ return listUserEntries; } - public void initSummaryContent(String toolContentID, HttpServletRequest request, IVoteService voteService, - VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) throws IOException, ServletException { - VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); - - /* this section is related to summary tab. Starts here. */ - Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, voteContent, voteService); - voteGeneralMonitoringDTO.setSummaryToolSessions(summaryToolSessions); - - Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, voteContent, voteService); - voteGeneralMonitoringDTO.setSummaryToolSessionsId(summaryToolSessionsId); - /* ends here. */ - - /* true means there is at least 1 response */ - if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { - voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); - } else { - voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); - } - - // prepareReflectionData(request, voteContent, voteService, null,false); - prepareReflectionData(request, voteContent, voteService, null, false, "All"); - - EditActivityDTO editActivityDTO = new EditActivityDTO(); - boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - if (isContentInUse == true) { - editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); - } - request.setAttribute(VoteAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO); - - voteGeneralMonitoringDTO.setCurrentMonitoringTab("summary"); - - request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); - - /* find out if there are any reflection entries, from here */ - boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); - - if (notebookEntriesExist) { - request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); - - String userExceptionNoToolSessions = voteGeneralMonitoringDTO.getUserExceptionNoToolSessions(); - - if (userExceptionNoToolSessions.equals("true")) { - //there are no online student activity but there are reflections - request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); - } - } else { - request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString()); - } - /* ... till here */ - - MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); - - } - - public void initStatsContent(String toolContentID, HttpServletRequest request, IVoteService voteService, - VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) throws IOException, ServletException { - VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); - - if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { - voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); - } else { - voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); - } - - refreshStatsData(request, voteService, voteGeneralMonitoringDTO); - - // prepareReflectionData(request, voteContent, voteService, null,false); - prepareReflectionData(request, voteContent, voteService, null, false, "All"); - - EditActivityDTO editActivityDTO = new EditActivityDTO(); - boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - if (isContentInUse == true) { - editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); - } - request.setAttribute(VoteAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO); - - voteGeneralMonitoringDTO.setCurrentMonitoringTab("stats"); - - request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); - - /* find out if there are any reflection entries, from here */ - boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); - - if (notebookEntriesExist) { - request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); - - String userExceptionNoToolSessions = voteGeneralMonitoringDTO.getUserExceptionNoToolSessions(); - - if (userExceptionNoToolSessions.equals("true")) { - //there are no online student activity but there are reflections - request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); - } - } else { - request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString()); - } - /* ... till here */ - - MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); - } - - public void refreshStatsData(HttpServletRequest request, IVoteService voteService, - VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) { - /* it is possible that no users has ever logged in for the activity yet */ - if (voteService == null) { - voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - } - - int countAllUsers = voteService.getTotalNumberOfUsers(); - if (countAllUsers == 0) { - voteGeneralMonitoringDTO.setUserExceptionNoStudentActivity(new Boolean(true).toString()); - } - - voteGeneralMonitoringDTO.setCountAllUsers(new Integer(countAllUsers).toString()); - - int countSessionComplete = voteService.countSessionComplete(); - voteGeneralMonitoringDTO.setCountSessionComplete(new Integer(countSessionComplete).toString()); - - request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); - } - - /** - * calls learning action endLearning functionality - * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws IOException - * @throws ServletException - * @throws ToolException - */ - public ActionForward endLearning(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException, ToolException { - IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; - voteMonitoringForm.setVoteService(voteService); - - VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); - repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); - - VoteLearningAction voteLearningAction = new VoteLearningAction(); - - return null; - } - - public ActionForward viewOpenVotes(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException, ToolException { - IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; - voteMonitoringForm.setVoteService(voteService); - - VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); - - repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); - - if (voteService == null) { - voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - } - - voteMonitoringForm.setShowOpenVotesSection(new Boolean(true).toString()); - voteGeneralMonitoringDTO.setShowOpenVotesSection(new Boolean(true).toString()); - - String toolContentID = voteMonitoringForm.getToolContentID(); - VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); - String currentMonitoredToolSession = voteMonitoringForm.getSelectedToolSessionId(); - refreshSummaryData(request, voteContent, voteService, true, false, currentMonitoredToolSession, null, true, - null, voteGeneralMonitoringDTO, null); - - initSummaryContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); - - initStatsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); - if (voteService.studentActivityOccurredGlobal(voteContent)) { - voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); - } else { - voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); - } - request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); - - if (currentMonitoredToolSession.equals("All")) { - voteGeneralMonitoringDTO.setSelectionCase(new Long(2)); - } else { - voteGeneralMonitoringDTO.setSelectionCase(new Long(1)); - } - - voteGeneralMonitoringDTO.setCurrentMonitoredToolSession(currentMonitoredToolSession); - voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString()); - - request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); - - if (voteContent != null) { - // prepareReflectionData(request, voteContent, voteService, null,false); - prepareReflectionData(request, voteContent, voteService, null, false, "All"); - - EditActivityDTO editActivityDTO = new EditActivityDTO(); - boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - if (isContentInUse == true) { - editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); - } - request.setAttribute(VoteAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO); - } - - EditActivityDTO editActivityDTO = new EditActivityDTO(); - boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - if (isContentInUse == true) { - editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); - } - request.setAttribute(VoteAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO); - - /* find out if there are any reflection entries, from here */ - boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); - - if (notebookEntriesExist) { - request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); - - String userExceptionNoToolSessions = voteGeneralMonitoringDTO.getUserExceptionNoToolSessions(); - if (userExceptionNoToolSessions.equals("true")) { - //there are no online student activity but there are reflections - request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); - } - } else { - request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString()); - } - /* ... till here */ - - MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); - - if (currentMonitoredToolSession.equals("")) { - currentMonitoredToolSession = "All"; - } - - if (currentMonitoredToolSession.equals("All")) { - request.setAttribute(VoteAppConstants.SELECTION_CASE, new Long(2)); - } else { - request.setAttribute(VoteAppConstants.SELECTION_CASE, new Long(1)); - } - - return mapping.findForward(VoteAppConstants.LOAD_MONITORING); - } - - public ActionForward closeOpenVotes(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException, ToolException { - IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - - VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; - voteMonitoringForm.setVoteService(voteService); - - VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); - - repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); - - voteMonitoringForm.setShowOpenVotesSection(new Boolean(false).toString()); - voteGeneralMonitoringDTO.setShowOpenVotesSection(new Boolean(false).toString()); - - String toolContentID = voteMonitoringForm.getToolContentID(); - initSummaryContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); - initStatsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); - voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString()); - - VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); - if (voteContent != null) { - if (voteService.studentActivityOccurredGlobal(voteContent)) { - voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); - } else { - voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); - } - } - - request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); - - if (voteContent != null) { - // prepareReflectionData(request, voteContent, voteService, null,false); - prepareReflectionData(request, voteContent, voteService, null, false, "All"); - - EditActivityDTO editActivityDTO = new EditActivityDTO(); - boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - if (isContentInUse == true) { - editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); - } - request.setAttribute(VoteAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO); - } - - EditActivityDTO editActivityDTO = new EditActivityDTO(); - boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - if (isContentInUse == true) { - editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); - } - request.setAttribute(VoteAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO); - - /* find out if there are any reflection entries, from here */ - boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); - - if (notebookEntriesExist) { - request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); - - String userExceptionNoToolSessions = voteGeneralMonitoringDTO.getUserExceptionNoToolSessions(); - - if (userExceptionNoToolSessions.equals("true")) { - request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); - } - } else { - request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString()); - } - /* ... till here */ - - MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); - String currentMonitoredToolSession = voteMonitoringForm.getSelectedToolSessionId(); - if (currentMonitoredToolSession.equals("")) { - currentMonitoredToolSession = "All"; - } - - if (currentMonitoredToolSession.equals("All")) { - request.setAttribute(VoteAppConstants.SELECTION_CASE, new Long(2)); - } else { - request.setAttribute(VoteAppConstants.SELECTION_CASE, new Long(1)); - } - - return mapping.findForward(VoteAppConstants.LOAD_MONITORING); - } - public ActionForward hideOpenVote(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, ToolException { IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; - voteMonitoringForm.setVoteService(voteService); +// voteMonitoringForm.setVoteService(voteService); - VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); +// VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); - repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); +// repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); String currentUid = voteMonitoringForm.getCurrentUid(); @@ -775,83 +320,74 @@ voteService.hideOpenVote(voteUsrAttempt); String toolContentID = voteMonitoringForm.getToolContentID(); - VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); - initSummaryContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); - initStatsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); - String currentMonitoredToolSession = voteMonitoringForm.getSelectedToolSessionId(); - refreshSummaryData(request, voteContent, voteService, true, false, currentMonitoredToolSession, null, true, - null, voteGeneralMonitoringDTO, null); - - if (currentMonitoredToolSession.equals("")) { - currentMonitoredToolSession = "All"; - } - - if (currentMonitoredToolSession.equals("All")) { - voteGeneralMonitoringDTO.setSelectionCase(new Long(2)); - request.setAttribute(VoteAppConstants.SELECTION_CASE, new Long(2)); - } else { - voteGeneralMonitoringDTO.setSelectionCase(new Long(1)); - request.setAttribute(VoteAppConstants.SELECTION_CASE, new Long(1)); - } - - voteGeneralMonitoringDTO.setCurrentMonitoredToolSession(currentMonitoredToolSession); - - voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString()); - - if (voteService.studentActivityOccurredGlobal(voteContent)) { - voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); - } else { - voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); - } - - request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); - - request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); - - if (voteContent != null) { - // prepareReflectionData(request, voteContent, voteService, null,false); - prepareReflectionData(request, voteContent, voteService, null, false, "All"); - - EditActivityDTO editActivityDTO = new EditActivityDTO(); - boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - if (isContentInUse == true) { - editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); - } - request.setAttribute(VoteAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO); - } - - /* find out if there are any reflection entries, from here */ - boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); - - if (notebookEntriesExist) { - request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); - - String userExceptionNoToolSessions = voteGeneralMonitoringDTO.getUserExceptionNoToolSessions(); - - if (userExceptionNoToolSessions.equals("true")) { - request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); - } - } else { - request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString()); - } - /* ... till here */ - - MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); - - return submitSession(mapping, form, request, response, voteService, getMessageService(), - voteGeneralMonitoringDTO); +// VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); +// initSummaryContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); +// initStatsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); +// refreshSummaryData(request, voteContent, voteService, true, false, null, null, true, +// null, voteGeneralMonitoringDTO, null); +// +// voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString()); +// +// if (voteService.studentActivityOccurredGlobal(voteContent)) { +// voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); +// } else { +// voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); +// } +// +// request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); +// +// request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); +// +// if (voteContent != null) { +// // prepareReflectionData(request, voteContent, voteService, null,false); +// prepareReflectionData(request, voteContent, voteService, null, false); +// +// EditActivityDTO editActivityDTO = new EditActivityDTO(); +// boolean isContentInUse = VoteUtils.isContentInUse(voteContent); +// if (isContentInUse == true) { +// editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); +// } +// request.setAttribute(VoteAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO); +// } +// +// /* find out if there are any reflection entries, from here */ +// boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); +// +// if (notebookEntriesExist) { +// request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); +// +// String userExceptionNoToolSessions = voteGeneralMonitoringDTO.getUserExceptionNoToolSessions(); +// +// if (userExceptionNoToolSessions.equals("true")) { +// request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); +// } +// } else { +// request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString()); +// } +// /* ... till here */ +// +// MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); + + ActionRedirect redirect = new ActionRedirect( + mapping.findForwardConfig(VoteAppConstants.MONITORING_STARTER_REDIRECT)); + redirect.addParameter(AttributeNames.PARAM_TOOL_CONTENT_ID, toolContentID); + return redirect; +// +// +// return submitSession(mapping, form, request, response, voteService, getMessageService(), +// voteGeneralMonitoringDTO); } public ActionForward showOpenVote(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, ToolException { IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; - voteMonitoringForm.setVoteService(voteService); +// voteMonitoringForm.setVoteService(voteService); - VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); +// VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); - repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); +// repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); String currentUid = voteMonitoringForm.getCurrentUid(); @@ -863,69 +399,60 @@ String toolContentID = voteMonitoringForm.getToolContentID(); - VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); - - initSummaryContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); - - initStatsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); - String currentMonitoredToolSession = voteMonitoringForm.getSelectedToolSessionId(); - - refreshSummaryData(request, voteContent, voteService, true, false, currentMonitoredToolSession, null, true, - null, voteGeneralMonitoringDTO, null); - - if (currentMonitoredToolSession.equals("")) { - currentMonitoredToolSession = "All"; - } - - if (currentMonitoredToolSession.equals("All")) { - voteGeneralMonitoringDTO.setSelectionCase(new Long(2)); - request.setAttribute(VoteAppConstants.SELECTION_CASE, new Long(2)); - } else { - voteGeneralMonitoringDTO.setSelectionCase(new Long(1)); - request.setAttribute(VoteAppConstants.SELECTION_CASE, new Long(1)); - } - - voteGeneralMonitoringDTO.setCurrentMonitoredToolSession(currentMonitoredToolSession); - voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString()); - - if (voteService.studentActivityOccurredGlobal(voteContent)) { - voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); - } else { - voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); - } - - request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); - - if (voteContent != null) { - // prepareReflectionData(request, voteContent, voteService, null,false); - prepareReflectionData(request, voteContent, voteService, null, false, "All"); - - EditActivityDTO editActivityDTO = new EditActivityDTO(); - boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - if (isContentInUse == true) { - editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); - } - request.setAttribute(VoteAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO); - } - - /* find out if there are any reflection entries, from here */ - boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); - if (notebookEntriesExist) { - request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); - - String userExceptionNoToolSessions = voteGeneralMonitoringDTO.getUserExceptionNoToolSessions(); - - if (userExceptionNoToolSessions.equals("true")) { - request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); - } - } else { - request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString()); - } - /* ... till here */ - - MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); - return submitSession(mapping, form, request, response, voteService, getMessageService(), - voteGeneralMonitoringDTO); +// VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); +// +// initSummaryContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); +// +// initStatsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); +// +// refreshSummaryData(request, voteContent, voteService, true, false, null, null, true, +// null, voteGeneralMonitoringDTO, null); +// +// voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString()); +// +// if (voteService.studentActivityOccurredGlobal(voteContent)) { +// voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); +// } else { +// voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); +// } +// +// request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); +// +// if (voteContent != null) { +// // prepareReflectionData(request, voteContent, voteService, null,false); +// prepareReflectionData(request, voteContent, voteService, null, false); +// +// EditActivityDTO editActivityDTO = new EditActivityDTO(); +// boolean isContentInUse = VoteUtils.isContentInUse(voteContent); +// if (isContentInUse == true) { +// editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); +// } +// request.setAttribute(VoteAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO); +// } +// +// /* find out if there are any reflection entries, from here */ +// boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); +// if (notebookEntriesExist) { +// request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); +// +// String userExceptionNoToolSessions = voteGeneralMonitoringDTO.getUserExceptionNoToolSessions(); +// +// if (userExceptionNoToolSessions.equals("true")) { +// request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); +// } +// } else { +// request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString()); +// } +// /* ... till here */ +// +// MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); +// return submitSession(mapping, form, request, response, voteService, getMessageService(), +// voteGeneralMonitoringDTO); + + ActionRedirect redirect = new ActionRedirect( + mapping.findForwardConfig(VoteAppConstants.MONITORING_STARTER_REDIRECT)); + redirect.addParameter(AttributeNames.PARAM_TOOL_CONTENT_ID, toolContentID); + return redirect; } public ActionForward getVoteNomination(ActionMapping mapping, ActionForm form, HttpServletRequest request, @@ -937,7 +464,7 @@ voteMonitoringForm.setVoteService(voteService); VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); - repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); + MonitoringUtil.repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); String questionUid = request.getParameter("questionUid"); String sessionUid = request.getParameter("sessionUid"); @@ -1001,34 +528,6 @@ } protected void repopulateRequestParameters(HttpServletRequest request, VoteMonitoringForm voteMonitoringForm, - VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) { - - String toolContentID = request.getParameter(VoteAppConstants.TOOL_CONTENT_ID); - voteMonitoringForm.setToolContentID(toolContentID); - voteGeneralMonitoringDTO.setToolContentID(toolContentID); - - String activeModule = request.getParameter(VoteAppConstants.ACTIVE_MODULE); - voteMonitoringForm.setActiveModule(activeModule); - voteGeneralMonitoringDTO.setActiveModule(activeModule); - - String defineLaterInEditMode = request.getParameter(VoteAppConstants.DEFINE_LATER_IN_EDIT_MODE); - voteMonitoringForm.setDefineLaterInEditMode(defineLaterInEditMode); - voteGeneralMonitoringDTO.setDefineLaterInEditMode(defineLaterInEditMode); - - String isToolSessionChanged = request.getParameter(VoteAppConstants.IS_TOOL_SESSION_CHANGED); - voteMonitoringForm.setIsToolSessionChanged(isToolSessionChanged); - voteGeneralMonitoringDTO.setIsToolSessionChanged(isToolSessionChanged); - - String responseId = request.getParameter(VoteAppConstants.RESPONSE_ID); - voteMonitoringForm.setResponseId(responseId); - voteGeneralMonitoringDTO.setResponseId(responseId); - - String currentUid = request.getParameter(VoteAppConstants.CURRENT_UID); - voteMonitoringForm.setCurrentUid(currentUid); - voteGeneralMonitoringDTO.setCurrentUid(currentUid); - } - - protected void repopulateRequestParameters(HttpServletRequest request, VoteMonitoringForm voteMonitoringForm, VoteGeneralAuthoringDTO voteGeneralAuthoringDTO) { String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); @@ -1097,8 +596,8 @@ prepareEditActivityScreenData(request, voteContent); - // prepareReflectionData(request, voteContent, voteService, null, false, "All"); - prepareReflectionData(request, voteContent, voteService, null, false, "All"); + // prepareReflectionData(request, voteContent, voteService, null, false); + prepareReflectionData(request, voteContent, voteService, null, false); if (voteService.studentActivityOccurredGlobal(voteContent)) { generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); @@ -1151,8 +650,49 @@ /* ... till here */ MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); - MonitoringUtil.generateGroupsSessionData(request, voteService, voteContent); + + List listQuestions = voteService.getAllQuestionEntries(voteContent.getUid()); + List listAllGroupsContainerDTO = new LinkedList(); + Iterator iteratorSession = voteContent.getVoteSessions().iterator(); + while (iteratorSession.hasNext()) { + VoteSession voteSession = (VoteSession) iteratorSession.next(); + String currentSessionId = voteSession.getVoteSessionId().toString(); + + String currentSessionName = voteSession.getSession_name(); + + VoteAllGroupsDTO voteAllGroupsDTO = new VoteAllGroupsDTO(); + List listMonitoredAnswersContainerDTO = new LinkedList(); + + if (voteSession != null) { + Iterator itListQuestions = listQuestions.iterator(); + while (itListQuestions.hasNext()) { + VoteQueContent voteQueContent = (VoteQueContent) itListQuestions.next(); + + if (voteQueContent != null) { + VoteMonitoredAnswersDTO voteMonitoredAnswersDTO = new VoteMonitoredAnswersDTO(); + voteMonitoredAnswersDTO.setQuestionUid(voteQueContent.getUid().toString()); + voteMonitoredAnswersDTO.setQuestion(voteQueContent.getQuestion()); + voteMonitoredAnswersDTO.setSessionId(currentSessionId); + voteMonitoredAnswersDTO.setSessionName(currentSessionName); + + Map questionAttemptData = MonitoringUtil.buildGroupsAttemptData(request, voteContent, voteService, + voteQueContent, voteQueContent.getUid().toString(), currentSessionId); + voteMonitoredAnswersDTO.setQuestionAttempts(questionAttemptData); + + listMonitoredAnswersContainerDTO.add(voteMonitoredAnswersDTO); + } + } + } + voteAllGroupsDTO.setGroupData(listMonitoredAnswersContainerDTO); + voteAllGroupsDTO.setSessionName(currentSessionName); + voteAllGroupsDTO.setSessionId(currentSessionId); + + listAllGroupsContainerDTO.add(voteAllGroupsDTO); + + } + request.setAttribute(LIST_ALL_GROUPS_DTO, listAllGroupsContainerDTO); + return mapping.findForward(VoteAppConstants.LOAD_MONITORING); } @@ -1279,8 +819,6 @@ voteGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); } - voteGeneralAuthoringDTO.setSbmtSuccess(new Integer(1).toString()); - voteAuthoringForm.resetUserAction(); voteGeneralAuthoringDTO.setMapNominationContent(mapNominationContent); @@ -1313,7 +851,7 @@ if (voteContent != null) { // prepareReflectionData(request, voteContent, voteService, null,false); - prepareReflectionData(request, voteContent, voteService, null, false, "All"); + prepareReflectionData(request, voteContent, voteService, null, false); EditActivityDTO editActivityDTO = new EditActivityDTO(); boolean isContentInUse = VoteUtils.isContentInUse(voteContent); @@ -1377,8 +915,6 @@ voteGeneralAuthoringDTO.setContentFolderID(contentFolderID); - voteGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString()); - AuthoringUtil authoringUtil = new AuthoringUtil(); List listNominationContentDTO = (List) sessionMap.get(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY); @@ -1487,7 +1023,7 @@ if (voteContent != null) { // prepareReflectionData(request, voteContent, voteService, null,false); - prepareReflectionData(request, voteContent, voteService, null, false, "All"); + prepareReflectionData(request, voteContent, voteService, null, false); EditActivityDTO editActivityDTO = new EditActivityDTO(); boolean isContentInUse = VoteUtils.isContentInUse(voteContent); @@ -1565,8 +1101,6 @@ VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); voteGeneralAuthoringDTO.setContentFolderID(contentFolderID); - voteGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString()); - AuthoringUtil authoringUtil = new AuthoringUtil(); List listNominationContentDTO = (List) sessionMap.get(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY); @@ -1626,7 +1160,7 @@ if (voteContent != null) { // prepareReflectionData(request, voteContent, voteService, null,false); - prepareReflectionData(request, voteContent, voteService, null, false, "All"); + prepareReflectionData(request, voteContent, voteService, null, false); } VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); @@ -1716,7 +1250,7 @@ if (voteContent != null) { // prepareReflectionData(request, voteContent, voteService, null,false); - prepareReflectionData(request, voteContent, voteService, null, false, "All"); + prepareReflectionData(request, voteContent, voteService, null, false); EditActivityDTO editActivityDTO = new EditActivityDTO(); boolean isContentInUse = VoteUtils.isContentInUse(voteContent); @@ -1829,7 +1363,7 @@ if (voteContent != null) { // prepareReflectionData(request, voteContent, voteService, null,false); - prepareReflectionData(request, voteContent, voteService, null, false, "All"); + prepareReflectionData(request, voteContent, voteService, null, false); EditActivityDTO editActivityDTO = new EditActivityDTO(); boolean isContentInUse = VoteUtils.isContentInUse(voteContent); @@ -1972,7 +1506,7 @@ if (voteContent != null) { // prepareReflectionData(request, voteContent, voteService, null,false); - prepareReflectionData(request, voteContent, voteService, null, false, "All"); + prepareReflectionData(request, voteContent, voteService, null, false); EditActivityDTO editActivityDTO = new EditActivityDTO(); boolean isContentInUse = VoteUtils.isContentInUse(voteContent); @@ -2097,7 +1631,7 @@ if (voteContent != null) { // prepareReflectionData(request, voteContent, voteService, null,false); - prepareReflectionData(request, voteContent, voteService, null, false, "All"); + prepareReflectionData(request, voteContent, voteService, null, false); EditActivityDTO editActivityDTO = new EditActivityDTO(); boolean isContentInUse = VoteUtils.isContentInUse(voteContent); @@ -2223,7 +1757,7 @@ if (voteContent != null) { // prepareReflectionData(request, voteContent, voteService, null,false); - prepareReflectionData(request, voteContent, voteService, null, false, "All"); + prepareReflectionData(request, voteContent, voteService, null, false); EditActivityDTO editActivityDTO = new EditActivityDTO(); boolean isContentInUse = VoteUtils.isContentInUse(voteContent); @@ -2263,30 +1797,10 @@ return mapping.findForward(VoteAppConstants.LOAD_MONITORING); } - public void prepareReflectionData(HttpServletRequest request, VoteContent voteContent, IVoteService voteService, - String userID, boolean exportMode, String currentSessionId) { + public static void prepareReflectionData(HttpServletRequest request, VoteContent voteContent, IVoteService voteService, + String userID, boolean exportMode) { List reflectionsContainerDTO = new LinkedList(); - reflectionsContainerDTO = getReflectionList(voteContent, userID, voteService); - request.setAttribute(VoteAppConstants.REFLECTIONS_CONTAINER_DTO, reflectionsContainerDTO); - - if (exportMode) { - request.getSession().setAttribute(VoteAppConstants.REFLECTIONS_CONTAINER_DTO, reflectionsContainerDTO); - } - } - - /** - * returns reflection data for all sessions - * - * getReflectionList - * - * @param voteContent - * @param userID - * @param voteService - * @return - */ - public List getReflectionList(VoteContent voteContent, String userID, IVoteService voteService) { - List reflectionsContainerDTO = new LinkedList(); if (userID == null) { for (Iterator sessionIter = voteContent.getVoteSessions().iterator(); sessionIter.hasNext();) { VoteSession voteSession = (VoteSession) sessionIter.next(); @@ -2334,80 +1848,11 @@ } } } + request.setAttribute(VoteAppConstants.REFLECTIONS_CONTAINER_DTO, reflectionsContainerDTO); - return reflectionsContainerDTO; - } - - /** - * returns reflection data for a specific session - * - * @param voteContent - * @param userID - * @param voteService - * @param currentSessionId - * @return - */ - public List getReflectionListForSession(VoteContent voteContent, String userID, IVoteService voteService, - String currentSessionId) { - - List reflectionsContainerDTO = new LinkedList(); - if (userID == null) { - for (Iterator sessionIter = voteContent.getVoteSessions().iterator(); sessionIter.hasNext();) { - VoteSession voteSession = (VoteSession) sessionIter.next(); - - if (currentSessionId.equals(voteSession.getVoteSessionId())) { - - for (Iterator userIter = voteSession.getVoteQueUsers().iterator(); userIter.hasNext();) { - VoteQueUsr user = (VoteQueUsr) userIter.next(); - - NotebookEntry notebookEntry = voteService.getEntry(voteSession.getVoteSessionId(), - CoreNotebookConstants.NOTEBOOK_TOOL, VoteAppConstants.MY_SIGNATURE, new Integer(user - .getQueUsrId().toString())); - - if (notebookEntry != null) { - ReflectionDTO reflectionDTO = new ReflectionDTO(); - reflectionDTO.setUserId(user.getQueUsrId().toString()); - reflectionDTO.setSessionId(voteSession.getVoteSessionId().toString()); - reflectionDTO.setUserName(user.getFullname()); - reflectionDTO.setReflectionUid(notebookEntry.getUid().toString()); - String notebookEntryPresentable = VoteUtils.replaceNewLines(notebookEntry.getEntry()); - reflectionDTO.setEntry(notebookEntryPresentable); - reflectionsContainerDTO.add(reflectionDTO); - } - } - } - } - } else { - for (Iterator sessionIter = voteContent.getVoteSessions().iterator(); sessionIter.hasNext();) { - VoteSession voteSession = (VoteSession) sessionIter.next(); - - if (currentSessionId.equals(voteSession.getVoteSessionId())) { - for (Iterator userIter = voteSession.getVoteQueUsers().iterator(); userIter.hasNext();) { - VoteQueUsr user = (VoteQueUsr) userIter.next(); - - if (user.getQueUsrId().toString().equals(userID)) { - NotebookEntry notebookEntry = voteService.getEntry(voteSession.getVoteSessionId(), - CoreNotebookConstants.NOTEBOOK_TOOL, VoteAppConstants.MY_SIGNATURE, new Integer( - user.getQueUsrId().toString())); - - if (notebookEntry != null) { - ReflectionDTO reflectionDTO = new ReflectionDTO(); - reflectionDTO.setUserId(user.getQueUsrId().toString()); - reflectionDTO.setSessionId(voteSession.getVoteSessionId().toString()); - reflectionDTO.setUserName(user.getFullname()); - reflectionDTO.setReflectionUid(notebookEntry.getUid().toString()); - String notebookEntryPresentable = VoteUtils.replaceNewLines(notebookEntry.getEntry()); - reflectionDTO.setEntry(notebookEntryPresentable); - reflectionsContainerDTO.add(reflectionDTO); - } - } - } - - } - } + if (exportMode) { + request.getSession().setAttribute(VoteAppConstants.REFLECTIONS_CONTAINER_DTO, reflectionsContainerDTO); } - - return reflectionsContainerDTO; } /** Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringForm.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/Attic/VoteMonitoringForm.java,v diff -u -r1.12 -r1.13 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringForm.java 17 Sep 2006 06:29:22 -0000 1.12 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringForm.java 23 Jan 2014 23:53:16 -0000 1.13 @@ -21,229 +21,168 @@ * ***********************************************************************/ package org.lamsfoundation.lams.tool.vote.web; - import org.lamsfoundation.lams.tool.vote.VoteAppConstants; /** - *

ActionForm for the Monitoring environment

+ *

+ * ActionForm for the Monitoring environment + *

* * @author Ozgur Demirtas */ public class VoteMonitoringForm extends VoteAuthoringForm implements VoteAppConstants { - // controls which method is called by the Lookup map */ - - protected String method; - - protected String selectedToolSessionId; - - protected String isToolSessionChanged; - - protected String sessionUserCount; - - protected String completedSessionUserCount; - - protected String completedSessionUserPercent; - - protected String viewOpenVotes; - - protected String showOpenVotesSection; - - protected String closeOpenVotes; - - protected String hideOpenVote; - - protected String showOpenVote; - - protected String currentUid; - - protected String existsOpenVotes; - - protected String toolContentID; - - protected String defineLaterInEditMode; - - + // controls which method is called by the Lookup map */ + + protected String method; + + protected String sessionUserCount; + + protected String completedSessionUserCount; + + protected String hideOpenVote; + + protected String showOpenVote; + + protected String currentUid; + + protected String existsOpenVotes; + + protected String toolContentID; + + protected String defineLaterInEditMode; + /** * @return Returns the toolContentID. */ public String getToolContentID() { - return toolContentID; + return toolContentID; } + /** - * @param toolContentID The toolContentID to set. + * @param toolContentID + * The toolContentID to set. */ public void setToolContentID(String toolContentID) { - this.toolContentID = toolContentID; + this.toolContentID = toolContentID; } + /** * @return Returns the currentUid. */ public String getCurrentUid() { - return currentUid; + return currentUid; } + /** - * @param currentUid The currentUid to set. + * @param currentUid + * The currentUid to set. */ public void setCurrentUid(String currentUid) { - this.currentUid = currentUid; + this.currentUid = currentUid; } + /** * @return Returns the hideOpenVote. */ public String getHideOpenVote() { - return hideOpenVote; + return hideOpenVote; } + /** - * @param hideOpenVote The hideOpenVote to set. + * @param hideOpenVote + * The hideOpenVote to set. */ public void setHideOpenVote(String hideOpenVote) { - this.hideOpenVote = hideOpenVote; + this.hideOpenVote = hideOpenVote; } + /** - * @return Returns the closeOpenVotes. + * @return Returns the method. */ - public String getCloseOpenVotes() { - return closeOpenVotes; + public String getMethod() { + return method; } + /** - * @param closeOpenVotes The closeOpenVotes to set. + * @param method + * The method to set. */ - public void setCloseOpenVotes(String closeOpenVotes) { - this.closeOpenVotes = closeOpenVotes; + public void setMethod(String method) { + this.method = method; } - /** - * @return Returns the viewOpenVotes. - */ - public String getViewOpenVotes() { - return viewOpenVotes; - } - /** - * @param viewOpenVotes The viewOpenVotes to set. - */ - public void setViewOpenVotes(String viewOpenVotes) { - this.viewOpenVotes = viewOpenVotes; - } - /** - * @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 selectedToolSessionId. - */ - public String getSelectedToolSessionId() { - return selectedToolSessionId; - } - /** - * @param selectedToolSessionId The selectedToolSessionId to set. - */ - public void setSelectedToolSessionId(String selectedToolSessionId) { - this.selectedToolSessionId = selectedToolSessionId; - } - - /** - * @return Returns the method. - */ - public String getMethod() { - return method; - } - /** - * @param method The method to set. - */ - public void setMethod(String method) { - this.method = method; - } /** * @return Returns the completedSessionUserCount. */ public String getCompletedSessionUserCount() { - return completedSessionUserCount; + return completedSessionUserCount; } + /** - * @param completedSessionUserCount The completedSessionUserCount to set. + * @param completedSessionUserCount + * The completedSessionUserCount to set. */ public void setCompletedSessionUserCount(String completedSessionUserCount) { - this.completedSessionUserCount = completedSessionUserCount; + this.completedSessionUserCount = completedSessionUserCount; } + /** * @return Returns the sessionUserCount. */ public String getSessionUserCount() { - return sessionUserCount; + return sessionUserCount; } + /** - * @param sessionUserCount The sessionUserCount to set. + * @param sessionUserCount + * The sessionUserCount to set. */ public void setSessionUserCount(String sessionUserCount) { - this.sessionUserCount = sessionUserCount; + this.sessionUserCount = sessionUserCount; } + /** - * @return Returns the showOpenVotesSection. - */ - public String getShowOpenVotesSection() { - return showOpenVotesSection; - } - /** - * @param showOpenVotesSection The showOpenVotesSection to set. - */ - public void setShowOpenVotesSection(String showOpenVotesSection) { - this.showOpenVotesSection = showOpenVotesSection; - } - /** * @return Returns the showOpenVote. */ public String getShowOpenVote() { - return showOpenVote; + return showOpenVote; } + /** - * @param showOpenVote The showOpenVote to set. + * @param showOpenVote + * The showOpenVote to set. */ public void setShowOpenVote(String showOpenVote) { - this.showOpenVote = showOpenVote; + this.showOpenVote = showOpenVote; } + /** - * @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 existsOpenVotes. */ public String getExistsOpenVotes() { - return existsOpenVotes; + return existsOpenVotes; } + /** - * @param existsOpenVotes The existsOpenVotes to set. + * @param existsOpenVotes + * The existsOpenVotes to set. */ public void setExistsOpenVotes(String existsOpenVotes) { - this.existsOpenVotes = existsOpenVotes; + this.existsOpenVotes = existsOpenVotes; } + /** * @return Returns the defineLaterInEditMode. */ public String getDefineLaterInEditMode() { - return defineLaterInEditMode; + return defineLaterInEditMode; } + /** - * @param defineLaterInEditMode The defineLaterInEditMode to set. + * @param defineLaterInEditMode + * The defineLaterInEditMode to set. */ public void setDefineLaterInEditMode(String defineLaterInEditMode) { - this.defineLaterInEditMode = defineLaterInEditMode; + this.defineLaterInEditMode = defineLaterInEditMode; } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java,v diff -u -r1.40 -r1.41 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java 17 Jan 2014 22:18:25 -0000 1.40 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java 23 Jan 2014 23:53:16 -0000 1.41 @@ -27,6 +27,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.TreeMap; import javax.servlet.ServletException; @@ -42,6 +43,7 @@ import org.apache.struts.action.ActionMessage; import org.apache.struts.action.ActionMessages; import org.lamsfoundation.lams.tool.vote.EditActivityDTO; +import org.lamsfoundation.lams.tool.vote.SessionDTO; import org.lamsfoundation.lams.tool.vote.VoteAppConstants; import org.lamsfoundation.lams.tool.vote.VoteApplicationException; import org.lamsfoundation.lams.tool.vote.VoteComparator; @@ -51,284 +53,560 @@ 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.service.IVoteService; import org.lamsfoundation.lams.tool.vote.service.VoteServiceProxy; import org.lamsfoundation.lams.util.MessageService; import org.lamsfoundation.lams.web.util.AttributeNames; import org.lamsfoundation.lams.web.util.SessionMap; - /** * - *

Starts up the monitoring module

+ *

+ * Starts up the monitoring module + *

* * @author Ozgur Demirtas */ public class VoteMonitoringStarterAction extends Action implements VoteAppConstants { - static Logger logger = Logger.getLogger(VoteMonitoringStarterAction.class.getName()); + static Logger logger = Logger.getLogger(VoteMonitoringStarterAction.class.getName()); - public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) - throws IOException, ServletException, VoteApplicationException - { - VoteUtils.cleanUpSessionAbsolute(request); + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException, VoteApplicationException { + VoteUtils.cleanUpSessionAbsolute(request); - IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - - MessageService messageService = VoteServiceProxy.getMessageService(getServlet().getServletContext()); - - VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; - - VoteGeneralAuthoringDTO voteGeneralAuthoringDTO= new VoteGeneralAuthoringDTO(); - VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO(); - - ActionForward validateParameters=validateParameters(request, mapping, voteMonitoringForm); - - if (validateParameters != null) - { - return validateParameters; - } + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - boolean initData=initialiseMonitoringData(mapping, form, request, response, - voteService, voteGeneralMonitoringDTO); - if (initData == false) - return (mapping.findForward(ERROR_LIST)); - - voteMonitoringForm.setCurrentTab("1"); - voteGeneralMonitoringDTO.setCurrentTab("1"); - - String toolContentID=voteMonitoringForm.getToolContentID(); - - 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(); - - voteMonitoringAction.initSummaryContent(toolContentID , request, voteService, voteGeneralMonitoringDTO); - voteMonitoringAction.initStatsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); - - VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); - - /*true means there is at least 1 response*/ - if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) - { - voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); - } - else - { - voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); - } + MessageService messageService = VoteServiceProxy.getMessageService(getServlet().getServletContext()); - voteMonitoringForm.setActiveModule(MONITORING); - voteGeneralMonitoringDTO.setActiveModule(MONITORING); - - voteMonitoringForm.setSelectedToolSessionId("All"); - voteGeneralMonitoringDTO.setSelectedToolSessionId("All"); - - voteMonitoringForm.setSbmtSuccess(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()); - - request.setAttribute(VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); - - /*this section is needed for Edit Activity screen, from here... */ - voteGeneralAuthoringDTO.setActivityTitle(voteGeneralMonitoringDTO.getActivityTitle()); - voteGeneralAuthoringDTO.setActivityInstructions(voteGeneralMonitoringDTO.getActivityInstructions()); - voteGeneralAuthoringDTO.setDefaultOptionContent(voteGeneralMonitoringDTO.getDefaultOptionContent()); - voteGeneralAuthoringDTO.setMapOptionsContent(voteGeneralMonitoringDTO.getMapOptionsContent()); - voteGeneralAuthoringDTO.setActiveModule(MONITORING); - - Map mapOptionsContent=voteGeneralMonitoringDTO.getMapOptionsContent(); - int maxIndex=mapOptionsContent.size(); - voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); + VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; - request.setAttribute(VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); - /*...till here */ - - //voteMonitoringAction.prepareReflectionData(request, voteContent, voteService, null, false); - - return voteMonitoringAction.submitSession(mapping, voteMonitoringForm, request, response, voteService, messageService, voteGeneralMonitoringDTO); + VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); + + ActionForward validateParameters = validateParameters(request, mapping, voteMonitoringForm); + + if (validateParameters != null) { + return validateParameters; } + boolean initData = initialiseMonitoringData(mapping, form, request, response, voteService, + voteGeneralMonitoringDTO); + if (initData == false) + return (mapping.findForward(ERROR_LIST)); + + voteMonitoringForm.setCurrentTab("1"); + voteGeneralMonitoringDTO.setCurrentTab("1"); + + String toolContentID = voteMonitoringForm.getToolContentID(); + + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); + // Come back to fix here + voteGeneralMonitoringDTO.setCountAllUsers(new Integer(0).toString()); + voteGeneralMonitoringDTO.setCountSessionComplete(new Integer(0).toString()); + + initSummaryContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); + + VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); + + /* true means there is at least 1 response */ + if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); + } else { + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); + } + + voteMonitoringForm.setActiveModule(MONITORING); + voteGeneralMonitoringDTO.setActiveModule(MONITORING); + + voteGeneralMonitoringDTO.setRequestLearningReport(new Boolean(false).toString()); + voteGeneralMonitoringDTO.setIsPortfolioExport(new Boolean(false).toString()); + + request.setAttribute(VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); + + /* this section is needed for Edit Activity screen, from here... */ + voteGeneralAuthoringDTO.setActivityTitle(voteGeneralMonitoringDTO.getActivityTitle()); + voteGeneralAuthoringDTO.setActivityInstructions(voteGeneralMonitoringDTO.getActivityInstructions()); + voteGeneralAuthoringDTO.setDefaultOptionContent(voteGeneralMonitoringDTO.getDefaultOptionContent()); + voteGeneralAuthoringDTO.setMapOptionsContent(voteGeneralMonitoringDTO.getMapOptionsContent()); + voteGeneralAuthoringDTO.setActiveModule(MONITORING); + + Map mapOptionsContent = voteGeneralMonitoringDTO.getMapOptionsContent(); + int maxIndex = mapOptionsContent.size(); + voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); + + request.setAttribute(VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); + /* ...till here */ + + return submitSession(mapping, voteMonitoringForm, request, response, voteService, + messageService, voteGeneralMonitoringDTO); + } + + public ActionForward submitSession(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response, IVoteService voteService, MessageService messageService, + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) throws IOException, ServletException { - public boolean initialiseMonitoringData(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response, - IVoteService voteService, VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) - { - VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; - voteMonitoringForm.setSbmtSuccess(new Boolean(false).toString()); + VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; - 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()); - - VoteUtils.saveTimeZone(request); - - /* we have made sure TOOL_CONTENT_ID is passed */ - String toolContentID=voteMonitoringForm.getToolContentID(); - VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); - - if (voteContent == null) - { - VoteUtils.cleanUpSessionAbsolute(request); - voteGeneralMonitoringDTO.setUserExceptionContentDoesNotExist(new Boolean(true).toString()); - return false; - } - - - boolean isContentInUse=VoteUtils.isContentInUse(voteContent); - voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(false).toString()); - if (isContentInUse == true) - { - voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString()); - } - - voteGeneralMonitoringDTO.setActivityTitle(voteContent.getTitle()); - voteGeneralMonitoringDTO.setActivityInstructions(voteContent.getInstructions()); + MonitoringUtil.repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); + String toolContentID = voteMonitoringForm.getToolContentID(); + VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); - if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) - { - VoteUtils.cleanUpSessionAbsolute(request); - voteGeneralMonitoringDTO.setUserExceptionContentInUse(new Boolean(true).toString()); - voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); - } - else - { - voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); - } + List sessionDTOs = getSessionDTOs(request, voteService, voteMonitoringForm, + voteContent.getVoteContentId(), messageService); + voteGeneralMonitoringDTO.setSessionDTOs(sessionDTOs); + + boolean isGroupedActivity = voteService.isGroupedActivity(new Long(toolContentID)); + request.setAttribute("isGroupedActivity", isGroupedActivity); - /* - * get the nominations - * section is needed for the Edit tab's View Only mode, starts here - */ - - SessionMap sessionMap = new SessionMap(); - sessionMap.put(ACTIVITY_TITLE_KEY, voteContent.getTitle()); - sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, voteContent.getInstructions()); - - voteMonitoringForm.setHttpSessionID(sessionMap.getSessionID()); - request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); + voteGeneralMonitoringDTO.setRequestLearningReport(new Boolean(false).toString()); - - List listNominationContentDTO= new LinkedList(); - - Map mapOptionsContent= new TreeMap(new VoteComparator()); - mapOptionsContent.clear(); - Iterator queIterator=voteContent.getVoteQueContents().iterator(); - Long mapIndex=new Long(1); - while (queIterator.hasNext()) - { - VoteNominationContentDTO voteNominationContentDTO=new VoteNominationContentDTO(); - - VoteQueContent voteQueContent=(VoteQueContent) queIterator.next(); - if (voteQueContent != null) - { - mapOptionsContent.put(mapIndex.toString(),voteQueContent.getQuestion()); + // initInstructionsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); + initStatsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); + /* setting editable screen properties */ + VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); + voteGeneralAuthoringDTO.setActivityTitle(voteContent.getTitle()); + voteGeneralAuthoringDTO.setActivityInstructions(voteContent.getInstructions()); - voteNominationContentDTO.setQuestion(voteQueContent.getQuestion()); - voteNominationContentDTO.setDisplayOrder(new Integer(voteQueContent.getDisplayOrder()).toString()); - listNominationContentDTO.add(voteNominationContentDTO); - - mapIndex=new Long(mapIndex.longValue()+1); - } + Map mapOptionsContent = new TreeMap(new VoteComparator()); + Iterator queIterator = voteContent.getVoteQueContents().iterator(); + Long mapIndex = new Long(1); + while (queIterator.hasNext()) { + VoteQueContent voteQueContent = (VoteQueContent) queIterator.next(); + if (voteQueContent != null) { + mapOptionsContent.put(mapIndex.toString(), voteQueContent.getQuestion()); + /** + * make the first entry the default(first) one for jsp + */ + if (mapIndex.longValue() == 1) { + voteGeneralAuthoringDTO.setDefaultOptionContent(voteQueContent.getQuestion()); } - voteGeneralMonitoringDTO.setMapOptionsContent(mapOptionsContent); - /* ends here*/ - - - request.setAttribute(LIST_NOMINATION_CONTENT_DTO,listNominationContentDTO); - sessionMap.put(LIST_NOMINATION_CONTENT_DTO_KEY, listNominationContentDTO); - - request.setAttribute(TOTAL_NOMINATION_COUNT, new Integer(listNominationContentDTO.size())); - - - VoteMonitoringAction voteMonitoringAction= new VoteMonitoringAction(); - voteMonitoringAction.refreshSummaryData(request, voteContent, voteService, true, false, - null, null, false, null, voteGeneralMonitoringDTO, null); - - voteMonitoringAction.refreshStatsData(request, voteService, voteGeneralMonitoringDTO); - - voteGeneralMonitoringDTO.setExistsOpenVotes(new Boolean(false).toString()); - EditActivityDTO editActivityDTO = new EditActivityDTO(); - isContentInUse=VoteUtils.isContentInUse(voteContent); - if (isContentInUse == true) - { - editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); - } - request.setAttribute(EDIT_ACTIVITY_DTO, editActivityDTO); + mapIndex = new Long(mapIndex.longValue() + 1); + } + } - voteMonitoringAction.prepareReflectionData(request, voteContent, voteService, null, false, "All"); + int maxIndex = mapOptionsContent.size(); + voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); - - - boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(voteService, voteContent); - - if (notebookEntriesExist) - { - request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); - - String userExceptionNoToolSessions=(String)voteGeneralMonitoringDTO.getUserExceptionNoToolSessions(); - - if (userExceptionNoToolSessions.equals("true")) - { - request.setAttribute(NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); + voteGeneralAuthoringDTO.setMapOptionsContent(mapOptionsContent); + + boolean isContentInUse = VoteUtils.isContentInUse(voteContent); + voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(false).toString()); + if (isContentInUse == true) { + //monitoring url does not allow editActivity since the content is in use + voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString()); + } + + request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); + + VoteMonitoringAction.prepareReflectionData(request, voteContent, voteService, null, false); + + if (voteService.studentActivityOccurredGlobal(voteContent)) { + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); + } else { + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); + } + + request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); + + EditActivityDTO editActivityDTO = new EditActivityDTO(); + if (isContentInUse == true) { + editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); + } + request.setAttribute(VoteAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO); + + /* find out if there are any reflection entries, from here */ + boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); + if (notebookEntriesExist) { + request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); + + String userExceptionNoToolSessions = voteGeneralMonitoringDTO.getUserExceptionNoToolSessions(); + + if (userExceptionNoToolSessions.equals("true")) { + //there are no online student activity but there are reflections + request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); + } + } else { + request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString()); + } + /* ... till here */ + + MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); + + return mapping.findForward(VoteAppConstants.LOAD_MONITORING); + } + + + /** + * Generates chart data for all sessions in the Monitoring Summary. + * + * @param request + * @param voteService + * @param voteMonitoringForm + * @param toolContentID + * @return + */ + private static List getSessionDTOs(HttpServletRequest request, IVoteService voteService, + VoteMonitoringForm voteMonitoringForm, Long toolContentID, MessageService messageService) { + + List sessionsDTOs = new LinkedList(); + + VoteContent voteContent = voteService.retrieveVote(toolContentID); + + Iterator itListSessions = voteContent.getVoteSessions().iterator(); + while (itListSessions.hasNext()) { + VoteSession voteSession = (VoteSession) itListSessions.next(); + + Map mapOptionsContent = new TreeMap(new VoteComparator()); + Map mapVoteRatesContent = new TreeMap(new VoteComparator()); + + SessionDTO sessionDTO = new SessionDTO(); + sessionDTO.setSessionId(voteSession.getVoteSessionId().toString()); + sessionDTO.setSessionName(voteSession.getSession_name()); + + int entriesCount = voteService.getSessionEntriesCount(voteSession.getUid()); + Set userEntries = voteService.getSessionUserEntriesSet(voteSession.getUid()); + + int potentialUserCount = voteService.getVoteSessionPotentialLearnersCount(voteSession.getUid()); + sessionDTO.setSessionUserCount(Integer.toString(potentialUserCount)); + + int completedSessionUserCount = voteService.getCompletedVoteUserBySessionUid(voteSession.getUid()); + sessionDTO.setCompletedSessionUserCount(new Integer(completedSessionUserCount).toString()); + + Map mapStandardUserCount = new TreeMap(new VoteComparator()); + + mapOptionsContent.clear(); + Iterator queIterator = voteContent.getVoteQueContents().iterator(); + Long mapIndex = new Long(1); + int totalStandardVotesCount = 0; + + Map mapStandardNominationsHTMLedContent = new TreeMap(new VoteComparator()); + Map mapStandardQuestionUid = new TreeMap(new VoteComparator()); + Map mapStandardToolSessionUid = new TreeMap(new VoteComparator()); + + while (queIterator.hasNext()) { + VoteQueContent question = (VoteQueContent) queIterator.next(); + if (question != null) { + mapStandardNominationsHTMLedContent.put(mapIndex.toString(), question.getQuestion()); + String noHTMLNomination = VoteUtils.stripHTML(question.getQuestion()); + mapOptionsContent.put(mapIndex.toString(), noHTMLNomination); + + int votesCount = 0; + votesCount = voteService.getStandardAttemptsForQuestionContentAndSessionUid( + question.getUid(), voteSession.getUid()); + + mapStandardQuestionUid.put(mapIndex.toString(), question.getUid().toString()); + mapStandardToolSessionUid.put(mapIndex.toString(), voteSession.getUid()); + + mapStandardUserCount.put(mapIndex.toString(), new Integer(votesCount).toString()); + totalStandardVotesCount = totalStandardVotesCount + votesCount; + + double voteRate = 0d; + double doubleVotesCount = votesCount * 1d; + double doubleEntriesCount = entriesCount * 1d; + + if (entriesCount != 0) { + voteRate = ((doubleVotesCount * 100) / doubleEntriesCount); } + String stringVoteRate = new Double(voteRate).toString(); + int lengthVoteRate = stringVoteRate.length(); + if (lengthVoteRate > 5) + stringVoteRate = stringVoteRate.substring(0, 6); + mapVoteRatesContent.put(mapIndex.toString(), stringVoteRate); + mapIndex = new Long(mapIndex.longValue() + 1); } - else - { - request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString()); - } + } + Map mapStandardNominationsContent = new TreeMap(new VoteComparator()); + mapStandardNominationsContent = mapOptionsContent; + Map mapStandardRatesContent = new TreeMap(new VoteComparator()); + mapStandardRatesContent = mapVoteRatesContent; + + Iterator itListQuestions = userEntries.iterator(); + int mapVoteRatesSize = mapVoteRatesContent.size(); + mapIndex = new Long(mapVoteRatesSize + 1); + + double total = MonitoringUtil.calculateTotal(mapVoteRatesContent); + double share = 100d - total; + int userEnteredVotesCount = entriesCount - totalStandardVotesCount; + + if (userEnteredVotesCount != 0) { + share = ((userEnteredVotesCount * 100) / entriesCount); + } else { + share = 0; + } + + if (voteContent.isAllowText()) { + mapStandardNominationsContent.put(mapIndex.toString(), messageService.getMessage("label.open.vote")); + mapStandardNominationsHTMLedContent.put(mapIndex.toString(), + messageService.getMessage("label.open.vote")); + } + mapStandardRatesContent.put(mapIndex.toString(), new Double(share).toString()); + mapStandardUserCount.put(mapIndex.toString(), new Integer(userEnteredVotesCount).toString()); + /** following are needed just for proper iteration in the summary jsp */ + mapStandardQuestionUid.put(mapIndex.toString(), "1"); + mapStandardToolSessionUid.put(mapIndex.toString(), "1"); + + sessionDTO.setMapStandardNominationsContent(mapStandardNominationsContent); + sessionDTO.setMapStandardNominationsHTMLedContent(mapStandardNominationsHTMLedContent); + sessionDTO.setMapStandardUserCount(mapStandardUserCount); + sessionDTO.setMapStandardRatesContent(mapStandardRatesContent); + sessionDTO.setMapStandardQuestionUid(mapStandardQuestionUid); + sessionDTO.setMapStandardToolSessionUid(mapStandardToolSessionUid); + + List listUserEntries = VoteMonitoringAction.processUserEnteredNominations(voteService, voteContent, + voteSession.getVoteSessionId().toString(), true, null, false); + sessionDTO.setListUserEntries(listUserEntries); + + if (listUserEntries.size() > 0) + sessionDTO.setExistsOpenVote(new Boolean(true).toString()); + else + sessionDTO.setExistsOpenVote(new Boolean(false).toString()); + + sessionsDTOs.add(sessionDTO); + } + + return sessionsDTOs; + } + + private boolean initialiseMonitoringData(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response, IVoteService voteService, VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) { + VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; + + voteGeneralMonitoringDTO.setCurrentMonitoringTab("summary"); + voteGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(false).toString()); + voteGeneralMonitoringDTO.setRequestLearningReport(new Boolean(false).toString()); + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); + + VoteUtils.saveTimeZone(request); + + /* we have made sure TOOL_CONTENT_ID is passed */ + String toolContentID = voteMonitoringForm.getToolContentID(); + VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); + + if (voteContent == null) { + VoteUtils.cleanUpSessionAbsolute(request); + voteGeneralMonitoringDTO.setUserExceptionContentDoesNotExist(new Boolean(true).toString()); + return false; + } + + boolean isContentInUse = VoteUtils.isContentInUse(voteContent); + voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(false).toString()); + if (isContentInUse == true) { + voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString()); + } + + voteGeneralMonitoringDTO.setActivityTitle(voteContent.getTitle()); + voteGeneralMonitoringDTO.setActivityInstructions(voteContent.getInstructions()); + + if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { + VoteUtils.cleanUpSessionAbsolute(request); + voteGeneralMonitoringDTO.setUserExceptionContentInUse(new Boolean(true).toString()); + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); + } else { + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); + } + + /* + * get the nominations section is needed for the Edit tab's View Only mode, starts here + */ + + SessionMap sessionMap = new SessionMap(); + sessionMap.put(ACTIVITY_TITLE_KEY, voteContent.getTitle()); + sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, voteContent.getInstructions()); + + voteMonitoringForm.setHttpSessionID(sessionMap.getSessionID()); + request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); + + List listNominationContentDTO = new LinkedList(); + + Map mapOptionsContent = new TreeMap(new VoteComparator()); + mapOptionsContent.clear(); + Iterator queIterator = voteContent.getVoteQueContents().iterator(); + Long mapIndex = new Long(1); + while (queIterator.hasNext()) { + VoteNominationContentDTO voteNominationContentDTO = new VoteNominationContentDTO(); + + VoteQueContent voteQueContent = (VoteQueContent) queIterator.next(); + if (voteQueContent != null) { + mapOptionsContent.put(mapIndex.toString(), voteQueContent.getQuestion()); + + voteNominationContentDTO.setQuestion(voteQueContent.getQuestion()); + voteNominationContentDTO.setDisplayOrder(new Integer(voteQueContent.getDisplayOrder()).toString()); + listNominationContentDTO.add(voteNominationContentDTO); + + mapIndex = new Long(mapIndex.longValue() + 1); + } + } + voteGeneralMonitoringDTO.setMapOptionsContent(mapOptionsContent); + /* ends here */ + + request.setAttribute(LIST_NOMINATION_CONTENT_DTO, listNominationContentDTO); + sessionMap.put(LIST_NOMINATION_CONTENT_DTO_KEY, listNominationContentDTO); + + request.setAttribute(TOTAL_NOMINATION_COUNT, new Integer(listNominationContentDTO.size())); + + VoteMonitoringAction.refreshSummaryData(request, voteContent, voteService, true, false, null, null, false, + null, voteGeneralMonitoringDTO, null); + + voteGeneralMonitoringDTO.setExistsOpenVotes(new Boolean(false).toString()); + + EditActivityDTO editActivityDTO = new EditActivityDTO(); + isContentInUse = VoteUtils.isContentInUse(voteContent); + if (isContentInUse == true) { + editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); + } + request.setAttribute(EDIT_ACTIVITY_DTO, editActivityDTO); + + boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); + + if (notebookEntriesExist) { + request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); + + String userExceptionNoToolSessions = (String) voteGeneralMonitoringDTO.getUserExceptionNoToolSessions(); + + if (userExceptionNoToolSessions.equals("true")) { + request.setAttribute(NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); + } + + } else { + request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString()); + } + MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); return true; + } + + + + private void initStatsContent(String toolContentID, HttpServletRequest request, IVoteService voteService, + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) throws IOException, ServletException { + VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); + + if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); + } else { + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } + //refreshStatsData + /* it is possible that no users has ever logged in for the activity yet */ + int countAllUsers = voteService.getTotalNumberOfUsers(); + if (countAllUsers == 0) { + voteGeneralMonitoringDTO.setUserExceptionNoStudentActivity(new Boolean(true).toString()); + } + voteGeneralMonitoringDTO.setCountAllUsers(new Integer(countAllUsers).toString()); + int countSessionComplete = voteService.countSessionComplete(); + voteGeneralMonitoringDTO.setCountSessionComplete(new Integer(countSessionComplete).toString()); + request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); - protected ActionForward validateParameters(HttpServletRequest request, ActionMapping mapping, VoteMonitoringForm voteMonitoringForm) - { - - String strToolContentId=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - - if ((strToolContentId == null) || (strToolContentId.length() == 0)) - { - VoteUtils.cleanUpSessionAbsolute(request); - return (mapping.findForward(ERROR_LIST)); + EditActivityDTO editActivityDTO = new EditActivityDTO(); + boolean isContentInUse = VoteUtils.isContentInUse(voteContent); + if (isContentInUse == true) { + editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); + } + request.setAttribute(VoteAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO); + + voteGeneralMonitoringDTO.setCurrentMonitoringTab("stats"); + + request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); + + /* find out if there are any reflection entries, from here */ + boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); + + if (notebookEntriesExist) { + request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); + + String userExceptionNoToolSessions = voteGeneralMonitoringDTO.getUserExceptionNoToolSessions(); + + if (userExceptionNoToolSessions.equals("true")) { + //there are no online student activity but there are reflections + request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); } - else - { - try - { - voteMonitoringForm.setToolContentID(strToolContentId); - } - catch(NumberFormatException e) - { - logger.error("add error.numberFormatException to ActionMessages."); - VoteUtils.cleanUpSessionAbsolute(request); - return (mapping.findForward(ERROR_LIST)); - } + } else { + request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString()); + } + /* ... till here */ + + MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); + } + + private void initSummaryContent(String toolContentID, HttpServletRequest request, IVoteService voteService, + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) throws IOException, ServletException { + VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); + + /* true means there is at least 1 response */ + if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); + } else { + voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); + } + + EditActivityDTO editActivityDTO = new EditActivityDTO(); + boolean isContentInUse = VoteUtils.isContentInUse(voteContent); + if (isContentInUse == true) { + editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); + } + request.setAttribute(VoteAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO); + + voteGeneralMonitoringDTO.setCurrentMonitoringTab("summary"); + + request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); + + /* find out if there are any reflection entries, from here */ + boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); + + if (notebookEntriesExist) { + request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); + + String userExceptionNoToolSessions = voteGeneralMonitoringDTO.getUserExceptionNoToolSessions(); + + if (userExceptionNoToolSessions.equals("true")) { + //there are no online student activity but there are reflections + request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); } - return null; + } else { + request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString()); } + /* ... till here */ - - /** + MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); + + } + + private ActionForward validateParameters(HttpServletRequest request, ActionMapping mapping, + VoteMonitoringForm voteMonitoringForm) { + + String strToolContentId = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); + + if ((strToolContentId == null) || (strToolContentId.length() == 0)) { + VoteUtils.cleanUpSessionAbsolute(request); + return (mapping.findForward(ERROR_LIST)); + } else { + try { + voteMonitoringForm.setToolContentID(strToolContentId); + } catch (NumberFormatException e) { + logger.error("add error.numberFormatException to ActionMessages."); + VoteUtils.cleanUpSessionAbsolute(request); + return (mapping.findForward(ERROR_LIST)); + } + } + return null; + } + + /** * persists error messages to request scope + * * @param request * @param message */ - public void persistInRequestError(HttpServletRequest request, String message) - { - ActionMessages errors= new ActionMessages(); - errors.add(Globals.ERROR_KEY, new ActionMessage(message)); - logger.error("add " + message +" to ActionMessages:"); - saveErrors(request,errors); - } -} + public void persistInRequestError(HttpServletRequest request, String message) { + ActionMessages errors = new ActionMessages(); + errors.add(Globals.ERROR_KEY, new ActionMessage(message)); + logger.error("add " + message + " to ActionMessages:"); + saveErrors(request, errors); + } +} Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java,v diff -u -r1.40 -r1.41 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java 17 Jan 2014 22:18:25 -0000 1.40 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java 23 Jan 2014 23:53:16 -0000 1.41 @@ -91,11 +91,6 @@ voteService = voteAuthoringForm.getVoteService(); } - voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); - voteAuthoringForm.setSbmtSuccess(new Boolean(false).toString()); - - voteGeneralAuthoringDTO.setSubmissionAttempt(new Boolean(false).toString()); - voteGeneralAuthoringDTO.setSbmtSuccess(new Boolean(false).toString()); voteGeneralAuthoringDTO.setContentFolderID(contentFolderID); String servletPath = request.getServletPath(); Index: lams_tool_vote/web/WEB-INF/struts-config.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/web/WEB-INF/struts-config.xml,v diff -u -r1.35 -r1.36 --- lams_tool_vote/web/WEB-INF/struts-config.xml 17 Jan 2014 22:18:26 -0000 1.35 +++ lams_tool_vote/web/WEB-INF/struts-config.xml 23 Jan 2014 23:53:16 -0000 1.36 @@ -185,12 +185,6 @@ redirect="false" /> - - + + + + + + + +
+ + Index: lams_tool_vote/web/monitoring/AllSessionsSummary.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/web/monitoring/AllSessionsSummary.jsp,v diff -u -r1.21 -r1.22 --- lams_tool_vote/web/monitoring/AllSessionsSummary.jsp 12 Nov 2012 17:13:43 -0000 1.21 +++ lams_tool_vote/web/monitoring/AllSessionsSummary.jsp 23 Jan 2014 23:53:16 -0000 1.22 @@ -1,353 +1,154 @@ -<%-- -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 version 2 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 - USA - - http://www.gnu.org/licenses/gpl.txt ---%> - - <%@ include file="/common/taglibs.jsp"%> +

+ +

+ - - - - <%-- When grouping is not enabled, we have only 2 items in summaryToolSessions. The main toolSession and 'All' --%> - - - - - - - + +

+ +

+
+
- - - - - - - - - - - - - - - - + + + + + + + + + +
- - - - - - -
- -
-
-
- - - - - -
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - +
-  ( ) -
- -
- - - - - - - - - + + + +  ( ) + + + + + +
- - - - - - - - - - - - - - - - - - - + + + + - - - - + + + + + - - -
- - - -
- - - -
- -
+ + + + + - - - - - - - - - - - - - - - - - - - monitoring.do?dispatch=getVoteNomination&questionUid=${currentQuestionUid.value}&sessionUid=${currentSessionUid.value} - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + monitoring.do?dispatch=getVoteNomination&questionUid=${currentQuestionUid.value}&sessionUid=${currentSessionUid.value} + + + + + + + + + + + + + + + + + + + + - - + + - - - -  ( ) - - -
-
+ + + + + - - - - - - - - - - - - - - - - - - - - - - - -

- - - - - - - - - - - - - + + + + + + - - - - - - - + + + + + + - - - - - + + + - - - - - -
- - - - -
+ + + + + - - - - - + + + + + + - - - - - -
-

-
+ + +

+ + + + + + + + + +

+ +

+ -
- - - - + +

+
+ +

- + Index: lams_tool_vote/web/monitoring/Edit.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/web/monitoring/Edit.jsp,v diff -u -r1.7 -r1.8 --- lams_tool_vote/web/monitoring/Edit.jsp 17 Oct 2006 20:29:42 -0000 1.7 +++ lams_tool_vote/web/monitoring/Edit.jsp 23 Jan 2014 23:53:16 -0000 1.8 @@ -1,24 +1,3 @@ -<%-- -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 version 2 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 - USA - - http://www.gnu.org/licenses/gpl.txt ---%> - <%@ include file="/common/taglibs.jsp"%> Fisheye: Tag 1.23 refers to a dead (removed) revision in file `lams_tool_vote/web/monitoring/IndividualSessionSummary.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_vote/web/monitoring/LearnerNotebook.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/web/monitoring/Attic/LearnerNotebook.jsp,v diff -u -r1.7 -r1.8 --- lams_tool_vote/web/monitoring/LearnerNotebook.jsp 8 Jun 2007 01:43:32 -0000 1.7 +++ lams_tool_vote/web/monitoring/LearnerNotebook.jsp 23 Jan 2014 23:53:16 -0000 1.8 @@ -1,24 +1,3 @@ -<%-- -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 version 2 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 - USA - - http://www.gnu.org/licenses/gpl.txt ---%> - Fisheye: Tag 1.14 refers to a dead (removed) revision in file `lams_tool_vote/web/monitoring/LearnerRep.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_vote/web/monitoring/MonitoringMaincontent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/web/monitoring/MonitoringMaincontent.jsp,v diff -u -r1.22 -r1.23 --- lams_tool_vote/web/monitoring/MonitoringMaincontent.jsp 17 Jan 2014 22:18:26 -0000 1.22 +++ lams_tool_vote/web/monitoring/MonitoringMaincontent.jsp 23 Jan 2014 23:53:16 -0000 1.23 @@ -1,24 +1,3 @@ -<%-- -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 version 2 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 - USA - - http://www.gnu.org/licenses/gpl.txt ---%> - @@ -109,12 +88,6 @@ submitMethod(actionMethod); } - function submitSession(selectedToolSessionId, actionMethod) { - document.VoteMonitoringForm.selectedToolSessionId.value=selectedToolSessionId; - submitMonitoringMethod(actionMethod); - } - - function submitModifyOption(optionIndexValue, actionMethod) { document.VoteMonitoringForm.optIndex.value=optionIndexValue; @@ -157,8 +130,6 @@ - - Index: lams_tool_vote/web/monitoring/Reflections.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/web/monitoring/Attic/Reflections.jsp,v diff -u -r1.4 -r1.5 --- lams_tool_vote/web/monitoring/Reflections.jsp 23 Nov 2006 07:07:26 -0000 1.4 +++ lams_tool_vote/web/monitoring/Reflections.jsp 23 Jan 2014 23:53:16 -0000 1.5 @@ -1,23 +1,3 @@ -<%-- -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 version 2 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - - http://www.gnu.org/licenses/gpl.txt ---%> - <%@ include file="/common/taglibs.jsp"%> Index: lams_tool_vote/web/monitoring/Stats.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/web/monitoring/Stats.jsp,v diff -u -r1.12 -r1.13 --- lams_tool_vote/web/monitoring/Stats.jsp 17 Oct 2006 20:29:42 -0000 1.12 +++ lams_tool_vote/web/monitoring/Stats.jsp 23 Jan 2014 23:53:16 -0000 1.13 @@ -1,30 +1,8 @@ -<%-- -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 version 2 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 - USA - - http://www.gnu.org/licenses/gpl.txt ---%> - <%@ include file="/common/taglibs.jsp"%> - - + @@ -37,14 +15,8 @@ - - - - - - - - + + Index: lams_tool_vote/web/monitoring/SummaryContent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/web/monitoring/SummaryContent.jsp,v diff -u -r1.41 -r1.42 --- lams_tool_vote/web/monitoring/SummaryContent.jsp 2 Jan 2014 23:12:51 -0000 1.41 +++ lams_tool_vote/web/monitoring/SummaryContent.jsp 23 Jan 2014 23:53:16 -0000 1.42 @@ -1,25 +1,3 @@ -<%-- -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 version 2 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 - USA - - http://www.gnu.org/licenses/gpl.txt ---%> - - <%@ include file="/common/taglibs.jsp"%> @@ -28,8 +6,24 @@ - + + + + + + + + + - - - - - - - - - - -

- + + +

+ + + +
+ +
+
+
- - - - -
+ + + + + - - - <%@include file="daterestriction.jsp"%> - - - - - - - - -
- -
-
-
- - - - - - - - - - - - - - - - - - - Fisheye: Tag 1.10 refers to a dead (removed) revision in file `lams_tool_vote/web/monitoring/UserResponses.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_vote/web/monitoring/VoteNominationViewer.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/web/monitoring/VoteNominationViewer.jsp,v diff -u -r1.13 -r1.14 --- lams_tool_vote/web/monitoring/VoteNominationViewer.jsp 8 Jun 2007 01:43:32 -0000 1.13 +++ lams_tool_vote/web/monitoring/VoteNominationViewer.jsp 23 Jan 2014 23:53:16 -0000 1.14 @@ -1,25 +1,3 @@ -<%-- -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 version 2 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 - USA - - http://www.gnu.org/licenses/gpl.txt ---%> - - Index: lams_tool_vote/web/monitoring/editNominationBox.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/web/monitoring/Attic/editNominationBox.jsp,v diff -u -r1.9 -r1.10 --- lams_tool_vote/web/monitoring/editNominationBox.jsp 6 Oct 2010 10:16:29 -0000 1.9 +++ lams_tool_vote/web/monitoring/editNominationBox.jsp 23 Jan 2014 23:53:16 -0000 1.10 @@ -1,23 +1,3 @@ -<%-- -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 version 2 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - - http://www.gnu.org/licenses/gpl.txt ---%> - Index: lams_tool_vote/web/monitoring/itemlist.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/web/monitoring/Attic/itemlist.jsp,v diff -u -r1.8 -r1.9 --- lams_tool_vote/web/monitoring/itemlist.jsp 15 Aug 2013 20:20:38 -0000 1.8 +++ lams_tool_vote/web/monitoring/itemlist.jsp 23 Jan 2014 23:53:16 -0000 1.9 @@ -1,23 +1,3 @@ -<%-- -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 version 2 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - - http://www.gnu.org/licenses/gpl.txt ---%> - <%@ include file="/common/taglibs.jsp" %>
Index: lams_tool_vote/web/monitoring/newNominationBox.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/web/monitoring/Attic/newNominationBox.jsp,v diff -u -r1.10 -r1.11 --- lams_tool_vote/web/monitoring/newNominationBox.jsp 24 Oct 2013 08:14:04 -0000 1.10 +++ lams_tool_vote/web/monitoring/newNominationBox.jsp 23 Jan 2014 23:53:16 -0000 1.11 @@ -1,23 +1,3 @@ - <%-- -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 version 2 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - - http://www.gnu.org/licenses/gpl.txt ---%> -