Fisheye: Tag 463f7b3dbb88ee41210f7170dc19dc25360cd26f refers to a dead (removed) revision in file `lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAllGroupsDTO.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java =================================================================== diff -u -rc6ad8493ef2064430e8783b28258cc9f223a3844 -r463f7b3dbb88ee41210f7170dc19dc25360cd26f --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java (.../McAppConstants.java) (revision c6ad8493ef2064430e8783b28258cc9f223a3844) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java (.../McAppConstants.java) (revision 463f7b3dbb88ee41210f7170dc19dc25360cd26f) @@ -28,9 +28,6 @@ public interface McAppConstants { public static final String MY_SIGNATURE = "lamc11"; - public static final String DEFAULT_CONTENT_ID = "defaultContentId"; - public static final String TOOL_SERVICE = "tool_service"; - public static final String ERROR_MCAPPLICATION = "error.exception.McApplication"; /* * Struts level constants @@ -39,136 +36,37 @@ public static final String LEARNING_STARTER = "learningStarter"; public static final String LOAD_LEARNER = "loadLearner"; 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 LIST_ALL_GROUPS_DTO = "listAllGroupsDTO"; - public static final String REDO_QUESTIONS = "redoQuestions"; - public static final String SINGLE_QUESTION_ANSWERS = "singleQuestionAnswers"; public static final String ERROR_LIST = "errorList"; - public static final String PREVIEW = "preview"; - public static final String ACTIVITY_TITLE_KEY = "activityTitleKey"; - public static final String ACTIVITY_INSTRUCTIONS_KEY = "activityInstructionsKey"; public static final String LIST_QUESTION_DTOS = "listQuestionContentDTO"; public static final String LIST_DELETED_QUESTION_DTOS = "deletedQuestionDTOs"; - public static final String LOAD_VIEW_ONLY = "loadViewOnly"; public static final String MC_GENERAL_AUTHORING_DTO = "mcGeneralAuthoringDTO"; - public static final String LIST_ADD_QUESTION_CONTENT_DTO_KEY = "listAddQuestionContentDtoKey"; - public static final String NEW_QUESTION_CONTENT_DTO = "newQuestionContentDTO"; - 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 NEW_QUESTION_BOX_DTO = "newQuestionBoxDTO"; public static final String NEW_QUESTION_DTO = "newQuestionDTO"; - public static final String TOTAL_MARKS_POSSIBLE = "totalMarksPossible"; - public static final String AUTHORING_CANCELLED = "authoringCancelled"; - public static final String DEFINE_LATER_EDIT_ACTIVITY = "defineLaterEditActivity"; - public static final String EDIT_OPTIONS_MODE = "editOptionsMode"; - public static final String SUBMIT_SUCCESS = "sbmtSuccess"; - public static final String QUESTION_INDEX = "questionIndex"; public static final String REFLECTION_SUBJECT = "reflectionSubject"; public static final String REFLECTIONS_CONTAINER_DTO = "reflectionsContainerDTO"; public static final String LEARNER_NOTEBOOK = "learnerNotebook"; public static final String USER_MASTER_DETAIL = "userMasterDetail"; - /* - * authoring mode controllers - */ - public static final String IS_ADD_QUESTION = "isAddQuestion"; - public static final String IS_REMOVE_QUESTION = "isRemoveQuestion"; - public static final String IS_REMOVE_CONTENT = "isRemoveContent"; - public static final String IS_REVISITING_USER = "isRevisitingUser"; - - public static final String USER = "user"; public static final String TOOL_CONTENT_ID = "toolContentID"; - public static final String TOOL_CONTENT_UID = "toolContentUID"; public static final String TOOL_SESSION_ID = "toolSessionID"; - public static final String USER_ID = "userID"; - public static final String MAX_QUESTION_INDEX = "maxQuestionIndex"; - public static final String COPY_TOOL_CONTENT = "copyToolContent"; - public static final String REMOVE_TOOL_CONTENT = "removeToolContent"; - public static final String DEFAULT_MCQ_TITLE = "MCQ"; - public static final int MAX_OPTION_COUNT = 25; public static final String QUESTION_AND_CANDIDATE_ANSWERS_KEY = "questionAndCandidateAnswersKey"; /* * authoring mode constants */ - public static final String MAP_QUESTIONS_CONTENT = "mapQuestionsContent"; - public static final String MAP_OPTIONS_CONTENT = "mapOptionsContent"; - public static final String MAP_DEFAULTOPTIONS_CONTENT = "mapDefaultOptionsContent"; - public static final String MAP_DEFAULTSELECTEDOPTIONS_CONTENT = "mapDefaultSelectedOptionsContent"; - public static final String MAP_DISABLED_QUESTIONS = "mapDisabledQuestions"; - public static final String MAP_GENERAL_OPTIONS_CONTENT = "mapGeneralOptionsContent"; - public static final String MAP_GENERAL_SELECTED_OPTIONS_CONTENT = "mapGeneralSelectedOptionsContent"; - public static final String MAP_STARTUP_GENERAL_OPTIONS_CONTENT = "mapStartupGeneralOptionsContent"; - public static final String MAP_STARTUP_GENERAL_SELECTED_OPTIONS_CONTENT = "mapStartupGeneralSelectedOptionsContent"; - public static final String MAP_STARTUP_GENERAL_OPTIONS_QUEID = "mapStartupGeneralOptionsQueId"; - public static final String QUESTIONS_WITHNO_OPTIONS = "questionsWithNoOptions"; - public static final String MAP_GENERAL_CHECKED_OPTIONS_CONTENT = "mapGeneralCheckedOptionsContent"; - public static final String MAP_LEARNER_QUESTIONS_CONTENT = "mapLearnerQuestionsContent"; - public static final String MAP_LEARNER_CHECKED_OPTIONS_CONTENT = "mapLearnerCheckedOptionsContent"; - public static final String MAP_LEARNER_ASSESSMENT_RESULTS = "mapLearnerAssessmentResults"; - public static final String MAP_LEARNER_FEEDBACK_INCORRECT = "mapLeanerFeedbackIncorrect"; - public static final String MAP_LEARNER_FEEDBACK_CORRECT = "mapLeanerFeedbackCorrect"; - public static final String MAP_QUESTION_WEIGHTS = "mapQuestionWeights"; - public static final String MAP_RESPONSES = "mapResponses"; - - public static final String MAP_WEIGHTS = "mapWeights"; - public static final String MAP_CHECKBOX_STATES = "mapCheckBoxStates"; - public static final String MAP_SELECTED_OPTIONS = "mapSelectedOptions"; - - public static final String DEFAULT_FIRST_OPTION = "Candidate Answer 1"; - public static final String DEFAULT_SELECTED_OPTION = "Candidate Answer 2"; - public static final String MAP_FEEDBACK_INCORRECT = "mapFeedbackIncorrect"; - public static final String MAP_INCORRECT_FEEDBACK = "mapIncorrectFeedback"; - - public static final String MAP_INCORRECT_FEEDBACK_LEARNER = "mapIncorrectFeedbackLearner"; - public static final String MAP_CORRECT_FEEDBACK_LEARNER = "mapCorrectFeedbackLearner"; - public static final String MAP_CORRECT_FEEDBACK = "mapCorrectFeedback"; - public static final String MAP_FEEDBACK_CORRECT = "mapFeedbackCorrect"; - - public static final String SELECTED_QUESTION = "selectedQuestion"; - public static final String SELECTED_QUESTION_INDEX = "selectedQuestionIndex"; - public static final String DEFAULT_QUESTION_UID = "defaultQuestionUid"; - - public static final String DEFAULT_FEEDBACK_INCORRECT = "Your answer is incorrect"; - public static final String DEFAULT_FEEDBACK_CORRECT = "Correct"; - public static final String TITLE = "title"; public static final String INSTRUCTIONS = "instructions"; - public static final String CREATION_DATE = "creationDate"; public static final String WAIT_FOR_LEADER = "waitForLeader"; public static final String RETRIES = "retries"; public static final String PASSMARK = "passMark"; public static final String VIEW_ANSWERS = "viewAnswers"; - public static final String SHOW_AUTHORING_TABS = "showAuthoringTabs"; + public static final String ATTR_SESSION_MAP_ID = "sessionMapId"; - public static final String ON = "ON"; - public static final String OFF = "OFF"; - public static final String RICHTEXT_FEEDBACK_CORRECT = "richTextFeedbackCorrect"; - public static final String RICHTEXT_INCORRECT_FEEDBACK = "richTextIncorrectFeedback"; - public static final String RICHTEXT_CORRECT_FEEDBACK = "richTextCorrectFeedback"; - public static final String RICHTEXT_FEEDBACK_INCORRECT = "richTextFeedbackInCorrect"; - public static final String RICHTEXT_REPORT_TITLE = "richTextReportTitle"; - public static final String RICHTEXT_TITLE = "richTextTitle"; - public static final String RICHTEXT_INSTRUCTIONS = "richTextInstructions"; - public static final String RICHTEXT_BLANK = "

 

"; - - public static final String COUNT_SESSION_COMPLETE = "countSessionComplete"; - public static final String COUNT_ALL_USERS = "countAllUsers"; - public static final String COUNT_MAX_ATTEMPT = "countMaxAttempt"; - public static final String TOP_MARK = "topMark"; - public static final String LOWEST_MARK = "lowestMark"; - public static final String AVERAGE_MARK = "averageMark"; - /* Date time restriction */ public static final String ATTR_SUBMISSION_DEADLINE = "submissionDeadline"; public static final String ATTR_SUBMISSION_DEADLINE_DATESTRING = "submissionDateString"; @@ -180,90 +78,29 @@ /* * the learner or monitoring environment provides toolSessionId */ - public final static String NOT_ATTEMPTED = "NOT_ATTEMPTED"; - public final static String INCOMPLETE = "INCOMPLETE"; public static final String COMPLETED = "COMPLETED"; - - public static final String MAP_TOOL_SESSIONS = "mapToolSessions"; - public static final Integer MAX_TOOL_SESSION_COUNT = new Integer(500); public static final String OPTION_OFF = "false"; - public static final String ACTIVITY_TITLE = "activityTitle"; - public static final String ACTIVITY_INSTRUCTIONS = "activityInstructions"; public static final String CORRECT = "Correct"; - /* - * user actions - */ - public static final String ADD_NEW_QUESTION = "addNewQuestion"; - public static final String REMOVE_QUESTION = "removeQuestion"; - public static final String REMOVE_ALL_CONTENT = "removeAllContent"; - public static final String SUBMIT_ALL_CONTENT = "submitAllContent"; - public static final String SUBMIT_TAB_DONE = "submitTabDone"; - /* learner mode contants */ - public static final String MAP_QUESTION_CONTENT_LEARNER = "mapQuestionContentLearner"; public static final String LEARNER_ANSWERS_DTO_LIST = "learnerAnswersDTOList"; public static final String MC_GENERAL_LEARNER_FLOW_DTO = "mcGeneralLearnerFlowDTO"; - public static final String ANSWER_DTOS = "answerDtos"; - public static final String CURRENT_QUESTION_INDEX = "currentQuestionIndex"; public static final String TOTAL_QUESTION_COUNT = "totalQuestionCount"; - public static final String HR_COLUMN_COUNT = "hrColumnCount"; - public static final String LEARNER_MARK = "learnerMark"; - public static final String MAP_ANSWERS = "mapAnswers"; - public static final String CURRENT_ANSWER = "currentAnswer"; - public static final String USER_FEEDBACK = "userFeedback"; - public static final String REPORT_TITLE_LEARNER = "reportTitleLearner"; - public static final String TOTAL_COUNT_REACHED = "totalCountReached"; public static final String NOTEBOOK = "notebook"; public static final String ENTRY_TEXT = "entryText"; - public static final String IS_USERNAME_VISIBLE = "isUsernameVisible"; - public static final String IS_CONTENT_IN_USE = "isContentInUse"; - public static final String IS_MONITORED_CONTENT_IN_USE = "isMonitoredContentInUse"; - public static final String IS_RETRIES = "isRetries"; - public static final String IS_SHOW_FEEDBACK = "isShowFeedback"; - public static final String IS_SHOW_LEARNERS_REPORT = "isShowLearnersReport"; - public static final String IS_ALL_SESSIONS_COMPLETED = "isAllSessionsCompleted"; - public static final String CHECK_ALL_SESSIONS_COMPLETED = "checkAllSessionsCompleted"; - public static final String FROM_TOOL_CONTENT_ID = "fromToolContentId"; - public static final String TO_TOOL_CONTENT_ID = "toToolContentId"; - public static final String LEARNER_REPORT = "learnerReport"; - public static final String MAP_USER_RESPONSES = "mapUserResponses"; - public static final String MAP_MAIN_REPORT = "mapMainReport"; - public static final String MAP_STATS = "mapStats"; - /* * Monitoring Mode constants */ public static final String ATTR_CONTENT = "content"; - public static final String CURRENT_MONITORING_TAB = "currentMonitoringTab"; - public static final String REPORT_TITLE_MONITOR = "reportTitleMonitor"; - public static final String MONITOR_USER_ID = "userId"; public static final String USER_UID = "userUid"; public static final String USER_ATTEMPTS = "userAttempts"; public static final String PARAM_NOT_A_NUMBER = "nan"; public static final String PARAM_GRADE = "grade"; public static final String PARAM_USER_ATTEMPT_UID = "userAttemptUid"; - public static final String MONITORING_REPORT = "monitoringReport"; - public static final String MONITORING_ERROR = "monitoringError"; - public static final String MAP_MONITORING_QUESTIONS = "mapMonitoringQuestions"; - public static final String SUMMARY_TOOL_SESSIONS = "summaryToolSessions"; - public static final String CURRENT_SESSION_NAME = "currentSessionName"; - public static final String SUMMARY_TOOL_SESSIONS_ID = "summaryToolSessionsId"; - public static final String MONITORED_CONTENT_ID = "monitoredContentId"; - public static final String EDITACTIVITY_EDITMODE = "editActivityEditMode"; - public static final String FORM_INDEX = "formIndex"; - public static final String LIST_MONITORED_ANSWERS_CONTAINER_DTO = "listMonitoredAnswersContainerDto"; - public static final String LIST_GROUPING_DATA = "listGroupingData"; - public static final String LEARNER_NAME = "learnerName"; - public static final String LIST_MONITORED_MARKS_CONTAINER_DTO = "listMonitoredMarksContainerDto"; public static final String SESSION_DTOS = "sessionDtos"; - public static final String TIMEZONE = "timeZone"; - public static final String PREVIEW_ONLY = "previewOnly"; - public static final String MODE = "mode"; - public static final String LEARNING_MODE = "learningMode"; public static final String REFLECT = "reflect"; //output definitions @@ -272,51 +109,6 @@ public static final String OUTPUT_NAME_LEARNER_MARK = "learner.mark"; public static final String OUTPUT_NAME_LEARNER_ALL_CORRECT = "learner.all.correct"; - /* - * exception constants - */ - public static final String USER_EXCEPTION_WRONG_FORMAT = "userExceptionWrongFormat"; - public static final String USER_EXCEPTION_INCOMPATIBLE_IDS = "userExceptionIncompatibleIds"; - public static final String USER_EXCEPTION_NUMBERFORMAT = "userExceptionNumberFormat"; - public static final String USER_EXCEPTION_CONTENT_DOESNOTEXIST = "userExceptionContentDoesNotExist"; - public static final String USER_EXCEPTION_TOOLSESSION_DOESNOTEXIST = "userExceptionToolSessionDoesNotExist"; - public static final String USER_EXCEPTION_TOOLCONTENT_DOESNOTEXIST = "userExceptionToolContentDoesNotExist"; - public static final String USER_EXCEPTION_LEARNER_REQUIRED = "userExceptionLearnerRequired"; - public static final String USER_EXCEPTION_CONTENTID_REQUIRED = "userExceptionContentIdRequired"; - public static final String USER_EXCEPTION_TOOLSESSIONID_REQUIRED = "userExceptionToolSessionIdRequired"; - public static final String USER_EXCEPTION_TOOLSESSIONID_INCONSISTENT = "userExceptionToolSessionIdInconsistent"; - public static final String USER_EXCEPTION_DEFAULTCONTENT_NOT_AVAILABLE = "userExceptionDefaultContentNotAvailable"; - public static final String USER_EXCEPTION_DEFAULTQUESTIONCONTENT_NOT_AVAILABLE = "userExceptionDefaultQuestionContentNotAvailable"; - public static final String USER_EXCEPTION_DEFAULTOPTIONSCONTENT_NOT_AVAILABLE = "userExceptionDefaultOptionsContentNotAvailable"; - public static final String USER_EXCEPTION_USERID_NOTAVAILABLE = "userExceptionUserIdNotAvailable"; - public static final String USER_EXCEPTION_USERID_NOTNUMERIC = "userExceptionUserIdNotNumeric"; - public static final String USER_EXCEPTION_ONLYCONTENT_ANDNOSESSIONS = "userExceptionOnlyContentAndNoSessions"; - public static final String USER_EXCEPTION_USERID_EXISTING = "userExceptionUserIdExisting"; - public static final String USER_EXCEPTION_USER_DOESNOTEXIST = "userExceptionUserDoesNotExist"; - public static final String USER_EXCEPTION_MONITORINGTAB_CONTENTID_REQUIRED = "userExceptionMonitoringTabContentIdRequired"; - public static final String USER_EXCEPTION_DEFAULTCONTENT_NOTSETUP = "userExceptionDefaultContentNotSetup"; - public static final String USER_EXCEPTION_NO_TOOL_SESSIONS = "userExceptionNoToolSessions"; - public static final String USER_EXCEPTION_NO_STUDENT_ACTIVITY = "userExceptionNoStudentActivity"; - public static final String USER_EXCEPTION_MODE_REQUIRED = "userExceptionModeRequired"; - public static final String USER_EXCEPTION_CONTENT_IN_USE = "userExceptionContentInUse"; - public static final String USER_EXCEPTION_CONTENT_BEING_MODIFIED = "userExceptionContentBeingModified"; - public static final String USER_EXCEPTION_MODE_INVALID = "userExceptionModeInvalid"; - public static final String USER_EXCEPTION_QUESTION_EMPTY = "userExceptionQuestionEmpty"; - public static final String USER_EXCEPTION_ANSWER_EMPTY = "userExceptionAnswerEmpty"; - public static final String USER_EXCEPTION_WEIGHT_TOTAL = "userExceptionWeightTotal"; - public static final String USER_EXCEPTION_WEIGHT_EMPTY = "userExceptionWeightEmpty"; - public static final String USER_EXCEPTION_WEIGHT_NOTINTEGER = "userExceptionWeightNotInteger"; - public static final String USER_EXCEPTION_WEIGHT_ZERO = "userExceptionWeightZero"; - public static final String USER_EXCEPTION_ANSWERS_DUPLICATE = "userExceptionAnswersDuplicate"; - public static final String USER_EXCEPTION_OPTIONS_COUNT_ZERO = "userExceptionOptionsCountZero"; - public static final String USER_EXCEPTION_CHKBOXES_EMPTY = "userExceptionChkboxesEmpty"; - public static final String USER_EXCEPTION_SUBMIT_NONE = "userExceptionSubmitNone"; - public static final String USER_EXCEPTION_PASSMARK_NOTINTEGER = "userExceptionPassmarkNotInteger"; - public static final String USER_EXCEPTION_PASSMARK_EMPTY = "userExceptionPassmarkEmpty"; - public static final String USER_EXCEPTION_PASSMARK_GREATER100 = "userExceptionPassmarkGreater100"; - public static final String USER_EXCEPTION_WEIGHT_MUST_EQUAL100 = "userExceptionWeightMustEqual100"; - public static final String USER_EXCEPTION_SINGLE_OPTION = "userExceptionSingleOption"; - public static final String SUCCESS = "success"; public static final String CANDIDATE_ANSWER_COUNT = "candidateAnswerCount"; public static final String CANDIDATE_ANSWER_PREFIX = "candidateAnswer"; Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McComparator.java =================================================================== diff -u -r2f725f8ef2aa09a2663b2335bf67213074426d11 -r463f7b3dbb88ee41210f7170dc19dc25360cd26f --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McComparator.java (.../McComparator.java) (revision 2f725f8ef2aa09a2663b2335bf67213074426d11) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McComparator.java (.../McComparator.java) (revision 463f7b3dbb88ee41210f7170dc19dc25360cd26f) @@ -39,7 +39,6 @@ int key1 = new Long(s1).intValue(); int key2 = new Long(s2).intValue(); - // logger.debug(logger + " " + this.getClass().getName() + "comparing key1 and key2:" + key1 + " and " + key2); return key1 - key2; } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralAuthoringDTO.java =================================================================== diff -u -r2f725f8ef2aa09a2663b2335bf67213074426d11 -r463f7b3dbb88ee41210f7170dc19dc25360cd26f --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralAuthoringDTO.java (.../McGeneralAuthoringDTO.java) (revision 2f725f8ef2aa09a2663b2335bf67213074426d11) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralAuthoringDTO.java (.../McGeneralAuthoringDTO.java) (revision 463f7b3dbb88ee41210f7170dc19dc25360cd26f) @@ -24,19 +24,13 @@ package org.lamsfoundation.lams.tool.mc; -import java.util.Map; - /** * DTO that holds authoring properties for authoring jsps * * @author Ozgur Demirtas */ public class McGeneralAuthoringDTO implements Comparable { - protected String toolContentID; - protected String currentTab; - protected String activityTitle; - protected String activityInstructions; protected String usernameVisible; protected String reflect; protected String questionsSequenced; @@ -45,53 +39,17 @@ protected String reflectionSubject; protected String showMarks; - protected String httpSessionID; - - 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; protected String totalMarks; - /** - * @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 toolContentID. - */ - public String getToolContentID() { - return toolContentID; - } - - /** - * @param toolContentID - * The toolContentID to set. - */ - public void setToolContentID(String toolContentID) { - this.toolContentID = toolContentID; - } - @Override public int compareTo(Object o) { McGeneralAuthoringDTO mcGeneralAuthoringDTO = (McGeneralAuthoringDTO) o; @@ -104,36 +62,6 @@ } /** - * @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 questionsSequenced. */ public String getQuestionsSequenced() { @@ -164,36 +92,6 @@ } /** - * @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 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() { @@ -284,21 +182,6 @@ } /** - * @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() { @@ -314,21 +197,6 @@ } /** - * @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() { @@ -344,21 +212,6 @@ } /** - * @return Returns the passMarksMap. - */ - public Map getPassMarksMap() { - return passMarksMap; - } - - /** - * @param passMarksMap - * The passMarksMap to set. - */ - public void setPassMarksMap(Map passMarksMap) { - this.passMarksMap = passMarksMap; - } - - /** * @return Returns the totalMarks. */ public String getTotalMarks() { Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralMonitoringDTO.java =================================================================== diff -u -r2f725f8ef2aa09a2663b2335bf67213074426d11 -r463f7b3dbb88ee41210f7170dc19dc25360cd26f --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralMonitoringDTO.java (.../McGeneralMonitoringDTO.java) (revision 2f725f8ef2aa09a2663b2335bf67213074426d11) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralMonitoringDTO.java (.../McGeneralMonitoringDTO.java) (revision 463f7b3dbb88ee41210f7170dc19dc25360cd26f) @@ -22,88 +22,26 @@ package org.lamsfoundation.lams.tool.mc; -import java.util.List; -import java.util.Map; - /** *

* DTO that holds monitoring flow properties *

* * @author Ozgur Demirtas */ -public class McGeneralMonitoringDTO implements Comparable { +public class McGeneralMonitoringDTO { - protected Map mapQuestionContent; - protected String defaultQuestionContent; - - protected String currentMonitoringTab; - protected String requestLearningReport; - protected String userExceptionNoToolSessions; - protected String userExceptionContentInUse; - protected String userExceptionContentDoesNotExist; - protected String userExceptionNoStudentActivity; - protected String currentTab; protected String activityTitle; protected String activityInstructions; - protected String defaultOptionContent; protected Integer countAllUsers; protected Integer countSessionComplete; - protected String groupName; - protected String existsOpenMcs; - protected String responseId; protected String displayAnswers; - protected String toolContentID; - protected Map summaryToolSessions; - protected List listMonitoredAnswersContainerDto; - protected List listUserEntries; - 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 contentFolderID; /** - * @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 currentTab. */ public String getCurrentTab() { @@ -119,36 +57,6 @@ } /** - * @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() { @@ -179,51 +87,6 @@ } /** - * @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 requestLearningReport. - */ - public String getRequestLearningReport() { - return requestLearningReport; - } - - /** - * @param requestLearningReport - * The requestLearningReport to set. - */ - public void setRequestLearningReport(String requestLearningReport) { - this.requestLearningReport = requestLearningReport; - } - - /** - * @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 countAllUsers. */ public Integer getCountAllUsers() { @@ -254,156 +117,6 @@ } /** - * @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 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 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 displayAnswers. */ public String getDisplayAnswers() { @@ -419,21 +132,6 @@ } /** - * @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() { @@ -449,62 +147,6 @@ } /** - * @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; - } - - @Override - public int compareTo(Object o) { - McGeneralMonitoringDTO mcGeneralMonitoringDTO = (McGeneralMonitoringDTO) o; - - if (mcGeneralMonitoringDTO == null) { - return 1; - } else { - return 0; - } - } - - /** * @return Returns the contentFolderID. */ public String getContentFolderID() { @@ -518,34 +160,4 @@ public void setContentFolderID(String contentFolderID) { this.contentFolderID = contentFolderID; } - - /** - * @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 mapQuestionContent. - */ - public Map getMapQuestionContent() { - return mapQuestionContent; - } - - /** - * @param mapQuestionContent - * The mapQuestionContent to set. - */ - public void setMapQuestionContent(Map mapQuestionContent) { - this.mapQuestionContent = mapQuestionContent; - } } Fisheye: Tag 463f7b3dbb88ee41210f7170dc19dc25360cd26f refers to a dead (removed) revision in file `lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McMonitoredAnswersDTO.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 463f7b3dbb88ee41210f7170dc19dc25360cd26f refers to a dead (removed) revision in file `lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McMonitoredUserDTO.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McQuestionDTO.java =================================================================== diff -u -r2f725f8ef2aa09a2663b2335bf67213074426d11 -r463f7b3dbb88ee41210f7170dc19dc25360cd26f --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McQuestionDTO.java (.../McQuestionDTO.java) (revision 2f725f8ef2aa09a2663b2335bf67213074426d11) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McQuestionDTO.java (.../McQuestionDTO.java) (revision 463f7b3dbb88ee41210f7170dc19dc25360cd26f) @@ -42,9 +42,9 @@ @Override public int compareTo(Object o) { - McMonitoredUserDTO mcMonitoredUserDTO = (McMonitoredUserDTO) o; + McQuestionDTO mcQuestionDTO = (McQuestionDTO) o; - if (mcMonitoredUserDTO == null) { + if (mcQuestionDTO == null) { return 1; } else { return 0; Fisheye: Tag 463f7b3dbb88ee41210f7170dc19dc25360cd26f refers to a dead (removed) revision in file `lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 463f7b3dbb88ee41210f7170dc19dc25360cd26f refers to a dead (removed) revision in file `lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/Nullable.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dto/ToolOutputDTO.java =================================================================== diff -u -r1d3ff83fba3454c6e0e4139dc15ad6cecdfa389c -r463f7b3dbb88ee41210f7170dc19dc25360cd26f --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dto/ToolOutputDTO.java (.../ToolOutputDTO.java) (revision 1d3ff83fba3454c6e0e4139dc15ad6cecdfa389c) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dto/ToolOutputDTO.java (.../ToolOutputDTO.java) (revision 463f7b3dbb88ee41210f7170dc19dc25360cd26f) @@ -1,7 +1,5 @@ package org.lamsfoundation.lams.tool.mc.dto; -import org.lamsfoundation.lams.tool.ToolOutputValue; - /** * An output for a tool. */ Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/IMcService.java =================================================================== diff -u -r2abc3485dc2d24ea02044a64271f3ee0d3b8c11b -r463f7b3dbb88ee41210f7170dc19dc25360cd26f --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/IMcService.java (.../IMcService.java) (revision 2abc3485dc2d24ea02044a64271f3ee0d3b8c11b) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/IMcService.java (.../IMcService.java) (revision 463f7b3dbb88ee41210f7170dc19dc25360cd26f) @@ -31,8 +31,8 @@ import org.lamsfoundation.lams.tool.ToolSessionExportOutputData; import org.lamsfoundation.lams.tool.exception.DataMissingException; import org.lamsfoundation.lams.tool.exception.ToolException; -import org.lamsfoundation.lams.tool.mc.McApplicationException; import org.lamsfoundation.lams.tool.mc.AnswerDTO; +import org.lamsfoundation.lams.tool.mc.McApplicationException; import org.lamsfoundation.lams.tool.mc.McOptionDTO; import org.lamsfoundation.lams.tool.mc.McQuestionDTO; import org.lamsfoundation.lams.tool.mc.McSessionMarkDTO; @@ -45,7 +45,6 @@ import org.lamsfoundation.lams.tool.mc.pojos.McQueUsr; import org.lamsfoundation.lams.tool.mc.pojos.McSession; import org.lamsfoundation.lams.tool.mc.pojos.McUsrAttempt; -import org.lamsfoundation.lams.usermanagement.dto.UserDTO; /** * Interface that defines the contract that all MCQ service provider must follow. Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/util/McToolContentHandler.java =================================================================== diff -u -r2f725f8ef2aa09a2663b2335bf67213074426d11 -r463f7b3dbb88ee41210f7170dc19dc25360cd26f --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/util/McToolContentHandler.java (.../McToolContentHandler.java) (revision 2f725f8ef2aa09a2663b2335bf67213074426d11) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/util/McToolContentHandler.java (.../McToolContentHandler.java) (revision 463f7b3dbb88ee41210f7170dc19dc25360cd26f) @@ -43,8 +43,6 @@ } /* - * (non-Javadoc) - * * @see org.lamsfoundation.lams.contentrepository.client.ToolContentHandler#getRepositoryWorkspaceName() */ @Override @@ -53,8 +51,6 @@ } /* - * (non-Javadoc) - * * @see org.lamsfoundation.lams.contentrepository.client.ToolContentHandler#getRepositoryUser() */ @Override @@ -63,8 +59,6 @@ } /* - * (non-Javadoc) - * * @see org.lamsfoundation.lams.contentrepository.client.ToolContentHandler#getRepositoryId() */ @Override Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java =================================================================== diff -u -r2f725f8ef2aa09a2663b2335bf67213074426d11 -r463f7b3dbb88ee41210f7170dc19dc25360cd26f --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision 2f725f8ef2aa09a2663b2335bf67213074426d11) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision 463f7b3dbb88ee41210f7170dc19dc25360cd26f) @@ -34,6 +34,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; +import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.lamsfoundation.lams.tool.mc.McAppConstants; import org.lamsfoundation.lams.tool.mc.McComparator; @@ -204,45 +205,25 @@ return null; } - public static String getTotalMark(List questionDTOs) { + public static String getTotalMark(List questionDTOs) { - Map mapMarks = AuthoringUtil.extractMapMarks(questionDTOs); - + Iterator iter = questionDTOs.iterator(); int intTotalMark = 0; - Iterator itMap = mapMarks.entrySet().iterator(); - while (itMap.hasNext()) { - Map.Entry pairs = (Map.Entry) itMap.next(); + while (iter.hasNext()) { + McQuestionDTO questionDto = iter.next(); - String mark = (String) pairs.getValue(); + String mark = questionDto.getMark(); - if (mark != null) { + if (StringUtils.isNotBlank(mark)) { int intMark = new Integer(mark).intValue(); intTotalMark += intMark; } } - String strFinalTotalMark = new Integer(intTotalMark).toString(); - return strFinalTotalMark; + return new Integer(intTotalMark).toString(); } /** - * extractMapQuestionContent - */ - public static Map extractMapQuestions(List questionDTOs) { - Map mapQuestionContent = new TreeMap(new McComparator()); - - Iterator iter = questionDTOs.iterator(); - int queIndex = 0; - while (iter.hasNext()) { - McQuestionDTO questionDto = iter.next(); - - queIndex++; - mapQuestionContent.put(new Integer(queIndex).toString(), questionDto.getQuestion()); - } - return mapQuestionContent; - } - - /** * reorderSimpleListQuestionContentDTO */ public static List reorderSimpleQuestionDtos(List questionDTOs) { @@ -257,7 +238,7 @@ String feedback = questionDto.getFeedback(); - List optionDtos = questionDto.getListCandidateAnswersDTO(); + List optionDtos = questionDto.getListCandidateAnswersDTO(); String mark = questionDto.getMark(); @@ -298,7 +279,7 @@ String mark = questionDto.getMark(); - List optionDtos = questionDto.getListCandidateAnswersDTO(); + List optionDtos = questionDto.getListCandidateAnswersDTO(); if (displayOrder.equals(editableQuestionIndex)) { questionDto.setQuestion(mcQuestionContentDTONew.getQuestion()); @@ -328,8 +309,16 @@ */ public static boolean checkDuplicateQuestions(List questionDTOs, String newQuestion) { - Map mapQuestionContent = AuthoringUtil.extractMapQuestions(questionDTOs); + Map mapQuestionContent = new TreeMap(new McComparator()); + Iterator iter = questionDTOs.iterator(); + int queIndex = 0; + while (iter.hasNext()) { + McQuestionDTO questionDto = iter.next(); + queIndex++; + mapQuestionContent.put(new Integer(queIndex).toString(), questionDto.getQuestion()); + } + Iterator> itMap = mapQuestionContent.entrySet().iterator(); while (itMap.hasNext()) { Entry pairs = itMap.next(); @@ -344,23 +333,6 @@ } /** - * extractMapMarks - */ - public static Map extractMapMarks(List questionDTOs) { - Map mapMarks = new TreeMap(new McComparator()); - - Iterator iter = questionDTOs.iterator(); - int queIndex = 0; - while (iter.hasNext()) { - McQuestionDTO questionDto = (McQuestionDTO) iter.next(); - - queIndex++; - mapMarks.put(new Integer(queIndex).toString(), questionDto.getMark()); - } - return mapMarks; - } - - /** * persisting content */ public static McContent saveOrUpdateMcContent(IMcService mcService, HttpServletRequest request, McContent mcContent, @@ -369,25 +341,15 @@ String richTextTitle = request.getParameter(McAppConstants.TITLE); String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS); - String sln = request.getParameter("sln"); - String useSelectLeaderToolOuput = request.getParameter("useSelectLeaderToolOuput"); - String prefixAnswersWithLetters = request.getParameter("prefixAnswersWithLetters"); - String questionsSequenced = request.getParameter("questionsSequenced"); - String randomize = request.getParameter("randomize"); - String displayAnswers = request.getParameter("displayAnswers"); - String showMarks = request.getParameter("showMarks"); - String retries = request.getParameter("retries"); - String reflect = request.getParameter(McAppConstants.REFLECT); - String reflectionSubject = request.getParameter(McAppConstants.REFLECTION_SUBJECT); boolean questionsSequencedBoolean = false; @@ -501,61 +463,7 @@ return mcContent; } - public static Map buildDynamicPassMarkMap(List questionDTOs, boolean initialScreen) { - - Map map = new TreeMap(new McComparator()); - - String totalMark = AuthoringUtil.getTotalMark(questionDTOs); - - int intTotalMark = 0; - if ((totalMark != null) && (totalMark.length() > 0)) { - intTotalMark = new Integer(totalMark).intValue(); - } - - Map passMarksMap = AuthoringUtil.buildPassMarkMap(intTotalMark, false); - return passMarksMap; - } - - public static Map buildPassMarkMap(int intTotalMark, boolean initialScreen) { - - Map map = new TreeMap(new McComparator()); - - if (initialScreen) { - return map; - } - - for (int i = 1; i <= intTotalMark; i++) { - map.put(new Integer(i).toString(), new Integer(i).toString()); - } - return map; - } - /** - * Map buildMarksMap() - * - * @return - */ - public static Map buildMarksMap() { - Map map = new TreeMap(new McComparator()); - - for (int i = 1; i <= 10; i++) { - map.put(new Integer(i).toString(), new Integer(i).toString()); - } - return map; - } - - /** - * Map buildCorrectMap() - * - * @return - */ - public static Map buildCorrectMap() { - Map map = new TreeMap(new McComparator()); - map.put(new Integer(2).toString(), "Correct"); - return map; - } - - /** * generates a list for holding default questions and their candidate answers */ public static List buildDefaultQuestions(McContent mcContent) { Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ClearSessionAction.java =================================================================== diff -u -r2f725f8ef2aa09a2663b2335bf67213074426d11 -r463f7b3dbb88ee41210f7170dc19dc25360cd26f --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ClearSessionAction.java (.../ClearSessionAction.java) (revision 2f725f8ef2aa09a2663b2335bf67213074426d11) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ClearSessionAction.java (.../ClearSessionAction.java) (revision 463f7b3dbb88ee41210f7170dc19dc25360cd26f) @@ -29,66 +29,15 @@ import org.lamsfoundation.lams.authoring.web.AuthoringConstants; import org.lamsfoundation.lams.authoring.web.LamsAuthoringFinishAction; import org.lamsfoundation.lams.tool.ToolAccessMode; -import org.lamsfoundation.lams.tool.mc.McAppConstants; /** * This class give a chance to clear HttpSession when user save/close authoring page. - * - * - * - * - * */ public class ClearSessionAction extends LamsAuthoringFinishAction { @Override public void clearSession(String customiseSessionID, HttpSession session, ToolAccessMode mode) { - // only this tool save LAMS_AUTHORING_SUCCESS_FLAG into session, remove it!!! session.removeAttribute(AuthoringConstants.LAMS_AUTHORING_SUCCESS_FLAG); - if (mode.isAuthor()) { - session.removeAttribute(McAppConstants.SUBMIT_SUCCESS); - session.removeAttribute(McAppConstants.USER_EXCEPTION_QUESTION_EMPTY); - session.removeAttribute(McAppConstants.MAX_QUESTION_INDEX); - session.removeAttribute(McAppConstants.USER_EXCEPTION_WEIGHT_TOTAL); - session.removeAttribute(McAppConstants.MAP_WEIGHTS); - session.removeAttribute(McAppConstants.EDIT_OPTIONS_MODE); - session.removeAttribute(McAppConstants.MAP_GENERAL_OPTIONS_CONTENT); - session.removeAttribute(McAppConstants.MAP_GENERAL_SELECTED_OPTIONS_CONTENT); - session.removeAttribute(McAppConstants.MAP_INCORRECT_FEEDBACK); - session.removeAttribute(McAppConstants.MAP_CORRECT_FEEDBACK); - session.removeAttribute(McAppConstants.TOOL_CONTENT_ID); - session.removeAttribute(McAppConstants.SELECTED_QUESTION_INDEX); - session.removeAttribute(McAppConstants.DEFAULT_QUESTION_UID); - session.removeAttribute(McAppConstants.USER_EXCEPTION_ANSWERS_DUPLICATE); - session.removeAttribute(McAppConstants.USER_EXCEPTION_ANSWER_EMPTY); - session.removeAttribute(McAppConstants.USER_EXCEPTION_NO_TOOL_SESSIONS); - session.removeAttribute(McAppConstants.CREATION_DATE); - session.removeAttribute(McAppConstants.QUESTIONS_WITHNO_OPTIONS); - session.removeAttribute(McAppConstants.RICHTEXT_CORRECT_FEEDBACK); - session.removeAttribute(McAppConstants.RICHTEXT_INSTRUCTIONS); - session.removeAttribute(McAppConstants.MAP_STARTUP_GENERAL_OPTIONS_CONTENT); - session.removeAttribute(McAppConstants.MAP_STARTUP_GENERAL_OPTIONS_QUEID); - session.removeAttribute(McAppConstants.MAP_STARTUP_GENERAL_SELECTED_OPTIONS_CONTENT); - session.removeAttribute(McAppConstants.SHOW_AUTHORING_TABS); - session.removeAttribute(McAppConstants.MAP_SELECTED_OPTIONS); - session.removeAttribute(McAppConstants.SELECTED_QUESTION); - session.removeAttribute(McAppConstants.RICHTEXT_TITLE); - session.removeAttribute(McAppConstants.RICHTEXT_REPORT_TITLE); - session.removeAttribute(McAppConstants.DEFAULT_CONTENT_ID); - session.removeAttribute(McAppConstants.MAP_DISABLED_QUESTIONS); - session.removeAttribute(McAppConstants.MAP_QUESTIONS_CONTENT); - session.removeAttribute(McAppConstants.IS_REVISITING_USER); - session.removeAttribute(McAppConstants.MAP_CHECKBOX_STATES); - session.removeAttribute("queIndex"); - session.removeAttribute(McAppConstants.MAP_OPTIONS_CONTENT); - session.removeAttribute(McAppConstants.MAP_STARTUP_GENERAL_SELECTED_OPTIONS_CONTENT); - session.removeAttribute(McAppConstants.PASSMARK); - session.removeAttribute(McAppConstants.TOOL_SERVICE); - session.removeAttribute(McAppConstants.MAP_DEFAULTOPTIONS_CONTENT); - session.removeAttribute(McAppConstants.RETRIES); - session.removeAttribute(McAppConstants.DEFINE_LATER_EDIT_ACTIVITY); - session.removeAttribute("optionIndex"); - } } } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/LearningUtil.java =================================================================== diff -u -rd82560c4b917240cb90b5d3416f5199cba68fb85 -r463f7b3dbb88ee41210f7170dc19dc25360cd26f --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/LearningUtil.java (.../LearningUtil.java) (revision d82560c4b917240cb90b5d3416f5199cba68fb85) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/LearningUtil.java (.../LearningUtil.java) (revision 463f7b3dbb88ee41210f7170dc19dc25360cd26f) @@ -28,9 +28,9 @@ import javax.servlet.http.HttpServletRequest; import org.apache.log4j.Logger; +import org.lamsfoundation.lams.tool.mc.AnswerDTO; import org.lamsfoundation.lams.tool.mc.McAppConstants; import org.lamsfoundation.lams.tool.mc.McGeneralLearnerFlowDTO; -import org.lamsfoundation.lams.tool.mc.AnswerDTO; import org.lamsfoundation.lams.tool.mc.pojos.McContent; /** Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java =================================================================== diff -u -r2abc3485dc2d24ea02044a64271f3ee0d3b8c11b -r463f7b3dbb88ee41210f7170dc19dc25360cd26f --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java (.../McAction.java) (revision 2abc3485dc2d24ea02044a64271f3ee0d3b8c11b) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java (.../McAction.java) (revision 463f7b3dbb88ee41210f7170dc19dc25360cd26f) @@ -28,7 +28,6 @@ import java.util.Iterator; import java.util.LinkedList; import java.util.List; -import java.util.Map; import java.util.Set; import javax.servlet.ServletException; @@ -37,7 +36,6 @@ import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; -import org.apache.struts.Globals; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; @@ -53,7 +51,6 @@ import org.lamsfoundation.lams.tool.mc.McGeneralAuthoringDTO; import org.lamsfoundation.lams.tool.mc.McOptionDTO; import org.lamsfoundation.lams.tool.mc.McQuestionDTO; -import org.lamsfoundation.lams.tool.mc.McUtils; import org.lamsfoundation.lams.tool.mc.pojos.McContent; import org.lamsfoundation.lams.tool.mc.pojos.McQueContent; import org.lamsfoundation.lams.tool.mc.service.IMcService; @@ -71,32 +68,21 @@ public class McAction extends LamsDispatchAction implements McAppConstants { private static Logger logger = Logger.getLogger(McAction.class.getName()); - @Override - public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - return (mapping.findForward(McAppConstants.LOAD_AUTHORING)); - } - /** * submits content into the tool database */ public ActionForward submitAllContent(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; - IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - - String httpSessionID = mcAuthoringForm.getHttpSessionID(); - + String sessionMapId = mcAuthoringForm.getHttpSessionID(); SessionMap sessionMap = (SessionMap) request.getSession() - .getAttribute(httpSessionID); + .getAttribute(sessionMapId); + request.setAttribute(McAppConstants.ATTR_SESSION_MAP_ID, sessionMapId); - String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - mcAuthoringForm.setContentFolderID(contentFolderID); + String strToolContentID = (String) sessionMap.get(AttributeNames.PARAM_TOOL_CONTENT_ID); - String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - List questionDTOs = (List) sessionMap.get(McAppConstants.LIST_QUESTION_DTOS); ActionMessages errors = new ActionMessages(); @@ -109,29 +95,18 @@ McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO(); - mcGeneralAuthoringDTO.setContentFolderID(contentFolderID); - String richTextTitle = request.getParameter(McAppConstants.TITLE); - String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS); - mcGeneralAuthoringDTO.setActivityTitle(richTextTitle); mcAuthoringForm.setTitle(richTextTitle); - mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); - - sessionMap.put(McAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); - sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); - request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO); - // there are no issues with input, continue and submit data - McContent mcContentTest = mcService.getMcContent(new Long(strToolContentID)); McContent mcContent = mcContentTest; if (errors.isEmpty()) { - ToolAccessMode mode = WebUtil.readToolAccessModeAuthorDefaulted(request); + ToolAccessMode mode = (ToolAccessMode) sessionMap.get(AttributeNames.ATTR_MODE); request.setAttribute(AttributeNames.ATTR_MODE, mode.toString()); List deletedQuestionDTOs = (List) sessionMap.get(LIST_DELETED_QUESTION_DTOS); @@ -172,7 +147,6 @@ mcContent = mcService.createQuestions(questionDTOs, mcContent); if (mcContent != null) { - // sorts the questions by the display order List sortedQuestions = mcService.getAllQuestionsSorted(mcContent.getUid().longValue()); int displayOrder = 1; @@ -184,48 +158,30 @@ } } - McUtils.setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO, strToolContentID, httpSessionID); + setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO); request.setAttribute(AuthoringConstants.LAMS_AUTHORING_SUCCESS_FLAG, Boolean.TRUE); } else { // errors is not empty if (mcContent != null) { - McUtils.setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO, strToolContentID, - httpSessionID); + setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO); } } mcAuthoringForm.resetUserAction(); - Map marksMap = AuthoringUtil.buildMarksMap(); - mcGeneralAuthoringDTO.setMarksMap(marksMap); - - Map correctMap = AuthoringUtil.buildCorrectMap(); - mcGeneralAuthoringDTO.setCorrectMap(correctMap); - request.setAttribute(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); sessionMap.put(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - request.getSession().setAttribute(httpSessionID, sessionMap); request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(questionDTOs.size())); - // generating dyn pass map using questionDTOs - Map passMarksMap = AuthoringUtil.buildDynamicPassMarkMap(questionDTOs, false); - mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap); - String totalMark = AuthoringUtil.getTotalMark(questionDTOs); - mcAuthoringForm.setTotalMarks(totalMark); mcGeneralAuthoringDTO.setTotalMarks(totalMark); request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO); - mcGeneralAuthoringDTO.setToolContentID(strToolContentID); - mcGeneralAuthoringDTO.setHttpSessionID(httpSessionID); - - mcAuthoringForm.setToolContentID(strToolContentID); - mcAuthoringForm.setHttpSessionID(httpSessionID); mcAuthoringForm.setCurrentTab("1"); return mapping.findForward(McAppConstants.LOAD_AUTHORING); @@ -236,21 +192,14 @@ McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; - IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - - String httpSessionID = mcAuthoringForm.getHttpSessionID(); + String sessionMapId = request.getParameter(McAppConstants.ATTR_SESSION_MAP_ID); SessionMap sessionMap = (SessionMap) request.getSession() - .getAttribute(httpSessionID); + .getAttribute(sessionMapId); + request.setAttribute(McAppConstants.ATTR_SESSION_MAP_ID, sessionMapId); - String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - mcAuthoringForm.setContentFolderID(contentFolderID); + boolean editQuestionBoxRequest = WebUtil.readBooleanParam(request, "editQuestionBoxRequest"); - String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - - String editQuestionBoxRequest = request.getParameter("editQuestionBoxRequest"); - String mark = request.getParameter("mark"); - String passmark = request.getParameter("passmark"); List options = McAction.repopulateOptionDTOs(request, false); @@ -262,17 +211,13 @@ mcGeneralAuthoringDTO.setMarkValue(mark); mcGeneralAuthoringDTO.setPassMarkValue(passmark); - mcGeneralAuthoringDTO.setContentFolderID(contentFolderID); - String newQuestion = request.getParameter("newQuestion"); - String feedback = request.getParameter("feedback"); - String editableQuestionIndex = request.getParameter("editableQuestionIndex"); mcAuthoringForm.setQuestionIndex(editableQuestionIndex); if ((newQuestion != null) && (newQuestion.length() > 0)) { - if ((editQuestionBoxRequest != null) && (editQuestionBoxRequest.equals("false"))) { + if (!editQuestionBoxRequest) { // request for add and save boolean duplicates = AuthoringUtil.checkDuplicateQuestions(questionDTOs, newQuestion); @@ -339,13 +284,12 @@ request.setAttribute(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); sessionMap.put(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - commonSaveCode(request, mcGeneralAuthoringDTO, mcAuthoringForm, sessionMap, strToolContentID, mcService, - httpSessionID, questionDTOs); + setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO); + request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO); request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(questionDTOs.size())); return (mapping.findForward("itemList")); - } /** @@ -356,17 +300,13 @@ HttpServletResponse response) throws IOException, ServletException { // big part of code was taken from addSingleQuestion() and saveSingleQuestion() methods McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; - IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - - String httpSessionID = request.getParameter("httpSessionID"); + String sessionMapId = request.getParameter(McAppConstants.ATTR_SESSION_MAP_ID); SessionMap sessionMap = (SessionMap) request.getSession() - .getAttribute(httpSessionID); - String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - mcAuthoringForm.setContentFolderID(contentFolderID); - String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); + .getAttribute(sessionMapId); + request.setAttribute(McAppConstants.ATTR_SESSION_MAP_ID, sessionMapId); + String contentFolderID = (String) sessionMap.get(AttributeNames.PARAM_CONTENT_FOLDER_ID); McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO(); - mcGeneralAuthoringDTO.setContentFolderID(contentFolderID); List questionDTOs = (List) sessionMap.get(McAppConstants.LIST_QUESTION_DTOS); // proper parsing @@ -452,8 +392,14 @@ request.setAttribute(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); sessionMap.put(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - commonSaveCode(request, mcGeneralAuthoringDTO, mcAuthoringForm, sessionMap, strToolContentID, mcService, - httpSessionID, questionDTOs); + setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO); + request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO); + + String richTextTitle = request.getParameter(McAppConstants.TITLE); + mcAuthoringForm.setTitle(richTextTitle); + mcAuthoringForm.setCurrentTab("1"); + String totalMark = AuthoringUtil.getTotalMark(questionDTOs); + mcGeneralAuthoringDTO.setTotalMarks(totalMark); request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(questionDTOs.size())); return mapping.findForward(McAppConstants.LOAD_AUTHORING); @@ -465,9 +411,10 @@ @SuppressWarnings({ "unchecked", "rawtypes" }) public ActionForward exportQTI(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException { - String httpSessionID = request.getParameter("httpSessionID"); + String sessionMapId = request.getParameter(McAppConstants.ATTR_SESSION_MAP_ID); SessionMap sessionMap = (SessionMap) request.getSession() - .getAttribute(httpSessionID); + .getAttribute(sessionMapId); + request.setAttribute(McAppConstants.ATTR_SESSION_MAP_ID, sessionMapId); List questionDTOs = (List) sessionMap.get(McAppConstants.LIST_QUESTION_DTOS); List questions = new LinkedList(); @@ -502,68 +449,16 @@ return null; } - private void commonSaveCode(HttpServletRequest request, McGeneralAuthoringDTO mcGeneralAuthoringDTO, - McAuthoringForm mcAuthoringForm, SessionMap sessionMap, String strToolContentID, - IMcService mcService, String httpSessionID, List questionDTOs) { - String richTextTitle = request.getParameter(McAppConstants.TITLE); - String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS); - - mcGeneralAuthoringDTO.setActivityTitle(richTextTitle); - mcAuthoringForm.setTitle(richTextTitle); - - mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); - - sessionMap.put(McAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); - sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); - - request.getSession().setAttribute(httpSessionID, sessionMap); - sessionMap.put(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - - McUtils.setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO, strToolContentID, httpSessionID); - - mcGeneralAuthoringDTO.setToolContentID(strToolContentID); - mcGeneralAuthoringDTO.setHttpSessionID(httpSessionID); - - mcAuthoringForm.setToolContentID(strToolContentID); - mcAuthoringForm.setHttpSessionID(httpSessionID); - mcAuthoringForm.setCurrentTab("1"); - - Map marksMap = AuthoringUtil.buildMarksMap(); - mcGeneralAuthoringDTO.setMarksMap(marksMap); - - Map passMarksMap = AuthoringUtil.buildDynamicPassMarkMap(questionDTOs, false); - mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap); - - String totalMark = AuthoringUtil.getTotalMark(questionDTOs); - mcAuthoringForm.setTotalMarks(totalMark); - mcGeneralAuthoringDTO.setTotalMarks(totalMark); - - Map correctMap = AuthoringUtil.buildCorrectMap(); - mcGeneralAuthoringDTO.setCorrectMap(correctMap); - - request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO); - request.getSession().setAttribute(httpSessionID, sessionMap); - } - public ActionForward addSingleQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; - - IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - - String httpSessionID = mcAuthoringForm.getHttpSessionID(); - + String sessionMapId = request.getParameter(McAppConstants.ATTR_SESSION_MAP_ID); SessionMap sessionMap = (SessionMap) request.getSession() - .getAttribute(httpSessionID); + .getAttribute(sessionMapId); + request.setAttribute(McAppConstants.ATTR_SESSION_MAP_ID, sessionMapId); - String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - mcAuthoringForm.setContentFolderID(contentFolderID); - - String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO(); - mcGeneralAuthoringDTO.setContentFolderID(contentFolderID); List questionDTOs = (List) sessionMap.get(McAppConstants.LIST_QUESTION_DTOS); @@ -607,11 +502,7 @@ mcGeneralAuthoringDTO.setMarkValue(mark); - Map passMarksMap = AuthoringUtil.buildDynamicPassMarkMap(questionDTOs, false); - mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap); - String totalMark = AuthoringUtil.getTotalMark(questionDTOs); - mcAuthoringForm.setTotalMarks(totalMark); mcGeneralAuthoringDTO.setTotalMarks(totalMark); mcGeneralAuthoringDTO.setEditableQuestionText(newQuestionParam); @@ -623,8 +514,8 @@ request.setAttribute(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); sessionMap.put(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - commonSaveCode(request, mcGeneralAuthoringDTO, mcAuthoringForm, sessionMap, strToolContentID, mcService, - httpSessionID, questionDTOs); + setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO); + request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO); request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(questionDTOs.size())); @@ -646,36 +537,20 @@ HttpServletResponse response) throws IOException, ServletException { McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; - IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - - String httpSessionID = mcAuthoringForm.getHttpSessionID(); + String sessionMapId = request.getParameter(McAppConstants.ATTR_SESSION_MAP_ID); SessionMap sessionMap = (SessionMap) request.getSession() - .getAttribute(httpSessionID); - String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - mcAuthoringForm.setContentFolderID(contentFolderID); + .getAttribute(sessionMapId); + request.setAttribute(McAppConstants.ATTR_SESSION_MAP_ID, sessionMapId); - String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO(); - mcGeneralAuthoringDTO.setContentFolderID(contentFolderID); String richTextTitle = request.getParameter(McAppConstants.TITLE); - String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS); - mcGeneralAuthoringDTO.setActivityTitle(richTextTitle); mcAuthoringForm.setTitle(richTextTitle); - mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); + setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO); - McUtils.setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO, strToolContentID, httpSessionID); - - Map marksMap = AuthoringUtil.buildMarksMap(); - mcGeneralAuthoringDTO.setMarksMap(marksMap); - List questionDTOs = (List) sessionMap.get(McAppConstants.LIST_QUESTION_DTOS); - Map correctMap = AuthoringUtil.buildCorrectMap(); - mcGeneralAuthoringDTO.setCorrectMap(correctMap); - request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO); //prepare question for adding new question page @@ -692,9 +567,6 @@ request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(questionDTOs.size())); - Map passMarksMap = AuthoringUtil.buildDynamicPassMarkMap(questionDTOs, false); - mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap); - String newQuestionParam = request.getParameter("newQuestion"); mcGeneralAuthoringDTO.setEditableQuestionText(newQuestionParam); @@ -707,17 +579,10 @@ request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO); String totalMark = AuthoringUtil.getTotalMark(questionDTOs); - mcAuthoringForm.setTotalMarks(totalMark); mcGeneralAuthoringDTO.setTotalMarks(totalMark); request.setAttribute(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - mcGeneralAuthoringDTO.setToolContentID(strToolContentID); - mcGeneralAuthoringDTO.setHttpSessionID(httpSessionID); - - mcAuthoringForm.setToolContentID(strToolContentID); - mcAuthoringForm.setHttpSessionID(httpSessionID); - return (mapping.findForward("newQuestionBox")); } @@ -735,13 +600,10 @@ public ActionForward newEditableQuestionBox(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; - - IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - - String httpSessionID = mcAuthoringForm.getHttpSessionID(); - + String sessionMapId = request.getParameter(McAppConstants.ATTR_SESSION_MAP_ID); SessionMap sessionMap = (SessionMap) request.getSession() - .getAttribute(httpSessionID); + .getAttribute(sessionMapId); + request.setAttribute(McAppConstants.ATTR_SESSION_MAP_ID, sessionMapId); String questionIndex = request.getParameter("questionIndex"); mcAuthoringForm.setQuestionIndex(questionIndex); @@ -766,21 +628,11 @@ editableQuestion = questionDto.getQuestion(); editableMark = questionDto.getMark(); - List candidates = questionDto.getListCandidateAnswersDTO(); - break; } - } } - String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - mcAuthoringForm.setContentFolderID(contentFolderID); - - String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - - McContent mcContent = mcService.getMcContent(new Long(strToolContentID)); - McGeneralAuthoringDTO mcGeneralAuthoringDTO = (McGeneralAuthoringDTO) request .getAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO); @@ -789,61 +641,35 @@ } mcGeneralAuthoringDTO.setMarkValue(editableMark); - mcGeneralAuthoringDTO.setContentFolderID(contentFolderID); String richTextTitle = request.getParameter(McAppConstants.TITLE); - String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS); - mcGeneralAuthoringDTO.setActivityTitle(richTextTitle); mcAuthoringForm.setTitle(richTextTitle); - mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); + setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO); - McUtils.setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO, strToolContentID, httpSessionID); - mcGeneralAuthoringDTO.setEditableQuestionText(editableQuestion); mcGeneralAuthoringDTO.setEditableQuestionFeedback(editableFeedback); mcAuthoringForm.setFeedback(editableFeedback); - Map marksMap = AuthoringUtil.buildMarksMap(); - mcGeneralAuthoringDTO.setMarksMap(marksMap); - - Map correctMap = AuthoringUtil.buildCorrectMap(); - mcGeneralAuthoringDTO.setCorrectMap(correctMap); request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO); request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(questionDTOs.size())); - Map passMarksMap = AuthoringUtil.buildDynamicPassMarkMap(questionDTOs, false); - mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap); - String totalMark = AuthoringUtil.getTotalMark(questionDTOs); - mcAuthoringForm.setTotalMarks(totalMark); mcGeneralAuthoringDTO.setTotalMarks(totalMark); String requestNewEditableQuestionBox = (String) request.getAttribute("requestNewEditableQuestionBox"); - String editQuestionBoxRequest = request.getParameter("editQuestionBoxRequest"); - String newQuestion = request.getParameter("newQuestion"); String feedback = request.getParameter("feedback"); - // if ((editQuestionBoxRequest != null) && (editQuestionBoxRequest.equals("false"))) if ((requestNewEditableQuestionBox != null) && requestNewEditableQuestionBox.equals("true")) { - // String newQuestion=request.getParameter("newQuestion"); - // logger.debug("newQuestion: " + newQuestion); mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion); mcGeneralAuthoringDTO.setEditableQuestionFeedback(feedback); - - // mcAuthoringForm.setFeedback(feedback); } request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO); request.setAttribute(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - mcGeneralAuthoringDTO.setToolContentID(strToolContentID); - mcGeneralAuthoringDTO.setHttpSessionID(httpSessionID); - - mcAuthoringForm.setToolContentID(strToolContentID); - mcAuthoringForm.setHttpSessionID(httpSessionID); return (mapping.findForward("editQuestionBox")); } @@ -854,14 +680,14 @@ HttpServletResponse response) throws IOException, ServletException { McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; - IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - - String httpSessionID = mcAuthoringForm.getHttpSessionID(); + String sessionMapId = request.getParameter(McAppConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap) request.getSession() + .getAttribute(sessionMapId); + request.setAttribute(McAppConstants.ATTR_SESSION_MAP_ID, sessionMapId); + String questionIndexToDelete = request.getParameter("questionIndex"); mcAuthoringForm.setQuestionIndex(questionIndexToDelete); - SessionMap sessionMap = (SessionMap) request.getSession() - .getAttribute(httpSessionID); List questionDTOs = (List) sessionMap.get(McAppConstants.LIST_QUESTION_DTOS); //exclude Question with questionIndex From List @@ -888,51 +714,20 @@ questionDTOs = listFinalQuestionContentDTO; sessionMap.put(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - mcAuthoringForm.setContentFolderID(contentFolderID); - String richTextTitle = request.getParameter(McAppConstants.TITLE); - String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS); - sessionMap.put(McAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); - sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); - String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - - McContent mcContent = mcService.getMcContent(new Long(strToolContentID)); - McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO(); - mcGeneralAuthoringDTO.setContentFolderID(contentFolderID); - - mcGeneralAuthoringDTO.setActivityTitle(richTextTitle); mcAuthoringForm.setTitle(richTextTitle); - mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); + setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO); - request.getSession().setAttribute(httpSessionID, sessionMap); - - McUtils.setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO, strToolContentID, httpSessionID); - - mcGeneralAuthoringDTO.setToolContentID(strToolContentID); - mcGeneralAuthoringDTO.setHttpSessionID(httpSessionID); - mcAuthoringForm.setToolContentID(strToolContentID); - mcAuthoringForm.setHttpSessionID(httpSessionID); mcAuthoringForm.setCurrentTab("1"); request.setAttribute(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - Map marksMap = AuthoringUtil.buildMarksMap(); - mcGeneralAuthoringDTO.setMarksMap(marksMap); - - Map passMarksMap = AuthoringUtil.buildDynamicPassMarkMap(questionDTOs, false); - mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap); - String totalMark = AuthoringUtil.getTotalMark(questionDTOs); - mcAuthoringForm.setTotalMarks(totalMark); mcGeneralAuthoringDTO.setTotalMarks(totalMark); - Map correctMap = AuthoringUtil.buildCorrectMap(); - mcGeneralAuthoringDTO.setCorrectMap(correctMap); - request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO); request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(questionDTOs.size())); @@ -955,11 +750,10 @@ McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - - String httpSessionID = mcAuthoringForm.getHttpSessionID(); - + String sessionMapId = request.getParameter(McAppConstants.ATTR_SESSION_MAP_ID); SessionMap sessionMap = (SessionMap) request.getSession() - .getAttribute(httpSessionID); + .getAttribute(sessionMapId); + request.setAttribute(McAppConstants.ATTR_SESSION_MAP_ID, sessionMapId); String questionIndex = request.getParameter("questionIndex"); mcAuthoringForm.setQuestionIndex(questionIndex); @@ -972,51 +766,20 @@ sessionMap.put(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - mcAuthoringForm.setContentFolderID(contentFolderID); - String richTextTitle = request.getParameter(McAppConstants.TITLE); - String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS); - - sessionMap.put(McAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); - sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); - - String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - - McContent mcContent = mcService.getMcContent(new Long(strToolContentID)); - McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO(); - mcGeneralAuthoringDTO.setContentFolderID(contentFolderID); - mcGeneralAuthoringDTO.setActivityTitle(richTextTitle); mcAuthoringForm.setTitle(richTextTitle); - mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); - - request.getSession().setAttribute(httpSessionID, sessionMap); - - McUtils.setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO, strToolContentID, httpSessionID); - - mcGeneralAuthoringDTO.setToolContentID(strToolContentID); - mcGeneralAuthoringDTO.setHttpSessionID(httpSessionID); - mcAuthoringForm.setToolContentID(strToolContentID); - mcAuthoringForm.setHttpSessionID(httpSessionID); + setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO); mcAuthoringForm.setCurrentTab("1"); request.setAttribute(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - Map marksMap = AuthoringUtil.buildMarksMap(); - mcGeneralAuthoringDTO.setMarksMap(marksMap); - Map passMarksMap = AuthoringUtil.buildDynamicPassMarkMap(questionDTOs, false); - mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap); - String totalMark = AuthoringUtil.getTotalMark(questionDTOs); - mcAuthoringForm.setTotalMarks(totalMark); mcGeneralAuthoringDTO.setTotalMarks(totalMark); - Map correctMap = AuthoringUtil.buildCorrectMap(); - mcGeneralAuthoringDTO.setCorrectMap(correctMap); request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO); request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(questionDTOs.size())); return (mapping.findForward("itemList")); @@ -1025,13 +788,10 @@ public ActionForward moveQuestionUp(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; - - IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - - String httpSessionID = mcAuthoringForm.getHttpSessionID(); - + String sessionMapId = request.getParameter(McAppConstants.ATTR_SESSION_MAP_ID); SessionMap sessionMap = (SessionMap) request.getSession() - .getAttribute(httpSessionID); + .getAttribute(sessionMapId); + request.setAttribute(McAppConstants.ATTR_SESSION_MAP_ID, sessionMapId); String questionIndex = request.getParameter("questionIndex"); mcAuthoringForm.setQuestionIndex(questionIndex); @@ -1044,52 +804,21 @@ sessionMap.put(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - mcAuthoringForm.setContentFolderID(contentFolderID); - String richTextTitle = request.getParameter(McAppConstants.TITLE); - String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS); - sessionMap.put(McAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); - sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); - - String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - - McContent mcContent = mcService.getMcContent(new Long(strToolContentID)); - McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO(); - mcGeneralAuthoringDTO.setContentFolderID(contentFolderID); - mcGeneralAuthoringDTO.setActivityTitle(richTextTitle); mcAuthoringForm.setTitle(richTextTitle); - mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); + setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO); - request.getSession().setAttribute(httpSessionID, sessionMap); - - McUtils.setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO, strToolContentID, httpSessionID); - - mcGeneralAuthoringDTO.setToolContentID(strToolContentID); - mcGeneralAuthoringDTO.setHttpSessionID(httpSessionID); - mcAuthoringForm.setToolContentID(strToolContentID); - mcAuthoringForm.setHttpSessionID(httpSessionID); mcAuthoringForm.setCurrentTab("1"); request.setAttribute(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - Map marksMap = AuthoringUtil.buildMarksMap(); - mcGeneralAuthoringDTO.setMarksMap(marksMap); - - Map passMarksMap = AuthoringUtil.buildDynamicPassMarkMap(questionDTOs, false); - mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap); - String totalMark = AuthoringUtil.getTotalMark(questionDTOs); - mcAuthoringForm.setTotalMarks(totalMark); mcGeneralAuthoringDTO.setTotalMarks(totalMark); - Map correctMap = AuthoringUtil.buildCorrectMap(); - mcGeneralAuthoringDTO.setCorrectMap(correctMap); - request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO); request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(questionDTOs.size())); @@ -1098,19 +827,6 @@ } /** - * - * persists error messages to request scope - * - * @param request - * @param message - */ - public void persistError(HttpServletRequest request, String message) { - ActionMessages errors = new ActionMessages(); - errors.add(Globals.ERROR_KEY, new ActionMessage(message)); - saveErrors(request, errors); - } - - /** * moves a candidate dwn in the list * * @param mapping @@ -1124,13 +840,10 @@ public ActionForward moveCandidateDown(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; - - IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - - String httpSessionID = mcAuthoringForm.getHttpSessionID(); - + String sessionMapId = request.getParameter(McAppConstants.ATTR_SESSION_MAP_ID); SessionMap sessionMap = (SessionMap) request.getSession() - .getAttribute(httpSessionID); + .getAttribute(sessionMapId); + request.setAttribute(McAppConstants.ATTR_SESSION_MAP_ID, sessionMapId); String questionIndex = request.getParameter("questionIndex"); request.setAttribute("questionIndex", questionIndex); @@ -1173,47 +886,15 @@ sessionMap.put(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - - String richTextTitle = request.getParameter(McAppConstants.TITLE); - - String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS); - - sessionMap.put(McAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); - sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); - - String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - - McContent mcContent = mcService.getMcContent(new Long(strToolContentID)); - McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO(); - mcGeneralAuthoringDTO.setContentFolderID(contentFolderID); - mcGeneralAuthoringDTO.setActivityTitle(richTextTitle); + setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO); - mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); - - request.getSession().setAttribute(httpSessionID, sessionMap); - - McUtils.setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO, strToolContentID, httpSessionID); - - mcGeneralAuthoringDTO.setToolContentID(strToolContentID); - mcGeneralAuthoringDTO.setHttpSessionID(httpSessionID); - request.setAttribute(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - Map marksMap = AuthoringUtil.buildMarksMap(); - mcGeneralAuthoringDTO.setMarksMap(marksMap); - - Map passMarksMap = AuthoringUtil.buildDynamicPassMarkMap(questionDTOs, false); - mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap); - String totalMark = AuthoringUtil.getTotalMark(questionDTOs); mcGeneralAuthoringDTO.setTotalMarks(totalMark); - Map correctMap = AuthoringUtil.buildCorrectMap(); - mcGeneralAuthoringDTO.setCorrectMap(correctMap); - String newQuestion = request.getParameter("newQuestion"); mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion); @@ -1224,8 +905,6 @@ request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(questionDTOs.size())); - String editQuestionBoxRequest = request.getParameter("editQuestionBoxRequest"); - request.setAttribute("requestNewEditableQuestionBox", new Boolean(true).toString()); return (mapping.findForward("candidateAnswersList")); } @@ -1245,12 +924,10 @@ HttpServletResponse response) throws IOException, ServletException { McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; - IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - - String httpSessionID = mcAuthoringForm.getHttpSessionID(); - + String sessionMapId = request.getParameter(McAppConstants.ATTR_SESSION_MAP_ID); SessionMap sessionMap = (SessionMap) request.getSession() - .getAttribute(httpSessionID); + .getAttribute(sessionMapId); + request.setAttribute(McAppConstants.ATTR_SESSION_MAP_ID, sessionMapId); String questionIndex = request.getParameter("questionIndex"); request.setAttribute("questionIndex", questionIndex); @@ -1263,22 +940,16 @@ List questionDTOs = (List) sessionMap.get(McAppConstants.LIST_QUESTION_DTOS); - List candidates = new LinkedList(); List listCandidates = new LinkedList(); - String editableQuestion = ""; Iterator iter = questionDTOs.iterator(); while (iter.hasNext()) { McQuestionDTO questionDto = (McQuestionDTO) iter.next(); - String question = questionDto.getQuestion(); String displayOrder = questionDto.getDisplayOrder(); if ((displayOrder != null) && (!displayOrder.equals(""))) { if (displayOrder.equals(questionIndex)) { - editableQuestion = questionDto.getQuestion(); - candidates = questionDto.getListCandidateAnswersDTO(); - listCandidates = AuthoringUtil.swapOptions(optionDtos, candidateIndex, "up"); questionDto.setListCandidateAnswersDTO(listCandidates); @@ -1291,43 +962,12 @@ sessionMap.put(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - - String richTextTitle = request.getParameter(McAppConstants.TITLE); - - String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS); - - sessionMap.put(McAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); - sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); - - String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - McContent mcContent = mcService.getMcContent(new Long(strToolContentID)); - McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO(); - mcGeneralAuthoringDTO.setContentFolderID(contentFolderID); - mcGeneralAuthoringDTO.setActivityTitle(richTextTitle); + setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO); - mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); - - request.getSession().setAttribute(httpSessionID, sessionMap); - - McUtils.setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO, strToolContentID, httpSessionID); - - mcGeneralAuthoringDTO.setToolContentID(strToolContentID); - mcGeneralAuthoringDTO.setHttpSessionID(httpSessionID); - request.setAttribute(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - Map marksMap = AuthoringUtil.buildMarksMap(); - mcGeneralAuthoringDTO.setMarksMap(marksMap); - - Map passMarksMap = AuthoringUtil.buildDynamicPassMarkMap(questionDTOs, false); - mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap); - - Map correctMap = AuthoringUtil.buildCorrectMap(); - mcGeneralAuthoringDTO.setCorrectMap(correctMap); - String totalMark = AuthoringUtil.getTotalMark(questionDTOs); mcGeneralAuthoringDTO.setTotalMarks(totalMark); @@ -1341,8 +981,6 @@ request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(questionDTOs.size())); - String editQuestionBoxRequest = request.getParameter("editQuestionBoxRequest"); - request.setAttribute("requestNewEditableQuestionBox", new Boolean(true).toString()); return (mapping.findForward("candidateAnswersList")); } @@ -1361,13 +999,10 @@ public ActionForward removeCandidate(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; - - IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - - String httpSessionID = mcAuthoringForm.getHttpSessionID(); - + String sessionMapId = request.getParameter(McAppConstants.ATTR_SESSION_MAP_ID); SessionMap sessionMap = (SessionMap) request.getSession() - .getAttribute(httpSessionID); + .getAttribute(sessionMapId); + request.setAttribute(McAppConstants.ATTR_SESSION_MAP_ID, sessionMapId); String questionIndex = request.getParameter("questionIndex"); request.setAttribute("questionIndex", questionIndex); @@ -1408,47 +1043,15 @@ sessionMap.put(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - - String richTextTitle = request.getParameter(McAppConstants.TITLE); - - String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS); - - sessionMap.put(McAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); - sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); - - String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - - McContent mcContent = mcService.getMcContent(new Long(strToolContentID)); - McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO(); - mcGeneralAuthoringDTO.setContentFolderID(contentFolderID); - mcGeneralAuthoringDTO.setActivityTitle(richTextTitle); + setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO); - mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); - - request.getSession().setAttribute(httpSessionID, sessionMap); - - McUtils.setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO, strToolContentID, httpSessionID); - - mcGeneralAuthoringDTO.setToolContentID(strToolContentID); - mcGeneralAuthoringDTO.setHttpSessionID(httpSessionID); - request.setAttribute(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - Map marksMap = AuthoringUtil.buildMarksMap(); - mcGeneralAuthoringDTO.setMarksMap(marksMap); - - Map passMarksMap = AuthoringUtil.buildDynamicPassMarkMap(questionDTOs, false); - mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap); - String totalMark = AuthoringUtil.getTotalMark(questionDTOs); mcGeneralAuthoringDTO.setTotalMarks(totalMark); - Map correctMap = AuthoringUtil.buildCorrectMap(); - mcGeneralAuthoringDTO.setCorrectMap(correctMap); - String newQuestion = request.getParameter("newQuestion"); mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion); @@ -1459,8 +1062,6 @@ request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(questionDTOs.size())); - String editQuestionBoxRequest = request.getParameter("editQuestionBoxRequest"); - request.setAttribute("requestNewEditableQuestionBox", new Boolean(true).toString()); return (mapping.findForward("candidateAnswersList")); } @@ -1479,13 +1080,10 @@ public ActionForward newCandidateBox(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; - - IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - - String httpSessionID = mcAuthoringForm.getHttpSessionID(); - + String sessionMapId = request.getParameter(McAppConstants.ATTR_SESSION_MAP_ID); SessionMap sessionMap = (SessionMap) request.getSession() - .getAttribute(httpSessionID); + .getAttribute(sessionMapId); + request.setAttribute(McAppConstants.ATTR_SESSION_MAP_ID, sessionMapId); String questionIndex = request.getParameter("questionIndex"); request.setAttribute("questionIndex", questionIndex); @@ -1502,12 +1100,6 @@ String mark = request.getParameter("mark"); - String passmark = request.getParameter("passmark"); - - String feedback = request.getParameter("feedback"); - - String editQuestionBoxRequest = request.getParameter("editQuestionBoxRequest"); - McQuestionDTO mcQuestionContentDTOLocal = null; Iterator iter = questionDTOs.iterator(); while (iter.hasNext()) { @@ -1530,45 +1122,15 @@ sessionMap.put(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - - String richTextTitle = request.getParameter(McAppConstants.TITLE); - - String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS); - - sessionMap.put(McAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); - sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); - - String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO(); - mcGeneralAuthoringDTO.setContentFolderID(contentFolderID); - mcGeneralAuthoringDTO.setActivityTitle(richTextTitle); + setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO); - mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); - - request.getSession().setAttribute(httpSessionID, sessionMap); - - McUtils.setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO, strToolContentID, httpSessionID); - - mcGeneralAuthoringDTO.setToolContentID(strToolContentID); - mcGeneralAuthoringDTO.setHttpSessionID(httpSessionID); - request.setAttribute(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - Map marksMap = AuthoringUtil.buildMarksMap(); - mcGeneralAuthoringDTO.setMarksMap(marksMap); - - Map passMarksMap = AuthoringUtil.buildDynamicPassMarkMap(questionDTOs, false); - mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap); - String totalMark = AuthoringUtil.getTotalMark(questionDTOs); mcGeneralAuthoringDTO.setTotalMarks(totalMark); - Map correctMap = AuthoringUtil.buildCorrectMap(); - mcGeneralAuthoringDTO.setCorrectMap(correctMap); - mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion); mcGeneralAuthoringDTO.setMarkValue(mark); @@ -1584,16 +1146,11 @@ public ActionForward updateMarksList(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; - - ToolAccessMode mode = WebUtil.readToolAccessModeAuthorDefaulted(request); - request.setAttribute(AttributeNames.ATTR_MODE, mode.toString()); - - IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - - String httpSessionID = mcAuthoringForm.getHttpSessionID(); - + //TODO + String sessionMapId = mcAuthoringForm.getHttpSessionID(); //= request.getParameter(McAppConstants.ATTR_SESSION_MAP_ID); SessionMap sessionMap = (SessionMap) request.getSession() - .getAttribute(httpSessionID); + .getAttribute(sessionMapId); + request.setAttribute(McAppConstants.ATTR_SESSION_MAP_ID, sessionMapId); String questionIndex = request.getParameter("questionIndex"); mcAuthoringForm.setQuestionIndex(questionIndex); @@ -1602,52 +1159,19 @@ sessionMap.put(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - mcAuthoringForm.setContentFolderID(contentFolderID); - String richTextTitle = request.getParameter(McAppConstants.TITLE); - String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS); - - sessionMap.put(McAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); - sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); - - String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - McContent mcContent = mcService.getMcContent(new Long(strToolContentID)); - McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO(); - mcGeneralAuthoringDTO.setContentFolderID(contentFolderID); - - mcGeneralAuthoringDTO.setActivityTitle(richTextTitle); mcAuthoringForm.setTitle(richTextTitle); - mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); - - request.getSession().setAttribute(httpSessionID, sessionMap); - - McUtils.setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO, strToolContentID, httpSessionID); - - mcGeneralAuthoringDTO.setToolContentID(strToolContentID); - mcGeneralAuthoringDTO.setHttpSessionID(httpSessionID); - mcAuthoringForm.setToolContentID(strToolContentID); - mcAuthoringForm.setHttpSessionID(httpSessionID); + setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO); mcAuthoringForm.setCurrentTab("2"); request.setAttribute(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - Map marksMap = AuthoringUtil.buildMarksMap(); - mcGeneralAuthoringDTO.setMarksMap(marksMap); - - Map passMarksMap = AuthoringUtil.buildDynamicPassMarkMap(questionDTOs, false); - mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap); - String totalMark = AuthoringUtil.getTotalMark(questionDTOs); - mcAuthoringForm.setTotalMarks(totalMark); mcGeneralAuthoringDTO.setTotalMarks(totalMark); - Map correctMap = AuthoringUtil.buildCorrectMap(); - mcGeneralAuthoringDTO.setCorrectMap(correctMap); - request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO); request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(questionDTOs.size())); @@ -1658,13 +1182,10 @@ public ActionForward moveAddedCandidateUp(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; - - IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - - String httpSessionID = mcAuthoringForm.getHttpSessionID(); - + String sessionMapId = request.getParameter(McAppConstants.ATTR_SESSION_MAP_ID); SessionMap sessionMap = (SessionMap) request.getSession() - .getAttribute(httpSessionID); + .getAttribute(sessionMapId); + request.setAttribute(McAppConstants.ATTR_SESSION_MAP_ID, sessionMapId); String candidateIndex = request.getParameter("candidateIndex"); request.setAttribute("candidateIndex", candidateIndex); @@ -1683,74 +1204,36 @@ request.setAttribute(McAppConstants.NEW_QUESTION_DTO, newQuestionDTO); sessionMap.put(McAppConstants.NEW_QUESTION_DTO, newQuestionDTO); - String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - - String richTextTitle = request.getParameter(McAppConstants.TITLE); - - String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS); - - sessionMap.put(McAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); - sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); - - String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - McContent mcContent = mcService.getMcContent(new Long(strToolContentID)); - McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO(); - mcGeneralAuthoringDTO.setContentFolderID(contentFolderID); - mcGeneralAuthoringDTO.setActivityTitle(richTextTitle); + setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO); - mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); - - request.getSession().setAttribute(httpSessionID, sessionMap); - - McUtils.setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO, strToolContentID, httpSessionID); - - mcGeneralAuthoringDTO.setToolContentID(strToolContentID); - mcGeneralAuthoringDTO.setHttpSessionID(httpSessionID); - request.setAttribute(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - Map marksMap = AuthoringUtil.buildMarksMap(); - mcGeneralAuthoringDTO.setMarksMap(marksMap); - - Map passMarksMap = AuthoringUtil.buildDynamicPassMarkMap(questionDTOs, false); - mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap); - - Map correctMap = AuthoringUtil.buildCorrectMap(); - mcGeneralAuthoringDTO.setCorrectMap(correctMap); - String totalMark = AuthoringUtil.getTotalMark(questionDTOs); mcGeneralAuthoringDTO.setTotalMarks(totalMark); String newQuestion = request.getParameter("newQuestion"); mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion); - String feedback = request.getParameter("feedback"); - String mark = request.getParameter("mark"); mcGeneralAuthoringDTO.setMarkValue(mark); request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO); request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(questionDTOs.size())); - String editQuestionBoxRequest = request.getParameter("editQuestionBoxRequest"); - return (mapping.findForward("candidateAnswersAddList")); } public ActionForward moveAddedCandidateDown(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; - - IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - - String httpSessionID = mcAuthoringForm.getHttpSessionID(); - + String sessionMapId = request.getParameter(McAppConstants.ATTR_SESSION_MAP_ID); SessionMap sessionMap = (SessionMap) request.getSession() - .getAttribute(httpSessionID); + .getAttribute(sessionMapId); + request.setAttribute(McAppConstants.ATTR_SESSION_MAP_ID, sessionMapId); String candidateIndex = request.getParameter("candidateIndex"); request.setAttribute("candidateIndex", candidateIndex); @@ -1768,45 +1251,15 @@ request.setAttribute(McAppConstants.NEW_QUESTION_DTO, newQuestionDTO); sessionMap.put(McAppConstants.NEW_QUESTION_DTO, newQuestionDTO); - String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - - String richTextTitle = request.getParameter(McAppConstants.TITLE); - - String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS); - - sessionMap.put(McAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); - sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); - - String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO(); - mcGeneralAuthoringDTO.setContentFolderID(contentFolderID); - mcGeneralAuthoringDTO.setActivityTitle(richTextTitle); + setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO); - mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); - - request.getSession().setAttribute(httpSessionID, sessionMap); - - McUtils.setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO, strToolContentID, httpSessionID); - - mcGeneralAuthoringDTO.setToolContentID(strToolContentID); - mcGeneralAuthoringDTO.setHttpSessionID(httpSessionID); - request.setAttribute(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - Map marksMap = AuthoringUtil.buildMarksMap(); - mcGeneralAuthoringDTO.setMarksMap(marksMap); - - Map passMarksMap = AuthoringUtil.buildDynamicPassMarkMap(questionDTOs, false); - mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap); - String totalMark = AuthoringUtil.getTotalMark(questionDTOs); mcGeneralAuthoringDTO.setTotalMarks(totalMark); - Map correctMap = AuthoringUtil.buildCorrectMap(); - mcGeneralAuthoringDTO.setCorrectMap(correctMap); - String newQuestion = request.getParameter("newQuestion"); mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion); @@ -1823,13 +1276,10 @@ public ActionForward removeAddedCandidate(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; - - IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - - String httpSessionID = mcAuthoringForm.getHttpSessionID(); - + String sessionMapId = request.getParameter(McAppConstants.ATTR_SESSION_MAP_ID); SessionMap sessionMap = (SessionMap) request.getSession() - .getAttribute(httpSessionID); + .getAttribute(sessionMapId); + request.setAttribute(McAppConstants.ATTR_SESSION_MAP_ID, sessionMapId); String candidateIndexToRemove = request.getParameter("candidateIndex"); request.setAttribute("candidateIndex", candidateIndexToRemove); @@ -1855,74 +1305,34 @@ request.setAttribute(McAppConstants.NEW_QUESTION_DTO, newQuestionDTO); sessionMap.put(McAppConstants.NEW_QUESTION_DTO, newQuestionDTO); - String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - - String richTextTitle = request.getParameter(McAppConstants.TITLE); - - String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS); - - sessionMap.put(McAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); - sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); - - String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - McContent mcContent = mcService.getMcContent(new Long(strToolContentID)); - McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO(); - mcGeneralAuthoringDTO.setContentFolderID(contentFolderID); - mcGeneralAuthoringDTO.setActivityTitle(richTextTitle); + setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO); - mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); - - request.getSession().setAttribute(httpSessionID, sessionMap); - - McUtils.setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO, strToolContentID, httpSessionID); - - mcGeneralAuthoringDTO.setToolContentID(strToolContentID); - mcGeneralAuthoringDTO.setHttpSessionID(httpSessionID); - request.setAttribute(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - Map marksMap = AuthoringUtil.buildMarksMap(); - mcGeneralAuthoringDTO.setMarksMap(marksMap); - - Map passMarksMap = AuthoringUtil.buildDynamicPassMarkMap(questionDTOs, false); - mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap); - String totalMark = AuthoringUtil.getTotalMark(questionDTOs); mcGeneralAuthoringDTO.setTotalMarks(totalMark); - Map correctMap = AuthoringUtil.buildCorrectMap(); - mcGeneralAuthoringDTO.setCorrectMap(correctMap); - String newQuestion = request.getParameter("newQuestion"); mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion); - String feedback = request.getParameter("feedback"); - String mark = request.getParameter("mark"); mcGeneralAuthoringDTO.setMarkValue(mark); request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO); - request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(questionDTOs.size())); - String editQuestionBoxRequest = request.getParameter("editQuestionBoxRequest"); - return (mapping.findForward("candidateAnswersAddList")); - } public ActionForward newAddedCandidateBox(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; - - IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - - String httpSessionID = mcAuthoringForm.getHttpSessionID(); - + String sessionMapId = request.getParameter(McAppConstants.ATTR_SESSION_MAP_ID); SessionMap sessionMap = (SessionMap) request.getSession() - .getAttribute(httpSessionID); + .getAttribute(sessionMapId); + request.setAttribute(McAppConstants.ATTR_SESSION_MAP_ID, sessionMapId); String candidateIndex = request.getParameter("candidateIndex"); request.setAttribute("candidateIndex", candidateIndex); @@ -1935,80 +1345,30 @@ String mark = request.getParameter("mark"); - String passmark = request.getParameter("passmark"); - - String feedback = request.getParameter("feedback"); - - String editQuestionBoxRequest = request.getParameter("editQuestionBoxRequest"); - //newAddedCandidateBox McQuestionDTO newQuestionDTO = (McQuestionDTO) sessionMap.get(McAppConstants.NEW_QUESTION_DTO); newQuestionDTO.setListCandidateAnswersDTO(optionDtos); request.setAttribute(McAppConstants.NEW_QUESTION_DTO, newQuestionDTO); sessionMap.put(McAppConstants.NEW_QUESTION_DTO, newQuestionDTO); - sessionMap.put(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - - String richTextTitle = request.getParameter(McAppConstants.TITLE); - - String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS); - - sessionMap.put(McAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); - sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); - - String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO(); - mcGeneralAuthoringDTO.setContentFolderID(contentFolderID); - mcGeneralAuthoringDTO.setActivityTitle(richTextTitle); + setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO); - mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); - - request.getSession().setAttribute(httpSessionID, sessionMap); - - McUtils.setFormProperties(request, mcAuthoringForm, mcGeneralAuthoringDTO, strToolContentID, httpSessionID); - - mcGeneralAuthoringDTO.setToolContentID(strToolContentID); - mcGeneralAuthoringDTO.setHttpSessionID(httpSessionID); - request.setAttribute(McAppConstants.LIST_QUESTION_DTOS, questionDTOs); - Map marksMap = AuthoringUtil.buildMarksMap(); - mcGeneralAuthoringDTO.setMarksMap(marksMap); - - Map passMarksMap = AuthoringUtil.buildDynamicPassMarkMap(questionDTOs, false); - mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap); - String totalMark = AuthoringUtil.getTotalMark(questionDTOs); mcGeneralAuthoringDTO.setTotalMarks(totalMark); - - Map correctMap = AuthoringUtil.buildCorrectMap(); - mcGeneralAuthoringDTO.setCorrectMap(correctMap); - mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion); - mcGeneralAuthoringDTO.setMarkValue(mark); request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO); - request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(questionDTOs.size())); return (mapping.findForward("candidateAnswersAddList")); - } - protected boolean existsContent(long toolContentID, IMcService mcService) { - McContent mcContent = mcService.getMcContent(new Long(toolContentID)); - if (mcContent == null) { - return false; - } - - return true; - } - /** * repopulateOptionsBox */ @@ -2052,5 +1412,43 @@ return optionDtos; } + + /** + * + */ + private static void setFormProperties(HttpServletRequest request, McAuthoringForm mcAuthoringForm, + McGeneralAuthoringDTO mcGeneralAuthoringDTO) { + String sln = request.getParameter("sln"); + mcAuthoringForm.setSln(sln); + mcGeneralAuthoringDTO.setSln(sln); + + String questionsSequenced = request.getParameter("questionsSequenced"); + mcAuthoringForm.setQuestionsSequenced(questionsSequenced); + mcGeneralAuthoringDTO.setQuestionsSequenced(questionsSequenced); + + String randomize = request.getParameter("randomize"); + mcAuthoringForm.setRandomize(randomize); + mcGeneralAuthoringDTO.setRandomize(randomize); + + String showMarks = request.getParameter("showMarks"); + mcAuthoringForm.setShowMarks(showMarks); + mcGeneralAuthoringDTO.setShowMarks(showMarks); + + String retries = request.getParameter("retries"); + mcAuthoringForm.setRetries(retries); + mcGeneralAuthoringDTO.setRetries(retries); + + String reflect = request.getParameter(REFLECT); + mcAuthoringForm.setReflect(reflect); + mcGeneralAuthoringDTO.setReflect(reflect); + + String reflectionSubject = request.getParameter(REFLECTION_SUBJECT); + mcAuthoringForm.setReflectionSubject(reflectionSubject); + mcGeneralAuthoringDTO.setReflectionSubject(reflectionSubject); + + String passmark = request.getParameter("passmark"); + mcGeneralAuthoringDTO.setPassMarkValue(passmark); + } + } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAuthoringForm.java =================================================================== diff -u -r2f725f8ef2aa09a2663b2335bf67213074426d11 -r463f7b3dbb88ee41210f7170dc19dc25360cd26f --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAuthoringForm.java (.../McAuthoringForm.java) (revision 2f725f8ef2aa09a2663b2335bf67213074426d11) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAuthoringForm.java (.../McAuthoringForm.java) (revision 463f7b3dbb88ee41210f7170dc19dc25360cd26f) @@ -72,8 +72,6 @@ protected String instructions; protected String isRemoveContent; - protected String toolContentId; - protected String toolContentID; /* advanced content */ protected String synchInMonitor; @@ -101,12 +99,9 @@ protected String clickedObj; protected String edit; - private String contentFolderID; private String editableQuestionIndex; private String feedback; private String candidateIndex; - private String totalMarks; - protected String currentField; public void resetUserAction() { this.editDefaultQuestion = null; @@ -158,8 +153,6 @@ this.selectedIndex = null; this.deletableOptionIndex = null; this.isRemoveContent = null; - this.toolContentId = null; - this.toolContentID = null; this.endLearningMessage = null; this.synchInMonitor = null; @@ -314,21 +307,6 @@ } /** - * @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 syncInMonitor. */ public String getSynchInMonitor() { @@ -742,23 +720,6 @@ } /** - * @return Returns the toolContentID. - */ - @Override - public String getToolContentID() { - return toolContentID; - } - - /** - * @param toolContentID - * The toolContentID to set. - */ - @Override - public void setToolContentID(String toolContentID) { - this.toolContentID = toolContentID; - } - - /** * @return Returns the submit. */ public String getSubmit() { @@ -819,21 +780,6 @@ } /** - * @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 editableQuestionIndex. */ public String getEditableQuestionIndex() { @@ -879,21 +825,6 @@ } /** - * @return Returns the totalMarks. - */ - public String getTotalMarks() { - return totalMarks; - } - - /** - * @param totalMarks - * The totalMarks to set. - */ - public void setTotalMarks(String totalMarks) { - this.totalMarks = totalMarks; - } - - /** * @return Returns the clickedObj. */ public String getClickedObj() { @@ -909,21 +840,6 @@ } /** - * @return Returns the currentField. - */ - public String getCurrentField() { - return currentField; - } - - /** - * @param currentField - * The currentField to set. - */ - public void setCurrentField(String currentField) { - this.currentField = currentField; - } - - /** * @return Returns the showMarks. */ public String getShowMarks() { Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningAction.java =================================================================== diff -u -rd82560c4b917240cb90b5d3416f5199cba68fb85 -r463f7b3dbb88ee41210f7170dc19dc25360cd26f --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningAction.java (.../McLearningAction.java) (revision d82560c4b917240cb90b5d3416f5199cba68fb85) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningAction.java (.../McLearningAction.java) (revision 463f7b3dbb88ee41210f7170dc19dc25360cd26f) @@ -50,7 +50,6 @@ import org.lamsfoundation.lams.tool.mc.McAppConstants; import org.lamsfoundation.lams.tool.mc.McComparator; import org.lamsfoundation.lams.tool.mc.McGeneralLearnerFlowDTO; -import org.lamsfoundation.lams.tool.mc.McUtils; import org.lamsfoundation.lams.tool.mc.pojos.McContent; import org.lamsfoundation.lams.tool.mc.pojos.McOptsContent; import org.lamsfoundation.lams.tool.mc.pojos.McQueContent; @@ -173,9 +172,6 @@ HttpSession ss = SessionManager.getSession(); UserDTO userDto = (UserDTO) ss.getAttribute(AttributeNames.USER); - // attempting to leave/complete session with toolSessionId: - McUtils.cleanUpSessionAbsolute(request); - String nextUrl = null; try { nextUrl = mcService.leaveToolSession(new Long(toolSessionID), userDto.getUserID().longValue()); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningForm.java =================================================================== diff -u -rd82560c4b917240cb90b5d3416f5199cba68fb85 -r463f7b3dbb88ee41210f7170dc19dc25360cd26f --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningForm.java (.../McLearningForm.java) (revision d82560c4b917240cb90b5d3416f5199cba68fb85) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningForm.java (.../McLearningForm.java) (revision 463f7b3dbb88ee41210f7170dc19dc25360cd26f) @@ -65,7 +65,6 @@ protected String nextQuestionSelected; protected String httpSessionID; - protected String responseId; protected String sessionId; public IMcService mcService; @@ -433,21 +432,6 @@ } /** - * @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 sessionId. */ public String getSessionId() { Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java =================================================================== diff -u -r7f589f1ea063f8c50aad53033e73f9cb1ba5adac -r463f7b3dbb88ee41210f7170dc19dc25360cd26f --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java (.../McLearningStarterAction.java) (revision 7f589f1ea063f8c50aad53033e73f9cb1ba5adac) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java (.../McLearningStarterAction.java) (revision 463f7b3dbb88ee41210f7170dc19dc25360cd26f) @@ -50,7 +50,6 @@ import org.lamsfoundation.lams.tool.mc.McAppConstants; import org.lamsfoundation.lams.tool.mc.McApplicationException; import org.lamsfoundation.lams.tool.mc.McGeneralLearnerFlowDTO; -import org.lamsfoundation.lams.tool.mc.McUtils; import org.lamsfoundation.lams.tool.mc.pojos.McContent; import org.lamsfoundation.lams.tool.mc.pojos.McQueUsr; import org.lamsfoundation.lams.tool.mc.pojos.McSession; @@ -79,8 +78,6 @@ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, McApplicationException { - McUtils.cleanUpSessionAbsolute(request); - if (mcService == null) { mcService = McServiceProxy.getMcService(getServlet().getServletContext()); } @@ -105,7 +102,6 @@ */ McSession mcSession = mcService.getMcSessionById(new Long(toolSessionID)); if (mcSession == null) { - McUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(McAppConstants.ERROR_LIST)); } @@ -115,7 +111,6 @@ */ McContent mcContent = mcSession.getMcContent(); if (mcContent == null) { - McUtils.cleanUpSessionAbsolute(request); ActionMessages errors = new ActionMessages(); errors.add(Globals.ERROR_KEY, new ActionMessage("error.content.doesNotExist")); saveErrors(request, errors); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java =================================================================== diff -u -r27ce47a7e28a2a4804f696bcd55d28d83959fedb -r463f7b3dbb88ee41210f7170dc19dc25360cd26f --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java (.../McMonitoringAction.java) (revision 27ce47a7e28a2a4804f696bcd55d28d83959fedb) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java (.../McMonitoringAction.java) (revision 463f7b3dbb88ee41210f7170dc19dc25360cd26f) @@ -25,11 +25,8 @@ import java.io.IOException; import java.io.OutputStream; import java.util.Date; -import java.util.Iterator; import java.util.List; -import java.util.Map; import java.util.TimeZone; -import java.util.TreeMap; import javax.servlet.ServletException; import javax.servlet.http.Cookie; @@ -43,20 +40,18 @@ import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.ActionRedirect; import org.apache.tomcat.util.json.JSONArray; import org.apache.tomcat.util.json.JSONException; import org.apache.tomcat.util.json.JSONObject; import org.lamsfoundation.lams.notebook.model.NotebookEntry; import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants; import org.lamsfoundation.lams.tool.exception.ToolException; import org.lamsfoundation.lams.tool.mc.McAppConstants; -import org.lamsfoundation.lams.tool.mc.McComparator; -import org.lamsfoundation.lams.tool.mc.McGeneralAuthoringDTO; import org.lamsfoundation.lams.tool.mc.McGeneralLearnerFlowDTO; -import org.lamsfoundation.lams.tool.mc.McGeneralMonitoringDTO; import org.lamsfoundation.lams.tool.mc.McUserMarkDTO; -import org.lamsfoundation.lams.tool.mc.ReflectionDTO; import org.lamsfoundation.lams.tool.mc.pojos.McContent; +import org.lamsfoundation.lams.tool.mc.pojos.McOptsContent; import org.lamsfoundation.lams.tool.mc.pojos.McQueContent; import org.lamsfoundation.lams.tool.mc.pojos.McQueUsr; import org.lamsfoundation.lams.tool.mc.pojos.McSession; @@ -77,87 +72,23 @@ private static Logger logger = Logger.getLogger(McMonitoringAction.class.getName()); /** - * main content/question content management and workflow logic - * - */ - @Override - public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException { - return null; - } - - /** * displayAnswers */ public ActionForward displayAnswers(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + McContent mcContent = mcService.getMcContent(new Long(strToolContentID)); mcContent.setDisplayAnswers(new Boolean(true)); - - McMonitoringForm mcMonitoringForm = (McMonitoringForm) form; - McGeneralMonitoringDTO mcGeneralMonitoringDTO = new McGeneralMonitoringDTO(); - - repopulateRequestParameters(request, mcMonitoringForm, mcGeneralMonitoringDTO); - - // generate DTO for All sessions - MonitoringUtil.setupAllSessionsData(request, mcContent, mcService); - - mcGeneralMonitoringDTO.setRequestLearningReport(new Boolean(false).toString()); - - mcGeneralMonitoringDTO.setSummaryToolSessions(MonitoringUtil.populateToolSessions(mcContent)); - mcGeneralMonitoringDTO.setDisplayAnswers(new Boolean(mcContent.isDisplayAnswers()).toString()); - - /* setting editable screen properties */ - McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO(); - mcGeneralAuthoringDTO.setActivityTitle(mcContent.getTitle()); - mcGeneralAuthoringDTO.setActivityInstructions(mcContent.getInstructions()); - - Map mapOptionsContent = new TreeMap(new McComparator()); - Iterator queIterator = mcContent.getMcQueContents().iterator(); - Long mapIndex = new Long(1); - while (queIterator.hasNext()) { - McQueContent mcQueContent = (McQueContent) queIterator.next(); - if (mcQueContent != null) { - mapOptionsContent.put(mapIndex.toString(), mcQueContent.getQuestion()); - - mapIndex = new Long(mapIndex.longValue() + 1); - } - } - - request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO); - - List reflectionsContainerDTO = mcService.getReflectionList(mcContent, null); - request.setAttribute(REFLECTIONS_CONTAINER_DTO, reflectionsContainerDTO); - - if (!mcContent.getMcSessions().isEmpty()) { - // USER_EXCEPTION_NO_TOOL_SESSIONS is set to false - mcGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); - } else { - // USER_EXCEPTION_NO_TOOL_SESSIONS is set to true - mcGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); - } - - request.setAttribute(MC_GENERAL_MONITORING_DTO, mcGeneralMonitoringDTO); - - if (!reflectionsContainerDTO.isEmpty()) { - request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); - - String userExceptionNoToolSessions = mcGeneralMonitoringDTO.getUserExceptionNoToolSessions(); - - if (userExceptionNoToolSessions.equals("true")) { - // there are no online student activity but there are reflections - request.setAttribute(NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); - } - } else { - request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString()); - } - /* ... till here */ - - MonitoringUtil.setSessionUserCount(mcContent, mcGeneralMonitoringDTO); - - return (mapping.findForward(LOAD_MONITORING_CONTENT)); + mcService.updateMc(mcContent); + + // use redirect to prevent resubmition of the same request + ActionRedirect redirect = new ActionRedirect(mapping.findForwardConfig("monitoringStarterRedirect")); + redirect.addParameter(McAppConstants.TOOL_CONTENT_ID, strToolContentID); + redirect.addParameter(AttributeNames.PARAM_CONTENT_FOLDER_ID, contentFolderID); + return redirect; } /** @@ -166,7 +97,6 @@ public ActionForward openNotebook(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, ToolException { IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - String uid = request.getParameter("uid"); String userId = request.getParameter("userId"); String userName = request.getParameter("userName"); String sessionId = request.getParameter("sessionId"); @@ -190,12 +120,10 @@ */ public ActionForward downloadMarks(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - MessageService messageService = getMessageService(); + MessageService messageService = McServiceProxy.getMessageService(getServlet().getServletContext()); - McMonitoringForm mcMonitoringForm = (McMonitoringForm) form; - IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - String toolContentID = mcMonitoringForm.getToolContentID(); + Long toolContentID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID, false); McContent mcContent = mcService.getMcContent(new Long(toolContentID)); @@ -308,9 +236,24 @@ McQueUsr user = mcService.getMcUserByUID(userUid); List userAttempts = mcService.getFinalizedUserAttempts(user); + // Escapes all characters that may brake JS code on assigning Java value to JS String variable (particularly + // escapes all quotes in the following way \"). if (userAttempts != null) { for (McUsrAttempt userAttempt : userAttempts) { - MonitoringUtil.escapeQuotes(userAttempt); + McQueContent question = userAttempt.getMcQueContent(); + McOptsContent option = userAttempt.getMcOptionsContent(); + + String questionText = question.getQuestion(); + if (questionText != null) { + String escapedQuestion = StringEscapeUtils.escapeJavaScript(questionText); + question.setEscapedQuestion(escapedQuestion); + } + + String optionText = option.getMcQueOptionText(); + if (optionText != null) { + String escapedOptionText = StringEscapeUtils.escapeJavaScript(optionText); + option.setEscapedOptionText(escapedOptionText); + } } } @@ -397,29 +340,4 @@ return null; } - - // ************************************************************************************* - // Private methods - // ************************************************************************************* - - /** - */ - protected void repopulateRequestParameters(HttpServletRequest request, McMonitoringForm mcMonitoringForm, - McGeneralMonitoringDTO mcGeneralMonitoringDTO) { - - String toolContentID = request.getParameter(TOOL_CONTENT_ID); - mcMonitoringForm.setToolContentID(toolContentID); - mcGeneralMonitoringDTO.setToolContentID(toolContentID); - - String responseId = request.getParameter(RESPONSE_ID); - mcMonitoringForm.setResponseId(responseId); - mcGeneralMonitoringDTO.setResponseId(responseId); - } - - /** - * Return ResourceService bean. - */ - private MessageService getMessageService() { - return McServiceProxy.getMessageService(getServlet().getServletContext()); - } } Fisheye: Tag 463f7b3dbb88ee41210f7170dc19dc25360cd26f refers to a dead (removed) revision in file `lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringForm.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java =================================================================== diff -u -r5773f84ed608838de3521ecde87c52f3c72d478c -r463f7b3dbb88ee41210f7170dc19dc25360cd26f --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java (.../McMonitoringStarterAction.java) (revision 5773f84ed608838de3521ecde87c52f3c72d478c) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java (.../McMonitoringStarterAction.java) (revision 463f7b3dbb88ee41210f7170dc19dc25360cd26f) @@ -23,13 +23,19 @@ package org.lamsfoundation.lams.tool.mc.web; import java.io.IOException; +import java.util.ArrayList; +import java.util.Date; +import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Set; +import java.util.TimeZone; +import java.util.TreeSet; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; import org.apache.log4j.Logger; import org.apache.struts.action.Action; @@ -38,18 +44,19 @@ import org.apache.struts.action.ActionMapping; import org.lamsfoundation.lams.tool.mc.McAppConstants; import org.lamsfoundation.lams.tool.mc.McApplicationException; -import org.lamsfoundation.lams.tool.mc.McGeneralAuthoringDTO; import org.lamsfoundation.lams.tool.mc.McGeneralMonitoringDTO; -import org.lamsfoundation.lams.tool.mc.McQuestionDTO; -import org.lamsfoundation.lams.tool.mc.McUtils; import org.lamsfoundation.lams.tool.mc.ReflectionDTO; +import org.lamsfoundation.lams.tool.mc.dto.SessionDTO; import org.lamsfoundation.lams.tool.mc.pojos.McContent; -import org.lamsfoundation.lams.tool.mc.pojos.McQueContent; +import org.lamsfoundation.lams.tool.mc.pojos.McSession; import org.lamsfoundation.lams.tool.mc.service.IMcService; import org.lamsfoundation.lams.tool.mc.service.McServiceProxy; +import org.lamsfoundation.lams.tool.mc.util.McSessionComparator; +import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.util.DateUtil; import org.lamsfoundation.lams.util.WebUtil; +import org.lamsfoundation.lams.web.session.SessionManager; import org.lamsfoundation.lams.web.util.AttributeNames; -import org.lamsfoundation.lams.web.util.SessionMap; /** * Starts up the monitoring module @@ -65,110 +72,106 @@ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, McApplicationException { initializeMcService(); - McUtils.cleanUpSessionAbsolute(request); - McMonitoringForm mcMonitoringForm = (McMonitoringForm) form; - McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO(); McGeneralMonitoringDTO mcGeneralMonitoringDTO = new McGeneralMonitoringDTO(); String toolContentID = null; try { Long toolContentIDLong = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID, false); toolContentID = toolContentIDLong.toString(); - mcMonitoringForm.setToolContentId(toolContentID); - mcMonitoringForm.setToolContentID(toolContentID); } catch (IllegalArgumentException e) { logger.error("Unable to start monitoring as tool content id is missing"); - McUtils.cleanUpSessionAbsolute(request); throw (e); } McContent mcContent = service.getMcContent(new Long(toolContentID)); mcGeneralMonitoringDTO.setToolContentID(toolContentID); mcGeneralMonitoringDTO.setActivityTitle(mcContent.getTitle()); mcGeneralMonitoringDTO.setActivityInstructions(mcContent.getInstructions()); - mcGeneralMonitoringDTO.setCurrentMonitoringTab("summary"); - mcGeneralMonitoringDTO.setRequestLearningReport(new Boolean(false).toString()); - mcGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); - /* - * get the questions section is needed for the Edit tab's View Only mode - */ - List listQuestionContentDTO = new LinkedList(); - Long mapIndex = new Long(1); - for (McQueContent question : (Set) mcContent.getMcQueContents()) { - McQuestionDTO mcContentDTO = new McQuestionDTO(); + //set up sessionDTOs list + Set sessions = new TreeSet(new McSessionComparator()); + sessions.addAll(mcContent.getMcSessions()); + List sessionDtos = new LinkedList(); + for (McSession session : sessions) { + SessionDTO sessionDto = new SessionDTO(); + sessionDto.setSessionId(session.getMcSessionId()); + sessionDto.setSessionName(session.getSession_name()); - if (question != null) { - - mcContentDTO.setQuestion(question.getQuestion()); - mcContentDTO.setDisplayOrder(question.getDisplayOrder().toString()); - listQuestionContentDTO.add(mcContentDTO); - - mapIndex = new Long(mapIndex.longValue() + 1); - } + sessionDtos.add(sessionDto); } + request.setAttribute(SESSION_DTOS, sessionDtos); - request.setAttribute(LIST_QUESTION_DTOS, listQuestionContentDTO); - request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size())); + // setting up the advanced summary - mcGeneralMonitoringDTO.setExistsOpenMcs(new Boolean(false).toString()); + request.setAttribute(ATTR_CONTENT, mcContent); + request.setAttribute("questionsSequenced", mcContent.isQuestionsSequenced()); + request.setAttribute("showMarks", mcContent.isShowMarks()); + request.setAttribute("useSelectLeaderToolOuput", mcContent.isUseSelectLeaderToolOuput()); + request.setAttribute("prefixAnswersWithLetters", mcContent.isPrefixAnswersWithLetters()); + request.setAttribute("randomize", mcContent.isRandomize()); + request.setAttribute("displayAnswers", mcContent.isDisplayAnswers()); + request.setAttribute("retries", mcContent.isRetries()); + request.setAttribute("reflect", mcContent.isReflect()); + request.setAttribute("reflectionSubject", mcContent.getReflectionSubject()); + request.setAttribute("passMark", mcContent.getPassMark()); + request.setAttribute("toolContentID", mcContent.getMcContentId()); + request.setAttribute(AttributeNames.PARAM_CONTENT_FOLDER_ID, + WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID)); - MonitoringUtil.setupAllSessionsData(request, mcContent, service); - mcGeneralMonitoringDTO.setGroupName("All Groups"); - mcGeneralMonitoringDTO.setListMonitoredAnswersContainerDto(new LinkedList()); - mcGeneralMonitoringDTO.setExistsOpenMcs(new Boolean(false).toString()); + // setting up Date and time restriction in activities + HttpSession ss = SessionManager.getSession(); + Date submissionDeadline = mcContent.getSubmissionDeadline(); + if (submissionDeadline != null) { + UserDTO learnerDto = (UserDTO) ss.getAttribute(AttributeNames.USER); + TimeZone learnerTimeZone = learnerDto.getTimeZone(); + Date tzSubmissionDeadline = DateUtil.convertToTimeZoneFromDefault(learnerTimeZone, submissionDeadline); + request.setAttribute(McAppConstants.ATTR_SUBMISSION_DEADLINE, tzSubmissionDeadline.getTime()); + // use the unconverted time, as convertToStringForJSON() does the timezone conversion if needed + request.setAttribute(McAppConstants.ATTR_SUBMISSION_DEADLINE_DATESTRING, + DateUtil.convertToStringForJSON(submissionDeadline, request.getLocale())); + } - // The edit activity code needs a session map - SessionMap sessionMap = new SessionMap(); - mcMonitoringForm.setHttpSessionID(sessionMap.getSessionID()); - request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); + //prepare toolOutputDefinitions and activityEvaluation + List toolOutputDefinitions = new ArrayList(); + toolOutputDefinitions.add(McAppConstants.OUTPUT_NAME_LEARNER_MARK); + toolOutputDefinitions.add(McAppConstants.OUTPUT_NAME_LEARNER_ALL_CORRECT); + String activityEvaluation = service.getActivityEvaluation(mcContent.getMcContentId()); + request.setAttribute(McAppConstants.ATTR_TOOL_OUTPUT_DEFINITIONS, toolOutputDefinitions); + request.setAttribute(McAppConstants.ATTR_ACTIVITY_EVALUATION, activityEvaluation); - mcMonitoringForm.setCurrentTab("1"); + boolean isGroupedActivity = service.isGroupedActivity(new Long(mcContent.getMcContentId())); + request.setAttribute("isGroupedActivity", isGroupedActivity); + mcGeneralMonitoringDTO.setCurrentTab("1"); /* this section is needed for Edit Activity screen, from here... */ - mcGeneralAuthoringDTO.setActivityTitle(mcGeneralMonitoringDTO.getActivityTitle()); - mcGeneralAuthoringDTO.setActivityInstructions(mcGeneralMonitoringDTO.getActivityInstructions()); - request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO); - McMonitoringAction monitoringAction = new McMonitoringAction(); - monitoringAction.repopulateRequestParameters(request, mcMonitoringForm, mcGeneralMonitoringDTO); - - mcGeneralMonitoringDTO.setRequestLearningReport(new Boolean(false).toString()); - - mcGeneralMonitoringDTO.setSummaryToolSessions(MonitoringUtil.populateToolSessions(mcContent)); mcGeneralMonitoringDTO.setDisplayAnswers(new Boolean(mcContent.isDisplayAnswers()).toString()); List reflectionsContainerDTO = service.getReflectionList(mcContent, null); request.setAttribute(REFLECTIONS_CONTAINER_DTO, reflectionsContainerDTO); - if (!mcContent.getMcSessions().isEmpty()) { - // USER_EXCEPTION_NO_TOOL_SESSIONS is set to false - mcGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); - } else { - // USER_EXCEPTION_NO_TOOL_SESSIONS is set to true - mcGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); - } - request.setAttribute(MC_GENERAL_MONITORING_DTO, mcGeneralMonitoringDTO); + + //count users + int countSessionComplete = 0; + int countAllUsers = 0; + Iterator iteratorSession = mcContent.getMcSessions().iterator(); + while (iteratorSession.hasNext()) { + McSession mcSession = (McSession) iteratorSession.next(); - // find out if there are any reflection entries - if (!reflectionsContainerDTO.isEmpty()) { - request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); + if (mcSession != null) { - String userExceptionNoToolSessions = mcGeneralMonitoringDTO.getUserExceptionNoToolSessions(); - - if (userExceptionNoToolSessions.equals("true")) { - // there are no online student activity but there are reflections - request.setAttribute(NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); + if (mcSession.getSessionStatus().equals(COMPLETED)) { + countSessionComplete++; + } + countAllUsers += mcSession.getMcQueUsers().size(); } - } else { - request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString()); } + mcGeneralMonitoringDTO.setCountAllUsers(new Integer(countAllUsers)); + mcGeneralMonitoringDTO.setCountSessionComplete(new Integer(countSessionComplete)); - MonitoringUtil.setSessionUserCount(mcContent, mcGeneralMonitoringDTO); - return (mapping.findForward(LOAD_MONITORING_CONTENT)); } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McPedagogicalPlannerAction.java =================================================================== diff -u -r2f725f8ef2aa09a2663b2335bf67213074426d11 -r463f7b3dbb88ee41210f7170dc19dc25360cd26f --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McPedagogicalPlannerAction.java (.../McPedagogicalPlannerAction.java) (revision 2f725f8ef2aa09a2663b2335bf67213074426d11) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McPedagogicalPlannerAction.java (.../McPedagogicalPlannerAction.java) (revision 463f7b3dbb88ee41210f7170dc19dc25360cd26f) @@ -67,10 +67,7 @@ Long toolContentID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); McContent mcContent = getMcService().getMcContent(toolContentID); plannerForm.fillForm(mcContent, getMcService()); - String contentFolderId = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - plannerForm.setContentFolderID(contentFolderId); return mapping.findForward(McAppConstants.SUCCESS); - } public ActionForward saveOrUpdatePedagogicalPlannerForm(ActionMapping mapping, ActionForm form, Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McPedagogicalPlannerForm.java =================================================================== diff -u -r2f725f8ef2aa09a2663b2335bf67213074426d11 -r463f7b3dbb88ee41210f7170dc19dc25360cd26f --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McPedagogicalPlannerForm.java (.../McPedagogicalPlannerForm.java) (revision 2f725f8ef2aa09a2663b2335bf67213074426d11) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McPedagogicalPlannerForm.java (.../McPedagogicalPlannerForm.java) (revision 463f7b3dbb88ee41210f7170dc19dc25360cd26f) @@ -49,16 +49,7 @@ private List candidateAnswerCount; private String candidateAnswersString; private List correct; - private String contentFolderID; - public String getContentFolderID() { - return contentFolderID; - } - - public void setContentFolderID(String contentFolderID) { - this.contentFolderID = contentFolderID; - } - public ActionMessages validate(HttpServletRequest request) { ActionMessages errors = new ActionMessages(); boolean allEmpty = true; @@ -124,8 +115,6 @@ public void fillForm(McContent mcContent, IMcService mcService) { if (mcContent != null) { - setToolContentID(mcContent.getMcContentId()); - List questionDtos = AuthoringUtil.buildDefaultQuestions(mcContent); StringBuilder candidateAnswersBuilder = new StringBuilder(); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java =================================================================== diff -u -r23b5b0a587e3c4dc659729270eb0d608fb4dd982 -r463f7b3dbb88ee41210f7170dc19dc25360cd26f --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java (.../McStarterAction.java) (revision 23b5b0a587e3c4dc659729270eb0d608fb4dd982) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java (.../McStarterAction.java) (revision 463f7b3dbb88ee41210f7170dc19dc25360cd26f) @@ -27,27 +27,21 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Map; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; -import org.apache.struts.Globals; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; -import org.apache.struts.action.ActionMessage; -import org.apache.struts.action.ActionMessages; import org.lamsfoundation.lams.tool.ToolAccessMode; import org.lamsfoundation.lams.tool.mc.McAppConstants; import org.lamsfoundation.lams.tool.mc.McApplicationException; import org.lamsfoundation.lams.tool.mc.McGeneralAuthoringDTO; import org.lamsfoundation.lams.tool.mc.McQuestionDTO; -import org.lamsfoundation.lams.tool.mc.McUtils; import org.lamsfoundation.lams.tool.mc.pojos.McContent; import org.lamsfoundation.lams.tool.mc.service.IMcService; import org.lamsfoundation.lams.tool.mc.service.McServiceProxy; @@ -67,57 +61,34 @@ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, McApplicationException { - McUtils.cleanUpSessionAbsolute(request); McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; + McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO(); + SessionMap sessionMap = new SessionMap(); + request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); + String sessionMapId = sessionMap.getSessionID(); + request.setAttribute(McAppConstants.ATTR_SESSION_MAP_ID, sessionMapId); + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - mcAuthoringForm.setContentFolderID(contentFolderID); + sessionMap.put(AttributeNames.PARAM_CONTENT_FOLDER_ID, contentFolderID); + String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); + sessionMap.put(AttributeNames.PARAM_TOOL_CONTENT_ID, strToolContentID); + ToolAccessMode mode = WebUtil.readToolAccessModeAuthorDefaulted(request); + sessionMap.put(AttributeNames.ATTR_MODE, mode); - McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO(); - mcGeneralAuthoringDTO.setContentFolderID(contentFolderID); - mcAuthoringForm.resetRadioBoxes(); - IMcService mcService = null; - if ((getServlet() == null) || (getServlet().getServletContext() == null)) { - mcService = mcAuthoringForm.getMcService(); - } else { - mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - } + IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - mcGeneralAuthoringDTO.setCurrentTab("1"); - - boolean validateSignature = validateDefaultContent(request, mapping, mcService, mcGeneralAuthoringDTO, - mcAuthoringForm); - if (validateSignature == false) { - logger.debug("error during validation"); - } - - /* the authoring url must be passed a tool content id */ - String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - mcGeneralAuthoringDTO.setToolContentID(strToolContentID); - - ToolAccessMode mode = WebUtil.readToolAccessModeAuthorDefaulted(request); // request is from monitoring module if (mode.isTeacher()) { mcService.setDefineLater(strToolContentID, true); } - request.setAttribute(AttributeNames.ATTR_MODE, mode.toString()); - SessionMap sessionMap = new SessionMap(); - sessionMap.put(ACTIVITY_TITLE_KEY, ""); - sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, ""); - mcAuthoringForm.setHttpSessionID(sessionMap.getSessionID()); - mcGeneralAuthoringDTO.setHttpSessionID(sessionMap.getSessionID()); - request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); - if ((strToolContentID == null) || (strToolContentID.equals(""))) { - McUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST)); } - mcAuthoringForm.setToolContentID(strToolContentID); - McContent mcContent = mcService.getMcContent(new Long(strToolContentID)); // if mcContent does not exist, try to use default content instead. @@ -127,8 +98,7 @@ mcContent = McContent.newInstance(mcContent, new Long(strToolContentID)); } - prepareDTOandForm(request, mapping, mcAuthoringForm, new Long(strToolContentID).longValue(), mcContent, - mcGeneralAuthoringDTO, sessionMap); + prepareDTOandForm(request, mapping, mcAuthoringForm, mcContent, mcGeneralAuthoringDTO); List questionDtos = AuthoringUtil.buildDefaultQuestions(mcContent); request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(questionDtos.size())); @@ -138,28 +108,17 @@ List listDeletedQuestionDTOs = new ArrayList(); sessionMap.put(LIST_DELETED_QUESTION_DTOS, listDeletedQuestionDTOs); - Map marksMap = AuthoringUtil.buildMarksMap(); - mcGeneralAuthoringDTO.setMarksMap(marksMap); mcGeneralAuthoringDTO.setMarkValue("1"); - Map passMarksMap = AuthoringUtil.buildDynamicPassMarkMap(questionDtos, true); - mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap); - String totalMark = AuthoringUtil.getTotalMark(questionDtos); - mcAuthoringForm.setTotalMarks(totalMark); mcGeneralAuthoringDTO.setTotalMarks(totalMark); String passMark = " "; - if ((mcContent.getPassMark() != null) && (mcContent.getPassMark().intValue() != 0)) { passMark = mcContent.getPassMark().toString(); } - mcGeneralAuthoringDTO.setPassMarkValue(passMark); - Map correctMap = AuthoringUtil.buildCorrectMap(); - mcGeneralAuthoringDTO.setCorrectMap(correctMap); - request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO); return (mapping.findForward(LOAD_AUTHORING)); @@ -176,12 +135,9 @@ * @return ActionForward */ protected McContent prepareDTOandForm(HttpServletRequest request, ActionMapping mapping, - McAuthoringForm mcAuthoringForm, long toolContentID, McContent mcContent, - McGeneralAuthoringDTO mcGeneralAuthoringDTO, SessionMap sessionMap) { + McAuthoringForm mcAuthoringForm, McContent mcContent, + McGeneralAuthoringDTO mcGeneralAuthoringDTO) { - mcGeneralAuthoringDTO.setActivityTitle(mcContent.getTitle()); - mcGeneralAuthoringDTO.setActivityInstructions(mcContent.getInstructions()); - mcAuthoringForm.setSln(mcContent.isShowReport() ? "1" : "0"); mcAuthoringForm.setQuestionsSequenced(mcContent.isQuestionsSequenced() ? "1" : "0"); mcAuthoringForm.setRandomize(mcContent.isRandomize() ? "1" : "0"); @@ -202,71 +158,10 @@ mcGeneralAuthoringDTO.setReflect(mcContent.isReflect() ? "1" : "0"); mcGeneralAuthoringDTO.setReflectionSubject(mcContent.getReflectionSubject()); - mcGeneralAuthoringDTO.setActivityTitle(mcContent.getTitle()); mcAuthoringForm.setTitle(mcContent.getTitle()); - - mcGeneralAuthoringDTO.setActivityInstructions(mcContent.getInstructions()); mcAuthoringForm.setInstructions(mcContent.getInstructions()); - sessionMap.put(ACTIVITY_TITLE_KEY, mcGeneralAuthoringDTO.getActivityTitle()); - sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, mcGeneralAuthoringDTO.getActivityInstructions()); - mcAuthoringForm.resetUserAction(); return mcContent; } - - /** - * each tool has a signature. MC tool's signature is stored in MY_SIGNATURE. The default tool content id and other - * depending content ids are obtained in this method. if all the default content has been setup properly the method - * persists DEFAULT_CONTENT_ID in the session. - * - * @param request - * @param mapping - * @return ActionForward - */ - private boolean validateDefaultContent(HttpServletRequest request, ActionMapping mapping, IMcService mcService, - McGeneralAuthoringDTO mcGeneralAuthoringDTO, McAuthoringForm mcAuthoringForm) { - /* - * retrieve the default content id based on tool signature - */ - long defaultContentID = 0; - try { - defaultContentID = mcService.getToolDefaultContentIdBySignature(MY_SIGNATURE); - if (defaultContentID == 0) { - // default content id has not been setup - return false; - } - } catch (Exception e) { - logger.debug("error getting the default content id: " + e.getMessage()); - persistError(request, "error.defaultContent.notSetup"); - return false; - } - - try { - McContent mcContent = mcService.getMcContent(new Long(defaultContentID)); - if (mcContent == null) { - logger.debug("Exception occured: No default content"); - persistError(request, "error.defaultContent.notSetup"); - return false; - } - } catch (Exception e) { - logger.debug("Exception occured: No default question content"); - persistError(request, "error.defaultContent.notSetup"); - return false; - } - - return true; - } - - /** - * persists error messages to request scope - * - * @param request - * @param message - */ - public void persistError(HttpServletRequest request, String message) { - ActionMessages errors = new ActionMessages(); - errors.add(Globals.ERROR_KEY, new ActionMessage(message)); - saveErrors(request, errors); - } } Fisheye: Tag 463f7b3dbb88ee41210f7170dc19dc25360cd26f refers to a dead (removed) revision in file `lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/MonitoringUtil.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_lamc/web/WEB-INF/struts-config.xml =================================================================== diff -u -rd82560c4b917240cb90b5d3416f5199cba68fb85 -r463f7b3dbb88ee41210f7170dc19dc25360cd26f --- lams_tool_lamc/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision d82560c4b917240cb90b5d3416f5199cba68fb85) +++ lams_tool_lamc/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 463f7b3dbb88ee41210f7170dc19dc25360cd26f) @@ -6,7 +6,6 @@ - @@ -37,25 +36,11 @@ unknown="false" validate="false" > - - - - - - + /> - - - - - - - @@ -278,7 +244,6 @@ @@ -287,13 +252,7 @@ name="loadMonitoring" path="/monitoring/MonitoringMaincontent.jsp" redirect="false" - /> - - + /> - - + + + -
-
-
\ No newline at end of file