Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/EditActivityDTO.java =================================================================== diff -u --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/EditActivityDTO.java (revision 0) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/EditActivityDTO.java (revision 81e4b129f71e63322c81c9016ec1ffa93f3c5944) @@ -0,0 +1,69 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.mc; + +import org.apache.commons.lang.builder.ToStringBuilder; + + +/** + *

DTO that holds question and user attempts data for jsp purposes + *

+ * + * @author Ozgur Demirtas + */ +public class EditActivityDTO implements Comparable +{ + private String monitoredContentInUse; + + + /** + * @return Returns the monitoredContentInUse. + */ + public String getMonitoredContentInUse() { + return monitoredContentInUse; + } + /** + * @param monitoredContentInUse The monitoredContentInUse to set. + */ + public void setMonitoredContentInUse(String monitoredContentInUse) { + this.monitoredContentInUse = monitoredContentInUse; + } + public String toString() { + return new ToStringBuilder(this) + .append("monitoredContentInUse", monitoredContentInUse) + .toString(); + } + + public int compareTo(Object o) + { + EditActivityDTO editActivityDTO = (EditActivityDTO) o; + + if (editActivityDTO == null) + return 1; + else + return 0; + } + +} Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/ExportPortfolioDTO.java =================================================================== diff -u --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/ExportPortfolioDTO.java (revision 0) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/ExportPortfolioDTO.java (revision 81e4b129f71e63322c81c9016ec1ffa93f3c5944) @@ -0,0 +1,119 @@ +/*************************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * ***********************************************************************/ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.mc; + +import java.util.List; + +import org.apache.commons.lang.builder.ToStringBuilder; + + + +/** + *

DTO that holds export portfolio properties + *

+ * + * @author Ozgur Demirtas + */ +public class ExportPortfolioDTO implements Comparable +{ + protected String portfolioExportMode; + protected String userExceptionNoToolSessions; + + protected List listUserEntries; + protected List listMonitoredAnswersContainerDto; + + + + public int compareTo(Object o) + { + McGeneralAuthoringDTO mcGeneralAuthoringDTO = (McGeneralAuthoringDTO) o; + + if (mcGeneralAuthoringDTO == null) + return 1; + else + return 0; + } + + public String toString() { + return new ToStringBuilder(this) + .append("portfolioExportMode: ", portfolioExportMode) + .append("userExceptionNoToolSessions: ", userExceptionNoToolSessions) + .append("listUserEntries: ", listUserEntries) + .append("listMonitoredAnswersContainerDto: ", listMonitoredAnswersContainerDto) + .toString(); + } + + /** + * @return Returns the listMonitoredAnswersContainerDto. + */ + public List getListMonitoredAnswersContainerDto() { + return listMonitoredAnswersContainerDto; + } + /** + * @param listMonitoredAnswersContainerDto The listMonitoredAnswersContainerDto to set. + */ + public void setListMonitoredAnswersContainerDto( + List listMonitoredAnswersContainerDto) { + this.listMonitoredAnswersContainerDto = listMonitoredAnswersContainerDto; + } + /** + * @return Returns the listUserEntries. + */ + public List getListUserEntries() { + return listUserEntries; + } + /** + * @param listUserEntries The listUserEntries to set. + */ + public void setListUserEntries(List listUserEntries) { + this.listUserEntries = listUserEntries; + } + /** + * @return Returns the mapStandardNominationsHTMLedContent. + */ + /** + * @return Returns the portfolioExportMode. + */ + public String getPortfolioExportMode() { + return portfolioExportMode; + } + /** + * @param portfolioExportMode The portfolioExportMode to set. + */ + public void setPortfolioExportMode(String portfolioExportMode) { + this.portfolioExportMode = portfolioExportMode; + } + /** + * @return Returns the userExceptionNoToolSessions. + */ + public String getUserExceptionNoToolSessions() { + return userExceptionNoToolSessions; + } + /** + * @param userExceptionNoToolSessions The userExceptionNoToolSessions to set. + */ + public void setUserExceptionNoToolSessions( + String userExceptionNoToolSessions) { + this.userExceptionNoToolSessions = userExceptionNoToolSessions; + } +} Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAllGroupsDTO.java =================================================================== diff -u --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAllGroupsDTO.java (revision 0) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAllGroupsDTO.java (revision 81e4b129f71e63322c81c9016ec1ffa93f3c5944) @@ -0,0 +1,104 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.mc; + +import java.util.List; + +import org.apache.commons.lang.builder.ToStringBuilder; + + +/** + *

DTO that holds question and user attempts data for jsp purposes + *

+ * + * @author Ozgur Demirtas + */ +public class McAllGroupsDTO implements Comparable +{ + + private String sessionId; + + private String sessionName; + + private List groupData; + + + + public String toString() { + return new ToStringBuilder(this) + .append("sessionId:", sessionId) + .append("sessionName:", sessionName) + .append("groupData: ", groupData) + .toString(); + } + + public int compareTo(Object o) + { + McAllGroupsDTO mcAllGroupsDTO = (McAllGroupsDTO) o; + + if (mcAllGroupsDTO == null) + return 1; + else + return 0; + } + + + /** + * @return Returns the groupData. + */ + public List getGroupData() { + return groupData; + } + /** + * @param groupData The groupData to set. + */ + public void setGroupData(List groupData) { + this.groupData = groupData; + } + /** + * @return Returns the sessionName. + */ + public String getSessionName() { + return sessionName; + } + /** + * @param sessionName The sessionName to set. + */ + public void setSessionName(String sessionName) { + this.sessionName = sessionName; + } + /** + * @return Returns the sessionId. + */ + public String getSessionId() { + return sessionId; + } + /** + * @param sessionId The sessionId to set. + */ + public void setSessionId(String sessionId) { + this.sessionId = sessionId; + } +} Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r81e4b129f71e63322c81c9016ec1ffa93f3c5944 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java (.../McAppConstants.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java (.../McAppConstants.java) (revision 81e4b129f71e63322c81c9016ec1ffa93f3c5944) @@ -43,8 +43,11 @@ public static final String LEARNING_STARTER ="learningStarter"; public static final String MONITORING_STARTER ="monitoringStarter"; public static final String LOAD_LEARNER ="loadLearner"; - public static final String LOAD_MONITORING_CONTENT ="loadMonitoring"; - public static final String LOAD_MONITORING_CONTENT_EDITACTIVITY ="loadMonitoringEditActivity"; + public static final String LOAD_MONITORING_CONTENT ="loadMonitoring"; + public static final String LOAD_MONITORING ="refreshMonitoring"; + public static final String LOAD_MONITORING_CONTENT_EDITACTIVITY ="loadMonitoringEditActivity"; + public static final String MC_STATS_DTO ="mcStatsDTO"; + public static final String LIST_ALL_GROUPS_DTO ="listAllGroupsDTO"; public static final String EXPORT_PORTFOLIO = "exportPortfolio"; public static final String INDIVIDUAL_REPORT ="individualReport"; public static final String VIEW_SUMMARY ="viewSummary"; @@ -55,9 +58,44 @@ public static final String PREVIEW ="preview"; public static final String LEARNER_PROGRESS ="learnerProgress"; public static final String LEARNER_PROGRESS_USERID ="learnerProgressUserId"; - - public static final String AUTHORING ="authoring"; + public static final String ATTACHMENT_LIST_KEY = "attachmentListKey"; + public static final String DELETED_ATTACHMENT_LIST_KEY = "deletedAttachmentListKey"; + public static final String ACTIVITY_TITLE_KEY = "activityTitleKey"; + public static final String ACTIVITY_INSTRUCTIONS_KEY = "activityInstructionsKey"; + public static final String LIST_QUESTION_CONTENT_DTO = "listQuestionContentDTO"; + public static final String LIST_QUESTION_CONTENT_DTO_KEY = "listQuestionContentDTOKey"; + public static final String DEFAULT_ONLINE_INST ="online instructions"; + public static final String DEFAULT_OFFLINE_INST ="offline instructions"; + public static final String ONLINE_INSTRUCTIONS_KEY = "onlineInstructionsKey"; + public static final String OFFLINE_INSTRUCTIONS_KEY = "offlineInstructionsKey"; + public static final String MAP_QUESTION_CONTENT_KEY = "mapQuestionContentKey"; + public static final String DEFAULT_MC_TITLE ="MCQ Title"; + public static final String DEFAULT_MC_INSTRUCTIONS ="MCQ Instructions"; + public static final String LOAD_VIEW_ONLY ="loadViewOnly"; + public static final String MC_GENERAL_AUTHORING_DTO ="mcGeneralAuthoringDTO"; + public static final String DEFAULT_CONTENT_ID_STR ="defaultContentIdStr"; + public static final String LIST_ADD_QUESTION_CONTENT_DTO_KEY ="listAddQuestionContentDtoKey"; + public static final String NEW_QUESTION_CONTENT_DTO ="newQuestionContentDTO"; + public static final Integer MAX_QUESTION_COUNT =new Integer(50); + public static final String ONLINE_INSTRUCTIONS ="onlineInstructions"; + public static final String OFFLINE_INSTRUCTIONS ="offlineInstructions"; + public static final String UUID ="uuid"; + public static final String EDIT_ACTIVITY_DTO ="editActivityDTO"; + public static final String LIST_CANDIDATE_ANSWERS_DTO ="listCandidateAnswersDTO"; + public static final String CURRENT_EDITABLE_QUESTION_INDEX ="currentEditableQuestionIndex"; + public static final String MC_GENERAL_MONITORING_DTO ="mcGeneralMonitoringDTO"; + public static final String NOTEBOOK_ENTRIES_EXIST ="notebookEntriesExist"; + public static final String NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST ="noSessionsNotebookEntriesExist"; + public static final String MONITORING ="monitoring"; + public static final String RESPONSE_ID ="responseId"; + public static final String CURRENT_UID ="currentUid"; + public static final String NEW_QUESTION_BOX_DTO ="newQuestionBoxDTO"; + public static final String NEW_QUESTION_BOX_DTO_KEY ="newQuestionBoxDTOKey"; + + + public static final String AUTHORING ="authoring"; public static final String SOURCE_MC_STARTER ="sourceMcStarter"; + public static final String TARGET_MODE_AUTHORING ="Authoring"; public static final String AUTHORING_CANCELLED ="authoringCancelled"; public static final String DEFINE_LATER_EDIT_ACTIVITY ="defineLaterEditActivity"; public static final String ACTIVE_MODULE ="activeModule"; @@ -93,8 +131,7 @@ * refers to number of questions presented initially, we have a single record for default content */ public static final Long INITIAL_QUESTION_COUNT =new Long(1); - public static final long MAX_QUESTION_COUNT =20; - public static final long MAX_OPTION_COUNT =10; + public static final int MAX_OPTION_COUNT =25; public static final int MAX_ATTEMPT_HISTORY =30; public static final String QUESTION_AND_CANDIDATE_ANSWERS_KEY ="questionAndCandidateAnswersKey"; Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McCandidateAnswersDTO.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r81e4b129f71e63322c81c9016ec1ffa93f3c5944 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McCandidateAnswersDTO.java (.../McCandidateAnswersDTO.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McCandidateAnswersDTO.java (.../McCandidateAnswersDTO.java) (revision 81e4b129f71e63322c81c9016ec1ffa93f3c5944) @@ -22,8 +22,10 @@ /* $$Id$$ */ package org.lamsfoundation.lams.tool.mc; +import org.apache.commons.lang.builder.ToStringBuilder; + /** *

DTO that holds candiate answers data for summary page *

@@ -32,6 +34,11 @@ */ public class McCandidateAnswersDTO implements Comparable { + + private String candidateAnswer; + + private String correct; + /** * @return Returns the candidateAnswer. */ @@ -56,11 +63,7 @@ public void setCorrect(String correct) { this.correct = correct; } - private String candidateAnswer; - private String correct; - - public int compareTo(Object o) { McCandidateAnswersDTO mcCandidateAnswersDTO = (McCandidateAnswersDTO) o; @@ -71,4 +74,11 @@ return 0; } + public String toString() { + return new ToStringBuilder(this) + .append("candidateAnswer: ", candidateAnswer) + .append("correct: ", correct) + .toString(); + } + } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralAuthoringDTO.java =================================================================== diff -u --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralAuthoringDTO.java (revision 0) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralAuthoringDTO.java (revision 81e4b129f71e63322c81c9016ec1ffa93f3c5944) @@ -0,0 +1,612 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.mc; + +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang.builder.ToStringBuilder; + + + +/** + *

DTO that holds authoring properties for authoring jsps + *

+ * + * @author Ozgur Demirtas + */ +public class McGeneralAuthoringDTO implements Comparable +{ + protected String toolContentID; + protected String currentTab; + protected String activeModule; + protected String defineLaterInEditMode; + protected String showAuthoringTabs; + protected String monitoringOriginatedDefineLater; + protected String targetMode; + protected String defaultQuestionContent; + protected String defaultContentIdStr; + + protected String activityTitle; + protected String activityInstructions; + protected String onlineInstructions; + protected String offlineInstructions; + protected String usernameVisible; + protected String reflect; + protected String synchInMonitor; + protected String questionsSequenced; + protected String editActivityEditMode; + protected String reflectionSubject; + + protected String monitoredContentInUse; + + protected String httpSessionID; + protected String requestedModule; + protected String isDefineLater; + protected Map mapQuestionContent; + + protected List attachmentList; + protected List deletedAttachmentList; + + protected String sbmtSuccess; + protected String userExceptionQuestionsDuplicate; + + protected String contentFolderID; + protected String editableQuestionText; + protected String editableQuestionFeedback; + protected String sln; + protected String retries; + + protected Map marksMap; + protected String markValue; + protected Map correctMap; + + protected String passMarkValue; + protected Map passMarksMap; + + + public String toString() { + return new ToStringBuilder(this) + .append("toolContentID: ", toolContentID) + .append("contentFolderID: ", contentFolderID) + .append("httpSessionID: ", httpSessionID) + .append("marksMap: ", marksMap) + .append("currentTab: ", currentTab) + .append("markValue: ", markValue) + .append("activeModule: ", activeModule) + .append("defineLaterInEditMode: ", defineLaterInEditMode) + .append("showAuthoringTabs: ", showAuthoringTabs) + .append("monitoringOriginatedDefineLater: ", monitoringOriginatedDefineLater) + .append("targetMode: ", targetMode) + .append("defaultQuestionContent: ", defaultQuestionContent) + .append("defaultContentIdStr: ", defaultContentIdStr) + .append("activityTitle: ", activityTitle) + .append("activityInstructions: ", activityInstructions) + .append("reflect: ", reflect) + .append("onlineInstructions: ", onlineInstructions) + .append("offlineInstructions: ", offlineInstructions) + .append("usernameVisible: ", usernameVisible) + .append("synchInMonitor: ", synchInMonitor) + .append("questionsSequenced: ", questionsSequenced) + .append("editActivityEditMode: ", editActivityEditMode) + .append("reflectionSubject: ", reflectionSubject) + .append("requestedModule: ", requestedModule) + .append("isDefineLater: ", isDefineLater) + .append("monitoredContentInUse: ", monitoredContentInUse) + .append("mapQuestionContent: ", mapQuestionContent) + .append("attachmentList: ", attachmentList) + .append("deletedAttachmentList: ", deletedAttachmentList) + .append("sbmtSuccess: ", sbmtSuccess) + .append("userExceptionQuestionsDuplicate: ", userExceptionQuestionsDuplicate) + .toString(); + } + + + + /** + * @return Returns the userExceptionQuestionsDuplicate. + */ + public String getUserExceptionQuestionsDuplicate() { + return userExceptionQuestionsDuplicate; + } + /** + * @param userExceptionQuestionsDuplicate The userExceptionQuestionsDuplicate to set. + */ + public void setUserExceptionQuestionsDuplicate( + String userExceptionQuestionsDuplicate) { + this.userExceptionQuestionsDuplicate = userExceptionQuestionsDuplicate; + } + /** + * @return Returns the httpSessionID. + */ + public String getHttpSessionID() { + return httpSessionID; + } + /** + * @param httpSessionID The httpSessionID to set. + */ + public void setHttpSessionID(String httpSessionID) { + this.httpSessionID = httpSessionID; + } + /** + * @return Returns the monitoredContentInUse. + */ + public String getMonitoredContentInUse() { + return monitoredContentInUse; + } + /** + * @param monitoredContentInUse The monitoredContentInUse to set. + */ + public void setMonitoredContentInUse(String monitoredContentInUse) { + this.monitoredContentInUse = monitoredContentInUse; + } + /** + * @return Returns the editActivityEditMode. + */ + public String getEditActivityEditMode() { + return editActivityEditMode; + } + /** + * @param editActivityEditMode The editActivityEditMode to set. + */ + public void setEditActivityEditMode(String editActivityEditMode) { + this.editActivityEditMode = editActivityEditMode; + } + /** + * @return Returns the deletedAttachmentList. + */ + public List getDeletedAttachmentList() { + return deletedAttachmentList; + } + /** + * @param deletedAttachmentList The deletedAttachmentList to set. + */ + public void setDeletedAttachmentList(List deletedAttachmentList) { + this.deletedAttachmentList = deletedAttachmentList; + } + /** + * @return Returns the mapQuestionContent. + */ + public Map getMapQuestionContent() { + return mapQuestionContent; + } + /** + * @param mapQuestionContent The mapQuestionContent to set. + */ + public void setMapQuestionContent(Map mapQuestionContent) { + this.mapQuestionContent = mapQuestionContent; + } + /** + * @return Returns the isDefineLater. + */ + public String getIsDefineLater() { + return isDefineLater; + } + /** + * @param isDefineLater The isDefineLater to set. + */ + public void setIsDefineLater(String isDefineLater) { + this.isDefineLater = isDefineLater; + } + + + /** + * @return Returns the attachmentList. + */ + public List getAttachmentList() { + return attachmentList; + } + /** + * @param attachmentList The attachmentList to set. + */ + public void setAttachmentList(List attachmentList) { + this.attachmentList = attachmentList; + } + /** + * @return Returns the toolContentID. + */ + public String getToolContentID() { + return toolContentID; + } + /** + * @param toolContentID The toolContentID to set. + */ + public void setToolContentID(String toolContentID) { + this.toolContentID = toolContentID; + } + + + /** + * @return Returns the targetMode. + */ + public String getTargetMode() { + return targetMode; + } + /** + * @param targetMode The targetMode to set. + */ + public void setTargetMode(String targetMode) { + this.targetMode = targetMode; + } + + /** + * @return Returns the monitoringOriginatedDefineLater. + */ + public String getMonitoringOriginatedDefineLater() { + return monitoringOriginatedDefineLater; + } + /** + * @param monitoringOriginatedDefineLater The monitoringOriginatedDefineLater to set. + */ + public void setMonitoringOriginatedDefineLater( + String monitoringOriginatedDefineLater) { + this.monitoringOriginatedDefineLater = monitoringOriginatedDefineLater; + } + + + /** + * @return Returns the activeModule. + */ + public String getActiveModule() { + return activeModule; + } + /** + * @param activeModule The activeModule to set. + */ + public void setActiveModule(String activeModule) { + this.activeModule = activeModule; + } + /** + * @return Returns the defineLaterInEditMode. + */ + public String getDefineLaterInEditMode() { + return defineLaterInEditMode; + } + /** + * @param defineLaterInEditMode The defineLaterInEditMode to set. + */ + public void setDefineLaterInEditMode(String defineLaterInEditMode) { + this.defineLaterInEditMode = defineLaterInEditMode; + } + /** + * @return Returns the showAuthoringTabs. + */ + public String getShowAuthoringTabs() { + return showAuthoringTabs; + } + /** + * @param showAuthoringTabs The showAuthoringTabs to set. + */ + public void setShowAuthoringTabs(String showAuthoringTabs) { + this.showAuthoringTabs = showAuthoringTabs; + } + + public int compareTo(Object o) + { + McGeneralAuthoringDTO mcGeneralAuthoringDTO = (McGeneralAuthoringDTO) o; + + if (mcGeneralAuthoringDTO == null) + return 1; + else + return 0; + } + + /** + * @return Returns the defaultContentIdStr. + */ + public String getDefaultContentIdStr() { + return defaultContentIdStr; + } + /** + * @param defaultContentIdStr The defaultContentIdStr to set. + */ + public void setDefaultContentIdStr(String defaultContentIdStr) { + this.defaultContentIdStr = defaultContentIdStr; + } + /** + * @return Returns the defaultQuestionContent. + */ + public String getDefaultQuestionContent() { + return defaultQuestionContent; + } + /** + * @param defaultQuestionContent The defaultQuestionContent to set. + */ + public void setDefaultQuestionContent(String defaultQuestionContent) { + this.defaultQuestionContent = defaultQuestionContent; + } + /** + * @return Returns the requestedModule. + */ + public String getRequestedModule() { + return requestedModule; + } + /** + * @param requestedModule The requestedModule to set. + */ + public void setRequestedModule(String requestedModule) { + this.requestedModule = requestedModule; + } + /** + * @return Returns the activityInstructions. + */ + public String getActivityInstructions() { + return activityInstructions; + } + /** + * @param activityInstructions The activityInstructions to set. + */ + public void setActivityInstructions(String activityInstructions) { + this.activityInstructions = activityInstructions; + } + /** + * @return Returns the activityTitle. + */ + public String getActivityTitle() { + return activityTitle; + } + /** + * @param activityTitle The activityTitle to set. + */ + public void setActivityTitle(String activityTitle) { + this.activityTitle = activityTitle; + } + /** + * @return Returns the offlineInstructions. + */ + public String getOfflineInstructions() { + return offlineInstructions; + } + /** + * @param offlineInstructions The offlineInstructions to set. + */ + public void setOfflineInstructions(String offlineInstructions) { + this.offlineInstructions = offlineInstructions; + } + /** + * @return Returns the onlineInstructions. + */ + public String getOnlineInstructions() { + return onlineInstructions; + } + /** + * @param onlineInstructions The onlineInstructions to set. + */ + public void setOnlineInstructions(String onlineInstructions) { + this.onlineInstructions = onlineInstructions; + } + /** + * @return Returns the questionsSequenced. + */ + public String getQuestionsSequenced() { + return questionsSequenced; + } + /** + * @param questionsSequenced The questionsSequenced to set. + */ + public void setQuestionsSequenced(String questionsSequenced) { + this.questionsSequenced = questionsSequenced; + } + + /** + * @return Returns the synchInMonitor. + */ + public String getSynchInMonitor() { + return synchInMonitor; + } + /** + * @param synchInMonitor The synchInMonitor to set. + */ + public void setSynchInMonitor(String synchInMonitor) { + this.synchInMonitor = synchInMonitor; + } + /** + * @return Returns the usernameVisible. + */ + public String getUsernameVisible() { + return usernameVisible; + } + /** + * @param usernameVisible The usernameVisible to set. + */ + public void setUsernameVisible(String usernameVisible) { + this.usernameVisible = usernameVisible; + } + /** + * @return Returns the currentTab. + */ + public String getCurrentTab() { + return currentTab; + } + /** + * @param currentTab The currentTab to set. + */ + public void setCurrentTab(String currentTab) { + this.currentTab = currentTab; + } + + /** + * @return Returns the sbmtSuccess. + */ + public String getSbmtSuccess() { + return sbmtSuccess; + } + /** + * @param sbmtSuccess The sbmtSuccess to set. + */ + public void setSbmtSuccess(String sbmtSuccess) { + this.sbmtSuccess = sbmtSuccess; + } + + /** + * @return Returns the contentFolderID. + */ + public String getContentFolderID() { + return contentFolderID; + } + /** + * @param contentFolderID The contentFolderID to set. + */ + public void setContentFolderID(String contentFolderID) { + this.contentFolderID = contentFolderID; + } + + /** + * @return Returns the editableQuestionText. + */ + public String getEditableQuestionText() { + return editableQuestionText; + } + /** + * @param editableQuestionText The editableQuestionText to set. + */ + public void setEditableQuestionText(String editableQuestionText) { + this.editableQuestionText = editableQuestionText; + } + + /** + * @return Returns the editableQuestionFeedback. + */ + public String getEditableQuestionFeedback() { + return editableQuestionFeedback; + } + /** + * @param editableQuestionFeedback The editableQuestionFeedback to set. + */ + public void setEditableQuestionFeedback(String editableQuestionFeedback) { + this.editableQuestionFeedback = editableQuestionFeedback; + } + + /** + * @return Returns the reflect. + */ + public String getReflect() { + return reflect; + } + /** + * @param reflect The reflect to set. + */ + public void setReflect(String reflect) { + this.reflect = reflect; + } + /** + * @return Returns the reflectionSubject. + */ + public String getReflectionSubject() { + return reflectionSubject; + } + /** + * @param reflectionSubject The reflectionSubject to set. + */ + public void setReflectionSubject(String reflectionSubject) { + this.reflectionSubject = reflectionSubject; + } + + /** + * @return Returns the sln. + */ + public String getSln() { + return sln; + } + /** + * @param sln The sln to set. + */ + public void setSln(String sln) { + this.sln = sln; + } + /** + * @return Returns the retries. + */ + public String getRetries() { + return retries; + } + /** + * @param retries The retries to set. + */ + public void setRetries(String retries) { + this.retries = retries; + } + /** + * @return Returns the marksMap. + */ + public Map getMarksMap() { + return marksMap; + } + /** + * @param marksMap The marksMap to set. + */ + public void setMarksMap(Map marksMap) { + this.marksMap = marksMap; + } + /** + * @return Returns the markValue. + */ + public String getMarkValue() { + return markValue; + } + /** + * @param markValue The markValue to set. + */ + public void setMarkValue(String markValue) { + this.markValue = markValue; + } + + /** + * @return Returns the correctMap. + */ + public Map getCorrectMap() { + return correctMap; + } + /** + * @param correctMap The correctMap to set. + */ + public void setCorrectMap(Map correctMap) { + this.correctMap = correctMap; + } + /** + * @return Returns the passMarkValue. + */ + public String getPassMarkValue() { + return passMarkValue; + } + /** + * @param passMarkValue The passMarkValue to set. + */ + public void setPassMarkValue(String passMarkValue) { + this.passMarkValue = passMarkValue; + } + /** + * @return Returns the passMarksMap. + */ + public Map getPassMarksMap() { + return passMarksMap; + } + /** + * @param passMarksMap The passMarksMap to set. + */ + public void setPassMarksMap(Map passMarksMap) { + this.passMarksMap = passMarksMap; + } +} Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralLearnerFlowDTO.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r81e4b129f71e63322c81c9016ec1ffa93f3c5944 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralLearnerFlowDTO.java (.../McGeneralLearnerFlowDTO.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralLearnerFlowDTO.java (.../McGeneralLearnerFlowDTO.java) (revision 81e4b129f71e63322c81c9016ec1ffa93f3c5944) @@ -337,6 +337,8 @@ public String toString() { return new ToStringBuilder(this) .append("retries: ", retries) + .append("mapQueAttempts: ", mapQueAttempts) + .append("mapGeneralOptionsContent: ", mapGeneralOptionsContent) .append("learnerMark : ", learnerMark) .append("learnerMarkAtLeast: ", learnerMarkAtLeast) .append("totalQuestionCount: ", totalQuestionCount) Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralMonitoringDTO.java =================================================================== diff -u --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralMonitoringDTO.java (revision 0) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralMonitoringDTO.java (revision 81e4b129f71e63322c81c9016ec1ffa93f3c5944) @@ -0,0 +1,827 @@ +/*************************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * ***********************************************************************/ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.mc; + + +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang.builder.ToStringBuilder; + + +/** + *

DTO that holds monitoring flow properties + *

+ * + * @author Ozgur Demirtas + */ +public class McGeneralMonitoringDTO implements Comparable +{ + protected String editResponse; + + protected Map mapQuestionContent; + protected String defaultQuestionContent; + + protected String currentMonitoringTab; + protected String sbmtSuccess; + protected String defineLaterInEditMode; + protected String requestLearningReport; + protected String userExceptionNoToolSessions; + protected String userExceptionContentInUse; + protected String userExceptionContentDoesNotExist; + protected String userExceptionNoStudentActivity; + protected String isMonitoredContentInUse; + protected String monitoredContentInUse; + + 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 existsOpenMcs; + protected String isToolSessionChanged; + protected String responseId; + protected String currentUid; + + protected String toolContentID; + protected Map mapOptionsContent; + protected Map summaryToolSessions; + protected Map summaryToolSessionsId; + protected List listMonitoredAnswersContainerDto; + protected List listUserEntries; + protected String selectedToolSessionId; + + protected String richTextOnlineInstructions; + protected String richTextOfflineInstructions; + protected List listOfflineFilesMetadata; + protected List listUploadedOfflineFileNames; + protected List listOnlineFilesMetadata; + protected List listUploadedOnlineFileNames; + protected String showOpenMcsSection; + + protected List listMcAllSessionsDTO; + protected Map mapStandardQuestionUid; + protected Map mapStandardToolSessionUid; + + protected String sessionUserCount; + protected String completedSessionUserCount; + protected String completedSessionUserPercent; + protected List mapStudentsMcd; + + protected String onlineInstructions; + protected String offlineInstructions; + protected List attachmentList; + protected List deletedAttachmentList; + + protected String contentFolderID; + + + + /** + * @return Returns the listOfflineFilesMetadata. + */ + public List getListOfflineFilesMetadata() { + return listOfflineFilesMetadata; + } + /** + * @param listOfflineFilesMetadata The listOfflineFilesMetadata to set. + */ + public void setListOfflineFilesMetadata(List listOfflineFilesMetadata) { + this.listOfflineFilesMetadata = listOfflineFilesMetadata; + } + /** + * @return Returns the listOnlineFilesMetadata. + */ + public List getListOnlineFilesMetadata() { + return listOnlineFilesMetadata; + } + /** + * @param listOnlineFilesMetadata The listOnlineFilesMetadata to set. + */ + public void setListOnlineFilesMetadata(List listOnlineFilesMetadata) { + this.listOnlineFilesMetadata = listOnlineFilesMetadata; + } + /** + * @return Returns the listUploadedOfflineFileNames. + */ + public List getListUploadedOfflineFileNames() { + return listUploadedOfflineFileNames; + } + /** + * @param listUploadedOfflineFileNames The listUploadedOfflineFileNames to set. + */ + public void setListUploadedOfflineFileNames( + List listUploadedOfflineFileNames) { + this.listUploadedOfflineFileNames = listUploadedOfflineFileNames; + } + /** + * @return Returns the listUploadedOnlineFileNames. + */ + public List getListUploadedOnlineFileNames() { + return listUploadedOnlineFileNames; + } + /** + * @param listUploadedOnlineFileNames The listUploadedOnlineFileNames to set. + */ + public void setListUploadedOnlineFileNames(List listUploadedOnlineFileNames) { + this.listUploadedOnlineFileNames = listUploadedOnlineFileNames; + } + /** + * @return Returns the richTextOfflineInstructions. + */ + public String getRichTextOfflineInstructions() { + return richTextOfflineInstructions; + } + /** + * @param richTextOfflineInstructions The richTextOfflineInstructions to set. + */ + public void setRichTextOfflineInstructions( + String richTextOfflineInstructions) { + this.richTextOfflineInstructions = richTextOfflineInstructions; + } + /** + * @return Returns the richTextOnlineInstructions. + */ + public String getRichTextOnlineInstructions() { + return richTextOnlineInstructions; + } + /** + * @param richTextOnlineInstructions The richTextOnlineInstructions to set. + */ + public void setRichTextOnlineInstructions(String richTextOnlineInstructions) { + this.richTextOnlineInstructions = richTextOnlineInstructions; + } + /** + * @return Returns the userExceptionContentDoesNotExist. + */ + public String getUserExceptionContentDoesNotExist() { + return userExceptionContentDoesNotExist; + } + /** + * @param userExceptionContentDoesNotExist The userExceptionContentDoesNotExist to set. + */ + public void setUserExceptionContentDoesNotExist( + String userExceptionContentDoesNotExist) { + this.userExceptionContentDoesNotExist = userExceptionContentDoesNotExist; + } + /** + * @return Returns the userExceptionNoStudentActivity. + */ + public String getUserExceptionNoStudentActivity() { + return userExceptionNoStudentActivity; + } + /** + * @param userExceptionNoStudentActivity The userExceptionNoStudentActivity to set. + */ + public void setUserExceptionNoStudentActivity( + String userExceptionNoStudentActivity) { + this.userExceptionNoStudentActivity = userExceptionNoStudentActivity; + } + /** + * @return Returns the activeModule. + */ + public String getActiveModule() { + return activeModule; + } + /** + * @param activeModule The activeModule to set. + */ + public void setActiveModule(String activeModule) { + this.activeModule = activeModule; + } + /** + * @return Returns the currentTab. + */ + public String getCurrentTab() { + return currentTab; + } + /** + * @param currentTab The currentTab to set. + */ + public void setCurrentTab(String currentTab) { + this.currentTab = currentTab; + } + /** + * @return Returns the defaultOptionContent. + */ + public String getDefaultOptionContent() { + return defaultOptionContent; + } + /** + * @param defaultOptionContent The defaultOptionContent to set. + */ + public void setDefaultOptionContent(String defaultOptionContent) { + this.defaultOptionContent = defaultOptionContent; + } + /** + * @return Returns the userExceptionContentInUse. + */ + public String getUserExceptionContentInUse() { + return userExceptionContentInUse; + } + /** + * @param userExceptionContentInUse The userExceptionContentInUse to set. + */ + public void setUserExceptionContentInUse(String userExceptionContentInUse) { + this.userExceptionContentInUse = userExceptionContentInUse; + } + /** + * @return Returns the activityInstructions. + */ + public String getActivityInstructions() { + return activityInstructions; + } + /** + * @param activityInstructions The activityInstructions to set. + */ + public void setActivityInstructions(String activityInstructions) { + this.activityInstructions = activityInstructions; + } + /** + * @return Returns the activityTitle. + */ + public String getActivityTitle() { + return activityTitle; + } + /** + * @param activityTitle The activityTitle to set. + */ + public void setActivityTitle(String activityTitle) { + this.activityTitle = activityTitle; + } + /** + * @return Returns the currentMonitoringTab. + */ + public String getCurrentMonitoringTab() { + return currentMonitoringTab; + } + /** + * @param currentMonitoringTab The currentMonitoringTab to set. + */ + public void setCurrentMonitoringTab(String currentMonitoringTab) { + this.currentMonitoringTab = currentMonitoringTab; + } + /** + * @return Returns the defineLaterInEditMode. + */ + public String getDefineLaterInEditMode() { + return defineLaterInEditMode; + } + /** + * @param defineLaterInEditMode The defineLaterInEditMode to set. + */ + public void setDefineLaterInEditMode(String defineLaterInEditMode) { + this.defineLaterInEditMode = defineLaterInEditMode; + } + /** + * @return Returns the requestLearningReport. + */ + public String getRequestLearningReport() { + return requestLearningReport; + } + /** + * @param requestLearningReport The requestLearningReport to set. + */ + public void setRequestLearningReport(String requestLearningReport) { + this.requestLearningReport = requestLearningReport; + } + /** + * @return Returns the sbmtSuccess. + */ + public String getSbmtSuccess() { + return sbmtSuccess; + } + /** + * @param sbmtSuccess The sbmtSuccess to set. + */ + public void setSbmtSuccess(String sbmtSuccess) { + this.sbmtSuccess = sbmtSuccess; + } + /** + * @return Returns the userExceptionNoToolSessions. + */ + public String getUserExceptionNoToolSessions() { + return userExceptionNoToolSessions; + } + /** + * @param userExceptionNoToolSessions The userExceptionNoToolSessions to set. + */ + public void setUserExceptionNoToolSessions( + String userExceptionNoToolSessions) { + this.userExceptionNoToolSessions = userExceptionNoToolSessions; + } + /** + * @return Returns the isMonitoredContentInUse. + */ + public String getIsMonitoredContentInUse() { + return isMonitoredContentInUse; + } + /** + * @param isMonitoredContentInUse The isMonitoredContentInUse to set. + */ + public void setIsMonitoredContentInUse(String isMonitoredContentInUse) { + this.isMonitoredContentInUse = isMonitoredContentInUse; + } + + + /** + * @return Returns the mapOptionsContent. + */ + public Map getMapOptionsContent() { + return mapOptionsContent; + } + /** + * @param mapOptionsContent The mapOptionsContent to set. + */ + public void setMapOptionsContent(Map mapOptionsContent) { + this.mapOptionsContent = mapOptionsContent; + } + + /** + * @return Returns the countAllUsers. + */ + public String getCountAllUsers() { + return countAllUsers; + } + /** + * @param countAllUsers The countAllUsers to set. + */ + public void setCountAllUsers(String countAllUsers) { + this.countAllUsers = countAllUsers; + } + /** + * @return Returns the countSessionComplete. + */ + public String getCountSessionComplete() { + return countSessionComplete; + } + /** + * @param countSessionComplete The countSessionComplete to set. + */ + public void setCountSessionComplete(String countSessionComplete) { + this.countSessionComplete = countSessionComplete; + } + /** + * @return Returns the isPortfolioExport. + */ + public String getIsPortfolioExport() { + return isPortfolioExport; + } + /** + * @param isPortfolioExport The isPortfolioExport to set. + */ + public void setIsPortfolioExport(String isPortfolioExport) { + this.isPortfolioExport = isPortfolioExport; + } + /** + * @return Returns the summaryToolSessions. + */ + public Map getSummaryToolSessions() { + return summaryToolSessions; + } + /** + * @param summaryToolSessions The summaryToolSessions to set. + */ + public void setSummaryToolSessions(Map summaryToolSessions) { + this.summaryToolSessions = summaryToolSessions; + } + /** + * @return Returns the summaryToolSessionsId. + */ + public Map getSummaryToolSessionsId() { + return summaryToolSessionsId; + } + /** + * @param summaryToolSessionsId The summaryToolSessionsId to set. + */ + public void setSummaryToolSessionsId(Map summaryToolSessionsId) { + this.summaryToolSessionsId = summaryToolSessionsId; + } + /** + * @return Returns the selectionCase. + */ + public Long getSelectionCase() { + return selectionCase; + } + /** + * @param selectionCase The selectionCase to set. + */ + public void setSelectionCase(Long selectionCase) { + this.selectionCase = selectionCase; + } + /** + * @return Returns the currentMonitoredToolSession. + */ + public String getCurrentMonitoredToolSession() { + return currentMonitoredToolSession; + } + /** + * @param currentMonitoredToolSession The currentMonitoredToolSession to set. + */ + public void setCurrentMonitoredToolSession( + String currentMonitoredToolSession) { + this.currentMonitoredToolSession = currentMonitoredToolSession; + } + /** + * @return Returns the groupName. + */ + public String getGroupName() { + return groupName; + } + /** + * @param groupName The groupName to set. + */ + public void setGroupName(String groupName) { + this.groupName = groupName; + } + /** + * @return Returns the listMonitoredAnswersContainerDto. + */ + public List getListMonitoredAnswersContainerDto() { + return listMonitoredAnswersContainerDto; + } + /** + * @param listMonitoredAnswersContainerDto The listMonitoredAnswersContainerDto to set. + */ + public void setListMonitoredAnswersContainerDto( + List listMonitoredAnswersContainerDto) { + this.listMonitoredAnswersContainerDto = listMonitoredAnswersContainerDto; + } + /** + * @return Returns the listUserEntries. + */ + public List getListUserEntries() { + return listUserEntries; + } + /** + * @param listUserEntries The listUserEntries to set. + */ + public void setListUserEntries(List listUserEntries) { + this.listUserEntries = listUserEntries; + } + /** + * @return Returns the existsOpenMcs. + */ + public String getExistsOpenMcs() { + return existsOpenMcs; + } + /** + * @param existsOpenMcs The existsOpenMcs to set. + */ + public void setExistsOpenMcs(String existsOpenMcs) { + this.existsOpenMcs = existsOpenMcs; + } + /** + * @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 listMcAllSessionsDTO. + */ + public List getListMcAllSessionsDTO() { + return listMcAllSessionsDTO; + } + /** + * @param listMcAllSessionsDTO The listMcAllSessionsDTO to set. + */ + public void setListMcAllSessionsDTO(List listMcAllSessionsDTO) { + this.listMcAllSessionsDTO = listMcAllSessionsDTO; + } + /** + * @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; + } + /** + * @return Returns the showOpenMcsSection. + */ + public String getShowOpenMcsSection() { + return showOpenMcsSection; + } + /** + * @param showOpenMcsSection The showOpenMcsSection to set. + */ + public void setShowOpenMcsSection(String showOpenMcsSection) { + this.showOpenMcsSection = showOpenMcsSection; + } + /** + * @param mapStudentsMcd The mapStudentsMcd to set. + */ + public void setMapStudentsMcd(List mapStudentsMcd) { + this.mapStudentsMcd = mapStudentsMcd; + } + /** + * @return Returns the mapStudentsMcd. + */ + public List getMapStudentsMcd() { + return mapStudentsMcd; + } + /** + * @return Returns the currentUid. + */ + public String getCurrentUid() { + return currentUid; + } + /** + * @param currentUid The currentUid to set. + */ + public void setCurrentUid(String currentUid) { + this.currentUid = currentUid; + } + /** + * @return Returns the isToolSessionChanged. + */ + public String getIsToolSessionChanged() { + return isToolSessionChanged; + } + /** + * @param isToolSessionChanged The isToolSessionChanged to set. + */ + public void setIsToolSessionChanged(String isToolSessionChanged) { + this.isToolSessionChanged = isToolSessionChanged; + } + /** + * @return Returns the responseId. + */ + public String getResponseId() { + return responseId; + } + /** + * @param responseId The responseId to set. + */ + public void setResponseId(String responseId) { + this.responseId = responseId; + } + /** + * @return Returns the toolContentID. + */ + public String getToolContentID() { + return toolContentID; + } + /** + * @param toolContentID The toolContentID to set. + */ + public void setToolContentID(String toolContentID) { + this.toolContentID = toolContentID; + } + /** + * @return Returns the completedSessionUserCount. + */ + public String getCompletedSessionUserCount() { + return completedSessionUserCount; + } + /** + * @param completedSessionUserCount The completedSessionUserCount to set. + */ + public void setCompletedSessionUserCount(String completedSessionUserCount) { + this.completedSessionUserCount = completedSessionUserCount; + } + /** + * @return Returns the completedSessionUserPercent. + */ + public String getCompletedSessionUserPercent() { + return completedSessionUserPercent; + } + /** + * @param completedSessionUserPercent The completedSessionUserPercent to set. + */ + public void setCompletedSessionUserPercent( + String completedSessionUserPercent) { + this.completedSessionUserPercent = completedSessionUserPercent; + } + /** + * @return Returns the sessionUserCount. + */ + public String getSessionUserCount() { + return sessionUserCount; + } + /** + * @param sessionUserCount The sessionUserCount to set. + */ + public void setSessionUserCount(String sessionUserCount) { + this.sessionUserCount = sessionUserCount; + } + + public String toString() { + return new ToStringBuilder(this) + .append("toolContentID: ", toolContentID) + .append("activeModule: ", activeModule) + .append("monitoredContentInUse: ", monitoredContentInUse) + .append("currentMonitoringTab: ", currentMonitoringTab) + .append("selectionCase: ", selectionCase) + .append("isToolSessionChanged: ", isToolSessionChanged) + .append("currentTab: ", currentTab) + .append("sbmtSuccess: ", sbmtSuccess) + .append("defineLaterInEditMode: ", defineLaterInEditMode) + .append("requestLearningReport: ", requestLearningReport) + .append("userExceptionNoToolSessions: ", userExceptionNoToolSessions) + .append("userExceptionContentDoesNotExist: ", userExceptionContentDoesNotExist) + .append("userExceptionNoStudentActivity: ", userExceptionNoStudentActivity) + .append("isMonitoredContentInUse: ", isMonitoredContentInUse) + .append("activityTitle: ", activityTitle) + .append("activityInstructions: ", activityInstructions) + .append("userExceptionContentInUse: ", userExceptionContentInUse) + .append("defaultOptionContent: ", defaultOptionContent) + .append("countAllUsers: ", countAllUsers) + .append("countSessionComplete: ", countSessionComplete) + .append("isPortfolioExport: ", isPortfolioExport) + .append("summaryToolSessions: ", summaryToolSessions) + .append("summaryToolSessionsId: ", summaryToolSessionsId) + .append("currentMonitoredToolSession: ", currentMonitoredToolSession) + .append("groupName: ", groupName) + .append("listMonitoredAnswersContainerDto: ", listMonitoredAnswersContainerDto) + .append("listUserEntries: ", listUserEntries) + .append("existsOpenMcs: ", existsOpenMcs) + .append("selectedToolSessionId: ", selectedToolSessionId) + .append("listMcAllSessionsDTO: ", listMcAllSessionsDTO) + .append("richTextOnlineInstructions: ", richTextOnlineInstructions) + .append("richTextOfflineInstructions: ", richTextOfflineInstructions) + .append("listOfflineFilesMetadata: ", listOfflineFilesMetadata) + .append("listUploadedOfflineFileNames: ", listUploadedOfflineFileNames) + .append("listOnlineFilesMetadata: ", listOnlineFilesMetadata) + .append("listUploadedOnlineFileNames: ", listUploadedOnlineFileNames) + .append("showOpenMcsSection: ", showOpenMcsSection) + .append("mapStudentsMcd: ", mapStudentsMcd) + .append("responseId: ", responseId) + .append("currentUid: ", currentUid) + .append("sessionUserCount: ", sessionUserCount) + .append("completedSessionUserCount: ", completedSessionUserCount) + .append("completedSessionUserPercent: ", completedSessionUserPercent) + .toString(); + } + + public int compareTo(Object o) + { + McGeneralMonitoringDTO mcGeneralMonitoringDTO = (McGeneralMonitoringDTO) o; + + if (mcGeneralMonitoringDTO == null) + return 1; + else + return 0; + } + + /** + * @return Returns the monitoredContentInUse. + */ + public String getMonitoredContentInUse() { + return monitoredContentInUse; + } + /** + * @param monitoredContentInUse The monitoredContentInUse to set. + */ + public void setMonitoredContentInUse(String monitoredContentInUse) { + this.monitoredContentInUse = monitoredContentInUse; + } + + /** + * @return Returns the offlineInstructions. + */ + public String getOfflineInstructions() { + return offlineInstructions; + } + /** + * @param offlineInstructions The offlineInstructions to set. + */ + public void setOfflineInstructions(String offlineInstructions) { + this.offlineInstructions = offlineInstructions; + } + /** + * @return Returns the onlineInstructions. + */ + public String getOnlineInstructions() { + return onlineInstructions; + } + /** + * @param onlineInstructions The onlineInstructions to set. + */ + public void setOnlineInstructions(String onlineInstructions) { + this.onlineInstructions = onlineInstructions; + } + + /** + * @return Returns the attachmentList. + */ + public List getAttachmentList() { + return attachmentList; + } + /** + * @param attachmentList The attachmentList to set. + */ + public void setAttachmentList(List attachmentList) { + this.attachmentList = attachmentList; + } + /** + * @return Returns the contentFolderID. + */ + public String getContentFolderID() { + return contentFolderID; + } + /** + * @param contentFolderID The contentFolderID to set. + */ + public void setContentFolderID(String contentFolderID) { + this.contentFolderID = contentFolderID; + } + /** + * @return Returns the deletedAttachmentList. + */ + public List getDeletedAttachmentList() { + return deletedAttachmentList; + } + /** + * @param deletedAttachmentList The deletedAttachmentList to set. + */ + public void setDeletedAttachmentList(List deletedAttachmentList) { + this.deletedAttachmentList = deletedAttachmentList; + } + + /** + * @return Returns the defaultQuestionContent. + */ + public String getDefaultQuestionContent() { + return defaultQuestionContent; + } + /** + * @param defaultQuestionContent The defaultQuestionContent to set. + */ + public void setDefaultQuestionContent(String defaultQuestionContent) { + this.defaultQuestionContent = defaultQuestionContent; + } + /** + * @return Returns the editResponse. + */ + public String getEditResponse() { + return editResponse; + } + /** + * @param editResponse The editResponse to set. + */ + public void setEditResponse(String editResponse) { + this.editResponse = editResponse; + } + /** + * @return Returns the mapQuestionContent. + */ + public Map getMapQuestionContent() { + return mapQuestionContent; + } + /** + * @param mapQuestionContent The mapQuestionContent to set. + */ + public void setMapQuestionContent(Map mapQuestionContent) { + this.mapQuestionContent = mapQuestionContent; + } +} Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McLearnerAnswersDTO.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r81e4b129f71e63322c81c9016ec1ffa93f3c5944 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McLearnerAnswersDTO.java (.../McLearnerAnswersDTO.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McLearnerAnswersDTO.java (.../McLearnerAnswersDTO.java) (revision 81e4b129f71e63322c81c9016ec1ffa93f3c5944) @@ -55,6 +55,7 @@ protected String feedbackCorrect; + protected String feedback; /** * @return Returns the candidateAnswers. @@ -198,4 +199,16 @@ public void setMark(String mark) { this.mark = mark; } + /** + * @return Returns the feedback. + */ + public String getFeedback() { + return feedback; + } + /** + * @param feedback The feedback to set. + */ + public void setFeedback(String feedback) { + this.feedback = feedback; + } } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McMonitoredAnswersDTO.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r81e4b129f71e63322c81c9016ec1ffa93f3c5944 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McMonitoredAnswersDTO.java (.../McMonitoredAnswersDTO.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McMonitoredAnswersDTO.java (.../McMonitoredAnswersDTO.java) (revision 81e4b129f71e63322c81c9016ec1ffa93f3c5944) @@ -42,6 +42,12 @@ private String weight; + private String mark; + + private String sessionId; + + private String sessionName; + private List candidateAnswers; private List candidateAnswersCorrect; @@ -146,4 +152,41 @@ public void setCandidateAnswersCorrect(List candidateAnswersCorrect) { this.candidateAnswersCorrect = candidateAnswersCorrect; } + + /** + * @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 sessionName. + */ + public String getSessionName() { + return sessionName; + } + /** + * @param sessionName The sessionName to set. + */ + public void setSessionName(String sessionName) { + this.sessionName = sessionName; + } + /** + * @return Returns the mark. + */ + public String getMark() { + return mark; + } + /** + * @param mark The mark to set. + */ + public void setMark(String mark) { + this.mark = mark; + } } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McQuestionContentDTO.java =================================================================== diff -u --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McQuestionContentDTO.java (revision 0) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McQuestionContentDTO.java (revision 81e4b129f71e63322c81c9016ec1ffa93f3c5944) @@ -0,0 +1,155 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.mc; + +import org.apache.commons.lang.builder.ToStringBuilder; +import java.util.List; + + +/** + *

DTO that holds users attempt history data for jsp purposes + *

+ * + * @author Ozgur Demirtas + */ +public class McQuestionContentDTO implements Comparable +{ + private String question; + private String displayOrder; + private String feedback; + private String weight; + private String mark; + + private String caCount; + private List listCandidateAnswersDTO; + + public String toString() { + return new ToStringBuilder(this) + .append("question:", question) + .append("feedback:", feedback) + .append("weight:", weight) + .append("caCount:", caCount) + .append("displayOrder:", displayOrder) + .append("mark:", mark) + .append("listCandidateAnswersDTO:", listCandidateAnswersDTO) + .toString(); + } + + public int compareTo(Object o) + { + McMonitoredUserDTO mcMonitoredUserDTO = (McMonitoredUserDTO) o; + + if (mcMonitoredUserDTO == null) + return 1; + else + return 0; + } + /** + * @return Returns the displayOrder. + */ + public String getDisplayOrder() { + return displayOrder; + } + /** + * @param displayOrder The displayOrder to set. + */ + public void setDisplayOrder(String displayOrder) { + this.displayOrder = displayOrder; + } + /** + * @return Returns the feedback. + */ + public String getFeedback() { + return feedback; + } + /** + * @param feedback The feedback to set. + */ + public void setFeedback(String feedback) { + this.feedback = feedback; + } + /** + * @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 weight. + */ + public String getWeight() { + return weight; + } + /** + * @param weight The weight to set. + */ + public void setWeight(String weight) { + this.weight = weight; + } + + /** + * @return Returns the mark. + */ + public String getMark() { + return mark; + } + /** + * @param mark The mark to set. + */ + public void setMark(String mark) { + this.mark = mark; + } + /** + * @return Returns the listCandidateAnswersDTO. + */ + public List getListCandidateAnswersDTO() { + return listCandidateAnswersDTO; + } + /** + * @param listCandidateAnswersDTO The listCandidateAnswersDTO to set. + */ + public void setListCandidateAnswersDTO(List listCandidateAnswersDTO) { + this.listCandidateAnswersDTO = listCandidateAnswersDTO; + } + + /** + * @return Returns the caCount. + */ + public String getCaCount() { + return caCount; + } + /** + * @param caCount The caCount to set. + */ + public void setCaCount(String caCount) { + this.caCount = caCount; + } + } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McStatsDTO.java =================================================================== diff -u --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McStatsDTO.java (revision 0) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McStatsDTO.java (revision 81e4b129f71e63322c81c9016ec1ffa93f3c5944) @@ -0,0 +1,84 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.mc; + +import org.apache.commons.lang.builder.ToStringBuilder; + + +/** + *

DTO that holds stats data + *

+ * + * @author Ozgur Demirtas + */ +public class McStatsDTO implements Comparable +{ + private String countAllUsers; + + private String countSessionComplete; + + public String toString() { + return new ToStringBuilder(this) + .append("question", countAllUsers) + .append("countSessionComplete", countSessionComplete) + .toString(); + } + + public int compareTo(Object o) + { + McStatsDTO mcStatsDTO = (McStatsDTO) o; + + if (mcStatsDTO == null) + return 1; + else + return 0; + } + + + /** + * @return Returns the countAllUsers. + */ + public String getCountAllUsers() { + return countAllUsers; + } + /** + * @param countAllUsers The countAllUsers to set. + */ + public void setCountAllUsers(String countAllUsers) { + this.countAllUsers = countAllUsers; + } + /** + * @return Returns the countSessionComplete. + */ + public String getCountSessionComplete() { + return countSessionComplete; + } + /** + * @param countSessionComplete The countSessionComplete to set. + */ + public void setCountSessionComplete(String countSessionComplete) { + this.countSessionComplete = countSessionComplete; + } +} Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McTempDataHolderDTO.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r81e4b129f71e63322c81c9016ec1ffa93f3c5944 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McTempDataHolderDTO.java (.../McTempDataHolderDTO.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McTempDataHolderDTO.java (.../McTempDataHolderDTO.java) (revision 81e4b129f71e63322c81c9016ec1ffa93f3c5944) @@ -36,6 +36,7 @@ { protected String learnerMark; protected String totalUserWeight; + protected String totalUserMark; public int compareTo(Object o) @@ -52,6 +53,7 @@ return new ToStringBuilder(this) .append("learnerMark: ", learnerMark) .append("totalUserWeight : ", totalUserWeight) + .append("totalUserMark : ", totalUserMark) .toString(); } @@ -79,4 +81,16 @@ public void setTotalUserWeight(String totalUserWeight) { this.totalUserWeight = totalUserWeight; } + /** + * @return Returns the totalUserMark. + */ + public String getTotalUserMark() { + return totalUserMark; + } + /** + * @param totalUserMark The totalUserMark to set. + */ + public void setTotalUserMark(String totalUserMark) { + this.totalUserMark = totalUserMark; + } } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r81e4b129f71e63322c81c9016ec1ffa93f3c5944 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java (.../McUtils.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java (.../McUtils.java) (revision 81e4b129f71e63322c81c9016ec1ffa93f3c5944) @@ -23,6 +23,7 @@ package org.lamsfoundation.lams.tool.mc; import java.text.DateFormat; +import java.util.ArrayList; import java.util.Date; import java.util.Iterator; import java.util.List; @@ -37,12 +38,14 @@ import org.apache.log4j.Logger; import org.lamsfoundation.lams.tool.mc.pojos.McContent; import org.lamsfoundation.lams.tool.mc.pojos.McOptsContent; -import org.lamsfoundation.lams.tool.mc.pojos.McSession; +import org.lamsfoundation.lams.tool.mc.pojos.McUploadedFile; import org.lamsfoundation.lams.tool.mc.service.IMcService; +import org.lamsfoundation.lams.tool.mc.web.McAuthoringForm; import org.lamsfoundation.lams.usermanagement.User; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; import org.lamsfoundation.lams.web.session.SessionManager; import org.lamsfoundation.lams.web.util.AttributeNames; +import org.lamsfoundation.lams.web.util.SessionMap; /** @@ -53,19 +56,6 @@ static Logger logger = Logger.getLogger(McUtils.class.getName()); - /** - * returns the service object from the session cache - * IMcService getToolService(HttpServletRequest request) - * - * @param request - * @return - */ - public static IMcService getToolService(HttpServletRequest request) - { - IMcService mcService=(IMcService)request.getSession().getAttribute(TOOL_SERVICE); - return mcService; - } - public static String replaceNewLines(String text) { logger.debug("using text: " + text); @@ -152,47 +142,10 @@ /** - * existsContent(long toolContentId) - * @param long toolContentId - * @return boolean - * determine whether a specific toolContentId exists in the db - */ - public static boolean existsContent(Long toolContentId, HttpServletRequest request) - { - IMcService mcService =McUtils.getToolService(request); - - McContent mcContent=mcService.retrieveMc(toolContentId); - logger.debug("retrieving mcContent: " + mcContent); - if (mcContent == null) - return false; - - return true; - } - - /** - * it is expected that the tool session id already exists in the tool sessions table - * existsSession(long toolSessionId) - * @param toolSessionId - * @return boolean - */ - public static boolean existsSession(Long toolSessionId, HttpServletRequest request) - { - logger.debug("existsSession"); - IMcService mcService =McUtils.getToolService(request); - McSession mcSession=mcService.retrieveMcSession(toolSessionId); - logger.debug("mcSession:" + mcSession); - - if (mcSession == null) - return false; - - return true; - } - - - /** - * returns a Map of options * generateOptionsMap(List listMcOptions) * + * returns a Map of options + * * @param listMcOptions * @return Map */ @@ -215,7 +168,13 @@ } - //consider adding if (!requestByStarter) to other properties as well + + /** + * void saveInSessionRichText(HttpServletRequest request, boolean requestByStarter) + * + * @param request + * @param requestByStarter + */ public static void saveInSessionRichText(HttpServletRequest request, boolean requestByStarter) { logger.debug("saveInSessionRichText, requestByStarter: " + requestByStarter); @@ -244,15 +203,8 @@ if (!requestByStarter) { - //if ((richTextTitle != null) && (richTextTitle.length() > 0)) - //{ - request.getSession().setAttribute(RICHTEXT_TITLE,richTextTitle); - //} - - //if ((richTextInstructions != null) && (richTextInstructions.length() > 0)) - //{ - request.getSession().setAttribute(RICHTEXT_INSTRUCTIONS,richTextInstructions); - //} + request.getSession().setAttribute(RICHTEXT_TITLE,richTextTitle); + request.getSession().setAttribute(RICHTEXT_INSTRUCTIONS,richTextInstructions); } @@ -285,21 +237,11 @@ String richTextReportTitle=request.getParameter(RICHTEXT_REPORT_TITLE); logger.debug("read parameter richTextReportTitle: " + richTextReportTitle); - //String richTextEndLearningMessage=request.getParameter(RICHTEXT_END_LEARNING_MSG); - //logger.debug("read parameter richTextEndLearningMessage: " + richTextEndLearningMessage); - if ((richTextReportTitle != null) && (richTextReportTitle.length() > 0)) { request.getSession().setAttribute(RICHTEXT_REPORT_TITLE,richTextReportTitle); } - /* - if ((richTextEndLearningMessage != null) && (richTextEndLearningMessage.length() > 0)) - { - request.getSession().setAttribute(RICHTEXT_END_LEARNING_MSG,richTextEndLearningMessage); - } - */ - Map mapIncorrectFeedback=(Map)request.getSession().getAttribute(MAP_INCORRECT_FEEDBACK); } @@ -311,32 +253,6 @@ logger.debug("configureContentRepository ran successfully"); } - /** - * retrieves existing updated file information - * populateUploadedFilesData(HttpServletRequest request, McContent defaultMcContent) - * - * @param request - * @param defaultMcContent - */ - public static void populateUploadedFilesData(HttpServletRequest request, McContent defaultMcContent) - { - logger.debug("attempt populateUploadedFilesData for: " + defaultMcContent); - IMcService mcService =McUtils.getToolService(request); - logger.debug("mcService: " + mcService); - - /** read the uploaded offline uuid + file name pair */ - List listOffFilesName=mcService.retrieveMcUploadedOfflineFilesName(defaultMcContent.getUid()); - logger.debug("initial listOfflineFilesName: " + listOffFilesName); - - /** read the uploaded online uuid + file name pair */ - List listOnFilesName=mcService.retrieveMcUploadedOnlineFilesName(defaultMcContent.getUid()); - logger.debug("initial listOnlineFilesName: " + listOnFilesName); - - request.getSession().setAttribute(LIST_UPLOADED_OFFLINE_FILENAMES, listOffFilesName); - request.getSession().setAttribute(LIST_UPLOADED_ONLINE_FILENAMES, listOnFilesName); - } - - /** * temporary function * @return @@ -431,9 +347,10 @@ /** - * builds a String based map from a list * convertToMap(List sessionsList) * + * builds a String based map from a list + * * @param sessionsList * @return Map */ @@ -510,30 +427,6 @@ } - /** - * sets/resets the define later flag of the content - * setDefineLater(HttpServletRequest request, boolean value) - * - * @param request - * @param value - */ - public static void setDefineLater(HttpServletRequest request, boolean value) - { - IMcService mcService =McUtils.getToolService(request); - Long toolContentId=(Long)request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentId:" + toolContentId); - logger.debug("value:" + value); - - McContent mcContent=mcService.retrieveMc(toolContentId); - logger.debug("mcContent:" + mcContent); - if (mcContent != null) - { - mcContent.setDefineLater(value); - logger.debug("defineLater has been set to true"); - mcService.saveMcContent(mcContent); - } - } - public static String getDestination(String sourceMcStarter) { @@ -755,58 +648,223 @@ request.getSession().removeAttribute(ACTIVITY_TITLE); request.getSession().removeAttribute(ACTIVITY_INSTRUCTIONS); request.getSession().removeAttribute(SUMMARY_TOOL_SESSIONS_ID); - - cleanUpUserExceptions(request); logger.debug("completely cleaned the session."); } + - /** - *removes attributes except USER_EXCEPTION_NO_STUDENT_ACTIVITY - */ - public static void cleanUpUserExceptions(HttpServletRequest request) + /** + * String getDestination(String sourceMcStarter, String requestedModule) + * + * determines the struts level location to return + * + * @param sourceMcStarter + * @param requestedModule + * @return + */ + public static String getDestination(String sourceMcStarter, String requestedModule) + { + logger.debug("sourceMcStarter: " + sourceMcStarter + " and requestedModule:" + requestedModule); + + if (requestedModule.equals(DEFINE_LATER)) + { + logger.debug("request is from define Later url. return to: " + LOAD_VIEW_ONLY); + return LOAD_VIEW_ONLY; + } + else if (requestedModule.equals(AUTHORING)) + { + logger.debug("request is from authoring url. return to: " + LOAD_QUESTIONS); + return LOAD_QUESTIONS; + } + else + { + logger.debug("request is from an unknown source. return null"); + return null; + } + } + + + /** + * populateAuthoringDTO(HttpServletRequest request, McContent defaultMcContent, + McGeneralAuthoringDTO mcGeneralAuthoringDTO) + * + * @param request + * @param defaultMcContent + * @param mcGeneralAuthoringDTO + */ + public static void populateAuthoringDTO(HttpServletRequest request, McContent defaultMcContent, + McGeneralAuthoringDTO mcGeneralAuthoringDTO) + { + mcGeneralAuthoringDTO.setActivityTitle(defaultMcContent.getTitle()); + mcGeneralAuthoringDTO.setActivityInstructions(defaultMcContent.getInstructions()); + + mcGeneralAuthoringDTO.setOnlineInstructions(defaultMcContent.getOnlineInstructions()); + mcGeneralAuthoringDTO.setOfflineInstructions(defaultMcContent.getOfflineInstructions()); + } + + + /** + * setDefineLater(HttpServletRequest request, boolean value, String toolContentID) + * @param request + * @param value + * @param toolContentID + */ + public static void setDefineLater(HttpServletRequest request, boolean value, String strToolContentID, IMcService mcService) { - request.getSession().removeAttribute(USER_EXCEPTION_WRONG_FORMAT); - request.getSession().removeAttribute(USER_EXCEPTION_INCOMPATIBLE_IDS); - request.getSession().removeAttribute(USER_EXCEPTION_NUMBERFORMAT); - request.getSession().removeAttribute(USER_EXCEPTION_CONTENT_DOESNOTEXIST); - request.getSession().removeAttribute(USER_EXCEPTION_TOOLSESSION_DOESNOTEXIST); - request.getSession().removeAttribute(USER_EXCEPTION_TOOLCONTENT_DOESNOTEXIST); - request.getSession().removeAttribute(USER_EXCEPTION_LEARNER_REQUIRED); - request.getSession().removeAttribute(USER_EXCEPTION_CONTENTID_REQUIRED); - request.getSession().removeAttribute(USER_EXCEPTION_TOOLSESSIONID_REQUIRED); - request.getSession().removeAttribute(USER_EXCEPTION_TOOLSESSIONID_INCONSISTENT); - request.getSession().removeAttribute(USER_EXCEPTION_DEFAULTCONTENT_NOT_AVAILABLE); - request.getSession().removeAttribute(USER_EXCEPTION_DEFAULTQUESTIONCONTENT_NOT_AVAILABLE); - request.getSession().removeAttribute(USER_EXCEPTION_DEFAULTOPTIONSCONTENT_NOT_AVAILABLE); - request.getSession().removeAttribute(USER_EXCEPTION_USERID_NOTAVAILABLE); - request.getSession().removeAttribute(USER_EXCEPTION_USERID_NOTNUMERIC); - request.getSession().removeAttribute(USER_EXCEPTION_ONLYCONTENT_ANDNOSESSIONS); - request.getSession().removeAttribute(USER_EXCEPTION_USERID_EXISTING); - request.getSession().removeAttribute(USER_EXCEPTION_USER_DOESNOTEXIST); - request.getSession().removeAttribute(USER_EXCEPTION_MONITORINGTAB_CONTENTID_REQUIRED); - request.getSession().removeAttribute(USER_EXCEPTION_DEFAULTCONTENT_NOTSETUP); - request.getSession().removeAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS); - request.getSession().removeAttribute(USER_EXCEPTION_MODE_REQUIRED); - request.getSession().removeAttribute(USER_EXCEPTION_CONTENT_IN_USE); - request.getSession().removeAttribute(USER_EXCEPTION_CONTENT_BEING_MODIFIED); - request.getSession().removeAttribute(USER_EXCEPTION_CONTENT_RUNOFFLINE); - request.getSession().removeAttribute(USER_EXCEPTION_MODE_INVALID); - request.getSession().removeAttribute(USER_EXCEPTION_QUESTION_EMPTY); - request.getSession().removeAttribute(USER_EXCEPTION_ANSWER_EMPTY); - request.getSession().removeAttribute(USER_EXCEPTION_WEIGHT_TOTAL); - request.getSession().removeAttribute(USER_EXCEPTION_WEIGHT_EMPTY); - request.getSession().removeAttribute(USER_EXCEPTION_WEIGHT_NOTINTEGER); - request.getSession().removeAttribute(USER_EXCEPTION_WEIGHT_ZERO); - request.getSession().removeAttribute(USER_EXCEPTION_ANSWERS_DUPLICATE); - request.getSession().removeAttribute(USER_EXCEPTION_OPTIONS_COUNT_ZERO); - request.getSession().removeAttribute(USER_EXCEPTION_CHKBOXES_EMPTY); - request.getSession().removeAttribute(USER_EXCEPTION_SUBMIT_NONE); - request.getSession().removeAttribute(USER_EXCEPTION_PASSMARK_NOTINTEGER); - request.getSession().removeAttribute(USER_EXCEPTION_NUMBERFORMAT); - request.getSession().removeAttribute(USER_EXCEPTION_PASSMARK_EMPTY); - request.getSession().removeAttribute(USER_EXCEPTION_PASSMARK_GREATER100); - request.getSession().removeAttribute(USER_EXCEPTION_FILENAME_EMPTY); - request.getSession().removeAttribute(USER_EXCEPTION_WEIGHT_MUST_EQUAL100); - request.getSession().removeAttribute(USER_EXCEPTION_SINGLE_OPTION); + logger.debug("mcService: " + mcService); + logger.debug("value:" + value); + logger.debug("strToolContentID:" + strToolContentID); + + McContent mcContent=mcService.retrieveMc(new Long(strToolContentID)); + logger.debug("mcContent:" + mcContent); + if (mcContent != null) + { + mcContent.setDefineLater(value); + logger.debug("defineLater has been set to:" + value); + mcService.updateMc(mcContent); + } } + + + /** + * setFormProperties(HttpServletRequest request, IMcService mcService, + McAuthoringForm mcAuthoringForm, McGeneralAuthoringDTO mcGeneralAuthoringDTO, String strToolContentID, String defaultContentIdStr, + String activeModule, SessionMap sessionMap, String httpSessionID) + * + * @param request + * @param mcService + * @param mcAuthoringForm + * @param mcGeneralAuthoringDTO + * @param strToolContentID + * @param defaultContentIdStr + * @param activeModule + * @param sessionMap + * @param httpSessionID + */ + public static void setFormProperties(HttpServletRequest request, IMcService mcService, + McAuthoringForm mcAuthoringForm, McGeneralAuthoringDTO mcGeneralAuthoringDTO, String strToolContentID, String defaultContentIdStr, + String activeModule, SessionMap sessionMap, String httpSessionID) + { + logger.debug("setFormProperties: "); + logger.debug("using strToolContentID: " + strToolContentID); + logger.debug("using defaultContentIdStr: " + defaultContentIdStr); + logger.debug("using activeModule: " + activeModule); + logger.debug("using httpSessionID: " + httpSessionID); + + mcAuthoringForm.setHttpSessionID(httpSessionID); + mcGeneralAuthoringDTO.setHttpSessionID(httpSessionID); + + mcAuthoringForm.setToolContentID(strToolContentID); + + if ((defaultContentIdStr != null) && (defaultContentIdStr.length() > 0)) + { + mcAuthoringForm.setDefaultContentIdStr(new Long(defaultContentIdStr).toString()); + mcGeneralAuthoringDTO.setDefaultContentIdStr(new Long(defaultContentIdStr).toString()); + } + + + mcAuthoringForm.setActiveModule(activeModule); + mcGeneralAuthoringDTO.setActiveModule(activeModule); + + String sln=request.getParameter("sln"); + logger.debug("sln: " + sln); + mcAuthoringForm.setSln(sln); + mcGeneralAuthoringDTO.setSln(sln); + + String questionsSequenced=request.getParameter("questionsSequenced"); + logger.debug("questionsSequenced: " + questionsSequenced); + mcAuthoringForm.setQuestionsSequenced(questionsSequenced); + mcGeneralAuthoringDTO.setQuestionsSequenced(questionsSequenced); + + String retries=request.getParameter("retries"); + logger.debug("retries: " + retries); + mcAuthoringForm.setRetries(retries); + mcGeneralAuthoringDTO.setRetries(retries); + + + String offlineInstructions=request.getParameter(OFFLINE_INSTRUCTIONS); + logger.debug("offlineInstructions: " + offlineInstructions); + mcAuthoringForm.setOfflineInstructions(offlineInstructions); + mcGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions); + + String onlineInstructions=request.getParameter(ONLINE_INSTRUCTIONS); + logger.debug("onlineInstructions: " + onlineInstructions); + mcAuthoringForm.setOnlineInstructions(onlineInstructions); + mcGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); + + + String reflect=request.getParameter(REFLECT); + logger.debug("reflect: " + reflect); + mcAuthoringForm.setReflect(reflect); + mcGeneralAuthoringDTO.setReflect(reflect); + + + String reflectionSubject=request.getParameter(REFLECTION_SUBJECT); + logger.debug("reflectionSubject: " + reflectionSubject); + mcAuthoringForm.setReflectionSubject(reflectionSubject); + mcGeneralAuthoringDTO.setReflectionSubject(reflectionSubject); + + + String passmark= request.getParameter("passmark"); + logger.debug("passmark: " + passmark); + mcGeneralAuthoringDTO.setPassMarkValue(passmark); + + + logger.debug("ending setFormProperties with mcAuthoringForm: " + mcAuthoringForm); + logger.debug("ending setFormProperties with mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO); + } + + + /** If this file exists in attachments map, move it to the deleted attachments map. + * Returns the updated deletedAttachments map, creating a new one if needed. If uuid supplied + * then tries to match on that, otherwise uses filename and isOnline. */ + public static List moveToDelete(String uuid, List attachmentsList, List deletedAttachmentsList ) { + + List deletedList = deletedAttachmentsList != null ? deletedAttachmentsList : new ArrayList(); + + if ( attachmentsList != null ) { + Iterator iter = attachmentsList.iterator(); + McUploadedFile attachment = null; + while ( iter.hasNext() && attachment == null ) { + McUploadedFile value = (McUploadedFile) iter.next(); + if ( uuid.equals(value.getUuid()) ) { + attachment = value; + } + + } + if ( attachment != null ) { + deletedList.add(attachment); + attachmentsList.remove(attachment); + } + } + + return deletedList; + } + + + /** If this file exists in attachments map, move it to the deleted attachments map. + * Returns the updated deletedAttachments map, creating a new one if needed. If uuid supplied + * then tries to match on that, otherwise uses filename and isOnline. */ + public static List moveToDelete(String filename, boolean isOnline, List attachmentsList, List deletedAttachmentsList ) { + + List deletedList = deletedAttachmentsList != null ? deletedAttachmentsList : new ArrayList(); + + if ( attachmentsList != null ) { + Iterator iter = attachmentsList.iterator(); + McUploadedFile attachment = null; + while ( iter.hasNext() && attachment == null ) { + McUploadedFile value = (McUploadedFile) iter.next(); + if ( filename.equals(value.getFileName()) && isOnline == value.isFileOnline()) { + attachment = value; + } + + } + if ( attachment != null ) { + deletedList.add(attachment); + attachmentsList.remove(attachment); + } + } + + return deletedList; + } + } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcContentDAO.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r81e4b129f71e63322c81c9016ec1ffa93f3c5944 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcContentDAO.java (.../IMcContentDAO.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcContentDAO.java (.../IMcContentDAO.java) (revision 81e4b129f71e63322c81c9016ec1ffa93f3c5944) @@ -110,6 +110,8 @@ */ public void addMcSession(Long mcContentId, McSession mcSession); + public void saveOrUpdateMc(McContent mc); + public List findAll(Class objClass); public void flush(); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcQueContentDAO.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r81e4b129f71e63322c81c9016ec1ffa93f3c5944 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcQueContentDAO.java (.../IMcQueContentDAO.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcQueContentDAO.java (.../IMcQueContentDAO.java) (revision 81e4b129f71e63322c81c9016ec1ffa93f3c5944) @@ -177,4 +177,8 @@ public McQueContent findMcQuestionContentByUid(Long uid); + public List getAllQuestionEntriesSorted(final long qaContentId); + + public List getMcQueContentsByContentId(long mcContentId); + } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcUploadedFileDAO.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r81e4b129f71e63322c81c9016ec1ffa93f3c5944 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcUploadedFileDAO.java (.../IMcUploadedFileDAO.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcUploadedFileDAO.java (.../IMcUploadedFileDAO.java) (revision 81e4b129f71e63322c81c9016ec1ffa93f3c5944) @@ -4,8 +4,8 @@ * 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. + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -26,165 +26,32 @@ import java.util.List; +import org.lamsfoundation.lams.tool.mc.pojos.McContent; import org.lamsfoundation.lams.tool.mc.pojos.McUploadedFile; /** * * @author Ozgur Demirtas - *

Interface for the McUploadedFile DAO, defines methods needed to access/modify mc uploadedFile content

* */ public interface IMcUploadedFileDAO { - /** - * *

Return the persistent instance of a McUploadedFile - * with the given identifier submissionId, returns null if not found.

- * - * @param submissionId - * @return McUploadedFile - */ public McUploadedFile loadUploadedFileById(long submissionId); - /** - * *

updates McUploadedFile - * with the given identifier mcUploadedFile

- * - * @param mcUploadedFile - * @return McUploadedFile - */ public void updateUploadFile(McUploadedFile mcUploadedFile); - - /** - * *

saves McUploadedFile - * with the given identifier mcUploadedFile

- * - * @param mcUploadedFile - * @return - */ + public void saveUploadFile(McUploadedFile mcUploadedFile); - /** - * *

creates McUploadedFile - * with the given identifier mcUploadedFile

- * - * @param mcUploadedFile - * @return - */ public void createUploadFile(McUploadedFile mcUploadedFile); - - /** - * *

Updates McUploadedFile - * with the given identifier mcUploadedFile

- * - * @param mcUploadedFile - * @return - */ + public void UpdateUploadFile(McUploadedFile mcUploadedFile); - /** - * *

removes McUploadedFile - * with the given identifier mcUploadedFile

- * - * @param submissionId - * @return - */ public void removeUploadFile(Long submissionId); - - /** - * *

deletes McUploadedFile - * with the given identifier mcUploadedFile

- * - * @param mcUploadedFile - * @return - */ + public void deleteUploadFile(McUploadedFile mcUploadedFile); + + public List retrieveMcUploadedFiles(McContent mc); - /** - * *

returns file's uuid - * with the given identifier filename

- * - * @param filename - * @return - */ - public String getFileUuid(String filename); - - /** - * *

returns a list of McUploadedFiles - * with the given identifier mcContentId and fileOnline

- * - * @param mcContentId - * @param fileOnline - * @return List - */ - public List retrieveMcUploadedFiles(Long mcContentId, boolean fileOnline); - - /** - * *

returns a list of offline McUploadedFiles - * with the given identifier mcContentId

- * - * @param mcContentId - * @return List - */ - public List retrieveMcUploadedOfflineFilesUuid(Long mcContentId); - - /** - * *

returns a list of online McUploadedFiles - * with the given identifier mcContentId

- * - * @param mcContentId - * @return List - */ - public List retrieveMcUploadedOnlineFilesUuid(Long mcContentId); - - /** - * *

returns a list of offline McUploadedFile filenames - * with the given identifier mcContentId

- * - * @param mcContentId - * @return List - */ - public List retrieveMcUploadedOfflineFilesName(Long mcContentId); - - /** - * *

returns a list of online McUploadedFile filenames - * with the given identifier mcContentId

- * - * @param mcContentId - * @return List - */ - public List retrieveMcUploadedOnlineFilesName(Long mcContentId); - - /** - * *

returns a list of offline McUploadedFile uuid and filenames - * with the given identifier mcContentId

- * - * @param mcContentId - * @return List - */ - public List retrieveMcUploadedOfflineFilesUuidPlusFilename(Long mcContentId); - - /** - * *

removes files meta data - * - * @param mcContentId - * @return List - */ - - - public void removeOffLineFile(String filename, Long mcContentId); - - public void removeOnLineFile(String filename, Long mcContentId); - - public boolean isOffLineFilePersisted(String filename); - - public boolean isOnLineFilePersisted(String filename); - - public boolean isUuidPersisted(String uuid); - - public List getOnlineFilesMetaData(Long mcContentId); - - public List getOfflineFilesMetaData(Long mcContentId); - public void cleanUploadedFilesMetaData(); public void flush(); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McQueContentDAO.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r81e4b129f71e63322c81c9016ec1ffa93f3c5944 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McQueContentDAO.java (.../McQueContentDAO.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McQueContentDAO.java (.../McQueContentDAO.java) (revision 81e4b129f71e63322c81c9016ec1ffa93f3c5944) @@ -27,9 +27,8 @@ import org.apache.log4j.Logger; import org.hibernate.FlushMode; -import org.lamsfoundation.lams.tool.mc.pojos.McOptsContent; -import org.lamsfoundation.lams.tool.mc.pojos.McQueContent; import org.lamsfoundation.lams.tool.mc.dao.IMcQueContentDAO; +import org.lamsfoundation.lams.tool.mc.pojos.McQueContent; import org.springframework.orm.hibernate3.HibernateTemplate; import org.springframework.orm.hibernate3.support.HibernateDaoSupport; @@ -57,6 +56,8 @@ private static final String LOAD_QUESTION_CONTENT_BY_DISPLAY_ORDER = "from mcQueContent in class McQueContent where mcQueContent.displayOrder=:displayOrder and mcQueContent.mcContentId=:mcContentUid"; private static final String GET_NEXT_AVAILABLE_DISPLAY_ORDER = "from mcQueContent in class McQueContent where mcQueContent.mcContentId=:mcContentId"; + + private static final String SORT_QUESTION_CONTENT_BY_DISPLAY_ORDER = "from mcQueContent in class McQueContent where mcQueContent.mcContentId=:mcContentId order by mcQueContent.displayOrder"; public McQueContent findMcQuestionContentByUid(Long uid) @@ -247,10 +248,6 @@ this.getHibernateTemplate().save(mcQueContent); } - public void updateMcQueContent(McQueContent mcQueContent) - { - this.getHibernateTemplate().update(mcQueContent); - } public void saveOrUpdateMcQueContent(McQueContent mcQueContent) { @@ -263,7 +260,29 @@ this.getSession().setFlushMode(FlushMode.AUTO); this.getHibernateTemplate().delete(mcq); } + + public void updateMcQueContent(McQueContent mcQueContent) + { + this.getSession().setFlushMode(FlushMode.AUTO); + this.getHibernateTemplate().update(mcQueContent); + } + public List getAllQuestionEntriesSorted(final long mcContentId) + { + HibernateTemplate templ = this.getHibernateTemplate(); + List list = getSession().createQuery(SORT_QUESTION_CONTENT_BY_DISPLAY_ORDER) + .setLong("mcContentId", mcContentId) + .list(); + + return list; + } + + + public List getMcQueContentsByContentId(long mcContentId){ + return getHibernateTemplate().findByNamedParam(LOAD_QUESTION_CONTENT_BY_CONTENT_ID, "mcContentId", new Long(mcContentId)); + } + + public void removeMcQueContent(McQueContent mcQueContent) { Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McUploadedFileDAO.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r81e4b129f71e63322c81c9016ec1ffa93f3c5944 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McUploadedFileDAO.java (.../McUploadedFileDAO.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McUploadedFileDAO.java (.../McUploadedFileDAO.java) (revision 81e4b129f71e63322c81c9016ec1ffa93f3c5944) @@ -1,4 +1,4 @@ -/*************************************************************************** +/**************************************************************** * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) * ============================================================= * License Information: http://lamsfoundation.org/licensing/lams/2.0/ @@ -18,7 +18,8 @@ * USA * * http://www.gnu.org/licenses/gpl.txt - * ***********************************************************************/ + * **************************************************************** + */ /* $$Id$$ */ package org.lamsfoundation.lams.tool.mc.dao.hibernate; @@ -28,336 +29,124 @@ import org.apache.log4j.Logger; import org.hibernate.FlushMode; import org.lamsfoundation.lams.tool.mc.dao.IMcUploadedFileDAO; +import org.lamsfoundation.lams.tool.mc.pojos.McContent; import org.lamsfoundation.lams.tool.mc.pojos.McUploadedFile; import org.springframework.orm.hibernate3.HibernateTemplate; import org.springframework.orm.hibernate3.support.HibernateDaoSupport; /** - * @author ozgurd - *

Hibernate implementation for database access to McUploadedFile for the mc tool.

+ * @author Ozgur Demirtas + * + * TODO To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates */ + public class McUploadedFileDAO extends HibernateDaoSupport implements IMcUploadedFileDAO { - static Logger logger = Logger.getLogger(McUploadedFileDAO.class.getName()); - - private static final String GET_ONLINE_FILENAMES_FOR_CONTENT = "select mcUploadedFile.filename from McUploadedFile mcUploadedFile where mcUploadedFile.mcContentId = :mcContentId and mcUploadedFile.fileOnline=1"; - private static final String GET_OFFLINE_FILENAMES_FOR_CONTENT = "select mcUploadedFile.filename from McUploadedFile mcUploadedFile where mcUploadedFile.mcContentId = :mcContentId and mcUploadedFile.fileOnline=0"; - - private static final String GET_ONLINE_FILES_UUID = "select mcUploadedFile.uuid from McUploadedFile mcUploadedFile where mcUploadedFile.mcContentId = :mcContentId and mcUploadedFile.fileOnline=1"; - private static final String GET_ONLINE_FILES_NAME ="select mcUploadedFile.filename from McUploadedFile mcUploadedFile where mcUploadedFile.mcContentId = :mcContentId and mcUploadedFile.fileOnline=1 order by mcUploadedFile.uuid"; - - private static final String GET_OFFLINE_FILES_UUID = "select mcUploadedFile.uuid from McUploadedFile mcUploadedFile where mcUploadedFile.mcContentId = :mcContentId and mcUploadedFile.fileOnline=0"; - private static final String GET_OFFLINE_FILES_NAME ="select mcUploadedFile.filename from McUploadedFile mcUploadedFile where mcUploadedFile.mcContentId = :mcContentId and mcUploadedFile.fileOnline=0 order by mcUploadedFile.uuid"; - - private static final String GET_FILES_UUID ="select mcUploadedFile.uuid from McUploadedFile mcUploadedFile where mcUploadedFile.filename=:filename"; - - private static final String GET_OFFLINE_FILES_UUIDPLUSFILENAME = "select (mcUploadedFile.uuid + '~' + mcUploadedFile.filename) from McUploadedFile mcUploadedFile where mcUploadedFile.mcContentId = :mcContentId and mcUploadedFile.fileOnline=0"; - - private static final String FIND_ALL_UPLOADED_FILE_DATA = "from mcUploadedFile in class McUploadedFile"; - - private static final String IS_UUID_PERSISTED ="select mcUploadedFile.uuid from McUploadedFile mcUploadedFile where mcUploadedFile.uuid=:uuid"; - - private static final String GET_ONLINE_FILES_METADATA = "from mcUploadedFile in class McUploadedFile where mcUploadedFile.mcContentId = :mcContentId and mcUploadedFile.fileOnline=1"; - - private static final String GET_OFFLINE_FILES_METADATA = "from mcUploadedFile in class McUploadedFile where mcUploadedFile.mcContentId = :mcContentId and mcUploadedFile.fileOnline=0"; - - private static final String IS_OFFLINE_FILENAME_PERSISTED ="select mcUploadedFile from McUploadedFile mcUploadedFile where mcUploadedFile.mcContentId = :mcContentId and mcUploadedFile.filename=:filename and mcUploadedFile.fileOnline=0"; - - private static final String IS_ONLINE_FILENAME_PERSISTED ="select mcUploadedFile from McUploadedFile mcUploadedFile where mcUploadedFile.mcContentId = :mcContentId and mcUploadedFile.filename=:filename and mcUploadedFile.fileOnline=1"; - - - public McUploadedFile getUploadedFileById(long submissionId) - { - return (McUploadedFile) this.getHibernateTemplate() - .load(McUploadedFile.class, new Long(submissionId)); - } - - /** - * - * return null if not found - */ - public McUploadedFile loadUploadedFileById(long uid) - { - return (McUploadedFile) this.getHibernateTemplate().get(McUploadedFile.class, new Long(uid)); - } + static Logger logger = Logger.getLogger(McUploadedFileDAO.class.getName()); + + private static final String GET_UPLOADED_FILES = "from McUploadedFile mcUploadedFile where mcUploadedFile.mcContent.mcContentId = :contentId"; + + private static final String DELETE_FILES_META_DATA = "from mcUploadedFile in class McUploadedFile"; + + public McUploadedFile getUploadedFileById(long submissionId) + { + return (McUploadedFile) this.getHibernateTemplate() + .load(McUploadedFile.class, new Long(submissionId)); + } + + /** + * + * return null if not found + */ + public McUploadedFile loadUploadedFileById(long submissionId) + { + return (McUploadedFile) this.getHibernateTemplate().get(McUploadedFile.class, new Long(submissionId)); + } - - - public void updateUploadFile(McUploadedFile mcUploadedFile) - { - this.getSession().setFlushMode(FlushMode.AUTO); - this.getHibernateTemplate().update(mcUploadedFile); - this.getSession().setFlushMode(FlushMode.AUTO); - } - - - public void saveUploadFile(McUploadedFile mcUploadedFile) - { - this.getSession().setFlushMode(FlushMode.AUTO); - this.getHibernateTemplate().save(mcUploadedFile); - this.getSession().setFlushMode(FlushMode.AUTO); - } - - public void createUploadFile(McUploadedFile mcUploadedFile) - { - this.getSession().setFlushMode(FlushMode.AUTO); - this.getHibernateTemplate().save(mcUploadedFile); - } - - public void UpdateUploadFile(McUploadedFile mcUploadedFile) - { - this.getSession().setFlushMode(FlushMode.AUTO); - this.getHibernateTemplate().update(mcUploadedFile); - } + + + public void updateUploadFile(McUploadedFile mcUploadedFile) + { + this.getSession().setFlushMode(FlushMode.AUTO); + this.getHibernateTemplate().update(mcUploadedFile); + } + + + public void saveUploadFile(McUploadedFile mcUploadedFile) + { + this.getSession().setFlushMode(FlushMode.AUTO); + this.getHibernateTemplate().save(mcUploadedFile); + } + + public void createUploadFile(McUploadedFile mcUploadedFile) + { + this.getSession().setFlushMode(FlushMode.AUTO); + this.getHibernateTemplate().save(mcUploadedFile); + } + + public void UpdateUploadFile(McUploadedFile mcUploadedFile) + { + this.getSession().setFlushMode(FlushMode.AUTO); + this.getHibernateTemplate().update(mcUploadedFile); + } - - public void removeOffLineFile(String filename, Long mcContentId) - { - HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(IS_OFFLINE_FILENAME_PERSISTED) - .setString("filename", filename) - .setLong("mcContentId", mcContentId.longValue()) - .list(); - - if(list != null && list.size() > 0){ - Iterator listIterator=list.iterator(); - while (listIterator.hasNext()) - { - McUploadedFile mcFile=(McUploadedFile)listIterator.next(); - this.getSession().setFlushMode(FlushMode.AUTO); - templ.delete(mcFile); - templ.flush(); - } - } - } + + public void cleanUploadedFilesMetaData() + { + /* + String query = "from uploadedFile in class org.lamsfoundation.lams.tool.mc.McUploadedFile"; + this.getSession().setFlushMode(FlushMode.AUTO); + this.getHibernateTemplate().delete(query); + */ + HibernateTemplate templ = this.getHibernateTemplate(); + List list = getSession().createQuery(DELETE_FILES_META_DATA) + .list(); - public void removeOnLineFile(String filename, Long mcContentId) - { - HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(IS_ONLINE_FILENAME_PERSISTED) - .setString("filename", filename) - .setLong("mcContentId", mcContentId.longValue()) - .list(); - - if(list != null && list.size() > 0){ - Iterator listIterator=list.iterator(); - while (listIterator.hasNext()) - { - McUploadedFile mcFile=(McUploadedFile)listIterator.next(); - this.getSession().setFlushMode(FlushMode.AUTO); - templ.delete(mcFile); - templ.flush(); + if(list != null && list.size() > 0){ + Iterator listIterator=list.iterator(); + while (listIterator.hasNext()) + { + McUploadedFile mcFile=(McUploadedFile)listIterator.next(); + this.getSession().setFlushMode(FlushMode.AUTO); + templ.delete(mcFile); + templ.flush(); + } + } + } + + public void removeUploadFile(Long submissionId) + { + if (submissionId != null ) { + + String query = "from uploadedFile in class org.lamsfoundation.lams.tool.mc.pojos.McUploadedFile" + + " where uploadedFile.submissionId = ?"; + Object obj = this.getSession().createQuery(query) + .setLong(0,submissionId.longValue()) + .uniqueResult(); + if ( obj != null ) { + this.getSession().setFlushMode(FlushMode.AUTO); + this.getHibernateTemplate().delete(obj); + } } - } - } - - public boolean isOffLineFilePersisted(String filename) - { - HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(IS_OFFLINE_FILENAME_PERSISTED) - .setString("filename", filename) - .list(); - - if (list != null && list.size() > 0) - { - return true; - } - return false; - } - - - public boolean isOnLineFilePersisted(String filename) - { - HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(IS_ONLINE_FILENAME_PERSISTED) - .setString("filename", filename) - .list(); - - if (list != null && list.size() > 0) - { - return true; - } - return false; - } - - - public List getOnlineFilesMetaData(Long mcContentId) - { - HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(GET_ONLINE_FILES_METADATA) - .setLong("mcContentId", mcContentId.longValue()) - .list(); - - return list; - } - - - public List getOfflineFilesMetaData(Long mcContentId) - { - HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(GET_OFFLINE_FILES_METADATA) - .setLong("mcContentId", mcContentId.longValue()) - .list(); - - return list; - } - - - public boolean isUuidPersisted(String uuid) - { - HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(IS_UUID_PERSISTED) - .setString("uuid", uuid) - .list(); - - if (list != null && list.size() > 0) - { - return true; - } - return false; - } - - - public void cleanUploadedFilesMetaData() - { - HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(FIND_ALL_UPLOADED_FILE_DATA) - .list(); - - if(list != null && list.size() > 0){ - Iterator listIterator=list.iterator(); - while (listIterator.hasNext()) - { - McUploadedFile mcFile=(McUploadedFile)listIterator.next(); - this.getSession().setFlushMode(FlushMode.AUTO); - templ.delete(mcFile); - templ.flush(); - } - } - } - - - public String getFileUuid(String filename) - { - HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(GET_FILES_UUID) - .setString("filename", filename) - .list(); - - if (list != null && list.size() > 0){ - Iterator listIterator=list.iterator(); - while (listIterator.hasNext()) - { - String uuid=(String)listIterator.next(); - logger.debug("uuid :" + uuid); - return uuid; - } - } - else - { - return null; - } - return null; - } - - - public void removeUploadFile(Long uid) - { - if (uid != null ) { - - String query = "from uploadedFile in class org.lamsfoundation.lams.tool.mc.McUploadedFile" - + " where uploadedFile.uid = ?"; - Object obj = this.getSession().createQuery(query) - .setLong(0,uid.longValue()) - .uniqueResult(); - if ( obj != null ) { - this.getHibernateTemplate().delete(obj); - } } - } - - public List retrieveMcUploadedFiles(Long mcContentId, boolean fileOnline) - { - List listFilenames=null; - - if (fileOnline) - { - listFilenames=(getHibernateTemplate().findByNamedParam(GET_ONLINE_FILENAMES_FOR_CONTENT, - "mcContentId", - mcContentId)); - } - else - { - listFilenames=(getHibernateTemplate().findByNamedParam(GET_OFFLINE_FILENAMES_FOR_CONTENT, - "mcContentId", - mcContentId)); - } - return listFilenames; - } - - - public List retrieveMcUploadedOfflineFilesUuid(Long mcContentId) - { - HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(GET_OFFLINE_FILES_UUID) - .setLong("mcContentId", mcContentId.longValue()) - .list(); - - - return list; - } - - public List retrieveMcUploadedOnlineFilesUuid(Long mcContentId) - { - HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(GET_ONLINE_FILES_UUID) - .setLong("mcContentId", mcContentId.longValue()) - .list(); - - return list; - } - - public List retrieveMcUploadedOfflineFilesUuidPlusFilename(Long mcContentId) - { - HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(GET_OFFLINE_FILES_UUIDPLUSFILENAME) - .setLong("mcContentId", mcContentId.longValue()) - .list(); - - return list; - } - - - public List retrieveMcUploadedOfflineFilesName(Long mcContentId) - { - HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(GET_OFFLINE_FILES_NAME) - .setLong("mcContentId", mcContentId.longValue()) - .list(); - - return list; - } - - - public List retrieveMcUploadedOnlineFilesName(Long mcContentId) - { - HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(GET_ONLINE_FILES_NAME) - .setLong("mcContentId", mcContentId.longValue()) - .list(); - - return list; - } - - - public void deleteUploadFile(McUploadedFile mcUploadedFile) - { - this.getSession().setFlushMode(FlushMode.AUTO); - this.getHibernateTemplate().delete(mcUploadedFile); - } - - public void flush() - { - this.getHibernateTemplate().flush(); - } + + public List retrieveMcUploadedFiles(McContent mc) + { + List listFilenames=null; + listFilenames=(getHibernateTemplate().findByNamedParam(GET_UPLOADED_FILES, "contentId", mc.getMcContentId())); + return listFilenames; + } + + public void deleteUploadFile(McUploadedFile mcUploadedFile) + { + this.getSession().setFlushMode(FlushMode.AUTO); + this.getHibernateTemplate().delete(mcUploadedFile); + } + + public void flush() + { + this.getHibernateTemplate().flush(); + } + } \ No newline at end of file Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/mcApplicationContext.xml =================================================================== diff -u -r00df9ca2ddfb10b63d2260f8fa940108e13d72f2 -r81e4b129f71e63322c81c9016ec1ffa93f3c5944 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/mcApplicationContext.xml (.../mcApplicationContext.xml) (revision 00df9ca2ddfb10b63d2260f8fa940108e13d72f2) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/mcApplicationContext.xml (.../mcApplicationContext.xml) (revision 81e4b129f71e63322c81c9016ec1ffa93f3c5944) @@ -86,6 +86,7 @@ + @@ -96,12 +97,9 @@ PROPAGATION_REQUIRED,-McApplicationException PROPAGATION_REQUIRED, -McApplicationException PROPAGATION_REQUIRED,-McApplicationException - PROPAGATION_REQUIRED,readOnly,-McApplicationException + PROPAGATION_REQUIRED, -MccpApplicationException PROPAGATION_REQUIRED,-McApplicationException - PROPAGATION_REQUIRED,-McApplicationException - PROPAGATION_REQUIRED,-McApplicationException - PROPAGATION_REQUIRED,-McApplicationException - PROPAGATION_REQUIRED,-McApplicationException + PROPAGATION_REQUIRED,-McApplicationException PROPAGATION_REQUIRED,-McApplicationException PROPAGATION_REQUIRED,-McApplicationException PROPAGATION_REQUIRED,-McApplicationException