"; + public static final String MAP_QUESTION_CONTENT = "mapQuestionContent"; + public static final String DEFAULT_QUESTION_CONTENT = "defaultQuestionContent"; + public static final String ONLINE_INSTRUCTIONS = "onlineInstructions"; + public static final String OFFLINE_INSTRUCTIONS = "offlineInstructions"; + public static final String END_LEARNING_MESSSAGE = "endLearningMessage"; + public static final String ON = "ON"; + public static final String OFF = "OFF"; + public static final String RICHTEXT_OFFLINEINSTRUCTIONS = "richTextOfflineInstructions"; + public static final String RICHTEXT_ONLINEINSTRUCTIONS = "richTextOnlineInstructions"; + public static final String RICHTEXT_TITLE = "richTextTitle"; + public static final String RICHTEXT_INSTRUCTIONS = "richTextInstructions"; + public static final String RICHTEXT_BLANK = "
"; - public static final String SUBMIT_OFFLINE_FILE ="submitOfflineFile"; - public static final String SUBMIT_ONLINE_FILE ="submitOnlineFile"; - public static final String POPULATED_UPLOADED_FILESDATA ="populateUploadedFilesData"; - public static final String USER_ID = "userID"; - - public final long ONE_DAY =60 * 60 * 1000 * 24; - 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 IS_TOOL_SESSION_CHANGED ="isToolSessionChanged"; - public static final String USER_EXCEPTION_WRONG_FORMAT ="userExceptionWrongFormat"; - public static final String USER_EXCEPTION_UNCOMPATIBLE_IDS ="userExceptionUncompatibleIds"; - 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_CONTENTID_REQUIRED ="userExceptionContentIdRequired"; - public static final String USER_EXCEPTION_TOOLSESSIONID_REQUIRED ="userExceptionToolSessionIdRequired"; - 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_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_CONTENT_IN_USE ="userExceptionContentInUse"; - public static final String USER_EXCEPTION_RUN_OFFLINE ="userExceptionRunOffline"; - public static final String USER_EXCEPTION_MODE_REQUIRED ="userExceptionModeRequired"; - public static final String USER_EXCEPTION_MODE_INVALID ="userExceptionModeInvalid"; - public static final String USER_EXCEPTION_QUESTIONS_DUPLICATE ="userExceptionQuestionsDuplicate"; - public static final String COUNT_SESSION_COMPLETE ="countSessionComplete"; - public static final String CURRENT_MONITORED_TOOL_SESSION ="currentMonitoredToolSession"; - - - public static final String COUNT_ALL_USERS ="countAllUsers"; - public static final String LIST_MONITORED_ANSWERS_CONTAINER_DTO ="listMonitoredAnswersContainerDto"; - public static final String SUMMARY_TOOL_SESSIONS ="summaryToolSessions"; - public static final String SUMMARY_TOOL_SESSIONS_ID ="summaryToolSessionsId"; - public static final String EDIT_ACTIVITY_DTO ="editActivityDTO"; - - public static final String ACTIVITY_TITLE ="activityTitle"; - public static final String ACTIVITY_INSTRUCTIONS ="activityInstructions"; - public static final String IS_USERNAME_VISIBLE ="isUsernameVisible"; - public static final String CURRENT_ANSWER ="currentAnswer"; + public static final String SUBMIT_OFFLINE_FILE = "submitOfflineFile"; + public static final String SUBMIT_ONLINE_FILE = "submitOnlineFile"; + public static final String POPULATED_UPLOADED_FILESDATA = "populateUploadedFilesData"; + public static final String USER_ID = "userID"; - + public final long ONE_DAY = 60 * 60 * 1000 * 24; + + 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 IS_TOOL_SESSION_CHANGED = "isToolSessionChanged"; + public static final String USER_EXCEPTION_WRONG_FORMAT = "userExceptionWrongFormat"; + public static final String USER_EXCEPTION_UNCOMPATIBLE_IDS = "userExceptionUncompatibleIds"; + 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_CONTENTID_REQUIRED = "userExceptionContentIdRequired"; + public static final String USER_EXCEPTION_TOOLSESSIONID_REQUIRED = "userExceptionToolSessionIdRequired"; + 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_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_CONTENT_IN_USE = "userExceptionContentInUse"; + public static final String USER_EXCEPTION_RUN_OFFLINE = "userExceptionRunOffline"; + public static final String USER_EXCEPTION_MODE_REQUIRED = "userExceptionModeRequired"; + public static final String USER_EXCEPTION_MODE_INVALID = "userExceptionModeInvalid"; + public static final String USER_EXCEPTION_QUESTIONS_DUPLICATE = "userExceptionQuestionsDuplicate"; + public static final String COUNT_SESSION_COMPLETE = "countSessionComplete"; + public static final String CURRENT_MONITORED_TOOL_SESSION = "currentMonitoredToolSession"; + + public static final String COUNT_ALL_USERS = "countAllUsers"; + public static final String LIST_MONITORED_ANSWERS_CONTAINER_DTO = "listMonitoredAnswersContainerDto"; + public static final String SUMMARY_TOOL_SESSIONS = "summaryToolSessions"; + public static final String SUMMARY_TOOL_SESSIONS_ID = "summaryToolSessionsId"; + public static final String EDIT_ACTIVITY_DTO = "editActivityDTO"; + + public static final String ACTIVITY_TITLE = "activityTitle"; + public static final String ACTIVITY_INSTRUCTIONS = "activityInstructions"; + public static final String IS_USERNAME_VISIBLE = "isUsernameVisible"; + public static final String CURRENT_ANSWER = "currentAnswer"; + /* * export portfolio constants */ - public static final String MODE ="mode"; - public static final String LEARNER ="learner"; - public static final String TEACHER ="teacher"; - - public static final String PORTFOLIO_REPORT ="portfolioReport"; - public static final String PORTFOLIO_REQUEST ="portfolioRequest"; - public static final int MAX_GROUPS_COUNT =250; - + public static final String MODE = "mode"; + public static final String LEARNER = "learner"; + public static final String TEACHER = "teacher"; + + public static final String PORTFOLIO_REPORT = "portfolioReport"; + public static final String PORTFOLIO_REQUEST = "portfolioRequest"; + public static final int MAX_GROUPS_COUNT = 250; + /* * 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"; - - public static final String OPTION_OFF ="false"; - - //LEARNER mode contants - public static final String MAP_QUESTION_CONTENT_LEARNER ="mapQuestionContentLearner"; - public static final String CURRENT_QUESTION_INDEX ="currentQuestionIndex"; - public static final String TOTAL_QUESTION_COUNT ="totalQuestionCount"; - public static final String MAP_ANSWERS ="mapAnswers"; - public static final String USER_FEEDBACK ="userFeedback"; - public static final String REPORT_TITLE ="reportTitle"; - public static final String MONITORING_REPORT_TITLE ="monitoringReportTitle"; - public static final String REPORT_TITLE_LEARNER ="reportTitleLearner"; - public static final String END_LEARNING_MESSAGE ="endLearningMessage"; - public static final String IS_TOOL_ACTIVITY_OFFLINE ="isToolActivityOffline"; - 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 ="learnerRep"; - public static final String INDIVIDUAL_LEARNER_REPORT ="individualLearnerRep"; - public static final String REQUEST_LEARNING_REPORT ="requestLearningReport"; - public static final String REQUEST_LEARNING_REPORT_PROGRESS ="requestLearningReportProgress"; - public static final String REQUEST_PREVIEW ="requestPreview"; - public static final String REQUEST_LEARNING_REPORT_VIEWONLY ="requestLearningReportViewOnly"; - public static final String REVISITED_LEARNER_REP ="revisitedLearnerRep"; - - + 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"; + + public static final String OPTION_OFF = "false"; + + // LEARNER mode contants + public static final String MAP_QUESTION_CONTENT_LEARNER = "mapQuestionContentLearner"; + public static final String CURRENT_QUESTION_INDEX = "currentQuestionIndex"; + public static final String TOTAL_QUESTION_COUNT = "totalQuestionCount"; + public static final String MAP_ANSWERS = "mapAnswers"; + public static final String USER_FEEDBACK = "userFeedback"; + public static final String REPORT_TITLE = "reportTitle"; + public static final String MONITORING_REPORT_TITLE = "monitoringReportTitle"; + public static final String REPORT_TITLE_LEARNER = "reportTitleLearner"; + public static final String END_LEARNING_MESSAGE = "endLearningMessage"; + public static final String IS_TOOL_ACTIVITY_OFFLINE = "isToolActivityOffline"; + 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 = "learnerRep"; + public static final String INDIVIDUAL_LEARNER_REPORT = "individualLearnerRep"; + public static final String REQUEST_LEARNING_REPORT = "requestLearningReport"; + public static final String REQUEST_LEARNING_REPORT_PROGRESS = "requestLearningReportProgress"; + public static final String REQUEST_PREVIEW = "requestPreview"; + public static final String REQUEST_LEARNING_REPORT_VIEWONLY = "requestLearningReportViewOnly"; + public static final String REVISITED_LEARNER_REP = "revisitedLearnerRep"; + /* * Monitoring Mode constants */ - public static final String EDITACTIVITY_EDITMODE ="editActivityEditMode"; - public static final String RENDER_MONITORING_EDITACTIVITY ="renderMonitoringEditActivity"; - public static final String NO_AVAILABLE_SESSIONS ="noAvailableSessions"; - public static final String NO_TOOL_SESSIONS_AVAILABLE ="noToolSessionAvailable"; - - public static final String TIMEZONE ="timeZone"; - public static final String TIMEZONE_ID ="timeZoneId"; + public static final String EDITACTIVITY_EDITMODE = "editActivityEditMode"; + public static final String RENDER_MONITORING_EDITACTIVITY = "renderMonitoringEditActivity"; + public static final String NO_AVAILABLE_SESSIONS = "noAvailableSessions"; + public static final String NO_TOOL_SESSIONS_AVAILABLE = "noToolSessionAvailable"; + + public static final String TIMEZONE = "timeZone"; + public static final String TIMEZONE_ID = "timeZoneId"; /* * Monitor and Learning common constants - used in jsp reporting */ - - public static final String QUESTION_LISTING_MODE ="questionListingMode"; - public static final String QUESTION_LISTING_MODE_SEQUENTIAL ="questionListingModeSequential"; - public static final String QUESTION_LISTING_MODE_PREVIEW ="questionListingModePreview"; - public static final String QUESTION_LISTING_MODE_COMBINED ="questionListingModeCombined"; - - public static final String FEEDBACK_TYPE_SEQUENTIAL ="You will be presented a total of : "; - public static final String FEEDBACK_TYPE_COMBINED ="You are being presented total of: "; - public static final String QUESTIONS =" questions."; - public static final String ATTACHMENT_LIST ="attachmentList"; - public static final String SUBMIT_SUCCESS ="sbmtSuccess"; - public static final String DELETED_ATTACHMENT_LIST ="deletedAttachmentList"; - public static final String UUID ="uuid"; + public static final String QUESTION_LISTING_MODE = "questionListingMode"; + public static final String QUESTION_LISTING_MODE_SEQUENTIAL = "questionListingModeSequential"; + public static final String QUESTION_LISTING_MODE_PREVIEW = "questionListingModePreview"; + public static final String QUESTION_LISTING_MODE_COMBINED = "questionListingModeCombined"; + + public static final String FEEDBACK_TYPE_SEQUENTIAL = "You will be presented a total of : "; + public static final String FEEDBACK_TYPE_COMBINED = "You are being presented total of: "; + public static final String QUESTIONS = " questions."; + + public static final String ATTACHMENT_LIST = "attachmentList"; + public static final String SUBMIT_SUCCESS = "sbmtSuccess"; + public static final String DELETED_ATTACHMENT_LIST = "deletedAttachmentList"; + public static final String UUID = "uuid"; + // for condition management use + public static final String ATTR_SESSION_MAP_ID = "sessionMapID"; + public static final Object ATTR_CONDITION_SET = "conditionList"; + public static final Object ATTR_QA_AUTHORING_FORM = "QaAuthoringForm"; + public static final String PARAM_ORDER_ID = "orderId"; + public static final String ATTR_DELETED_CONDITION_LIST = "deletedConditionList"; + public static final int QUESTION_CUTOFF_INDEX = 40; + public static final String HTML_TAG_REGEX = "\\<.*?>"; + public static final String TEXT_SEARCH_DEFINITION_NAME = "text.search.output.definition"; + public static final String TEXT_SEARCH_DEFAULT_CONDITION_DISPLAY_NAME_KEY = "text.search.output.definition.default.condition"; } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaCondition.java =================================================================== diff -u --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaCondition.java (revision 0) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaCondition.java (revision 0af4ed13b963a588f3499b080801863d57f8ad95) @@ -0,0 +1,104 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.qa; + +import java.util.Set; +import java.util.SortedSet; +import java.util.TreeSet; + +import org.lamsfoundation.lams.learningdesign.TextSearchCondition; +import org.lamsfoundation.lams.learningdesign.dto.BranchConditionDTO; +import org.lamsfoundation.lams.tool.OutputType; +import org.lamsfoundation.lams.tool.ToolOutput; +import org.lamsfoundation.lams.tool.ToolOutputFormatException; +import org.lamsfoundation.lams.tool.ToolOutputValue; +import org.lamsfoundation.lams.tool.qa.util.QaQueContentComparator; +import org.lamsfoundation.lams.tool.qa.util.QaQuestionContentDTOComparator; + +/** + * A text search condition with a set of questions on answers to which the search should be performed. + * + * @author Marcin Cieslak + * + */ +public class QaCondition extends TextSearchCondition { + /** + * Questions linked to this condition. Answers to them will be scanned for the words that make the condition's + * parameters. + */ + private Set
DTO that holds users attempt history data for jsp purposes + *
+ * DTO that holds users attempt history data for jsp purposes *
* * @author Ozgur Demirtas */ -public class QaQuestionContentDTO implements Comparable -{ +public class QaQuestionContentDTO implements Comparable { private String question; private String displayOrder; private String feedback; - - public String toString() { - return new ToStringBuilder(this) - .append("question:", question) - .append("feedback:", feedback) - .append("displayOrder:", displayOrder) - .toString(); + + @Override + public String toString() { + return new ToStringBuilder(this).append("question:", question).append("feedback:", feedback).append( + "displayOrder:", displayOrder).toString(); } - - public int compareTo(Object o) - { - QaMonitoredUserDTO qaMonitoredUserDTO = (QaMonitoredUserDTO) o; - - if (qaMonitoredUserDTO == null) - return 1; - else - return 0; + + public int compareTo(Object o) { + QaMonitoredUserDTO qaMonitoredUserDTO = (QaMonitoredUserDTO) o; + + if (qaMonitoredUserDTO == null) { + return 1; + } else { + return 0; + } } + /** * @return Returns the displayOrder. */ public String getDisplayOrder() { - return displayOrder; + return displayOrder; } + /** - * @param displayOrder The displayOrder to set. + * @param displayOrder + * The displayOrder to set. */ public void setDisplayOrder(String displayOrder) { - this.displayOrder = displayOrder; + this.displayOrder = displayOrder; } + /** * @return Returns the feedback. */ public String getFeedback() { - return feedback; + return feedback; } + /** - * @param feedback The feedback to set. + * @param feedback + * The feedback to set. */ public void setFeedback(String feedback) { - this.feedback = feedback; + this.feedback = feedback; } + /** * @return Returns the question. */ public String getQuestion() { - return question; + return question; } + /** - * @param question The question to set. + * @param question + * The question to set. */ public void setQuestion(String question) { - this.question = question; + this.question = question; } + + @Override + public boolean equals(Object o) { + if (o instanceof QaQuestionContentDTO) { + QaQuestionContentDTO compare = (QaQuestionContentDTO) o; + return compare.getDisplayOrder().equals(getDisplayOrder()); + } + return false; + } + + @Override + public int hashCode() { + return new Integer(getDisplayOrder()); + } } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dbupdates/patch20080926_updateFrom21.sql =================================================================== diff -u --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dbupdates/patch20080926_updateFrom21.sql (revision 0) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dbupdates/patch20080926_updateFrom21.sql (revision 0af4ed13b963a588f3499b080801863d57f8ad95) @@ -0,0 +1,20 @@ +-- SQL statements to update from LAMS 2.1/2.1.1 +CREATE TABLE tl_laqa11_conditions ( + condition_id BIGINT(20) NOT NULL + , content_uid BIGINT(20) + , PRIMARY KEY (condition_id) + , CONSTRAINT QaConditionInheritance FOREIGN KEY (condition_id) + REFERENCES lams_branch_condition(condition_id) ON DELETE CASCADE ON UPDATE CASCADE + , CONSTRAINT QaConditionToQaContent FOREIGN KEY (content_uid) + REFERENCES tl_laqa11_content(uid) ON DELETE CASCADE ON UPDATE CASCADE +)TYPE=InnoDB; + +CREATE TABLE tl_laqa11_condition_questions ( + condition_id BIGINT(20) + , question_uid BIGINT(20) + , PRIMARY KEY (condition_id,question_uid) + , CONSTRAINT QaConditionQuestionToQaCondition FOREIGN KEY (condition_id) + REFERENCES tl_laqa11_conditions(condition_id) ON DELETE CASCADE ON UPDATE CASCADE + , CONSTRAINT QaConditionQuestionToQaQuestion FOREIGN KEY (question_uid) + REFERENCES tl_laqa11_que_content(uid) ON DELETE CASCADE ON UPDATE CASCADE +)TYPE=InnoDB; \ No newline at end of file Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/qaApplicationContext.xml =================================================================== diff -u -r407ec95b4825be357d61eefa7799b8fbd6a3c1bd -r0af4ed13b963a588f3499b080801863d57f8ad95 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/qaApplicationContext.xml (.../qaApplicationContext.xml) (revision 407ec95b4825be357d61eefa7799b8fbd6a3c1bd) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/qaApplicationContext.xml (.../qaApplicationContext.xml) (revision 0af4ed13b963a588f3499b080801863d57f8ad95) @@ -11,25 +11,38 @@ +Ticket
to login and access the Content Repository.
- *
- * A valid ticket is needed in order to access the content from the
- * repository. This method would be called evertime the tool needs to
- * upload/download files from the content repository.
- *
- * @return ITicket The ticket for repostory access
- * @throws SubmitFilesException
- */
- public ITicket getRepositoryLoginTicket() throws QaApplicationException {
- repositoryService = RepositoryProxy.getRepositoryService();
- logger.debug("retrieved repositoryService : " + repositoryService);
-
- ICredentials credentials = new SimpleCredentials(
- repositoryUser,
- repositoryId);
- try {
- ITicket ticket = repositoryService.login(credentials,
- repositoryWorkspace);
- logger.debug("retrieved ticket: " + ticket);
- return ticket;
- } catch (AccessDeniedException e) {
- throw new QaApplicationException("Access Denied to repository."
- + e.getMessage());
- } catch (WorkspaceNotFoundException e) {
- throw new QaApplicationException("Workspace not found."
- + e.getMessage());
- } catch (LoginException e) {
- throw new QaApplicationException("Login failed." + e.getMessage());
- }
+
+ public List getToolSessionsForContent(QaContent qa) {
+ QaServicePOJO.logger.debug("attempt retrieving listToolSessionIds for : " + qa);
+ List listToolSessionIds = qaSessionDAO.getToolSessionsForContent(qa);
+ return listToolSessionIds;
+ }
+
+ /**
+ * This method verifies the credentials of the SubmitFiles Tool and gives it the Ticket
to login and
+ * access the Content Repository.
+ *
+ * A valid ticket is needed in order to access the content from the repository. This method would be called evertime
+ * the tool needs to upload/download files from the content repository.
+ *
+ * @return ITicket The ticket for repostory access
+ * @throws SubmitFilesException
+ */
+ public ITicket getRepositoryLoginTicket() throws QaApplicationException {
+ repositoryService = RepositoryProxy.getRepositoryService();
+ QaServicePOJO.logger.debug("retrieved repositoryService : " + repositoryService);
+
+ ICredentials credentials = new SimpleCredentials(repositoryUser, repositoryId);
+ try {
+ ITicket ticket = repositoryService.login(credentials, repositoryWorkspace);
+ QaServicePOJO.logger.debug("retrieved ticket: " + ticket);
+ return ticket;
+ } catch (AccessDeniedException e) {
+ throw new QaApplicationException("Access Denied to repository." + e.getMessage());
+ } catch (WorkspaceNotFoundException e) {
+ throw new QaApplicationException("Workspace not found." + e.getMessage());
+ } catch (LoginException e) {
+ throw new QaApplicationException("Login failed." + e.getMessage());
}
-
-
- /**
- * This method deletes the content with the given uuid
and
- * versionID
from the content repository
- *
- * @param uuid
- * The uuid
of the node to be deleted
- * @param versionID
- * The version_id
of the node to be deleted.
- * @throws SubmitFilesException
- */
- public void deleteFromRepository(Long uuid, Long versionID)
- throws QaApplicationException {
- ITicket ticket = getRepositoryLoginTicket();
- logger.debug("retrieved ticket: " + ticket);
- try {
- String files[] = repositoryService.deleteVersion(ticket, uuid,versionID);
- logger.debug("retrieved files: " + files);
- } catch (Exception e) {
- throw new QaApplicationException(
- "Exception occured while deleting files from"
- + " the repository " + e.getMessage());
- }
+ }
+
+ /**
+ * This method deletes the content with the given uuid
and versionID
from the content
+ * repository
+ *
+ * @param uuid
+ * The uuid
of the node to be deleted
+ * @param versionID
+ * The version_id
of the node to be deleted.
+ * @throws SubmitFilesException
+ */
+ public void deleteFromRepository(Long uuid, Long versionID) throws QaApplicationException {
+ ITicket ticket = getRepositoryLoginTicket();
+ QaServicePOJO.logger.debug("retrieved ticket: " + ticket);
+ try {
+ String files[] = repositoryService.deleteVersion(ticket, uuid, versionID);
+ QaServicePOJO.logger.debug("retrieved files: " + files);
+ } catch (Exception e) {
+ throw new QaApplicationException("Exception occured while deleting files from" + " the repository "
+ + e.getMessage());
}
-
-
- public InputStream downloadFile(Long uuid, Long versionID)throws QaApplicationException{
- ITicket ticket = getRepositoryLoginTicket();
- try{
- IVersionedNode node = repositoryService.getFileItem(ticket,uuid,null);
- logger.debug("retrieved node: " + node);
- return node.getFile();
- }catch(AccessDeniedException e){
- throw new QaApplicationException("AccessDeniedException occured while trying to download file " + e.getMessage());
- }catch(FileException e){
- throw new QaApplicationException("FileException occured while trying to download file " + e.getMessage());
- }catch(ItemNotFoundException e){
- throw new QaApplicationException("ItemNotFoundException occured while trying to download file " + e.getMessage());
- }
+ }
+
+ public InputStream downloadFile(Long uuid, Long versionID) throws QaApplicationException {
+ ITicket ticket = getRepositoryLoginTicket();
+ try {
+ IVersionedNode node = repositoryService.getFileItem(ticket, uuid, null);
+ QaServicePOJO.logger.debug("retrieved node: " + node);
+ return node.getFile();
+ } catch (AccessDeniedException e) {
+ throw new QaApplicationException("AccessDeniedException occured while trying to download file "
+ + e.getMessage());
+ } catch (FileException e) {
+ throw new QaApplicationException("FileException occured while trying to download file " + e.getMessage());
+ } catch (ItemNotFoundException e) {
+ throw new QaApplicationException("ItemNotFoundException occured while trying to download file "
+ + e.getMessage());
}
-
- /**
- * adds a new entry to the uploaded files table
- */
- public void persistFile(String uuid, boolean isOnlineFile, String fileName, QaContent qaContent) throws QaApplicationException {
- logger.debug("attempt persisting file to the db: " + uuid + " " + isOnlineFile + " " + fileName + " " + qaContent);
- QaUploadedFile qaUploadedFile= new QaUploadedFile(uuid, isOnlineFile, fileName, qaContent);
- logger.debug("created qaUploadedFile: " + qaUploadedFile);
- qaUploadedFileDAO.saveUploadFile(qaUploadedFile);
- logger.debug("persisted qaUploadedFile: " + qaUploadedFile);
- }
-
-
+ }
+
/**
* adds a new entry to the uploaded files table
*/
+ public void persistFile(String uuid, boolean isOnlineFile, String fileName, QaContent qaContent)
+ throws QaApplicationException {
+ QaServicePOJO.logger.debug("attempt persisting file to the db: " + uuid + " " + isOnlineFile + " " + fileName
+ + " " + qaContent);
+ QaUploadedFile qaUploadedFile = new QaUploadedFile(uuid, isOnlineFile, fileName, qaContent);
+ QaServicePOJO.logger.debug("created qaUploadedFile: " + qaUploadedFile);
+ qaUploadedFileDAO.saveUploadFile(qaUploadedFile);
+ QaServicePOJO.logger.debug("persisted qaUploadedFile: " + qaUploadedFile);
+ }
+
+ /**
+ * adds a new entry to the uploaded files table
+ */
public void persistFile(QaContent content, QaUploadedFile file) throws QaApplicationException {
- logger.debug("in persistFile: " + file);
- content.getQaUploadedFiles().add(file);
- file.setQaContent(content);
- qaDAO.saveOrUpdateQa(content);
- logger.debug("persisted qaUploadedFile: " + file);
+ QaServicePOJO.logger.debug("in persistFile: " + file);
+ content.getQaUploadedFiles().add(file);
+ file.setQaContent(content);
+ qaDAO.saveOrUpdateQa(content);
+ QaServicePOJO.logger.debug("persisted qaUploadedFile: " + file);
}
-
-
+
/**
* removes an entry from the uploaded files table
*/
public void removeFile(Long submissionId) throws QaApplicationException {
- qaUploadedFileDAO.removeUploadFile(submissionId);
- logger.debug("removed qaUploadedFile: " + submissionId);
+ qaUploadedFileDAO.removeUploadFile(submissionId);
+ QaServicePOJO.logger.debug("removed qaUploadedFile: " + submissionId);
}
-
- /**
- * removes all the entries in the uploaded files table
- */
- public void cleanUploadedFilesMetaData() throws QaApplicationException {
- logger.debug("attempt cleaning up uploaded file meta data table from the db");
- qaUploadedFileDAO.cleanUploadedFilesMetaData();
- logger.debug("files meta data has been cleaned up");
- }
-
-
- public Long createNotebookEntry(Long id, Integer idType, String signature,
- Integer userID, String entry) {
- logger.debug("coreNotebookService: " + coreNotebookService);
- return coreNotebookService.createNotebookEntry(id, idType, signature, userID, "", entry);
- }
-
-
-
+ /**
+ * removes all the entries in the uploaded files table
+ */
+ public void cleanUploadedFilesMetaData() throws QaApplicationException {
+ QaServicePOJO.logger.debug("attempt cleaning up uploaded file meta data table from the db");
+ qaUploadedFileDAO.cleanUploadedFilesMetaData();
+ QaServicePOJO.logger.debug("files meta data has been cleaned up");
+ }
- public NotebookEntry getEntry(Long id, Integer idType, String signature,
- Integer userID) {
-
- ListQaCondition
. Only the order ID is compared.
+ *
+ * @author Marcin Cieslak
+ * @see org.lamsfoundation.lams.tool.qa.QaCondition
+ */
+public class QaConditionComparator implements ComparatorQaQueContent
. Only the display order is compared.
+ *
+ * @author Marcin Cieslak
+ */
+public class QaQueContentComparator implements ComparatorQaQuestionContentDTO
. Only the display order is compared.
+ *
+ * @author Marcin Cieslak
+ */
+public class QaQuestionContentDTOComparator implements ComparatorAction class that controls the logic of tool behavior.
+ *+ * Action class that controls the logic of tool behavior. + *
* - *Note that Struts action class only has the responsibility to navigate - * page flow. All database operation should go to service layer and data - * transformation from domain model to struts form bean should go to form - * bean class. This ensure clean and maintainable code. + *
+ * Note that Struts action class only has the responsibility to navigate page flow. All database operation should go to + * service layer and data transformation from domain model to struts form bean should go to form bean class. This ensure + * clean and maintainable code. *
* - *SystemException
is thrown whenever an known error condition is
- * identified. No system exception error handling code should appear in the
- * Struts action class as all of them are handled in
+ * SystemException
is thrown whenever an known error condition is identified. No system exception error
+ * handling code should appear in the Struts action class as all of them are handled in
* CustomStrutsExceptionHandler.
*
* @author Ozgur Demirtas
*
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
-
-
+
- *
+
+
+
+
+
+
+
+
+
+
+ *
*/
-public class QaAction extends LamsDispatchAction implements QaAppConstants
-{
+public class QaAction extends LamsDispatchAction implements QaAppConstants {
static Logger logger = Logger.getLogger(QaAction.class.getName());
-
+
private QaToolContentHandler toolContentHandler;
-
- /**
- * Struts dispatch method.
+
+ /**
+ *
+ * Struts dispatch method.
+ *
*
- * It is assuming that progress engine should pass in the tool access
- * mode and the tool session id as http parameters.
+ *
+ * It is assuming that progress engine should pass in the tool access mode and the tool session id as http
+ * parameters.
+ *
*
- * @param mapping An ActionMapping class that will be used by the Action class to tell
- * the ActionServlet where to send the end-user.
- *
- * @param form The ActionForm class that will contain any data submitted
- * by the end-user via a form.
- * @param request A standard Servlet HttpServletRequest class.
- * @param response A standard Servlet HttpServletResponse class.
- * @return An ActionForward class that will be returned to the ActionServlet indicating where
- * the user is to go next.
+ * @param mapping
+ * An ActionMapping class that will be used by the Action class to tell the ActionServlet where to
+ * send the end-user.
+ *
+ * @param form
+ * The ActionForm class that will contain any data submitted by the end-user via a form.
+ * @param request
+ * A standard Servlet HttpServletRequest class.
+ * @param response
+ * A standard Servlet HttpServletResponse class.
+ * @return An ActionForward class that will be returned to the ActionServlet indicating where the user is to go
+ * next.
* @throws IOException
* @throws ServletException
- * @throws QaApplicationException the known runtime exception
+ * @throws QaApplicationException
+ * the known runtime exception
*
*/
- public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
- return (mapping.findForward(LOAD_QUESTIONS));
+ @Override
+ public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+ return mapping.findForward(QaAppConstants.LOAD_QUESTIONS);
}
-
+
/**
- * submits content into the tool database
- * ActionForward submitAllContent(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException
+ * submits content into the tool database ActionForward submitAllContent(ActionMapping mapping, ActionForm form,
+ * HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
*
* @param mapping
* @param form
@@ -190,239 +200,230 @@
* @throws IOException
* @throws ServletException
*/
- public ActionForward submitAllContent(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException {
-
- logger.debug("dispathcing submitAllContent :" +form);
-
- QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
+ public ActionForward submitAllContent(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
- IQaService qaService =QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
-
- String httpSessionID=qaAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
-
- SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
+ QaAction.logger.debug("dispathcing submitAllContent :" + form);
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaAuthoringForm.setContentFolderID(contentFolderID);
+ QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
- String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaAction.logger.debug("qaService: " + qaService);
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
+ String httpSessionID = qaAuthoringForm.getHttpSessionID();
+ QaAction.logger.debug("httpSessionID: " + httpSessionID);
- String defaultContentIdStr=request.getParameter(DEFAULT_CONTENT_ID_STR);
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
- List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
-
- Map mapQuestionContent=AuthoringUtil.extractMapQuestionContent(listQuestionContentDTO);
- logger.debug("extracted mapQuestionContent: " + mapQuestionContent);
-
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
+ QaAction.logger.debug("sessionMap: " + sessionMap);
- Map mapFeedback=AuthoringUtil.extractMapFeedback(listQuestionContentDTO);
- logger.debug("extracted mapFeedback: " + mapFeedback);
+ SortedSet conditionSet = (SortedSet) sessionMap
+ .get(QaAppConstants.ATTR_CONDITION_SET);
- ActionMessages errors = new ActionMessages();
- logger.debug("mapQuestionContent size: " + mapQuestionContent.size());
-
- if (mapQuestionContent.size() == 0)
- {
- ActionMessage error = new ActionMessage("questions.none.submitted");
- errors.add(ActionMessages.GLOBAL_MESSAGE, error);
- }
- logger.debug("errors: " + errors);
-
- AuthoringUtil authoringUtil= new AuthoringUtil();
-
- QaGeneralAuthoringDTO qaGeneralAuthoringDTO= new QaGeneralAuthoringDTO();
-
- logger.debug("activeModule: " + activeModule);
- if (activeModule.equals(AUTHORING))
- {
- List attachmentListBackup= new ArrayList();
- List attachmentList=(List)sessionMap.get(ATTACHMENT_LIST_KEY);
- logger.debug("attachmentList: " + attachmentList);
- attachmentListBackup=attachmentList;
-
- List deletedAttachmentListBackup= new ArrayList();
- List deletedAttachmentList=(List)sessionMap.get(DELETED_ATTACHMENT_LIST_KEY);
- logger.debug("deletedAttachmentList: " + deletedAttachmentList);
- deletedAttachmentListBackup=deletedAttachmentList;
-
- String onlineInstructions=(String)sessionMap.get(ONLINE_INSTRUCTIONS_KEY);
- logger.debug("onlineInstructions: " + onlineInstructions);
- qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaAuthoringForm.setContentFolderID(contentFolderID);
- String offlineInstructions=(String)sessionMap.get(OFFLINE_INSTRUCTIONS_KEY);
- logger.debug("offlineInstructions: " + offlineInstructions);
- qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
+ String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE);
+ QaAction.logger.debug("activeModule: " + activeModule);
- qaGeneralAuthoringDTO.setAttachmentList(attachmentList);
- qaGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList);
-
- String strOnlineInstructions= request.getParameter("onlineInstructions");
- String strOfflineInstructions= request.getParameter("offlineInstructions");
- logger.debug("onlineInstructions: " + strOnlineInstructions);
- logger.debug("offlineInstructions: " + strOfflineInstructions);
- qaAuthoringForm.setOfflineInstructions(strOfflineInstructions);
- qaAuthoringForm.setOnlineInstructions(strOnlineInstructions);
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaAction.logger.debug("strToolContentID: " + strToolContentID);
- }
-
-
- qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
-
- String richTextTitle = request.getParameter(TITLE);
- String richTextInstructions = request.getParameter(INSTRUCTIONS);
-
- logger.debug("richTextTitle: " + richTextTitle);
- logger.debug("richTextInstructions: " + richTextInstructions);
-
- qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
- qaAuthoringForm.setTitle(richTextTitle);
-
- qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
-
- sessionMap.put(ACTIVITY_TITLE_KEY, richTextTitle);
- sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
-
- qaGeneralAuthoringDTO.setMapQuestionContent(mapQuestionContent);
- logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
-
- logger.debug("qaGeneralAuthoringDTO now: " + qaGeneralAuthoringDTO);
- request.setAttribute(QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
-
- logger.debug("there are no issues with input, continue and submit data");
+ String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR);
+ QaAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
- QaContent qaContentTest=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("qaContentTest: " + qaContentTest);
+ List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
+ QaAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
- logger.debug("errors: " + errors);
- if(!errors.isEmpty()){
- saveErrors(request, errors);
- logger.debug("errors saved: " + errors);
+ Map mapQuestionContent = AuthoringUtil.extractMapQuestionContent(listQuestionContentDTO);
+ QaAction.logger.debug("extracted mapQuestionContent: " + mapQuestionContent);
+
+ Map mapFeedback = AuthoringUtil.extractMapFeedback(listQuestionContentDTO);
+ QaAction.logger.debug("extracted mapFeedback: " + mapFeedback);
+
+ ActionMessages errors = new ActionMessages();
+ QaAction.logger.debug("mapQuestionContent size: " + mapQuestionContent.size());
+
+ if (mapQuestionContent.size() == 0) {
+ ActionMessage error = new ActionMessage("questions.none.submitted");
+ errors.add(ActionMessages.GLOBAL_MESSAGE, error);
+ }
+ QaAction.logger.debug("errors: " + errors);
+
+ AuthoringUtil authoringUtil = new AuthoringUtil();
+
+ QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO();
+
+ QaAction.logger.debug("activeModule: " + activeModule);
+ if (activeModule.equals(QaAppConstants.AUTHORING)) {
+ List attachmentListBackup = new ArrayList();
+ List attachmentList = (List) sessionMap.get(QaAppConstants.ATTACHMENT_LIST_KEY);
+ QaAction.logger.debug("attachmentList: " + attachmentList);
+ attachmentListBackup = attachmentList;
+
+ List deletedAttachmentListBackup = new ArrayList();
+ List deletedAttachmentList = (List) sessionMap.get(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY);
+ QaAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
+ deletedAttachmentListBackup = deletedAttachmentList;
+
+ String onlineInstructions = (String) sessionMap.get(QaAppConstants.ONLINE_INSTRUCTIONS_KEY);
+ QaAction.logger.debug("onlineInstructions: " + onlineInstructions);
+ qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
+
+ String offlineInstructions = (String) sessionMap.get(QaAppConstants.OFFLINE_INSTRUCTIONS_KEY);
+ QaAction.logger.debug("offlineInstructions: " + offlineInstructions);
+ qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
+
+ qaGeneralAuthoringDTO.setAttachmentList(attachmentList);
+ qaGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList);
+
+ String strOnlineInstructions = request.getParameter("onlineInstructions");
+ String strOfflineInstructions = request.getParameter("offlineInstructions");
+ QaAction.logger.debug("onlineInstructions: " + strOnlineInstructions);
+ QaAction.logger.debug("offlineInstructions: " + strOfflineInstructions);
+ qaAuthoringForm.setOfflineInstructions(strOfflineInstructions);
+ qaAuthoringForm.setOnlineInstructions(strOnlineInstructions);
+
+ }
+
+ qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
+
+ String richTextTitle = request.getParameter(QaAppConstants.TITLE);
+ String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS);
+
+ QaAction.logger.debug("richTextTitle: " + richTextTitle);
+ QaAction.logger.debug("richTextInstructions: " + richTextInstructions);
+
+ qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
+ qaAuthoringForm.setTitle(richTextTitle);
+
+ qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
+
+ sessionMap.put(QaAppConstants.ACTIVITY_TITLE_KEY, richTextTitle);
+ sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
+
+ qaGeneralAuthoringDTO.setMapQuestionContent(mapQuestionContent);
+ QaAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+
+ QaAction.logger.debug("qaGeneralAuthoringDTO now: " + qaGeneralAuthoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+
+ QaAction.logger.debug("there are no issues with input, continue and submit data");
+
+ QaContent qaContentTest = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaAction.logger.debug("qaContentTest: " + qaContentTest);
+
+ QaAction.logger.debug("errors: " + errors);
+ if (!errors.isEmpty()) {
+ saveErrors(request, errors);
+ QaAction.logger.debug("errors saved: " + errors);
+ }
+
+ QaContent qaContent = qaContentTest;
+ if (errors.isEmpty()) {
+ QaAction.logger.debug("errors is empty: " + errors);
+ /*
+ * to remove deleted entries in the questions table based on mapQuestionContent
+ */
+ authoringUtil.removeRedundantQuestions(mapQuestionContent, qaService, qaAuthoringForm, request,
+ strToolContentID);
+ QaAction.logger.debug("end of removing unused entries... ");
+
+ qaContent = authoringUtil.saveOrUpdateQaContent(mapQuestionContent, mapFeedback, qaService,
+ qaAuthoringForm, request, qaContentTest, strToolContentID, conditionSet);
+ QaAction.logger.debug("qaContent: " + qaContent);
+
+ long defaultContentID = 0;
+ QaAction.logger.debug("attempt retrieving tool with signatute : " + QaAppConstants.MY_SIGNATURE);
+ defaultContentID = qaService.getToolDefaultContentIdBySignature(QaAppConstants.MY_SIGNATURE);
+ QaAction.logger.debug("retrieved tool default contentId: " + defaultContentID);
+
+ if (qaContent != null) {
+ qaGeneralAuthoringDTO.setDefaultContentIdStr(new Long(defaultContentID).toString());
+ }
+ QaAction.logger.debug("updated qaGeneralAuthoringDTO to: " + qaGeneralAuthoringDTO);
+
+ authoringUtil.reOrganizeDisplayOrder(mapQuestionContent, qaService, qaAuthoringForm, qaContent);
+
+ QaAction.logger.debug("activeModule: " + activeModule);
+ if (activeModule.equals(QaAppConstants.AUTHORING)) {
+
+ List attachmentList = (List) sessionMap.get(QaAppConstants.ATTACHMENT_LIST_KEY);
+ QaAction.logger.debug("attachmentList: " + attachmentList);
+
+ List deletedAttachmentList = (List) sessionMap.get(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY);
+
+ List attachments = saveAttachments(qaContent, attachmentList, deletedAttachmentList, mapping, request);
+ QaAction.logger.debug("attachments: " + attachments);
+ }
+
+ QaAction.logger.debug("strToolContentID: " + strToolContentID);
+ QaUtils.setDefineLater(request, false, strToolContentID, qaService);
+ QaAction.logger.debug("define later set to false");
+
+ QaUtils.setFormProperties(request, qaService, qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID,
+ defaultContentIdStr, activeModule, sessionMap, httpSessionID);
+
+ if (activeModule.equals(QaAppConstants.AUTHORING)) {
+ QaAction.logger.debug("standard authoring close");
+ request.setAttribute(AuthoringConstants.LAMS_AUTHORING_SUCCESS_FLAG, Boolean.TRUE);
+ qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
+ } else {
+ QaAction.logger.debug("go back to view only screen");
+ qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(false).toString());
+ }
+
+ } else {
+ QaAction.logger.debug("errors is not empty: " + errors);
+
+ if (qaContent != null) {
+ long defaultContentID = 0;
+ QaAction.logger.debug("attempt retrieving tool with signatute : " + QaAppConstants.MY_SIGNATURE);
+ defaultContentID = qaService.getToolDefaultContentIdBySignature(QaAppConstants.MY_SIGNATURE);
+ QaAction.logger.debug("retrieved tool default contentId: " + defaultContentID);
+
+ if (qaContent != null) {
+ qaGeneralAuthoringDTO.setDefaultContentIdStr(new Long(defaultContentID).toString());
}
-
- QaContent qaContent=qaContentTest;
- if(errors.isEmpty()){
- logger.debug("errors is empty: " + errors);
- /*to remove deleted entries in the questions table based on mapQuestionContent */
- authoringUtil.removeRedundantQuestions(mapQuestionContent, qaService, qaAuthoringForm, request, strToolContentID);
- logger.debug("end of removing unused entries... ");
+ QaUtils.setFormProperties(request, qaService, qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID,
+ defaultContentIdStr, activeModule, sessionMap, httpSessionID);
- qaContent=authoringUtil.saveOrUpdateQaContent(mapQuestionContent, mapFeedback, qaService, qaAuthoringForm, request, qaContentTest, strToolContentID);
- logger.debug("qaContent: " + qaContent);
-
-
- long defaultContentID=0;
- logger.debug("attempt retrieving tool with signatute : " + MY_SIGNATURE);
- defaultContentID=qaService.getToolDefaultContentIdBySignature(MY_SIGNATURE);
- logger.debug("retrieved tool default contentId: " + defaultContentID);
-
- if (qaContent != null)
- {
- qaGeneralAuthoringDTO.setDefaultContentIdStr(new Long(defaultContentID).toString());
- }
- logger.debug("updated qaGeneralAuthoringDTO to: " + qaGeneralAuthoringDTO);
-
- authoringUtil.reOrganizeDisplayOrder(mapQuestionContent, qaService, qaAuthoringForm, qaContent);
+ }
+ }
- logger.debug("activeModule: " + activeModule);
- if (activeModule.equals(AUTHORING))
- {
+ qaGeneralAuthoringDTO.setSbmtSuccess(new Integer(1).toString());
- List attachmentList=(List)sessionMap.get(ATTACHMENT_LIST_KEY);
- logger.debug("attachmentList: " + attachmentList);
+ qaAuthoringForm.resetUserAction();
+ qaGeneralAuthoringDTO.setMapQuestionContent(mapQuestionContent);
- List deletedAttachmentList=(List)sessionMap.get(DELETED_ATTACHMENT_LIST_KEY);
+ QaAction.logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
- List attachments=saveAttachments(qaContent, attachmentList, deletedAttachmentList, mapping, request);
- logger.debug("attachments: " + attachments);
- }
-
- logger.debug("strToolContentID: " + strToolContentID);
- QaUtils.setDefineLater(request, false, strToolContentID, qaService);
- logger.debug("define later set to false");
-
- QaUtils.setFormProperties(request, qaService,
- qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID, defaultContentIdStr, activeModule, sessionMap, httpSessionID);
+ request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
+ sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
+ request.getSession().setAttribute(httpSessionID, sessionMap);
- if (activeModule.equals(AUTHORING))
- {
- logger.debug("standard authoring close");
- request.setAttribute(AuthoringConstants.LAMS_AUTHORING_SUCCESS_FLAG,Boolean.TRUE);
- qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
- }
- else
- {
- logger.debug("go back to view only screen");
- qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(false).toString());
- }
-
- }
- else
- {
- logger.debug("errors is not empty: " + errors);
-
- if (qaContent != null)
- {
- long defaultContentID=0;
- logger.debug("attempt retrieving tool with signatute : " + MY_SIGNATURE);
- defaultContentID=qaService.getToolDefaultContentIdBySignature(MY_SIGNATURE);
- logger.debug("retrieved tool default contentId: " + defaultContentID);
-
- if (qaContent != null)
- {
- qaGeneralAuthoringDTO.setDefaultContentIdStr(new Long(defaultContentID).toString());
- }
+ request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
- QaUtils.setFormProperties(request, qaService,
- qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID, defaultContentIdStr, activeModule, sessionMap, httpSessionID);
-
- }
- }
-
+ qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
+ qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
+ qaGeneralAuthoringDTO.setActiveModule(activeModule);
+ qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
- qaGeneralAuthoringDTO.setSbmtSuccess(new Integer(1).toString());
-
- qaAuthoringForm.resetUserAction();
- qaGeneralAuthoringDTO.setMapQuestionContent(mapQuestionContent);
-
- logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- request.setAttribute(QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+ qaAuthoringForm.setToolContentID(strToolContentID);
+ qaAuthoringForm.setHttpSessionID(httpSessionID);
+ qaAuthoringForm.setActiveModule(activeModule);
+ qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
+ qaAuthoringForm.setCurrentTab("1");
- request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
- sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
- request.getSession().setAttribute(httpSessionID, sessionMap);
-
- request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
-
- qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
- qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
- qaGeneralAuthoringDTO.setActiveModule(activeModule);
- qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
-
- qaAuthoringForm.setToolContentID(strToolContentID);
- qaAuthoringForm.setHttpSessionID(httpSessionID);
- qaAuthoringForm.setActiveModule(activeModule);
- qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
- qaAuthoringForm.setCurrentTab("1");
-
- logger.debug("forwarding to :" + LOAD_QUESTIONS);
- return mapping.findForward(LOAD_QUESTIONS);
+ QaAction.logger.debug("forwarding to :" + QaAppConstants.LOAD_QUESTIONS);
+ return mapping.findForward(QaAppConstants.LOAD_QUESTIONS);
}
-
/**
* saveSingleQuestion
+ *
* @param mapping
* @param form
* @param request
@@ -431,251 +432,224 @@
* @throws IOException
* @throws ServletException
*/
- public ActionForward saveSingleQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException {
-
- logger.debug("dispathcing saveSingleQuestion");
- QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
-
- IQaService qaService =QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
-
- String httpSessionID=qaAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
-
- SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaAuthoringForm.setContentFolderID(contentFolderID);
-
-
- String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
-
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
- String defaultContentIdStr=request.getParameter(DEFAULT_CONTENT_ID_STR);
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
- String editQuestionBoxRequest=request.getParameter("editQuestionBoxRequest");
- logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
-
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("qaContent: " + qaContent);
-
- /*
- if (qaContent == null)
- {
- logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
- qaContent=qaService.loadQa(new Long(defaultContentIdStr).longValue());
+ public ActionForward saveSingleQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+
+ QaAction.logger.debug("dispathcing saveSingleQuestion");
+ QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
+
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaAction.logger.debug("qaService: " + qaService);
+
+ String httpSessionID = qaAuthoringForm.getHttpSessionID();
+ QaAction.logger.debug("httpSessionID: " + httpSessionID);
+
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
+ QaAction.logger.debug("sessionMap: " + sessionMap);
+
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaAuthoringForm.setContentFolderID(contentFolderID);
+
+ String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE);
+ QaAction.logger.debug("activeModule: " + activeModule);
+
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaAction.logger.debug("strToolContentID: " + strToolContentID);
+
+ String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR);
+ QaAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
+
+ String editQuestionBoxRequest = request.getParameter("editQuestionBoxRequest");
+ QaAction.logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
+
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaAction.logger.debug("qaContent: " + qaContent);
+
+ /*
+ * if (qaContent == null) { logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
+ * qaContent=qaService.loadQa(new Long(defaultContentIdStr).longValue()); }
+ */
+
+ QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO();
+
+ QaAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
+
+ qaGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString());
+
+ AuthoringUtil authoringUtil = new AuthoringUtil();
+
+ List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
+ QaAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
+
+ String newQuestion = request.getParameter("newQuestion");
+ QaAction.logger.debug("newQuestion: " + newQuestion);
+
+ String feedback = request.getParameter("feedback");
+ QaAction.logger.debug("feedback: " + feedback);
+
+ String editableQuestionIndex = request.getParameter("editableQuestionIndex");
+ QaAction.logger.debug("editableQuestionIndex: " + editableQuestionIndex);
+
+ if (newQuestion != null && newQuestion.length() > 0) {
+ if (editQuestionBoxRequest != null && editQuestionBoxRequest.equals("false")) {
+ QaAction.logger.debug("request for add and save");
+ boolean duplicates = AuthoringUtil.checkDuplicateQuestions(listQuestionContentDTO, newQuestion);
+ QaAction.logger.debug("duplicates: " + duplicates);
+
+ if (!duplicates) {
+ QaQuestionContentDTO qaQuestionContentDTO = null;
+ Iterator listIterator = listQuestionContentDTO.iterator();
+ while (listIterator.hasNext()) {
+ qaQuestionContentDTO = (QaQuestionContentDTO) listIterator.next();
+ QaAction.logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO);
+ QaAction.logger.debug("qaQuestionContentDTO question:" + qaQuestionContentDTO.getQuestion());
+
+ String question = qaQuestionContentDTO.getQuestion();
+ String displayOrder = qaQuestionContentDTO.getDisplayOrder();
+ QaAction.logger.debug("displayOrder:" + displayOrder);
+
+ if (displayOrder != null && !displayOrder.equals("")) {
+ if (displayOrder.equals(editableQuestionIndex)) {
+ break;
+ }
+
+ }
+ }
+ QaAction.logger.debug("qaQuestionContentDTO found:" + qaQuestionContentDTO);
+
+ qaQuestionContentDTO.setQuestion(newQuestion);
+ qaQuestionContentDTO.setFeedback(feedback);
+ qaQuestionContentDTO.setDisplayOrder(editableQuestionIndex);
+
+ listQuestionContentDTO = AuthoringUtil.reorderUpdateListQuestionContentDTO(listQuestionContentDTO,
+ qaQuestionContentDTO, editableQuestionIndex);
+ QaAction.logger.debug("post reorderUpdateListQuestionContentDTO listQuestionContentDTO: "
+ + listQuestionContentDTO);
+ } else {
+ QaAction.logger.debug("duplicate question entry, not adding");
}
- */
-
- QaGeneralAuthoringDTO qaGeneralAuthoringDTO= new QaGeneralAuthoringDTO();
-
- logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
-
- qaGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString());
-
- AuthoringUtil authoringUtil= new AuthoringUtil();
-
- List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
-
-
- String newQuestion=request.getParameter("newQuestion");
- logger.debug("newQuestion: " + newQuestion);
-
- String feedback=request.getParameter("feedback");
- logger.debug("feedback: " + feedback);
+ } else {
+ QaAction.logger.debug("request for edit and save.");
+ QaQuestionContentDTO qaQuestionContentDTO = null;
+ Iterator listIterator = listQuestionContentDTO.iterator();
+ while (listIterator.hasNext()) {
+ qaQuestionContentDTO = (QaQuestionContentDTO) listIterator.next();
+ QaAction.logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO);
+ QaAction.logger.debug("qaQuestionContentDTO question:" + qaQuestionContentDTO.getQuestion());
-
- String editableQuestionIndex=request.getParameter("editableQuestionIndex");
- logger.debug("editableQuestionIndex: " + editableQuestionIndex);
-
+ String question = qaQuestionContentDTO.getQuestion();
+ String displayOrder = qaQuestionContentDTO.getDisplayOrder();
+ QaAction.logger.debug("displayOrder:" + displayOrder);
- if ((newQuestion != null) && (newQuestion.length() > 0))
- {
- if ((editQuestionBoxRequest != null) && (editQuestionBoxRequest.equals("false")))
- {
- logger.debug("request for add and save");
- boolean duplicates=AuthoringUtil.checkDuplicateQuestions(listQuestionContentDTO, newQuestion);
- logger.debug("duplicates: " + duplicates);
-
- if (!duplicates)
- {
- QaQuestionContentDTO qaQuestionContentDTO= null;
- Iterator listIterator=listQuestionContentDTO.iterator();
- while (listIterator.hasNext())
- {
- qaQuestionContentDTO= (QaQuestionContentDTO)listIterator.next();
- logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO);
- logger.debug("qaQuestionContentDTO question:" + qaQuestionContentDTO.getQuestion());
-
- String question=qaQuestionContentDTO.getQuestion();
- String displayOrder=qaQuestionContentDTO.getDisplayOrder();
- logger.debug("displayOrder:" + displayOrder);
-
- if ((displayOrder != null) && (!displayOrder.equals("")))
- {
- if (displayOrder.equals(editableQuestionIndex))
- {
- break;
- }
-
- }
- }
- logger.debug("qaQuestionContentDTO found:" + qaQuestionContentDTO);
-
- qaQuestionContentDTO.setQuestion(newQuestion);
- qaQuestionContentDTO.setFeedback(feedback);
- qaQuestionContentDTO.setDisplayOrder(editableQuestionIndex);
-
- listQuestionContentDTO=AuthoringUtil.reorderUpdateListQuestionContentDTO(listQuestionContentDTO, qaQuestionContentDTO, editableQuestionIndex);
- logger.debug("post reorderUpdateListQuestionContentDTO listQuestionContentDTO: " + listQuestionContentDTO);
- }
- else
- {
- logger.debug("duplicate question entry, not adding");
- }
- }
- else
- {
- logger.debug("request for edit and save.");
- QaQuestionContentDTO qaQuestionContentDTO= null;
- Iterator listIterator=listQuestionContentDTO.iterator();
- while (listIterator.hasNext())
- {
- qaQuestionContentDTO= (QaQuestionContentDTO)listIterator.next();
- logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO);
- logger.debug("qaQuestionContentDTO question:" + qaQuestionContentDTO.getQuestion());
-
- String question=qaQuestionContentDTO.getQuestion();
- String displayOrder=qaQuestionContentDTO.getDisplayOrder();
- logger.debug("displayOrder:" + displayOrder);
-
- if ((displayOrder != null) && (!displayOrder.equals("")))
- {
- if (displayOrder.equals(editableQuestionIndex))
- {
- break;
- }
-
- }
- }
- logger.debug("qaQuestionContentDTO found:" + qaQuestionContentDTO);
-
- qaQuestionContentDTO.setQuestion(newQuestion);
- qaQuestionContentDTO.setFeedback(feedback);
- qaQuestionContentDTO.setDisplayOrder(editableQuestionIndex);
-
- listQuestionContentDTO=AuthoringUtil.reorderUpdateListQuestionContentDTO(listQuestionContentDTO, qaQuestionContentDTO, editableQuestionIndex);
- logger.debug("post reorderUpdateListQuestionContentDTO listQuestionContentDTO: " + listQuestionContentDTO);
- }
- }
- else
- {
- logger.debug("entry blank, not adding");
- }
-
-
-
+ if (displayOrder != null && !displayOrder.equals("")) {
+ if (displayOrder.equals(editableQuestionIndex)) {
+ break;
+ }
- request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
- sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
- logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
-
-
- String richTextTitle = request.getParameter(TITLE);
- String richTextInstructions = request.getParameter(INSTRUCTIONS);
-
- logger.debug("richTextTitle: " + richTextTitle);
- logger.debug("richTextInstructions: " + richTextInstructions);
- qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
- qaAuthoringForm.setTitle(richTextTitle);
-
- qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
-
- sessionMap.put(ACTIVITY_TITLE_KEY, richTextTitle);
- sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
-
-
- logger.debug("activeModule: " + activeModule);
- if (activeModule.equals(AUTHORING))
- {
- String onlineInstructions=(String)sessionMap.get(ONLINE_INSTRUCTIONS_KEY);
- logger.debug("onlineInstructions: " + onlineInstructions);
- qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
-
- String offlineInstructions=(String)sessionMap.get(OFFLINE_INSTRUCTIONS_KEY);
- logger.debug("offlineInstructions: " + offlineInstructions);
- qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
-
- List attachmentList=(List)sessionMap.get(ATTACHMENT_LIST_KEY);
- logger.debug("attachmentList: " + attachmentList);
-
- List deletedAttachmentList=(List)sessionMap.get(DELETED_ATTACHMENT_LIST_KEY);
- logger.debug("deletedAttachmentList: " + deletedAttachmentList);
-
- qaGeneralAuthoringDTO.setAttachmentList(attachmentList);
- qaGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList);
-
- String strOnlineInstructions= request.getParameter("onlineInstructions");
- String strOfflineInstructions= request.getParameter("offlineInstructions");
- logger.debug("onlineInstructions: " + strOnlineInstructions);
- logger.debug("offlineInstructions: " + strOfflineInstructions);
- qaAuthoringForm.setOnlineInstructions(strOnlineInstructions);
- qaAuthoringForm.setOfflineInstructions(strOfflineInstructions);
+ }
+ }
+ QaAction.logger.debug("qaQuestionContentDTO found:" + qaQuestionContentDTO);
+ qaQuestionContentDTO.setQuestion(newQuestion);
+ qaQuestionContentDTO.setFeedback(feedback);
+ qaQuestionContentDTO.setDisplayOrder(editableQuestionIndex);
+
+ listQuestionContentDTO = AuthoringUtil.reorderUpdateListQuestionContentDTO(listQuestionContentDTO,
+ qaQuestionContentDTO, editableQuestionIndex);
+ QaAction.logger.debug("post reorderUpdateListQuestionContentDTO listQuestionContentDTO: "
+ + listQuestionContentDTO);
}
-
-
- qaGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString());
-
- request.getSession().setAttribute(httpSessionID, sessionMap);
- sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
-
- QaUtils.setFormProperties(request, qaService,
- qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID, defaultContentIdStr, activeModule, sessionMap, httpSessionID);
-
-
- qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
- qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
- qaGeneralAuthoringDTO.setActiveModule(activeModule);
- qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
-
- qaAuthoringForm.setToolContentID(strToolContentID);
- qaAuthoringForm.setHttpSessionID(httpSessionID);
- qaAuthoringForm.setActiveModule(activeModule);
- qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
- qaAuthoringForm.setCurrentTab("1");
-
- qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
-
- logger.debug("qaGeneralAuthoringDTO now: " + qaGeneralAuthoringDTO);
- request.setAttribute(QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
-
- logger.debug("httpSessionID: " + httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
- request.getSession().setAttribute(httpSessionID, sessionMap);
- logger.debug("qaGeneralAuthoringDTO.getMapQuestionContent(); " + qaGeneralAuthoringDTO.getMapQuestionContent());
-
- request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
-
-
- logger.debug("fwd ing to LOAD_QUESTIONS: " + LOAD_QUESTIONS);
- return (mapping.findForward(LOAD_QUESTIONS));
+ } else {
+ QaAction.logger.debug("entry blank, not adding");
}
-
-
+ request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
+ sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
+ QaAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
+
+ String richTextTitle = request.getParameter(QaAppConstants.TITLE);
+ String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS);
+
+ QaAction.logger.debug("richTextTitle: " + richTextTitle);
+ QaAction.logger.debug("richTextInstructions: " + richTextInstructions);
+ qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
+ qaAuthoringForm.setTitle(richTextTitle);
+
+ qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
+
+ sessionMap.put(QaAppConstants.ACTIVITY_TITLE_KEY, richTextTitle);
+ sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
+
+ QaAction.logger.debug("activeModule: " + activeModule);
+ if (activeModule.equals(QaAppConstants.AUTHORING)) {
+ String onlineInstructions = (String) sessionMap.get(QaAppConstants.ONLINE_INSTRUCTIONS_KEY);
+ QaAction.logger.debug("onlineInstructions: " + onlineInstructions);
+ qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
+
+ String offlineInstructions = (String) sessionMap.get(QaAppConstants.OFFLINE_INSTRUCTIONS_KEY);
+ QaAction.logger.debug("offlineInstructions: " + offlineInstructions);
+ qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
+
+ List attachmentList = (List) sessionMap.get(QaAppConstants.ATTACHMENT_LIST_KEY);
+ QaAction.logger.debug("attachmentList: " + attachmentList);
+
+ List deletedAttachmentList = (List) sessionMap.get(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY);
+ QaAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
+
+ qaGeneralAuthoringDTO.setAttachmentList(attachmentList);
+ qaGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList);
+
+ String strOnlineInstructions = request.getParameter("onlineInstructions");
+ String strOfflineInstructions = request.getParameter("offlineInstructions");
+ QaAction.logger.debug("onlineInstructions: " + strOnlineInstructions);
+ QaAction.logger.debug("offlineInstructions: " + strOfflineInstructions);
+ qaAuthoringForm.setOnlineInstructions(strOnlineInstructions);
+ qaAuthoringForm.setOfflineInstructions(strOfflineInstructions);
+
+ }
+
+ qaGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString());
+
+ request.getSession().setAttribute(httpSessionID, sessionMap);
+ sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
+
+ QaUtils.setFormProperties(request, qaService, qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID,
+ defaultContentIdStr, activeModule, sessionMap, httpSessionID);
+
+ qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
+ qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
+ qaGeneralAuthoringDTO.setActiveModule(activeModule);
+ qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
+
+ qaAuthoringForm.setToolContentID(strToolContentID);
+ qaAuthoringForm.setHttpSessionID(httpSessionID);
+ qaAuthoringForm.setActiveModule(activeModule);
+ qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
+ qaAuthoringForm.setCurrentTab("1");
+
+ qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
+
+ QaAction.logger.debug("qaGeneralAuthoringDTO now: " + qaGeneralAuthoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+
+ QaAction.logger.debug("httpSessionID: " + httpSessionID);
+ QaAction.logger.debug("sessionMap: " + sessionMap);
+
+ request.getSession().setAttribute(httpSessionID, sessionMap);
+ QaAction.logger.debug("qaGeneralAuthoringDTO.getMapQuestionContent(); "
+ + qaGeneralAuthoringDTO.getMapQuestionContent());
+
+ request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
+
+ QaAction.logger.debug("fwd ing to LOAD_QUESTIONS: " + QaAppConstants.LOAD_QUESTIONS);
+ return mapping.findForward(QaAppConstants.LOAD_QUESTIONS);
+ }
+
/**
* addSingleQuestion
+ *
* @param mapping
* @param form
* @param request
@@ -684,193 +658,173 @@
* @throws IOException
* @throws ServletException
*/
- public ActionForward addSingleQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException {
-
- logger.debug("dispathcing addSingleQuestion");
- QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
-
- IQaService qaService =QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
-
- String httpSessionID=qaAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
-
- SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaAuthoringForm.setContentFolderID(contentFolderID);
-
-
- String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
-
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
- String defaultContentIdStr=request.getParameter(DEFAULT_CONTENT_ID_STR);
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("qaContent: " + qaContent);
+ public ActionForward addSingleQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+
+ QaAction.logger.debug("dispathcing addSingleQuestion");
+ QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
+
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaAction.logger.debug("qaService: " + qaService);
+
+ String httpSessionID = qaAuthoringForm.getHttpSessionID();
+ QaAction.logger.debug("httpSessionID: " + httpSessionID);
+
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
+ QaAction.logger.debug("sessionMap: " + sessionMap);
+
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaAuthoringForm.setContentFolderID(contentFolderID);
+
+ String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE);
+ QaAction.logger.debug("activeModule: " + activeModule);
+
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaAction.logger.debug("strToolContentID: " + strToolContentID);
+
+ String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR);
+ QaAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
+
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaAction.logger.debug("qaContent: " + qaContent);
+ /*
+ * if (qaContent == null) { logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
+ * qaContent=qaService.loadQa(new Long(defaultContentIdStr).longValue()); } logger.debug("final qaContent: " +
+ * qaContent);
+ */
+
+ QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO();
+ QaAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
+
+ qaGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString());
+
+ AuthoringUtil authoringUtil = new AuthoringUtil();
+
+ List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
+ QaAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
+
+ String newQuestion = request.getParameter("newQuestion");
+ QaAction.logger.debug("newQuestion: " + newQuestion);
+
+ String feedback = request.getParameter("feedback");
+ QaAction.logger.debug("feedback: " + feedback);
+
+ int listSize = listQuestionContentDTO.size();
+ QaAction.logger.debug("listSize: " + listSize);
+
+ if (newQuestion != null && newQuestion.length() > 0) {
+ boolean duplicates = AuthoringUtil.checkDuplicateQuestions(listQuestionContentDTO, newQuestion);
+ QaAction.logger.debug("duplicates: " + duplicates);
+
+ if (!duplicates) {
+ QaQuestionContentDTO qaQuestionContentDTO = new QaQuestionContentDTO();
+ qaQuestionContentDTO.setDisplayOrder(new Long(listSize + 1).toString());
+ qaQuestionContentDTO.setFeedback(feedback);
+ qaQuestionContentDTO.setQuestion(newQuestion);
+
+ listQuestionContentDTO.add(qaQuestionContentDTO);
+ QaAction.logger.debug("updated listQuestionContentDTO: " + listQuestionContentDTO);
+ } else {
+ QaAction.logger.debug("entry duplicate, not adding");
/*
- if (qaContent == null)
- {
- logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
- qaContent=qaService.loadQa(new Long(defaultContentIdStr).longValue());
- }
- logger.debug("final qaContent: " + qaContent);
- */
-
- QaGeneralAuthoringDTO qaGeneralAuthoringDTO= new QaGeneralAuthoringDTO();
- logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
-
- qaGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString());
-
- AuthoringUtil authoringUtil= new AuthoringUtil();
-
- List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
-
- String newQuestion=request.getParameter("newQuestion");
- logger.debug("newQuestion: " + newQuestion);
-
- String feedback=request.getParameter("feedback");
- logger.debug("feedback: " + feedback);
-
-
- int listSize=listQuestionContentDTO.size();
- logger.debug("listSize: " + listSize);
-
- if ((newQuestion != null) && (newQuestion.length() > 0))
- {
- boolean duplicates=AuthoringUtil.checkDuplicateQuestions(listQuestionContentDTO, newQuestion);
- logger.debug("duplicates: " + duplicates);
-
- if (!duplicates)
- {
- QaQuestionContentDTO qaQuestionContentDTO=new QaQuestionContentDTO();
- qaQuestionContentDTO.setDisplayOrder(new Long(listSize+1).toString());
- qaQuestionContentDTO.setFeedback(feedback);
- qaQuestionContentDTO.setQuestion(newQuestion);
-
- listQuestionContentDTO.add(qaQuestionContentDTO);
- logger.debug("updated listQuestionContentDTO: " + listQuestionContentDTO);
- }
- else
- {
- logger.debug("entry duplicate, not adding");
- /*
- ActionMessages errors = new ActionMessages();
- ActionMessage error = new ActionMessage("question.duplicate");
- errors.add(ActionMessages.GLOBAL_MESSAGE, error);
- saveErrors(request, errors);
- logger.debug("errors saved: " + errors);
- */
- }
+ * ActionMessages errors = new ActionMessages(); ActionMessage error = new
+ * ActionMessage("question.duplicate"); errors.add(ActionMessages.GLOBAL_MESSAGE, error);
+ * saveErrors(request, errors); logger.debug("errors saved: " + errors);
+ */
}
- else
- {
- logger.debug("entry blank, not adding");
- /*
- ActionMessages errors = new ActionMessages();
- ActionMessage error = new ActionMessage("question.blank");
- errors.add(ActionMessages.GLOBAL_MESSAGE, error);
- saveErrors(request, errors);
- logger.debug("errors saved: " + errors);
- */
- }
-
-
- request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
- sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
+ } else {
+ QaAction.logger.debug("entry blank, not adding");
+ /*
+ * ActionMessages errors = new ActionMessages(); ActionMessage error = new ActionMessage("question.blank");
+ * errors.add(ActionMessages.GLOBAL_MESSAGE, error); saveErrors(request, errors); logger.debug("errors
+ * saved: " + errors);
+ */
+ }
-
- String richTextTitle = request.getParameter(TITLE);
- String richTextInstructions = request.getParameter(INSTRUCTIONS);
-
- logger.debug("richTextTitle: " + richTextTitle);
- logger.debug("richTextInstructions: " + richTextInstructions);
- qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
- qaAuthoringForm.setTitle(richTextTitle);
-
- qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
-
- sessionMap.put(ACTIVITY_TITLE_KEY, richTextTitle);
- sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
-
- logger.debug("activeModule: " + activeModule);
- if (activeModule.equals(AUTHORING))
- {
- String onlineInstructions=(String)sessionMap.get(ONLINE_INSTRUCTIONS_KEY);
- logger.debug("onlineInstructions: " + onlineInstructions);
- qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
-
- String offlineInstructions=(String)sessionMap.get(OFFLINE_INSTRUCTIONS_KEY);
- logger.debug("offlineInstructions: " + offlineInstructions);
- qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
-
- List attachmentList=(List)sessionMap.get(ATTACHMENT_LIST_KEY);
- logger.debug("attachmentList: " + attachmentList);
-
- List deletedAttachmentList=(List)sessionMap.get(DELETED_ATTACHMENT_LIST_KEY);
- logger.debug("deletedAttachmentList: " + deletedAttachmentList);
-
- qaGeneralAuthoringDTO.setAttachmentList(attachmentList);
- qaGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList);
-
- String strOnlineInstructions= request.getParameter("onlineInstructions");
- String strOfflineInstructions= request.getParameter("offlineInstructions");
- logger.debug("onlineInstructions: " + strOnlineInstructions);
- logger.debug("offlineInstructions: " + strOfflineInstructions);
- qaAuthoringForm.setOnlineInstructions(strOnlineInstructions);
- qaAuthoringForm.setOfflineInstructions(strOfflineInstructions);
- }
+ request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
+ sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
-
- qaGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString());
- request.getSession().setAttribute(httpSessionID, sessionMap);
-
- QaUtils.setFormProperties(request, qaService,
- qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID, defaultContentIdStr, activeModule, sessionMap, httpSessionID);
-
-
- qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
- qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
- qaGeneralAuthoringDTO.setActiveModule(activeModule);
- qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
-
- qaAuthoringForm.setToolContentID(strToolContentID);
- qaAuthoringForm.setHttpSessionID(httpSessionID);
- qaAuthoringForm.setActiveModule(activeModule);
- qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
- qaAuthoringForm.setCurrentTab("1");
-
- qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
-
- logger.debug("qaGeneralAuthoringDTO now: " + qaGeneralAuthoringDTO);
- request.setAttribute(QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
-
- logger.debug("httpSessionID: " + httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
- request.getSession().setAttribute(httpSessionID, sessionMap);
+ String richTextTitle = request.getParameter(QaAppConstants.TITLE);
+ String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS);
- logger.debug("qaGeneralAuthoringDTO.getMapQuestionContent(); " + qaGeneralAuthoringDTO.getMapQuestionContent());
-
- request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
-
+ QaAction.logger.debug("richTextTitle: " + richTextTitle);
+ QaAction.logger.debug("richTextInstructions: " + richTextInstructions);
+ qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
+ qaAuthoringForm.setTitle(richTextTitle);
- logger.debug("fwd ing to LOAD_QUESTIONS: " + LOAD_QUESTIONS);
- return (mapping.findForward(LOAD_QUESTIONS));
+ qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
+
+ sessionMap.put(QaAppConstants.ACTIVITY_TITLE_KEY, richTextTitle);
+ sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
+
+ QaAction.logger.debug("activeModule: " + activeModule);
+ if (activeModule.equals(QaAppConstants.AUTHORING)) {
+ String onlineInstructions = (String) sessionMap.get(QaAppConstants.ONLINE_INSTRUCTIONS_KEY);
+ QaAction.logger.debug("onlineInstructions: " + onlineInstructions);
+ qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
+
+ String offlineInstructions = (String) sessionMap.get(QaAppConstants.OFFLINE_INSTRUCTIONS_KEY);
+ QaAction.logger.debug("offlineInstructions: " + offlineInstructions);
+ qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
+
+ List attachmentList = (List) sessionMap.get(QaAppConstants.ATTACHMENT_LIST_KEY);
+ QaAction.logger.debug("attachmentList: " + attachmentList);
+
+ List deletedAttachmentList = (List) sessionMap.get(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY);
+ QaAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
+
+ qaGeneralAuthoringDTO.setAttachmentList(attachmentList);
+ qaGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList);
+
+ String strOnlineInstructions = request.getParameter("onlineInstructions");
+ String strOfflineInstructions = request.getParameter("offlineInstructions");
+ QaAction.logger.debug("onlineInstructions: " + strOnlineInstructions);
+ QaAction.logger.debug("offlineInstructions: " + strOfflineInstructions);
+ qaAuthoringForm.setOnlineInstructions(strOnlineInstructions);
+ qaAuthoringForm.setOfflineInstructions(strOfflineInstructions);
}
-
+
+ qaGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString());
+ request.getSession().setAttribute(httpSessionID, sessionMap);
+
+ QaUtils.setFormProperties(request, qaService, qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID,
+ defaultContentIdStr, activeModule, sessionMap, httpSessionID);
+
+ qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
+ qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
+ qaGeneralAuthoringDTO.setActiveModule(activeModule);
+ qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
+
+ qaAuthoringForm.setToolContentID(strToolContentID);
+ qaAuthoringForm.setHttpSessionID(httpSessionID);
+ qaAuthoringForm.setActiveModule(activeModule);
+ qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
+ qaAuthoringForm.setCurrentTab("1");
+
+ qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
+
+ QaAction.logger.debug("qaGeneralAuthoringDTO now: " + qaGeneralAuthoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+
+ QaAction.logger.debug("httpSessionID: " + httpSessionID);
+ QaAction.logger.debug("sessionMap: " + sessionMap);
+
+ request.getSession().setAttribute(httpSessionID, sessionMap);
+
+ QaAction.logger.debug("qaGeneralAuthoringDTO.getMapQuestionContent(); "
+ + qaGeneralAuthoringDTO.getMapQuestionContent());
+
+ request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
+
+ QaAction.logger.debug("fwd ing to LOAD_QUESTIONS: " + QaAppConstants.LOAD_QUESTIONS);
+ return mapping.findForward(QaAppConstants.LOAD_QUESTIONS);
+ }
+
/**
- * opens up an new screen within the current page for adding a new question
- * newQuestionBox
+ * opens up an new screen within the current page for adding a new question newQuestionBox
+ *
* @param mapping
* @param form
* @param request
@@ -879,97 +833,86 @@
* @throws IOException
* @throws ServletException
*/
- public ActionForward newQuestionBox(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException
- {
- logger.debug("dispathcing newQuestionBox");
- QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
-
- IQaService qaService =QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
-
- String httpSessionID=qaAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
-
- SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaAuthoringForm.setContentFolderID(contentFolderID);
+ public ActionForward newQuestionBox(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaAction.logger.debug("dispathcing newQuestionBox");
+ QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaAction.logger.debug("qaService: " + qaService);
- String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
+ String httpSessionID = qaAuthoringForm.getHttpSessionID();
+ QaAction.logger.debug("httpSessionID: " + httpSessionID);
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
- String defaultContentIdStr=request.getParameter(DEFAULT_CONTENT_ID_STR);
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("qaContent: " + qaContent);
-
- /*
- if (qaContent == null)
- {
- logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
- qaContent=qaService.loadQa(new Long(defaultContentIdStr).longValue());
- }
- logger.debug("final qaContent: " + qaContent);
- */
-
- QaGeneralAuthoringDTO qaGeneralAuthoringDTO= new QaGeneralAuthoringDTO();
- logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
+ QaAction.logger.debug("sessionMap: " + sessionMap);
- String richTextTitle = request.getParameter(TITLE);
- String richTextInstructions = request.getParameter(INSTRUCTIONS);
-
- logger.debug("richTextTitle: " + richTextTitle);
- logger.debug("richTextInstructions: " + richTextInstructions);
- qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
- qaAuthoringForm.setTitle(richTextTitle);
-
- qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
-
-
- QaUtils.setFormProperties(request, qaService,
- qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID, defaultContentIdStr, activeModule, sessionMap, httpSessionID);
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaAuthoringForm.setContentFolderID(contentFolderID);
-
- logger.debug("activeModule: " + activeModule);
- if (activeModule.equals(AUTHORING))
- {
- String strOnlineInstructions= request.getParameter("onlineInstructions");
- String strOfflineInstructions= request.getParameter("offlineInstructions");
- logger.debug("onlineInstructions: " + strOnlineInstructions);
- logger.debug("offlineInstructions: " + strOnlineInstructions);
- qaAuthoringForm.setOnlineInstructions(strOnlineInstructions);
- qaAuthoringForm.setOfflineInstructions(strOfflineInstructions);
- }
+ String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE);
+ QaAction.logger.debug("activeModule: " + activeModule);
-
- qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
-
- logger.debug("qaGeneralAuthoringDTO now: " + qaGeneralAuthoringDTO);
- request.setAttribute(QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaAction.logger.debug("strToolContentID: " + strToolContentID);
-
- List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
+ String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR);
+ QaAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
- request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
-
- logger.debug("fwd ing to newQuestionBox: ");
- return (mapping.findForward("newQuestionBox"));
- }
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaAction.logger.debug("qaContent: " + qaContent);
+ /*
+ * if (qaContent == null) { logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
+ * qaContent=qaService.loadQa(new Long(defaultContentIdStr).longValue()); } logger.debug("final qaContent: " +
+ * qaContent);
+ */
+ QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO();
+ QaAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
+
+ String richTextTitle = request.getParameter(QaAppConstants.TITLE);
+ String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS);
+
+ QaAction.logger.debug("richTextTitle: " + richTextTitle);
+ QaAction.logger.debug("richTextInstructions: " + richTextInstructions);
+ qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
+ qaAuthoringForm.setTitle(richTextTitle);
+
+ qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
+
+ QaUtils.setFormProperties(request, qaService, qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID,
+ defaultContentIdStr, activeModule, sessionMap, httpSessionID);
+
+ QaAction.logger.debug("activeModule: " + activeModule);
+ if (activeModule.equals(QaAppConstants.AUTHORING)) {
+ String strOnlineInstructions = request.getParameter("onlineInstructions");
+ String strOfflineInstructions = request.getParameter("offlineInstructions");
+ QaAction.logger.debug("onlineInstructions: " + strOnlineInstructions);
+ QaAction.logger.debug("offlineInstructions: " + strOnlineInstructions);
+ qaAuthoringForm.setOnlineInstructions(strOnlineInstructions);
+ qaAuthoringForm.setOfflineInstructions(strOfflineInstructions);
+ }
+
+ qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
+
+ QaAction.logger.debug("qaGeneralAuthoringDTO now: " + qaGeneralAuthoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+
+ List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
+ QaAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
+
+ request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
+
+ QaAction.logger.debug("fwd ing to newQuestionBox: ");
+ return mapping.findForward("newQuestionBox");
+ }
+
/**
- * opens up an new screen within the current page for editing a question
- * newEditableQuestionBox
+ * opens up an new screen within the current page for editing a question newEditableQuestionBox
+ *
* @param mapping
* @param form
* @param request
@@ -978,125 +921,112 @@
* @throws IOException
* @throws ServletException
*/
- public ActionForward newEditableQuestionBox(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException
- {
- logger.debug("dispathcing newEditableQuestionBox");
- QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
-
- IQaService qaService =QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
-
- String httpSessionID=qaAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
-
- SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
+ public ActionForward newEditableQuestionBox(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaAction.logger.debug("dispathcing newEditableQuestionBox");
+ QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
-
- String questionIndex=request.getParameter("questionIndex");
- logger.debug("questionIndex: " + questionIndex);
-
- qaAuthoringForm.setEditableQuestionIndex(questionIndex);
-
- List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaAction.logger.debug("qaService: " + qaService);
- String editableQuestion="";
- String editableFeedback="";
- Iterator listIterator=listQuestionContentDTO.iterator();
- while (listIterator.hasNext())
- {
- QaQuestionContentDTO qaQuestionContentDTO= (QaQuestionContentDTO)listIterator.next();
- logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO);
- logger.debug("qaQuestionContentDTO question:" + qaQuestionContentDTO.getQuestion());
- String question=qaQuestionContentDTO.getQuestion();
- String displayOrder=qaQuestionContentDTO.getDisplayOrder();
-
- if ((displayOrder != null) && (!displayOrder.equals("")))
- {
- if (displayOrder.equals(questionIndex))
- {
- editableFeedback=qaQuestionContentDTO.getFeedback();
- editableQuestion=qaQuestionContentDTO.getQuestion();
- logger.debug("editableFeedback found :" + editableFeedback);
- break;
- }
-
- }
- }
- logger.debug("editableFeedback found :" + editableFeedback);
- logger.debug("editableQuestion found :" + editableQuestion);
+ String httpSessionID = qaAuthoringForm.getHttpSessionID();
+ QaAction.logger.debug("httpSessionID: " + httpSessionID);
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaAuthoringForm.setContentFolderID(contentFolderID);
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
+ QaAction.logger.debug("sessionMap: " + sessionMap);
+ String questionIndex = request.getParameter("questionIndex");
+ QaAction.logger.debug("questionIndex: " + questionIndex);
- String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
+ qaAuthoringForm.setEditableQuestionIndex(questionIndex);
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
- String defaultContentIdStr=request.getParameter(DEFAULT_CONTENT_ID_STR);
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("qaContent: " + qaContent);
-
+ List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
+ QaAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
- QaGeneralAuthoringDTO qaGeneralAuthoringDTO= new QaGeneralAuthoringDTO();
- logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
+ String editableQuestion = "";
+ String editableFeedback = "";
+ Iterator listIterator = listQuestionContentDTO.iterator();
+ while (listIterator.hasNext()) {
+ QaQuestionContentDTO qaQuestionContentDTO = (QaQuestionContentDTO) listIterator.next();
+ QaAction.logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO);
+ QaAction.logger.debug("qaQuestionContentDTO question:" + qaQuestionContentDTO.getQuestion());
+ String question = qaQuestionContentDTO.getQuestion();
+ String displayOrder = qaQuestionContentDTO.getDisplayOrder();
-
- String richTextTitle = request.getParameter(TITLE);
- String richTextInstructions = request.getParameter(INSTRUCTIONS);
-
- logger.debug("richTextTitle: " + richTextTitle);
- logger.debug("richTextInstructions: " + richTextInstructions);
- qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
- qaAuthoringForm.setTitle(richTextTitle);
-
- qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
-
- QaUtils.setFormProperties(request, qaService,
- qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID, defaultContentIdStr, activeModule, sessionMap, httpSessionID);
-
- qaGeneralAuthoringDTO.setEditableQuestionText(editableQuestion);
- qaGeneralAuthoringDTO.setEditableQuestionFeedback (editableFeedback);
- qaAuthoringForm.setFeedback(editableFeedback);
+ if (displayOrder != null && !displayOrder.equals("")) {
+ if (displayOrder.equals(questionIndex)) {
+ editableFeedback = qaQuestionContentDTO.getFeedback();
+ editableQuestion = qaQuestionContentDTO.getQuestion();
+ QaAction.logger.debug("editableFeedback found :" + editableFeedback);
+ break;
+ }
- qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
-
- logger.debug("qaGeneralAuthoringDTO now: " + qaGeneralAuthoringDTO);
- request.setAttribute(QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
-
- request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
-
- logger.debug("activeModule: " + activeModule);
- if (activeModule.equals(AUTHORING))
- {
- String strOnlineInstructions= request.getParameter("onlineInstructions");
- String strOfflineInstructions= request.getParameter("offlineInstructions");
- logger.debug("onlineInstructions: " + strOnlineInstructions);
- logger.debug("offlineInstructions: " + strOnlineInstructions);
- qaAuthoringForm.setOnlineInstructions(strOnlineInstructions);
- qaAuthoringForm.setOfflineInstructions(strOfflineInstructions);
}
-
- logger.debug("fwd ing to editQuestionBox: ");
- return (mapping.findForward("editQuestionBox"));
+ }
+ QaAction.logger.debug("editableFeedback found :" + editableFeedback);
+ QaAction.logger.debug("editableQuestion found :" + editableQuestion);
+
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaAuthoringForm.setContentFolderID(contentFolderID);
+
+ String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE);
+ QaAction.logger.debug("activeModule: " + activeModule);
+
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaAction.logger.debug("strToolContentID: " + strToolContentID);
+
+ String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR);
+ QaAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
+
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaAction.logger.debug("qaContent: " + qaContent);
+
+ QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO();
+ QaAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
+
+ String richTextTitle = request.getParameter(QaAppConstants.TITLE);
+ String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS);
+
+ QaAction.logger.debug("richTextTitle: " + richTextTitle);
+ QaAction.logger.debug("richTextInstructions: " + richTextInstructions);
+ qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
+ qaAuthoringForm.setTitle(richTextTitle);
+
+ qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
+
+ QaUtils.setFormProperties(request, qaService, qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID,
+ defaultContentIdStr, activeModule, sessionMap, httpSessionID);
+
+ qaGeneralAuthoringDTO.setEditableQuestionText(editableQuestion);
+ qaGeneralAuthoringDTO.setEditableQuestionFeedback(editableFeedback);
+ qaAuthoringForm.setFeedback(editableFeedback);
+
+ qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
+
+ QaAction.logger.debug("qaGeneralAuthoringDTO now: " + qaGeneralAuthoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+
+ request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
+
+ QaAction.logger.debug("activeModule: " + activeModule);
+ if (activeModule.equals(QaAppConstants.AUTHORING)) {
+ String strOnlineInstructions = request.getParameter("onlineInstructions");
+ String strOfflineInstructions = request.getParameter("offlineInstructions");
+ QaAction.logger.debug("onlineInstructions: " + strOnlineInstructions);
+ QaAction.logger.debug("offlineInstructions: " + strOnlineInstructions);
+ qaAuthoringForm.setOnlineInstructions(strOnlineInstructions);
+ qaAuthoringForm.setOfflineInstructions(strOfflineInstructions);
+ }
+
+ QaAction.logger.debug("fwd ing to editQuestionBox: ");
+ return mapping.findForward("editQuestionBox");
}
-
-
/**
- * removes a question from the questions map
- * ActionForward removeQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException
+ * removes a question from the questions map ActionForward removeQuestion(ActionMapping mapping, ActionForm form,
+ * HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
*
* @param mapping
* @param form
@@ -1106,172 +1036,173 @@
* @throws IOException
* @throws ServletException
*/
- public ActionForward removeQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException {
- logger.debug("dispatching removeQuestion");
- QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
-
- IQaService qaService =QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
+ public ActionForward removeQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaAction.logger.debug("dispatching removeQuestion");
+ QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
- String httpSessionID=qaAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
-
- SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
- String questionIndex=request.getParameter("questionIndex");
- logger.debug("questionIndex: " + questionIndex);
-
-
- List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaAction.logger.debug("qaService: " + qaService);
- QaQuestionContentDTO qaQuestionContentDTO= null;
- Iterator listIterator=listQuestionContentDTO.iterator();
- while (listIterator.hasNext())
- {
- qaQuestionContentDTO= (QaQuestionContentDTO)listIterator.next();
- logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO);
- logger.debug("qaQuestionContentDTO question:" + qaQuestionContentDTO.getQuestion());
-
- String question=qaQuestionContentDTO.getQuestion();
- String displayOrder=qaQuestionContentDTO.getDisplayOrder();
- logger.debug("displayOrder:" + displayOrder);
-
- if ((displayOrder != null) && (!displayOrder.equals("")))
- {
- if (displayOrder.equals(questionIndex))
- {
- break;
- }
-
- }
- }
-
- logger.debug("qaQuestionContentDTO found:" + qaQuestionContentDTO);
- qaQuestionContentDTO.setQuestion("");
- logger.debug("listQuestionContentDTO after remove:" + listQuestionContentDTO);
-
-
- listQuestionContentDTO=AuthoringUtil.reorderListQuestionContentDTO(listQuestionContentDTO, questionIndex );
- logger.debug("listQuestionContentDTO reordered:" + listQuestionContentDTO);
-
+ String httpSessionID = qaAuthoringForm.getHttpSessionID();
+ QaAction.logger.debug("httpSessionID: " + httpSessionID);
- sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaAuthoringForm.setContentFolderID(contentFolderID);
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
+ QaAction.logger.debug("sessionMap: " + sessionMap);
-
- String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
+ String questionIndex = request.getParameter("questionIndex");
+ QaAction.logger.debug("questionIndex: " + questionIndex);
- String richTextTitle = request.getParameter(TITLE);
- logger.debug("richTextTitle: " + richTextTitle);
-
- String richTextInstructions = request.getParameter(INSTRUCTIONS);
- logger.debug("richTextInstructions: " + richTextInstructions);
-
-
- sessionMap.put(ACTIVITY_TITLE_KEY, richTextTitle);
- sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
+ List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
+ QaAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
+ QaQuestionContentDTO qaQuestionContentDTO = null;
+ Iterator listIterator = listQuestionContentDTO.iterator();
+ while (listIterator.hasNext()) {
+ qaQuestionContentDTO = (QaQuestionContentDTO) listIterator.next();
+ QaAction.logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO);
+ QaAction.logger.debug("qaQuestionContentDTO question:" + qaQuestionContentDTO.getQuestion());
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
- String defaultContentIdStr=request.getParameter(DEFAULT_CONTENT_ID_STR);
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("qaContent: " + qaContent);
-
- if (qaContent == null)
- {
- logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
- qaContent=qaService.loadQa(new Long(defaultContentIdStr).longValue());
+ String question = qaQuestionContentDTO.getQuestion();
+ String displayOrder = qaQuestionContentDTO.getDisplayOrder();
+ QaAction.logger.debug("displayOrder:" + displayOrder);
+
+ if (displayOrder != null && !displayOrder.equals("")) {
+ if (displayOrder.equals(questionIndex)) {
+ break;
}
- logger.debug("final qaContent: " + qaContent);
- QaGeneralAuthoringDTO qaGeneralAuthoringDTO= new QaGeneralAuthoringDTO();
- logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
-
- qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
- qaAuthoringForm.setTitle(richTextTitle);
-
- qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
+ }
+ }
- logger.debug("activeModule: " + activeModule);
- if (activeModule.equals(AUTHORING))
- {
- String onlineInstructions=(String)sessionMap.get(ONLINE_INSTRUCTIONS_KEY);
- logger.debug("onlineInstructions: " + onlineInstructions);
- qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
+ QaAction.logger.debug("qaQuestionContentDTO found:" + qaQuestionContentDTO);
+ qaQuestionContentDTO.setQuestion("");
- String offlineInstructions=(String)sessionMap.get(OFFLINE_INSTRUCTIONS_KEY);
- logger.debug("offlineInstructions: " + offlineInstructions);
- qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
-
-
- List attachmentList=(List)sessionMap.get(ATTACHMENT_LIST_KEY);
- logger.debug("attachmentList: " + attachmentList);
- List deletedAttachmentList=(List)sessionMap.get(DELETED_ATTACHMENT_LIST_KEY);
- logger.debug("deletedAttachmentList: " + deletedAttachmentList);
+ SortedSet list = (SortedSet) sessionMap.get(QaAppConstants.ATTR_CONDITION_SET);
+ Iterator conditionIter = list.iterator();
- qaGeneralAuthoringDTO.setAttachmentList(attachmentList);
- qaGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList);
-
- String strOnlineInstructions= request.getParameter("onlineInstructions");
- String strOfflineInstructions= request.getParameter("offlineInstructions");
- logger.debug("onlineInstructions: " + strOnlineInstructions);
- logger.debug("offlineInstructions: " + strOnlineInstructions);
- qaAuthoringForm.setOnlineInstructions(strOnlineInstructions);
- qaAuthoringForm.setOfflineInstructions(strOfflineInstructions);
- }
-
- AuthoringUtil authoringUtil= new AuthoringUtil();
-
- qaGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString());
-
- request.getSession().setAttribute(httpSessionID, sessionMap);
+ while (conditionIter.hasNext()) {
+ QaCondition condition = conditionIter.next();
+ Iterator dtoIter = condition.temporaryQuestionDTOSet.iterator();
+ while (dtoIter.hasNext()) {
+ if (dtoIter.next() == qaQuestionContentDTO) {
+ dtoIter.remove();
+ }
+ }
+ if (condition.temporaryQuestionDTOSet.isEmpty()) {
+ conditionIter.remove();
+ }
+ }
+ QaAction.logger.debug("listQuestionContentDTO after remove:" + listQuestionContentDTO);
- QaUtils.setFormProperties(request, qaService,
- qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID, defaultContentIdStr, activeModule, sessionMap, httpSessionID);
+ listQuestionContentDTO = AuthoringUtil.reorderListQuestionContentDTO(listQuestionContentDTO, questionIndex);
+ QaAction.logger.debug("listQuestionContentDTO reordered:" + listQuestionContentDTO);
-
- qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
- qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
- qaGeneralAuthoringDTO.setActiveModule(activeModule);
- qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
- qaAuthoringForm.setToolContentID(strToolContentID);
- qaAuthoringForm.setHttpSessionID(httpSessionID);
- qaAuthoringForm.setActiveModule(activeModule);
- qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
- qaAuthoringForm.setCurrentTab("1");
+ sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
- request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
- logger.debug("qaQuestionContentDTO now: " + qaQuestionContentDTO);
- logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
-
- qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
-
- logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- request.setAttribute(QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaAuthoringForm.setContentFolderID(contentFolderID);
- request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
-
-
- logger.debug("fwd ing to LOAD_QUESTIONS: " + LOAD_QUESTIONS);
- return (mapping.findForward(LOAD_QUESTIONS));
+ String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE);
+ QaAction.logger.debug("activeModule: " + activeModule);
+
+ String richTextTitle = request.getParameter(QaAppConstants.TITLE);
+ QaAction.logger.debug("richTextTitle: " + richTextTitle);
+
+ String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS);
+ QaAction.logger.debug("richTextInstructions: " + richTextInstructions);
+
+ sessionMap.put(QaAppConstants.ACTIVITY_TITLE_KEY, richTextTitle);
+ sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
+
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaAction.logger.debug("strToolContentID: " + strToolContentID);
+
+ String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR);
+ QaAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
+
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaAction.logger.debug("qaContent: " + qaContent);
+
+ if (qaContent == null) {
+ QaAction.logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
+ qaContent = qaService.loadQa(new Long(defaultContentIdStr).longValue());
+ }
+ QaAction.logger.debug("final qaContent: " + qaContent);
+
+ QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO();
+ QaAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
+
+ qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
+ qaAuthoringForm.setTitle(richTextTitle);
+
+ qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
+
+ QaAction.logger.debug("activeModule: " + activeModule);
+ if (activeModule.equals(QaAppConstants.AUTHORING)) {
+ String onlineInstructions = (String) sessionMap.get(QaAppConstants.ONLINE_INSTRUCTIONS_KEY);
+ QaAction.logger.debug("onlineInstructions: " + onlineInstructions);
+ qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
+
+ String offlineInstructions = (String) sessionMap.get(QaAppConstants.OFFLINE_INSTRUCTIONS_KEY);
+ QaAction.logger.debug("offlineInstructions: " + offlineInstructions);
+ qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
+
+ List attachmentList = (List) sessionMap.get(QaAppConstants.ATTACHMENT_LIST_KEY);
+ QaAction.logger.debug("attachmentList: " + attachmentList);
+ List deletedAttachmentList = (List) sessionMap.get(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY);
+ QaAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
+
+ qaGeneralAuthoringDTO.setAttachmentList(attachmentList);
+ qaGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList);
+
+ String strOnlineInstructions = request.getParameter("onlineInstructions");
+ String strOfflineInstructions = request.getParameter("offlineInstructions");
+ QaAction.logger.debug("onlineInstructions: " + strOnlineInstructions);
+ QaAction.logger.debug("offlineInstructions: " + strOnlineInstructions);
+ qaAuthoringForm.setOnlineInstructions(strOnlineInstructions);
+ qaAuthoringForm.setOfflineInstructions(strOfflineInstructions);
+ }
+
+ AuthoringUtil authoringUtil = new AuthoringUtil();
+
+ qaGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString());
+
+ request.getSession().setAttribute(httpSessionID, sessionMap);
+
+ QaUtils.setFormProperties(request, qaService, qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID,
+ defaultContentIdStr, activeModule, sessionMap, httpSessionID);
+
+ qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
+ qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
+ qaGeneralAuthoringDTO.setActiveModule(activeModule);
+ qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
+ qaAuthoringForm.setToolContentID(strToolContentID);
+ qaAuthoringForm.setHttpSessionID(httpSessionID);
+ qaAuthoringForm.setActiveModule(activeModule);
+ qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
+ qaAuthoringForm.setCurrentTab("1");
+
+ request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
+ QaAction.logger.debug("qaQuestionContentDTO now: " + qaQuestionContentDTO);
+ QaAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
+
+ qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
+
+ QaAction.logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+
+ request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
+
+ QaAction.logger.debug("fwd ing to LOAD_QUESTIONS: " + QaAppConstants.LOAD_QUESTIONS);
+ return mapping.findForward(QaAppConstants.LOAD_QUESTIONS);
}
-
-
+
/**
- * moves a question down in the list
- * moveQuestionDown
+ * moves a question down in the list moveQuestionDown
+ *
* @param mapping
* @param form
* @param request
@@ -1280,141 +1211,133 @@
* @throws IOException
* @throws ServletException
*/
- public ActionForward moveQuestionDown(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException {
- logger.debug("dispatching moveQuestionDown");
- QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
-
- IQaService qaService =QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
-
- String httpSessionID=qaAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
-
- SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
- String questionIndex=request.getParameter("questionIndex");
- logger.debug("questionIndex: " + questionIndex);
-
-
- List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
-
- listQuestionContentDTO=AuthoringUtil.swapNodes(listQuestionContentDTO, questionIndex, "down");
- logger.debug("listQuestionContentDTO after swap: " + listQuestionContentDTO);
-
- listQuestionContentDTO=AuthoringUtil.reorderSimpleListQuestionContentDTO(listQuestionContentDTO);
- logger.debug("listQuestionContentDTO after reordersimple: " + listQuestionContentDTO);
+ public ActionForward moveQuestionDown(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaAction.logger.debug("dispatching moveQuestionDown");
+ QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
-
- sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
-
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaAuthoringForm.setContentFolderID(contentFolderID);
-
-
- String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
-
- String richTextTitle = request.getParameter(TITLE);
- logger.debug("richTextTitle: " + richTextTitle);
-
- String richTextInstructions = request.getParameter(INSTRUCTIONS);
- logger.debug("richTextInstructions: " + richTextInstructions);
-
-
- sessionMap.put(ACTIVITY_TITLE_KEY, richTextTitle);
- sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
-
-
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
- String defaultContentIdStr=request.getParameter(DEFAULT_CONTENT_ID_STR);
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("qaContent: " + qaContent);
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaAction.logger.debug("qaService: " + qaService);
-
- QaGeneralAuthoringDTO qaGeneralAuthoringDTO= new QaGeneralAuthoringDTO();
- logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
-
- qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
- qaAuthoringForm.setTitle(richTextTitle);
-
- qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
-
- logger.debug("activeModule: " + activeModule);
- if (activeModule.equals(AUTHORING))
- {
- String onlineInstructions=(String)sessionMap.get(ONLINE_INSTRUCTIONS_KEY);
- logger.debug("onlineInstructions: " + onlineInstructions);
- qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
-
- String offlineInstructions=(String)sessionMap.get(OFFLINE_INSTRUCTIONS_KEY);
- logger.debug("offlineInstructions: " + offlineInstructions);
- qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
-
- List attachmentList=(List)sessionMap.get(ATTACHMENT_LIST_KEY);
- logger.debug("attachmentList: " + attachmentList);
- List deletedAttachmentList=(List)sessionMap.get(DELETED_ATTACHMENT_LIST_KEY);
- logger.debug("deletedAttachmentList: " + deletedAttachmentList);
-
- qaGeneralAuthoringDTO.setAttachmentList(attachmentList);
- qaGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList);
+ String httpSessionID = qaAuthoringForm.getHttpSessionID();
+ QaAction.logger.debug("httpSessionID: " + httpSessionID);
- String strOnlineInstructions= request.getParameter("onlineInstructions");
- String strOfflineInstructions= request.getParameter("offlineInstructions");
- logger.debug("onlineInstructions: " + strOnlineInstructions);
- logger.debug("offlineInstructions: " + strOnlineInstructions);
- qaAuthoringForm.setOnlineInstructions(strOnlineInstructions);
- qaAuthoringForm.setOfflineInstructions(strOfflineInstructions);
- }
-
- AuthoringUtil authoringUtil= new AuthoringUtil();
-
- qaGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString());
-
- request.getSession().setAttribute(httpSessionID, sessionMap);
-
- QaUtils.setFormProperties(request, qaService,
- qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID, defaultContentIdStr, activeModule, sessionMap, httpSessionID);
-
-
- qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
- qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
- qaGeneralAuthoringDTO.setActiveModule(activeModule);
- qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
- qaAuthoringForm.setToolContentID(strToolContentID);
- qaAuthoringForm.setHttpSessionID(httpSessionID);
- qaAuthoringForm.setActiveModule(activeModule);
- qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
- qaAuthoringForm.setCurrentTab("1");
-
- request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
- logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
-
- qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
-
- logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- request.setAttribute(QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
-
- request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
-
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
+ QaAction.logger.debug("sessionMap: " + sessionMap);
- logger.debug("fwd ing to LOAD_QUESTIONS: " + LOAD_QUESTIONS);
- return (mapping.findForward(LOAD_QUESTIONS));
+ String questionIndex = request.getParameter("questionIndex");
+ QaAction.logger.debug("questionIndex: " + questionIndex);
+
+ List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
+ QaAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
+
+ SortedSet conditionSet = (SortedSet) sessionMap
+ .get(QaAppConstants.ATTR_CONDITION_SET);
+
+ listQuestionContentDTO = AuthoringUtil.swapNodes(listQuestionContentDTO, questionIndex, "down", conditionSet);
+ QaAction.logger.debug("listQuestionContentDTO after swap: " + listQuestionContentDTO);
+
+ listQuestionContentDTO = AuthoringUtil.reorderSimpleListQuestionContentDTO(listQuestionContentDTO);
+ QaAction.logger.debug("listQuestionContentDTO after reordersimple: " + listQuestionContentDTO);
+
+ sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
+
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaAuthoringForm.setContentFolderID(contentFolderID);
+
+ String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE);
+ QaAction.logger.debug("activeModule: " + activeModule);
+
+ String richTextTitle = request.getParameter(QaAppConstants.TITLE);
+ QaAction.logger.debug("richTextTitle: " + richTextTitle);
+
+ String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS);
+ QaAction.logger.debug("richTextInstructions: " + richTextInstructions);
+
+ sessionMap.put(QaAppConstants.ACTIVITY_TITLE_KEY, richTextTitle);
+ sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
+
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaAction.logger.debug("strToolContentID: " + strToolContentID);
+
+ String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR);
+ QaAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
+
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaAction.logger.debug("qaContent: " + qaContent);
+
+ QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO();
+ QaAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
+
+ qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
+ qaAuthoringForm.setTitle(richTextTitle);
+
+ qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
+
+ QaAction.logger.debug("activeModule: " + activeModule);
+ if (activeModule.equals(QaAppConstants.AUTHORING)) {
+ String onlineInstructions = (String) sessionMap.get(QaAppConstants.ONLINE_INSTRUCTIONS_KEY);
+ QaAction.logger.debug("onlineInstructions: " + onlineInstructions);
+ qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
+
+ String offlineInstructions = (String) sessionMap.get(QaAppConstants.OFFLINE_INSTRUCTIONS_KEY);
+ QaAction.logger.debug("offlineInstructions: " + offlineInstructions);
+ qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
+
+ List attachmentList = (List) sessionMap.get(QaAppConstants.ATTACHMENT_LIST_KEY);
+ QaAction.logger.debug("attachmentList: " + attachmentList);
+ List deletedAttachmentList = (List) sessionMap.get(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY);
+ QaAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
+
+ qaGeneralAuthoringDTO.setAttachmentList(attachmentList);
+ qaGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList);
+
+ String strOnlineInstructions = request.getParameter("onlineInstructions");
+ String strOfflineInstructions = request.getParameter("offlineInstructions");
+ QaAction.logger.debug("onlineInstructions: " + strOnlineInstructions);
+ QaAction.logger.debug("offlineInstructions: " + strOnlineInstructions);
+ qaAuthoringForm.setOnlineInstructions(strOnlineInstructions);
+ qaAuthoringForm.setOfflineInstructions(strOfflineInstructions);
+ }
+
+ AuthoringUtil authoringUtil = new AuthoringUtil();
+
+ qaGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString());
+
+ request.getSession().setAttribute(httpSessionID, sessionMap);
+
+ QaUtils.setFormProperties(request, qaService, qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID,
+ defaultContentIdStr, activeModule, sessionMap, httpSessionID);
+
+ qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
+ qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
+ qaGeneralAuthoringDTO.setActiveModule(activeModule);
+ qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
+ qaAuthoringForm.setToolContentID(strToolContentID);
+ qaAuthoringForm.setHttpSessionID(httpSessionID);
+ qaAuthoringForm.setActiveModule(activeModule);
+ qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
+ qaAuthoringForm.setCurrentTab("1");
+
+ request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
+ QaAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
+
+ qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
+
+ QaAction.logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+
+ request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
+
+ QaAction.logger.debug("fwd ing to LOAD_QUESTIONS: " + QaAppConstants.LOAD_QUESTIONS);
+ return mapping.findForward(QaAppConstants.LOAD_QUESTIONS);
}
-
/**
- * moves a question up in the list
- * moveQuestionUp
+ * moves a question up in the list moveQuestionUp
+ *
* @param mapping
* @param form
* @param request
@@ -1423,142 +1346,132 @@
* @throws IOException
* @throws ServletException
*/
- public ActionForward moveQuestionUp(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException {
- logger.debug("dispatching moveQuestionUp");
- QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
-
- IQaService qaService =QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
-
- String httpSessionID=qaAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
-
- SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
- String questionIndex=request.getParameter("questionIndex");
- logger.debug("questionIndex: " + questionIndex);
-
-
- List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
-
- listQuestionContentDTO=AuthoringUtil.swapNodes(listQuestionContentDTO, questionIndex, "up");
- logger.debug("listQuestionContentDTO after swap: " + listQuestionContentDTO);
-
- listQuestionContentDTO=AuthoringUtil.reorderSimpleListQuestionContentDTO(listQuestionContentDTO);
- logger.debug("listQuestionContentDTO after reordersimple: " + listQuestionContentDTO);
-
- sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaAuthoringForm.setContentFolderID(contentFolderID);
-
-
- String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
-
- String richTextTitle = request.getParameter(TITLE);
- logger.debug("richTextTitle: " + richTextTitle);
-
- String richTextInstructions = request.getParameter(INSTRUCTIONS);
- logger.debug("richTextInstructions: " + richTextInstructions);
-
-
- sessionMap.put(ACTIVITY_TITLE_KEY, richTextTitle);
- sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
-
-
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
- String defaultContentIdStr=request.getParameter(DEFAULT_CONTENT_ID_STR);
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("qaContent: " + qaContent);
-
-
- QaGeneralAuthoringDTO qaGeneralAuthoringDTO= new QaGeneralAuthoringDTO();
- logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
-
- qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
- qaAuthoringForm.setTitle(richTextTitle);
-
- qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
-
- logger.debug("activeModule: " + activeModule);
- if (activeModule.equals(AUTHORING))
- {
- String onlineInstructions=(String)sessionMap.get(ONLINE_INSTRUCTIONS_KEY);
- logger.debug("onlineInstructions: " + onlineInstructions);
- qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
-
- String offlineInstructions=(String)sessionMap.get(OFFLINE_INSTRUCTIONS_KEY);
- logger.debug("offlineInstructions: " + offlineInstructions);
- qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
-
- List attachmentList=(List)sessionMap.get(ATTACHMENT_LIST_KEY);
- logger.debug("attachmentList: " + attachmentList);
- List deletedAttachmentList=(List)sessionMap.get(DELETED_ATTACHMENT_LIST_KEY);
- logger.debug("deletedAttachmentList: " + deletedAttachmentList);
-
- qaGeneralAuthoringDTO.setAttachmentList(attachmentList);
- qaGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList);
-
- String strOnlineInstructions= request.getParameter("onlineInstructions");
- String strOfflineInstructions= request.getParameter("offlineInstructions");
- logger.debug("onlineInstructions: " + strOnlineInstructions);
- logger.debug("offlineInstructions: " + strOnlineInstructions);
- qaAuthoringForm.setOnlineInstructions(strOnlineInstructions);
- qaAuthoringForm.setOfflineInstructions(strOfflineInstructions);
- }
-
- AuthoringUtil authoringUtil= new AuthoringUtil();
-
- qaGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString());
-
- request.getSession().setAttribute(httpSessionID, sessionMap);
-
- QaUtils.setFormProperties(request, qaService,
- qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID, defaultContentIdStr, activeModule, sessionMap, httpSessionID);
-
-
- qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
- qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
- qaGeneralAuthoringDTO.setActiveModule(activeModule);
- qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
- qaAuthoringForm.setToolContentID(strToolContentID);
- qaAuthoringForm.setHttpSessionID(httpSessionID);
- qaAuthoringForm.setActiveModule(activeModule);
- qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
- qaAuthoringForm.setCurrentTab("1");
-
- request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
- logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
-
- qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
-
- logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- request.setAttribute(QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
-
- request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
-
+ public ActionForward moveQuestionUp(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaAction.logger.debug("dispatching moveQuestionUp");
+ QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
- logger.debug("fwd ing to LOAD_QUESTIONS: " + LOAD_QUESTIONS);
- return (mapping.findForward(LOAD_QUESTIONS));
- }
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaAction.logger.debug("qaService: " + qaService);
+ String httpSessionID = qaAuthoringForm.getHttpSessionID();
+ QaAction.logger.debug("httpSessionID: " + httpSessionID);
-
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
+ QaAction.logger.debug("sessionMap: " + sessionMap);
+
+ String questionIndex = request.getParameter("questionIndex");
+ QaAction.logger.debug("questionIndex: " + questionIndex);
+
+ List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
+ QaAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
+ SortedSet conditionSet = (SortedSet) sessionMap
+ .get(QaAppConstants.ATTR_CONDITION_SET);
+ listQuestionContentDTO = AuthoringUtil.swapNodes(listQuestionContentDTO, questionIndex, "up", conditionSet);
+ QaAction.logger.debug("listQuestionContentDTO after swap: " + listQuestionContentDTO);
+
+ listQuestionContentDTO = AuthoringUtil.reorderSimpleListQuestionContentDTO(listQuestionContentDTO);
+ QaAction.logger.debug("listQuestionContentDTO after reordersimple: " + listQuestionContentDTO);
+
+ sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
+
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaAuthoringForm.setContentFolderID(contentFolderID);
+
+ String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE);
+ QaAction.logger.debug("activeModule: " + activeModule);
+
+ String richTextTitle = request.getParameter(QaAppConstants.TITLE);
+ QaAction.logger.debug("richTextTitle: " + richTextTitle);
+
+ String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS);
+ QaAction.logger.debug("richTextInstructions: " + richTextInstructions);
+
+ sessionMap.put(QaAppConstants.ACTIVITY_TITLE_KEY, richTextTitle);
+ sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
+
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaAction.logger.debug("strToolContentID: " + strToolContentID);
+
+ String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR);
+ QaAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
+
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaAction.logger.debug("qaContent: " + qaContent);
+
+ QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO();
+ QaAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
+
+ qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
+ qaAuthoringForm.setTitle(richTextTitle);
+
+ qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
+
+ QaAction.logger.debug("activeModule: " + activeModule);
+ if (activeModule.equals(QaAppConstants.AUTHORING)) {
+ String onlineInstructions = (String) sessionMap.get(QaAppConstants.ONLINE_INSTRUCTIONS_KEY);
+ QaAction.logger.debug("onlineInstructions: " + onlineInstructions);
+ qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
+
+ String offlineInstructions = (String) sessionMap.get(QaAppConstants.OFFLINE_INSTRUCTIONS_KEY);
+ QaAction.logger.debug("offlineInstructions: " + offlineInstructions);
+ qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
+
+ List attachmentList = (List) sessionMap.get(QaAppConstants.ATTACHMENT_LIST_KEY);
+ QaAction.logger.debug("attachmentList: " + attachmentList);
+ List deletedAttachmentList = (List) sessionMap.get(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY);
+ QaAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
+
+ qaGeneralAuthoringDTO.setAttachmentList(attachmentList);
+ qaGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList);
+
+ String strOnlineInstructions = request.getParameter("onlineInstructions");
+ String strOfflineInstructions = request.getParameter("offlineInstructions");
+ QaAction.logger.debug("onlineInstructions: " + strOnlineInstructions);
+ QaAction.logger.debug("offlineInstructions: " + strOnlineInstructions);
+ qaAuthoringForm.setOnlineInstructions(strOnlineInstructions);
+ qaAuthoringForm.setOfflineInstructions(strOfflineInstructions);
+ }
+
+ AuthoringUtil authoringUtil = new AuthoringUtil();
+
+ qaGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString());
+
+ request.getSession().setAttribute(httpSessionID, sessionMap);
+
+ QaUtils.setFormProperties(request, qaService, qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID,
+ defaultContentIdStr, activeModule, sessionMap, httpSessionID);
+
+ qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
+ qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
+ qaGeneralAuthoringDTO.setActiveModule(activeModule);
+ qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
+ qaAuthoringForm.setToolContentID(strToolContentID);
+ qaAuthoringForm.setHttpSessionID(httpSessionID);
+ qaAuthoringForm.setActiveModule(activeModule);
+ qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
+ qaAuthoringForm.setCurrentTab("1");
+
+ request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
+ QaAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
+
+ qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
+
+ QaAction.logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+
+ request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
+
+ QaAction.logger.debug("fwd ing to LOAD_QUESTIONS: " + QaAppConstants.LOAD_QUESTIONS);
+ return mapping.findForward(QaAppConstants.LOAD_QUESTIONS);
+ }
+
/**
- * adds a new file to content repository
- * ActionForward addNewFile(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException
-
+ * adds a new file to content repository ActionForward addNewFile(ActionMapping mapping, ActionForm form,
+ * HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
+ *
* @param mapping
* @param form
* @param request
@@ -1567,132 +1480,123 @@
* @throws IOException
* @throws ServletException
*/
- public ActionForward addNewFile(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException {
- logger.debug("dispathching addNewFile");
- QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
-
- IQaService qaService =QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
+ public ActionForward addNewFile(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaAction.logger.debug("dispathching addNewFile");
+ QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
- String httpSessionID=qaAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
-
- SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaAuthoringForm.setContentFolderID(contentFolderID);
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaAction.logger.debug("qaService: " + qaService);
+ String httpSessionID = qaAuthoringForm.getHttpSessionID();
+ QaAction.logger.debug("httpSessionID: " + httpSessionID);
- String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
-
- String onlineInstructions=request.getParameter(ONLINE_INSTRUCTIONS);
- logger.debug("onlineInstructions: " + onlineInstructions);
-
- String offlineInstructions=request.getParameter(OFFLINE_INSTRUCTIONS);
- logger.debug("offlineInstructions: " + offlineInstructions);
-
- sessionMap.put(ONLINE_INSTRUCTIONS_KEY, onlineInstructions);
- sessionMap.put(OFFLINE_INSTRUCTIONS, offlineInstructions);
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
+ QaAction.logger.debug("sessionMap: " + sessionMap);
- List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
-
- request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
-
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
- String defaultContentIdStr=request.getParameter(DEFAULT_CONTENT_ID_STR);
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("qaContent: " + qaContent);
-
-
- QaGeneralAuthoringDTO qaGeneralAuthoringDTO= new QaGeneralAuthoringDTO();
- logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
-
- qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
- qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaAuthoringForm.setContentFolderID(contentFolderID);
- qaGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString());
-
- String richTextTitle = request.getParameter(TITLE);
- String richTextInstructions = request.getParameter(INSTRUCTIONS);
-
- logger.debug("richTextTitle: " + richTextTitle);
- logger.debug("richTextInstructions: " + richTextInstructions);
- qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
- qaAuthoringForm.setTitle(richTextTitle);
-
- qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
-
- sessionMap.put(ACTIVITY_TITLE_KEY, richTextTitle);
- sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
+ String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE);
+ QaAction.logger.debug("activeModule: " + activeModule);
- List attachmentList=(List)sessionMap.get(ATTACHMENT_LIST_KEY);
- logger.debug("attachmentList: " + attachmentList);
- List deletedAttachmentList=(List)sessionMap.get(DELETED_ATTACHMENT_LIST_KEY);
- logger.debug("deletedAttachmentList: " + deletedAttachmentList);
-
- addFileToContentRepository(request, qaAuthoringForm, attachmentList, deletedAttachmentList, sessionMap, qaGeneralAuthoringDTO);
- logger.debug("post addFileToContentRepository, attachmentList: " + attachmentList);
- logger.debug("post addFileToContentRepository, deletedAttachmentList: " + deletedAttachmentList);
+ String onlineInstructions = request.getParameter(QaAppConstants.ONLINE_INSTRUCTIONS);
+ QaAction.logger.debug("onlineInstructions: " + onlineInstructions);
- sessionMap.put(ATTACHMENT_LIST_KEY,attachmentList);
- sessionMap.put(DELETED_ATTACHMENT_LIST_KEY,deletedAttachmentList);
-
- qaGeneralAuthoringDTO.setAttachmentList(attachmentList);
-
- request.getSession().setAttribute(httpSessionID, sessionMap);
+ String offlineInstructions = request.getParameter(QaAppConstants.OFFLINE_INSTRUCTIONS);
+ QaAction.logger.debug("offlineInstructions: " + offlineInstructions);
- QaUtils.setFormProperties(request, qaService,
- qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID, defaultContentIdStr,
- activeModule, sessionMap, httpSessionID);
+ sessionMap.put(QaAppConstants.ONLINE_INSTRUCTIONS_KEY, onlineInstructions);
+ sessionMap.put(QaAppConstants.OFFLINE_INSTRUCTIONS, offlineInstructions);
-
- qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
- qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
- qaGeneralAuthoringDTO.setActiveModule(activeModule);
- qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
- qaAuthoringForm.setToolContentID(strToolContentID);
- qaAuthoringForm.setHttpSessionID(httpSessionID);
- qaAuthoringForm.setActiveModule(activeModule);
- qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
- qaAuthoringForm.setCurrentTab("3");
-
+ List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
+ QaAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
- logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- request.setAttribute(QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+ request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
- qaAuthoringForm.resetUserAction();
-
- String strOnlineInstructions= request.getParameter("onlineInstructions");
- String strOfflineInstructions= request.getParameter("offlineInstructions");
- logger.debug("onlineInstructions: " + strOnlineInstructions);
- logger.debug("offlineInstructions: " + strOnlineInstructions);
- qaAuthoringForm.setOnlineInstructions(strOnlineInstructions);
- qaAuthoringForm.setOfflineInstructions(strOfflineInstructions);
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaAction.logger.debug("strToolContentID: " + strToolContentID);
- request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
-
- logger.debug("fwd ing to LOAD_QUESTIONS: " + LOAD_QUESTIONS);
- return (mapping.findForward(LOAD_QUESTIONS));
+ String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR);
+ QaAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
+
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaAction.logger.debug("qaContent: " + qaContent);
+
+ QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO();
+ QaAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
+
+ qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
+ qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
+
+ qaGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString());
+
+ String richTextTitle = request.getParameter(QaAppConstants.TITLE);
+ String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS);
+
+ QaAction.logger.debug("richTextTitle: " + richTextTitle);
+ QaAction.logger.debug("richTextInstructions: " + richTextInstructions);
+ qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
+ qaAuthoringForm.setTitle(richTextTitle);
+
+ qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
+
+ sessionMap.put(QaAppConstants.ACTIVITY_TITLE_KEY, richTextTitle);
+ sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
+
+ List attachmentList = (List) sessionMap.get(QaAppConstants.ATTACHMENT_LIST_KEY);
+ QaAction.logger.debug("attachmentList: " + attachmentList);
+ List deletedAttachmentList = (List) sessionMap.get(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY);
+ QaAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
+
+ addFileToContentRepository(request, qaAuthoringForm, attachmentList, deletedAttachmentList, sessionMap,
+ qaGeneralAuthoringDTO);
+ QaAction.logger.debug("post addFileToContentRepository, attachmentList: " + attachmentList);
+ QaAction.logger.debug("post addFileToContentRepository, deletedAttachmentList: " + deletedAttachmentList);
+
+ sessionMap.put(QaAppConstants.ATTACHMENT_LIST_KEY, attachmentList);
+ sessionMap.put(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY, deletedAttachmentList);
+
+ qaGeneralAuthoringDTO.setAttachmentList(attachmentList);
+
+ request.getSession().setAttribute(httpSessionID, sessionMap);
+
+ QaUtils.setFormProperties(request, qaService, qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID,
+ defaultContentIdStr, activeModule, sessionMap, httpSessionID);
+
+ qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
+ qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
+ qaGeneralAuthoringDTO.setActiveModule(activeModule);
+ qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
+ qaAuthoringForm.setToolContentID(strToolContentID);
+ qaAuthoringForm.setHttpSessionID(httpSessionID);
+ qaAuthoringForm.setActiveModule(activeModule);
+ qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
+ qaAuthoringForm.setCurrentTab("3");
+
+ QaAction.logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+
+ qaAuthoringForm.resetUserAction();
+
+ String strOnlineInstructions = request.getParameter("onlineInstructions");
+ String strOfflineInstructions = request.getParameter("offlineInstructions");
+ QaAction.logger.debug("onlineInstructions: " + strOnlineInstructions);
+ QaAction.logger.debug("offlineInstructions: " + strOnlineInstructions);
+ qaAuthoringForm.setOnlineInstructions(strOnlineInstructions);
+ qaAuthoringForm.setOfflineInstructions(strOfflineInstructions);
+
+ request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
+
+ QaAction.logger.debug("fwd ing to LOAD_QUESTIONS: " + QaAppConstants.LOAD_QUESTIONS);
+ return mapping.findForward(QaAppConstants.LOAD_QUESTIONS);
}
-
-
+
/**
- * deletes a file from the content repository
- * ActionForward deleteFile(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
+ * deletes a file from the content repository ActionForward deleteFile(ActionMapping mapping, ActionForm form,
+ * HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
*
* @param mapping
* @param form
@@ -1702,264 +1606,257 @@
* @throws IOException
* @throws ServletException
*/
- public ActionForward deleteFile(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
- {
- logger.debug("dispatching deleteFile");
- QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
-
- IQaService qaService =QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
+ public ActionForward deleteFile(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaAction.logger.debug("dispatching deleteFile");
+ QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
- String httpSessionID=qaAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
-
- SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaAuthoringForm.setContentFolderID(contentFolderID);
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaAction.logger.debug("qaService: " + qaService);
+ String httpSessionID = qaAuthoringForm.getHttpSessionID();
+ QaAction.logger.debug("httpSessionID: " + httpSessionID);
- String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
-
-
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
- String defaultContentIdStr=request.getParameter(DEFAULT_CONTENT_ID_STR);
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
- List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
-
- request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
-
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("qaContent: " + qaContent);
-
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
+ QaAction.logger.debug("sessionMap: " + sessionMap);
- QaGeneralAuthoringDTO qaGeneralAuthoringDTO= new QaGeneralAuthoringDTO();
- logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
-
- qaGeneralAuthoringDTO.setSbmtSuccess( new Integer(0).toString());
-
- QaUtils.setFormProperties(request, qaService,
- qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID, defaultContentIdStr, activeModule, sessionMap, httpSessionID);
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaAuthoringForm.setContentFolderID(contentFolderID);
-
- String onlineInstructions=(String) sessionMap.get(ONLINE_INSTRUCTIONS_KEY);
- logger.debug("onlineInstructions: " + onlineInstructions);
+ String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE);
+ QaAction.logger.debug("activeModule: " + activeModule);
- String offlineInstructions=(String) sessionMap.get(OFFLINE_INSTRUCTIONS_KEY);
- logger.debug("offlineInstructions: " + offlineInstructions);
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaAction.logger.debug("strToolContentID: " + strToolContentID);
- qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
- qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
- qaAuthoringForm.setOnlineInstructions(onlineInstructions);
- qaAuthoringForm.setOfflineInstructions(offlineInstructions);
+ String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR);
+ QaAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
+ List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
+ QaAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
- String richTextTitle=(String)sessionMap.get(ACTIVITY_TITLE_KEY);
- String richTextInstructions=(String)sessionMap.get(ACTIVITY_INSTRUCTIONS_KEY);
-
- logger.debug("richTextTitle: " + richTextTitle);
- logger.debug("richTextInstructions: " + richTextInstructions);
- qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
- qaAuthoringForm.setTitle(richTextTitle);
-
- qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
-
- long uuid = WebUtil.readLongParam(request, UUID);
+ request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
- List attachmentList=(List)sessionMap.get(ATTACHMENT_LIST_KEY);
- logger.debug("attachmentList: " + attachmentList);
-
- if(attachmentList == null)
- attachmentList = new ArrayList();
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaAction.logger.debug("qaContent: " + qaContent);
+ QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO();
+ QaAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
- List deletedAttachmentList=(List)sessionMap.get(DELETED_ATTACHMENT_LIST_KEY);
- logger.debug("deletedAttachmentList: " + deletedAttachmentList);
+ qaGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString());
- if(deletedAttachmentList == null)
- deletedAttachmentList = new ArrayList();
-
- /* move the file's details from the attachment collection to the deleted attachments collection
- the attachment will be delete on saving. */
-
- deletedAttachmentList = QaUtils.moveToDelete(Long.toString(uuid), attachmentList, deletedAttachmentList );
+ QaUtils.setFormProperties(request, qaService, qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID,
+ defaultContentIdStr, activeModule, sessionMap, httpSessionID);
-
- sessionMap.put(ATTACHMENT_LIST_KEY,attachmentList);
- sessionMap.put(DELETED_ATTACHMENT_LIST_KEY,deletedAttachmentList);
-
- qaGeneralAuthoringDTO.setAttachmentList(attachmentList);
-
- request.getSession().setAttribute(httpSessionID, sessionMap);
+ String onlineInstructions = (String) sessionMap.get(QaAppConstants.ONLINE_INSTRUCTIONS_KEY);
+ QaAction.logger.debug("onlineInstructions: " + onlineInstructions);
- qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
- qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
- qaGeneralAuthoringDTO.setActiveModule(activeModule);
- qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
- qaAuthoringForm.setToolContentID(strToolContentID);
- qaAuthoringForm.setHttpSessionID(httpSessionID);
- qaAuthoringForm.setActiveModule(activeModule);
- qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
- qaAuthoringForm.setCurrentTab("3");
-
+ String offlineInstructions = (String) sessionMap.get(QaAppConstants.OFFLINE_INSTRUCTIONS_KEY);
+ QaAction.logger.debug("offlineInstructions: " + offlineInstructions);
- logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- request.setAttribute(QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+ qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
+ qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
+ qaAuthoringForm.setOnlineInstructions(onlineInstructions);
+ qaAuthoringForm.setOfflineInstructions(offlineInstructions);
- request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
-
- qaAuthoringForm.resetUserAction();
- logger.debug("fwd ing to LOAD_QUESTIONS: " + LOAD_QUESTIONS);
-
- return (mapping.findForward(LOAD_QUESTIONS));
+ String richTextTitle = (String) sessionMap.get(QaAppConstants.ACTIVITY_TITLE_KEY);
+ String richTextInstructions = (String) sessionMap.get(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY);
+
+ QaAction.logger.debug("richTextTitle: " + richTextTitle);
+ QaAction.logger.debug("richTextInstructions: " + richTextInstructions);
+ qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
+ qaAuthoringForm.setTitle(richTextTitle);
+
+ qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
+
+ long uuid = WebUtil.readLongParam(request, QaAppConstants.UUID);
+
+ List attachmentList = (List) sessionMap.get(QaAppConstants.ATTACHMENT_LIST_KEY);
+ QaAction.logger.debug("attachmentList: " + attachmentList);
+
+ if (attachmentList == null) {
+ attachmentList = new ArrayList();
+ }
+
+ List deletedAttachmentList = (List) sessionMap.get(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY);
+ QaAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
+
+ if (deletedAttachmentList == null) {
+ deletedAttachmentList = new ArrayList();
+ }
+
+ /*
+ * move the file's details from the attachment collection to the deleted attachments collection the attachment
+ * will be delete on saving.
+ */
+
+ deletedAttachmentList = QaUtils.moveToDelete(Long.toString(uuid), attachmentList, deletedAttachmentList);
+
+ sessionMap.put(QaAppConstants.ATTACHMENT_LIST_KEY, attachmentList);
+ sessionMap.put(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY, deletedAttachmentList);
+
+ qaGeneralAuthoringDTO.setAttachmentList(attachmentList);
+
+ request.getSession().setAttribute(httpSessionID, sessionMap);
+
+ qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
+ qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
+ qaGeneralAuthoringDTO.setActiveModule(activeModule);
+ qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
+ qaAuthoringForm.setToolContentID(strToolContentID);
+ qaAuthoringForm.setHttpSessionID(httpSessionID);
+ qaAuthoringForm.setActiveModule(activeModule);
+ qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
+ qaAuthoringForm.setCurrentTab("3");
+
+ QaAction.logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+
+ request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
+
+ qaAuthoringForm.resetUserAction();
+ QaAction.logger.debug("fwd ing to LOAD_QUESTIONS: " + QaAppConstants.LOAD_QUESTIONS);
+
+ return mapping.findForward(QaAppConstants.LOAD_QUESTIONS);
}
-
-
+
/**
* persists error messages to request scope
*
* persistError(HttpServletRequest request, String message)
+ *
* @param request
* @param message
*/
- public void persistError(HttpServletRequest request, String message)
- {
- ActionMessages errors= new ActionMessages();
- errors.add(Globals.ERROR_KEY, new ActionMessage(message));
- logger.debug("add " + message +" to ActionMessages:");
- saveErrors(request,errors);
- }
-
-
+ public void persistError(HttpServletRequest request, String message) {
+ ActionMessages errors = new ActionMessages();
+ errors.add(Globals.ERROR_KEY, new ActionMessage(message));
+ QaAction.logger.debug("add " + message + " to ActionMessages:");
+ saveErrors(request, errors);
+ }
+
/**
* addFileToContentRepository(HttpServletRequest request, QaAuthoringForm qaAuthoringForm)
+ *
* @param request
* @param qaAuthoringForm
*/
- public void addFileToContentRepository(HttpServletRequest request, QaAuthoringForm qaAuthoringForm,
- List attachmentList, List deletedAttachmentList, SessionMap sessionMap,
- QaGeneralAuthoringDTO qaGeneralAuthoringDTO)
- {
- logger.debug("attempt addFileToContentRepository");
- logger.debug("attachmentList: " + attachmentList);
- logger.debug("deletedAttachmentList: " + deletedAttachmentList);
- IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
-
- if(attachmentList == null)
- attachmentList = new ArrayList();
-
- if(deletedAttachmentList == null)
- deletedAttachmentList = new ArrayList();
-
- FormFile uploadedFile = null;
- boolean isOnlineFile = false;
- String fileType = null;
- if(qaAuthoringForm.getTheOfflineFile() != null && qaAuthoringForm.getTheOfflineFile().getFileSize() > 0 ){
- logger.debug("theOfflineFile is available: ");
- uploadedFile = qaAuthoringForm.getTheOfflineFile();
- logger.debug("uploadedFile: " + uploadedFile);
- fileType = IToolContentHandler.TYPE_OFFLINE;
- }
- else if(qaAuthoringForm.getTheOnlineFile() != null && qaAuthoringForm.getTheOnlineFile().getFileSize() > 0 ){
- logger.debug("theOnlineFile is available: ");
- uploadedFile = qaAuthoringForm.getTheOnlineFile();
- logger.debug("uploadedFile: " + uploadedFile);
- isOnlineFile = true;
- fileType = IToolContentHandler.TYPE_ONLINE;
- }
- else
- /*no file uploaded*/
- return;
-
-
- //validate upload file size.
- ActionMessages errors = new ActionMessages();
- FileValidatorUtil.validateFileSize(uploadedFile, true, errors );
- if(!errors.isEmpty()){
- this.saveErrors(request, errors);
- return;
- }
-
- logger.debug("uploadedFile.getFileName(): " + uploadedFile.getFileName());
-
- /* if a file with the same name already exists then move the old one to deleted */
- deletedAttachmentList = QaUtils.moveToDelete(uploadedFile.getFileName(), isOnlineFile, attachmentList, deletedAttachmentList );
- logger.debug("deletedAttachmentList: " + deletedAttachmentList);
+ public void addFileToContentRepository(HttpServletRequest request, QaAuthoringForm qaAuthoringForm,
+ List attachmentList, List deletedAttachmentList, SessionMap sessionMap,
+ QaGeneralAuthoringDTO qaGeneralAuthoringDTO) {
+ QaAction.logger.debug("attempt addFileToContentRepository");
+ QaAction.logger.debug("attachmentList: " + attachmentList);
+ QaAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaAction.logger.debug("qaService: " + qaService);
- try
- {
- /* This is a new file and so is saved to the content repository. Add it to the
- attachments collection, but don't add it to the tool's tables yet.
- */
- NodeKey node = getToolContentHandler().uploadFile(uploadedFile.getInputStream(), uploadedFile.getFileName(),
- uploadedFile.getContentType(), fileType);
- QaUploadedFile file = new QaUploadedFile();
- String fileName=uploadedFile.getFileName();
- logger.debug("fileName: " + fileName);
- logger.debug("fileName length: " + fileName.length());
-
- if ((fileName != null) && (fileName.length() > 30))
- {
- fileName=fileName.substring(0, 31);
- logger.debug("shortened fileName: " + fileName);
- }
-
- file.setFileName(fileName);
- file.setFileOnline(isOnlineFile);
- file.setUuid(node.getUuid().toString());
- /* file.setVersionId(node.getVersion()); */
-
- /* add the files to the attachment collection - if one existed, it should have already been removed. */
- attachmentList.add(file);
-
- /* reset the fields so that more files can be uploaded */
- qaAuthoringForm.setTheOfflineFile(null);
- qaAuthoringForm.setTheOnlineFile(null);
- }
- catch (FileNotFoundException e) {
- logger.error("Unable to uploadfile",e);
- throw new RuntimeException("Unable to upload file, exception was "+e.getMessage());
- } catch (IOException e) {
- logger.error("Unable to uploadfile",e);
- throw new RuntimeException("Unable to upload file, exception was "+e.getMessage());
- } catch (RepositoryCheckedException e) {
- logger.error("Unable to uploadfile",e);
- throw new RuntimeException("Unable to upload file, exception was "+e.getMessage());
- }
+ if (attachmentList == null) {
+ attachmentList = new ArrayList();
+ }
+
+ if (deletedAttachmentList == null) {
+ deletedAttachmentList = new ArrayList();
+ }
+
+ FormFile uploadedFile = null;
+ boolean isOnlineFile = false;
+ String fileType = null;
+ if (qaAuthoringForm.getTheOfflineFile() != null && qaAuthoringForm.getTheOfflineFile().getFileSize() > 0) {
+ QaAction.logger.debug("theOfflineFile is available: ");
+ uploadedFile = qaAuthoringForm.getTheOfflineFile();
+ QaAction.logger.debug("uploadedFile: " + uploadedFile);
+ fileType = IToolContentHandler.TYPE_OFFLINE;
+ } else if (qaAuthoringForm.getTheOnlineFile() != null && qaAuthoringForm.getTheOnlineFile().getFileSize() > 0) {
+ QaAction.logger.debug("theOnlineFile is available: ");
+ uploadedFile = qaAuthoringForm.getTheOnlineFile();
+ QaAction.logger.debug("uploadedFile: " + uploadedFile);
+ isOnlineFile = true;
+ fileType = IToolContentHandler.TYPE_ONLINE;
+ } else {
+ /* no file uploaded */
+ return;
+ }
+
+ // validate upload file size.
+ ActionMessages errors = new ActionMessages();
+ FileValidatorUtil.validateFileSize(uploadedFile, true, errors);
+ if (!errors.isEmpty()) {
+ this.saveErrors(request, errors);
+ return;
+ }
+
+ QaAction.logger.debug("uploadedFile.getFileName(): " + uploadedFile.getFileName());
+
+ /*
+ * if a file with the same name already exists then move the old one to deleted
+ */
+ deletedAttachmentList = QaUtils.moveToDelete(uploadedFile.getFileName(), isOnlineFile, attachmentList,
+ deletedAttachmentList);
+ QaAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
+
+ try {
+ /*
+ * This is a new file and so is saved to the content repository. Add it to the attachments collection, but
+ * don't add it to the tool's tables yet.
+ */
+ NodeKey node = getToolContentHandler().uploadFile(uploadedFile.getInputStream(),
+ uploadedFile.getFileName(), uploadedFile.getContentType(), fileType);
+ QaUploadedFile file = new QaUploadedFile();
+ String fileName = uploadedFile.getFileName();
+ QaAction.logger.debug("fileName: " + fileName);
+ QaAction.logger.debug("fileName length: " + fileName.length());
+
+ if (fileName != null && fileName.length() > 30) {
+ fileName = fileName.substring(0, 31);
+ QaAction.logger.debug("shortened fileName: " + fileName);
+ }
+
+ file.setFileName(fileName);
+ file.setFileOnline(isOnlineFile);
+ file.setUuid(node.getUuid().toString());
+ /* file.setVersionId(node.getVersion()); */
+
+ /*
+ * add the files to the attachment collection - if one existed, it should have already been removed.
+ */
+ attachmentList.add(file);
+
+ /* reset the fields so that more files can be uploaded */
+ qaAuthoringForm.setTheOfflineFile(null);
+ qaAuthoringForm.setTheOnlineFile(null);
+ } catch (FileNotFoundException e) {
+ QaAction.logger.error("Unable to uploadfile", e);
+ throw new RuntimeException("Unable to upload file, exception was " + e.getMessage());
+ } catch (IOException e) {
+ QaAction.logger.error("Unable to uploadfile", e);
+ throw new RuntimeException("Unable to upload file, exception was " + e.getMessage());
+ } catch (RepositoryCheckedException e) {
+ QaAction.logger.error("Unable to uploadfile", e);
+ throw new RuntimeException("Unable to upload file, exception was " + e.getMessage());
+ }
}
-
-
+
/**
* QaToolContentHandler getToolContentHandler()
+ *
* @return
*/
- private QaToolContentHandler getToolContentHandler()
- {
- if ( toolContentHandler == null ) {
- WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet().getServletContext());
- toolContentHandler = (QaToolContentHandler) wac.getBean("qaToolContentHandler");
- }
- return toolContentHandler;
+ private QaToolContentHandler getToolContentHandler() {
+ if (toolContentHandler == null) {
+ WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet()
+ .getServletContext());
+ toolContentHandler = (QaToolContentHandler) wac.getBean("qaToolContentHandler");
+ }
+ return toolContentHandler;
}
/**
*
- * Go through the attachments collections. Remove any content repository or tool objects
- * matching entries in the the deletedAttachments collection, add any new attachments in the
- * attachments collection. Clear the deletedAttachments collection, ready for new editing.
+ * Go through the attachments collections. Remove any content repository or tool objects matching entries in the the
+ * deletedAttachments collection, add any new attachments in the attachments collection. Clear the
+ * deletedAttachments collection, ready for new editing.
*
* @param qaContent
* @param attachmentList
@@ -1968,75 +1865,66 @@
* @param request
* @return
*/
- private List saveAttachments (QaContent qaContent,
- List attachmentList, List deletedAttachmentList,
- ActionMapping mapping, HttpServletRequest request) {
+ private List saveAttachments(QaContent qaContent, List attachmentList, List deletedAttachmentList,
+ ActionMapping mapping, HttpServletRequest request) {
- logger.debug("start saveAttachments, attachmentList " + attachmentList);
- logger.debug("start deletedAttachmentList, deletedAttachmentList " + deletedAttachmentList);
-
- if(attachmentList==null || deletedAttachmentList==null)
- return null;
-
- IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
-
- if ( deletedAttachmentList != null ) {
- logger.debug("deletedAttachmentList is iterated...");
- Iterator iter = deletedAttachmentList.iterator();
- while (iter.hasNext()) {
- QaUploadedFile attachment = (QaUploadedFile) iter.next();
- logger.debug("attachment: " + attachment);
-
- /* remove entry from db, leave in content repository. */
+ QaAction.logger.debug("start saveAttachments, attachmentList " + attachmentList);
+ QaAction.logger.debug("start deletedAttachmentList, deletedAttachmentList " + deletedAttachmentList);
- if ( attachment.getSubmissionId() != null ) {
- qaService.removeFile(attachment.getSubmissionId());
- }
- }
- deletedAttachmentList.clear();
- logger.error("cleared attachment list.");
- }
-
- if ( attachmentList != null )
- {
- logger.debug("attachmentList is iterated...");
- Iterator iter = attachmentList.iterator();
- while (iter.hasNext()) {
- QaUploadedFile attachment = (QaUploadedFile) iter.next();
- logger.debug("attachment: " + attachment);
- logger.debug("attachment submission id: " + attachment.getSubmissionId());
+ if (attachmentList == null || deletedAttachmentList == null) {
+ return null;
+ }
- if ( attachment.getSubmissionId() == null ) {
- /* add entry to tool table - file already in content repository */
- logger.debug("calling persistFile with attachment: " + attachment);
- qaService.persistFile(qaContent, attachment);
- }
- }
- }
-
- return deletedAttachmentList;
- }
-
-
- public ActionForward editActivity(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
- {
- logger.debug("dispatching proxy editActivity...");
- return null;
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaAction.logger.debug("qaService: " + qaService);
+
+ if (deletedAttachmentList != null) {
+ QaAction.logger.debug("deletedAttachmentList is iterated...");
+ Iterator iter = deletedAttachmentList.iterator();
+ while (iter.hasNext()) {
+ QaUploadedFile attachment = (QaUploadedFile) iter.next();
+ QaAction.logger.debug("attachment: " + attachment);
+
+ /* remove entry from db, leave in content repository. */
+
+ if (attachment.getSubmissionId() != null) {
+ qaService.removeFile(attachment.getSubmissionId());
+ }
+ }
+ deletedAttachmentList.clear();
+ QaAction.logger.error("cleared attachment list.");
}
-
+ if (attachmentList != null) {
+ QaAction.logger.debug("attachmentList is iterated...");
+ Iterator iter = attachmentList.iterator();
+ while (iter.hasNext()) {
+ QaUploadedFile attachment = (QaUploadedFile) iter.next();
+ QaAction.logger.debug("attachment: " + attachment);
+ QaAction.logger.debug("attachment submission id: " + attachment.getSubmissionId());
+
+ if (attachment.getSubmissionId() == null) {
+ /*
+ * add entry to tool table - file already in content repository
+ */
+ QaAction.logger.debug("calling persistFile with attachment: " + attachment);
+ qaService.persistFile(qaContent, attachment);
+ }
+ }
+ }
+
+ return deletedAttachmentList;
+ }
+
+ public ActionForward editActivity(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaAction.logger.debug("dispatching proxy editActivity...");
+ return null;
+ }
+
/**
- * calls monitoring action summary screen generation
- * ActionForward getSummary(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
+ * calls monitoring action summary screen generation ActionForward getSummary(ActionMapping mapping, ActionForm
+ * form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
*
* @param mapping
* @param form
@@ -2046,25 +1934,16 @@
* @throws IOException
* @throws ServletException
*/
- public ActionForward getSummary(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
- {
- logger.debug("dispatching proxy getSummary...start with monitoringStarter" + request);
- QaMonitoringAction qaMonitoringAction= new QaMonitoringAction();
- return qaMonitoringAction.getSummary(mapping, form, request, response);
- }
+ public ActionForward getSummary(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaAction.logger.debug("dispatching proxy getSummary...start with monitoringStarter" + request);
+ QaMonitoringAction qaMonitoringAction = new QaMonitoringAction();
+ return qaMonitoringAction.getSummary(mapping, form, request, response);
+ }
-
/**
- * calls monitoring action instructions screen generation
- * ActionForward getInstructions(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
+ * calls monitoring action instructions screen generation ActionForward getInstructions(ActionMapping mapping,
+ * ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
*
* @param mapping
* @param form
@@ -2074,25 +1953,18 @@
* @throws IOException
* @throws ServletException
*/
- public ActionForward getInstructions(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
- {
- logger.debug("dispatching proxy getInstructions..." + request);
- QaMonitoringAction qaMonitoringAction= new QaMonitoringAction();
- return qaMonitoringAction.getInstructions(mapping, form, request, response);
- }
+ public ActionForward getInstructions(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaAction.logger.debug("dispatching proxy getInstructions..." + request);
+ QaMonitoringAction qaMonitoringAction = new QaMonitoringAction();
+ return qaMonitoringAction.getInstructions(mapping, form, request, response);
+ }
/**
* calls monitoring action stats screen generation
*
- * ActionForward getStats(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
+ * ActionForward getStats(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse
+ * response) throws IOException, ServletException
*
* @param mapping
* @param form
@@ -2102,27 +1974,18 @@
* @throws IOException
* @throws ServletException
*/
- public ActionForward getStats(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
- {
- logger.debug("dispatching proxy getStats..." + request);
- QaMonitoringAction qaMonitoringAction= new QaMonitoringAction();
- //return qaMonitoringAction.getStats(mapping, form, request, response, "All");
- return null;
- }
+ public ActionForward getStats(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaAction.logger.debug("dispatching proxy getStats..." + request);
+ QaMonitoringAction qaMonitoringAction = new QaMonitoringAction();
+ // return qaMonitoringAction.getStats(mapping, form, request, response,
+ // "All");
+ return null;
+ }
-
/**
- * generates Edit Activity screen
- * ActionForward editActivityQuestions(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException,
- ToolException
+ * generates Edit Activity screen ActionForward editActivityQuestions(ActionMapping mapping, ActionForm form,
+ * HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, ToolException
*
* @param mapping
* @param form
@@ -2133,150 +1996,137 @@
* @throws ServletException
* @throws ToolException
*/
- public ActionForward editActivityQuestions(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException,
- ToolException
- {
- logger.debug("dispatching editActivityQuestions...");
-
- QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
- logger.debug("qaAuthoringForm: " + qaAuthoringForm);
-
- IQaService qaService =QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
+ public ActionForward editActivityQuestions(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException, ToolException {
+ QaAction.logger.debug("dispatching editActivityQuestions...");
- String httpSessionID=qaAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
-
- SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaAuthoringForm.setContentFolderID(contentFolderID);
+ QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
+ QaAction.logger.debug("qaAuthoringForm: " + qaAuthoringForm);
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaAction.logger.debug("qaService: " + qaService);
- String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
-
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
- String defaultContentIdStr=request.getParameter(DEFAULT_CONTENT_ID_STR);
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("qaContent: " + qaContent);
-
- QaGeneralAuthoringDTO qaGeneralAuthoringDTO= new QaGeneralAuthoringDTO();
- logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
+ String httpSessionID = qaAuthoringForm.getHttpSessionID();
+ QaAction.logger.debug("httpSessionID: " + httpSessionID);
-
- logger.debug("title: " + qaContent.getTitle());
- logger.debug("instructions: " + qaContent.getInstructions());
-
- qaGeneralAuthoringDTO.setActivityTitle(qaContent.getTitle());
- qaAuthoringForm.setTitle(qaContent.getTitle());
-
- qaGeneralAuthoringDTO.setActivityInstructions(qaContent.getInstructions());
-
- sessionMap.put(ACTIVITY_TITLE_KEY, qaContent.getTitle());
- sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, qaContent.getInstructions());
-
-
-
- /* determine whether the request is from Monitoring url Edit Activity*/
- String sourceMcStarter = (String) request.getAttribute(SOURCE_MC_STARTER);
- logger.debug("sourceMcStarter: " + sourceMcStarter);
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
+ QaAction.logger.debug("sessionMap: " + sessionMap);
- qaAuthoringForm.setDefineLaterInEditMode(new Boolean(true).toString());
- qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
-
- boolean isContentInUse=QaUtils.isContentInUse(qaContent);
- logger.debug("isContentInUse:" + isContentInUse);
-
- qaGeneralAuthoringDTO.setMonitoredContentInUse(new Boolean(false).toString());
- if (isContentInUse == true)
- {
- logger.debug("monitoring url does not allow editActivity since the content is in use.");
- persistError(request,"error.content.inUse");
- qaGeneralAuthoringDTO.setMonitoredContentInUse(new Boolean(true).toString());
- }
-
- EditActivityDTO editActivityDTO = new EditActivityDTO();
- logger.debug("isContentInUse:" + isContentInUse);
- if (isContentInUse == true)
- {
- editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
- }
- request.setAttribute(EDIT_ACTIVITY_DTO, editActivityDTO);
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaAuthoringForm.setContentFolderID(contentFolderID);
- QaUtils.setDefineLater(request, true, strToolContentID, qaService);
+ String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE);
+ QaAction.logger.debug("activeModule: " + activeModule);
- QaUtils.setFormProperties(request, qaService,
- qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID, defaultContentIdStr, activeModule, sessionMap, httpSessionID);
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaAction.logger.debug("strToolContentID: " + strToolContentID);
+ String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR);
+ QaAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
- qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
- qaGeneralAuthoringDTO.setActiveModule(activeModule);
- qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
- qaAuthoringForm.setToolContentID(strToolContentID);
- qaAuthoringForm.setActiveModule(activeModule);
- qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
- qaAuthoringForm.setCurrentTab("1");
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaAction.logger.debug("qaContent: " + qaContent);
- List listQuestionContentDTO= new LinkedList();
+ QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO();
+ QaAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
- Iterator queIterator=qaContent.getQaQueContents().iterator();
- while (queIterator.hasNext())
- {
- QaQuestionContentDTO qaQuestionContentDTO=new QaQuestionContentDTO();
-
- QaQueContent qaQueContent=(QaQueContent) queIterator.next();
- if (qaQueContent != null)
- {
- logger.debug("question: " + qaQueContent.getQuestion());
- logger.debug("displayorder: " + new Integer(qaQueContent.getDisplayOrder()).toString());
- logger.debug("feedback: " + qaQueContent.getFeedback());
-
- qaQuestionContentDTO.setQuestion(qaQueContent.getQuestion());
- qaQuestionContentDTO.setDisplayOrder(new Integer(qaQueContent.getDisplayOrder()).toString());
- qaQuestionContentDTO.setFeedback(qaQueContent.getFeedback());
- listQuestionContentDTO.add(qaQuestionContentDTO);
- }
- }
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
- request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
- sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
-
- request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
- request.getSession().setAttribute(httpSessionID, sessionMap);
-
- logger.debug("before fwding to jsp, qaAuthoringForm: " + qaAuthoringForm);
- logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- request.setAttribute(QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+ QaAction.logger.debug("title: " + qaContent.getTitle());
+ QaAction.logger.debug("instructions: " + qaContent.getInstructions());
- logger.debug("forwarding to : " + LOAD_QUESTIONS);
- return mapping.findForward(LOAD_QUESTIONS);
+ qaGeneralAuthoringDTO.setActivityTitle(qaContent.getTitle());
+ qaAuthoringForm.setTitle(qaContent.getTitle());
+
+ qaGeneralAuthoringDTO.setActivityInstructions(qaContent.getInstructions());
+
+ sessionMap.put(QaAppConstants.ACTIVITY_TITLE_KEY, qaContent.getTitle());
+ sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, qaContent.getInstructions());
+
+ /* determine whether the request is from Monitoring url Edit Activity */
+ String sourceMcStarter = (String) request.getAttribute(QaAppConstants.SOURCE_MC_STARTER);
+ QaAction.logger.debug("sourceMcStarter: " + sourceMcStarter);
+
+ qaAuthoringForm.setDefineLaterInEditMode(new Boolean(true).toString());
+ qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
+
+ boolean isContentInUse = QaUtils.isContentInUse(qaContent);
+ QaAction.logger.debug("isContentInUse:" + isContentInUse);
+
+ qaGeneralAuthoringDTO.setMonitoredContentInUse(new Boolean(false).toString());
+ if (isContentInUse == true) {
+ QaAction.logger.debug("monitoring url does not allow editActivity since the content is in use.");
+ persistError(request, "error.content.inUse");
+ qaGeneralAuthoringDTO.setMonitoredContentInUse(new Boolean(true).toString());
+ }
+
+ EditActivityDTO editActivityDTO = new EditActivityDTO();
+ QaAction.logger.debug("isContentInUse:" + isContentInUse);
+ if (isContentInUse == true) {
+ editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
+ }
+ request.setAttribute(QaAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO);
+
+ QaUtils.setDefineLater(request, true, strToolContentID, qaService);
+
+ QaUtils.setFormProperties(request, qaService, qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID,
+ defaultContentIdStr, activeModule, sessionMap, httpSessionID);
+
+ qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
+ qaGeneralAuthoringDTO.setActiveModule(activeModule);
+ qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
+ qaAuthoringForm.setToolContentID(strToolContentID);
+ qaAuthoringForm.setActiveModule(activeModule);
+ qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
+ qaAuthoringForm.setCurrentTab("1");
+
+ List listQuestionContentDTO = new LinkedList();
+
+ Iterator queIterator = qaContent.getQaQueContents().iterator();
+ while (queIterator.hasNext()) {
+ QaQuestionContentDTO qaQuestionContentDTO = new QaQuestionContentDTO();
+
+ QaQueContent qaQueContent = (QaQueContent) queIterator.next();
+ if (qaQueContent != null) {
+ QaAction.logger.debug("question: " + qaQueContent.getQuestion());
+ QaAction.logger.debug("displayorder: " + new Integer(qaQueContent.getDisplayOrder()).toString());
+ QaAction.logger.debug("feedback: " + qaQueContent.getFeedback());
+
+ qaQuestionContentDTO.setQuestion(qaQueContent.getQuestion());
+ qaQuestionContentDTO.setDisplayOrder(new Integer(qaQueContent.getDisplayOrder()).toString());
+ qaQuestionContentDTO.setFeedback(qaQueContent.getFeedback());
+ listQuestionContentDTO.add(qaQuestionContentDTO);
+ }
+ }
+ QaAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
+ request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
+ sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
+
+ request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
+ request.getSession().setAttribute(httpSessionID, sessionMap);
+
+ QaAction.logger.debug("before fwding to jsp, qaAuthoringForm: " + qaAuthoringForm);
+ QaAction.logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+
+ QaAction.logger.debug("forwarding to : " + QaAppConstants.LOAD_QUESTIONS);
+ return mapping.findForward(QaAppConstants.LOAD_QUESTIONS);
}
/**
* existsContent
+ *
* @param toolContentID
* @param qaService
* @return
*/
- protected boolean existsContent(long toolContentID, IQaService qaService)
- {
- QaContent qaContent=qaService.loadQa(toolContentID);
- if (qaContent == null)
- return false;
-
- return true;
+ protected boolean existsContent(long toolContentID, IQaService qaService) {
+ QaContent qaContent = qaService.loadQa(toolContentID);
+ if (qaContent == null) {
+ return false;
}
-
+
+ return true;
+ }
+
}
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAuthoringConditionAction.java
===================================================================
diff -u
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAuthoringConditionAction.java (revision 0)
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAuthoringConditionAction.java (revision 0af4ed13b963a588f3499b080801863d57f8ad95)
@@ -0,0 +1,484 @@
+/****************************************************************
+ * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+ * =============================================================
+ * License Information: http://lamsfoundation.org/licensing/lams/2.0/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2.0
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ****************************************************************
+ */
+
+/* $$Id$$ */
+package org.lamsfoundation.lams.tool.qa.web;
+
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.math.NumberUtils;
+import org.apache.struts.action.Action;
+import org.apache.struts.action.ActionErrors;
+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.apache.struts.util.LabelValueBean;
+import org.lamsfoundation.lams.tool.qa.QaAppConstants;
+import org.lamsfoundation.lams.tool.qa.QaCondition;
+import org.lamsfoundation.lams.tool.qa.QaQuestionContentDTO;
+import org.lamsfoundation.lams.tool.qa.service.IQaService;
+import org.lamsfoundation.lams.tool.qa.service.QaServiceProxy;
+import org.lamsfoundation.lams.tool.qa.util.QaConditionComparator;
+import org.lamsfoundation.lams.util.WebUtil;
+import org.lamsfoundation.lams.web.util.SessionMap;
+import org.springframework.web.context.WebApplicationContext;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+/**
+ * Auxiliary action in author mode. It contains operations with QaCondition. The rest of operations are located in
+ * QaAction
action.
+ *
+ * @author Marcin Cieslak
+ * @see org.lamsfoundation.lams.tool.qa.web.QaAction
+ */
+public class QaAuthoringConditionAction extends Action {
+
+ @Override
+ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws Exception {
+
+ String param = mapping.getParameter();
+
+ if (param.equals("newConditionInit")) {
+ return newConditionInit(mapping, form, request, response);
+ }
+ if (param.equals("editCondition")) {
+ return editCondition(mapping, form, request, response);
+ }
+ if (param.equals("saveOrUpdateCondition")) {
+ return saveOrUpdateCondition(mapping, form, request, response);
+ }
+ if (param.equals("removeCondition")) {
+ return removeCondition(mapping, form, request, response);
+ }
+ if (param.equals("upCondition")) {
+ return upCondition(mapping, form, request, response);
+ }
+ if (param.equals("downCondition")) {
+ return downCondition(mapping, form, request, response);
+ }
+ return null;
+ }
+
+ /**
+ * Display empty page for a new condition.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ */
+ private ActionForward newConditionInit(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+
+ populateFormWithPossibleItems(form, request);
+ ((QaConditionForm) form).setOrderId(-1);
+ return mapping.findForward("addcondition");
+ }
+
+ /**
+ * Display edit page for an existing condition.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ */
+ private ActionForward editCondition(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+
+ QaConditionForm qaConditionForm = (QaConditionForm) form;
+ String sessionMapID = qaConditionForm.getSessionMapID();
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID);
+
+ int orderId = NumberUtils.stringToInt(request.getParameter(QaAppConstants.PARAM_ORDER_ID), -1);
+ QaCondition condition = null;
+ if (orderId != -1) {
+ SortedSet conditionSet = getQaConditionSet(sessionMap);
+ List conditionList = new ArrayList(conditionSet);
+ condition = conditionList.get(orderId);
+ if (condition != null) {
+ populateConditionToForm(orderId, condition, qaConditionForm, request);
+ }
+ }
+
+ populateFormWithPossibleItems(form, request);
+ return condition == null ? null : mapping.findForward("addcondition");
+ }
+
+ /**
+ * This method will get necessary information from condition form and save or update into HttpSession
+ * condition list. Notice, this save is not persist them into database, just save HttpSession
+ * temporarily. Only they will be persist when the entire authoring page is being persisted.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ * @throws ServletException
+ */
+ private ActionForward saveOrUpdateCondition(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+
+ QaConditionForm conditionForm = (QaConditionForm) form;
+ ActionErrors errors = validateQaCondition(conditionForm, request);
+
+ if (!errors.isEmpty()) {
+ populateFormWithPossibleItems(form, request);
+ this.addErrors(request, errors);
+ return mapping.findForward("addcondition");
+ }
+
+ try {
+ extractFormToQaCondition(request, conditionForm);
+ } catch (Exception e) {
+
+ errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.condition", e.getMessage()));
+ if (!errors.isEmpty()) {
+ populateFormWithPossibleItems(form, request);
+ this.addErrors(request, errors);
+ return mapping.findForward("addcondition");
+ }
+ }
+
+ request.setAttribute(QaAppConstants.ATTR_SESSION_MAP_ID, conditionForm.getSessionMapID());
+
+ return mapping.findForward(QaAppConstants.SUCCESS);
+ }
+
+ /**
+ * Remove condition from HttpSession list and update page display. As authoring rule, all persist only happen when
+ * user submit whole page. So this remove is just impact HttpSession values.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ */
+ private ActionForward removeCondition(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+
+ // get back sessionMAP
+ String sessionMapID = WebUtil.readStrParam(request, QaAppConstants.ATTR_SESSION_MAP_ID);
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID);
+
+ int orderId = NumberUtils.stringToInt(request.getParameter(QaAppConstants.PARAM_ORDER_ID), -1);
+ if (orderId != -1) {
+ SortedSet conditionSet = getQaConditionSet(sessionMap);
+ List conditionList = new ArrayList(conditionSet);
+ QaCondition condition = conditionList.remove(orderId);
+ conditionSet.clear();
+ conditionSet.addAll(conditionList);
+ // add to delList
+ List deletedList = getDeletedQaConditionList(sessionMap);
+ deletedList.add(condition);
+ }
+
+ request.setAttribute(QaAppConstants.ATTR_SESSION_MAP_ID, sessionMapID);
+ return mapping.findForward(QaAppConstants.SUCCESS);
+ }
+
+ /**
+ * Move up current item.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ */
+ private ActionForward upCondition(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+ return switchItem(mapping, request, true);
+ }
+
+ /**
+ * Move down current item.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ */
+ private ActionForward downCondition(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+ return switchItem(mapping, request, false);
+ }
+
+ private ActionForward switchItem(ActionMapping mapping, HttpServletRequest request, boolean up) {
+ // get back sessionMAP
+ String sessionMapID = WebUtil.readStrParam(request, QaAppConstants.ATTR_SESSION_MAP_ID);
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID);
+
+ int orderId = NumberUtils.stringToInt(request.getParameter(QaAppConstants.PARAM_ORDER_ID), -1);
+ if (orderId != -1) {
+ SortedSet conditionSet = getQaConditionSet(sessionMap);
+ List conditionList = new ArrayList(conditionSet);
+ // get current and the target item, and switch their sequnece
+ QaCondition condition = conditionList.get(orderId);
+ QaCondition repCondition;
+ if (up) {
+ repCondition = conditionList.get(--orderId);
+ } else {
+ repCondition = conditionList.get(++orderId);
+ }
+ int upSeqId = repCondition.getOrderId();
+ repCondition.setOrderId(condition.getOrderId());
+ condition.setOrderId(upSeqId);
+
+ // put back list, it will be sorted again
+ conditionSet.clear();
+ conditionSet.addAll(conditionList);
+ }
+
+ request.setAttribute(QaAppConstants.ATTR_SESSION_MAP_ID, sessionMapID);
+ return mapping.findForward(QaAppConstants.SUCCESS);
+ }
+
+ // *************************************************************************************
+ // Private methods for internal needs
+ // *************************************************************************************
+ /**
+ * Return QaService bean.
+ */
+ private IQaService getQaService() {
+ WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet()
+ .getServletContext());
+ return QaServiceProxy.getQaService(getServlet().getServletContext());
+ }
+
+ /**
+ * List save current taskList items.
+ *
+ * @param request
+ * @return
+ */
+ private SortedSet getQaConditionSet(SessionMap sessionMap) {
+ SortedSet list = (SortedSet) sessionMap.get(QaAppConstants.ATTR_CONDITION_SET);
+ if (list == null) {
+ list = new TreeSet(new QaConditionComparator());
+ sessionMap.put(QaAppConstants.ATTR_CONDITION_SET, list);
+ }
+ return list;
+ }
+
+ /**
+ * List save current taskList items.
+ *
+ * @param request
+ * @return
+ */
+ private List getQuestionList(SessionMap sessionMap) {
+ List list = (List) sessionMap
+ .get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
+ if (list == null) {
+ list = new LinkedList();
+ sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, list);
+ }
+ return list;
+ }
+
+ /**
+ * Get the deleted condition list, which could be persisted or non-persisted items.
+ *
+ * @param request
+ * @return
+ */
+ private List getDeletedQaConditionList(SessionMap sessionMap) {
+ return getListFromSession(sessionMap, QaAppConstants.ATTR_DELETED_CONDITION_LIST);
+ }
+
+ /**
+ * Get java.util.List
from HttpSession by given name.
+ *
+ * @param request
+ * @param name
+ * @return
+ */
+ private List getListFromSession(SessionMap sessionMap, String name) {
+ List list = (List) sessionMap.get(name);
+ if (list == null) {
+ list = new ArrayList();
+ sessionMap.put(name, list);
+ }
+ return list;
+ }
+
+ /**
+ * This method will populate condition information to its form for edit use.
+ *
+ * @param orderId
+ * @param condition
+ * @param form
+ * @param request
+ */
+ private void populateConditionToForm(int orderId, QaCondition condition, QaConditionForm form,
+ HttpServletRequest request) {
+ form.populateForm(condition);
+ if (orderId >= 0) {
+ form.setOrderId(new Integer(orderId));
+ }
+
+ Integer[] selectedItems = new Integer[condition.temporaryQuestionDTOSet.size()];
+ int i = 0;
+ for (QaQuestionContentDTO question : condition.temporaryQuestionDTOSet) {
+ selectedItems[i++] = new Integer(question.getDisplayOrder());
+ }
+ form.setSelectedItems(selectedItems);
+ }
+
+ /**
+ * This method will populate questions to choose to the form for edit use.
+ *
+ * @param sequenceId
+ * @param condition
+ * @param form
+ * @param request
+ */
+ private void populateFormWithPossibleItems(ActionForm form, HttpServletRequest request) {
+ QaConditionForm conditionForm = (QaConditionForm) form;
+ // get back sessionMAP
+ String sessionMapID = conditionForm.getSessionMapID();
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID);
+
+ List questions = getQuestionList(sessionMap);
+
+ // Initialise the LabelValueBeans in the possibleOptions array.
+ LabelValueBean[] lvBeans = new LabelValueBean[questions.size()];
+
+ int i = 0;
+ for (QaQuestionContentDTO question : questions) {
+ String nonHTMLQuestion = question.getQuestion();
+ if (nonHTMLQuestion != null) {
+ nonHTMLQuestion = nonHTMLQuestion.replaceAll(QaAppConstants.HTML_TAG_REGEX, "");
+ if (nonHTMLQuestion.length() > QaAppConstants.QUESTION_CUTOFF_INDEX) {
+ nonHTMLQuestion = nonHTMLQuestion.substring(0, QaAppConstants.QUESTION_CUTOFF_INDEX) + "...";
+ }
+ }
+ lvBeans[i++] = new LabelValueBean(nonHTMLQuestion, new Integer(question.getDisplayOrder()).toString());
+ }
+ conditionForm.setPossibleItems(lvBeans);
+ }
+
+ /**
+ * Extract form content to QaCondition.
+ *
+ * @param request
+ * @param form
+ * @throws QaException
+ */
+ private void extractFormToQaCondition(HttpServletRequest request, QaConditionForm form) throws Exception {
+
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(form.getSessionMapID());
+ // check whether it is "edit(old item)" or "add(new item)"
+ SortedSet conditionSet = getQaConditionSet(sessionMap);
+ int orderId = form.getOrderId();
+ QaCondition condition = null;
+
+ if (orderId == -1) { // add
+ String properConditionName = getQaService().createConditionName(conditionSet);
+ condition = form.extractCondition();
+ condition.setName(properConditionName);
+ int maxOrderId = 1;
+ if (conditionSet != null && conditionSet.size() > 0) {
+ QaCondition last = conditionSet.last();
+ maxOrderId = last.getOrderId() + 1;
+ }
+ condition.setOrderId(maxOrderId);
+ conditionSet.add(condition);
+ } else { // edit
+ List conditionList = new ArrayList(conditionSet);
+ condition = conditionList.get(orderId);
+ }
+
+ Integer[] selectedItems = form.getSelectedItems();
+ List questions = getQuestionList(sessionMap);
+
+ condition.temporaryQuestionDTOSet.clear();
+ for (Integer selectedItem : selectedItems) {
+ for (QaQuestionContentDTO question : questions) {
+ if (selectedItem.equals(new Integer(question.getDisplayOrder()))) {
+ condition.temporaryQuestionDTOSet.add(question);
+ }
+ }
+ }
+ }
+
+ /**
+ * Validate QaCondition
+ *
+ * @param conditionForm
+ * @return
+ */
+ private ActionErrors validateQaCondition(QaConditionForm conditionForm, HttpServletRequest request) {
+ ActionErrors errors = new ActionErrors();
+
+ String formConditionName = conditionForm.getDisplayName();
+ if (StringUtils.isBlank(formConditionName)) {
+
+ errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.condition.name.blank"));
+ } else {
+
+ Integer formConditionOrderId = conditionForm.getOrderId();
+
+ String sessionMapID = conditionForm.getSessionMapID();
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID);
+ SortedSet conditionSet = getQaConditionSet(sessionMap);
+ for (QaCondition condition : conditionSet) {
+ if (formConditionName.equals(condition.getDisplayName())
+ && !formConditionOrderId.equals(condition.getOrderId() - 1)) {
+
+ errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.condition.duplicated.name"));
+ break;
+ }
+ }
+ }
+
+ // should be selected at least one question
+ Integer[] selectedItems = conditionForm.getSelectedItems();
+ if (selectedItems == null || selectedItems.length == 0) {
+ errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.condition.no.questions.selected"));
+ }
+
+ return errors;
+ }
+
+ private ActionMessages validate(QaConditionForm form, ActionMapping mapping, HttpServletRequest request) {
+ return new ActionMessages();
+ }
+}
\ No newline at end of file
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaConditionForm.java
===================================================================
diff -u
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaConditionForm.java (revision 0)
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaConditionForm.java (revision 0af4ed13b963a588f3499b080801863d57f8ad95)
@@ -0,0 +1,107 @@
+/****************************************************************
+ * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+ * =============================================================
+ * License Information: http://lamsfoundation.org/licensing/lams/2.0/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2.0
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ****************************************************************
+ */
+
+/* $$Id$$ */
+package org.lamsfoundation.lams.tool.qa.web;
+
+import org.apache.struts.util.LabelValueBean;
+import org.lamsfoundation.lams.tool.qa.QaCondition;
+import org.lamsfoundation.lams.tool.qa.QaQuestionContentDTO;
+import org.lamsfoundation.lams.web.TextSearchActionForm;
+
+/**
+ * A text search form with additional parameters for Q&A needs.
+ *
+ * @author Marcin Cieslak
+ *
+ */
+public class QaConditionForm extends TextSearchActionForm {
+ /**
+ * Names of the questions that could be selected by a user.
+ */
+ private LabelValueBean[] possibleItems;
+ /**
+ * Numbers of questions that were selected by a user.
+ */
+ private Integer[] selectedItems;
+ private Integer orderId;
+ private String displayName;
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public void setDisplayName(String name) {
+ displayName = name;
+ }
+
+ public QaConditionForm() {
+ }
+
+ public void populateForm(QaCondition condition) {
+ super.populateForm(condition);
+ setOrderId(condition.getOrderId());
+ setDisplayName(condition.getDisplayName());
+ Integer[] selectedItems = new Integer[condition.temporaryQuestionDTOSet.size()];
+ int questionIndex = 0;
+ for (QaQuestionContentDTO question : condition.temporaryQuestionDTOSet) {
+ selectedItems[questionIndex] = new Integer(question.getDisplayOrder());
+ questionIndex++;
+ }
+ setSelectedItems(selectedItems);
+ }
+
+ public LabelValueBean[] getPossibleItems() {
+ return possibleItems;
+ }
+
+ public void setPossibleItems(LabelValueBean[] possibleItems) {
+ this.possibleItems = possibleItems;
+ }
+
+ public Integer[] getSelectedItems() {
+ return selectedItems;
+ }
+
+ public void setSelectedItems(Integer[] selectedItems) {
+ this.selectedItems = selectedItems;
+ }
+
+ public Integer getOrderId() {
+ return orderId;
+ }
+
+ public void setOrderId(Integer orderId) {
+ this.orderId = orderId;
+ }
+
+ /**
+ * Fills a new QaCondition with data contained in this form. Note that some cruicial data is missing, so the
+ * condition is NOT complete.
+ *
+ * @return created condition
+ */
+ public QaCondition extractCondition() {
+ return new QaCondition(null, null, getOrderId(), null, getDisplayName(), "OUTPUT_COMPLEX", null, null, null,
+ getAllWords(), getPhrase(), getAnyWords(), getExcludedWords(), null);
+ }
+}
\ No newline at end of file
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java
===================================================================
diff -u -r6cdc71ebb9a54565ad1c47f9750963b3aeda942d -r0af4ed13b963a588f3499b080801863d57f8ad95
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java (.../QaMonitoringAction.java) (revision 6cdc71ebb9a54565ad1c47f9750963b3aeda942d)
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java (.../QaMonitoringAction.java) (revision 0af4ed13b963a588f3499b080801863d57f8ad95)
@@ -17,77 +17,77 @@
USA
http://www.gnu.org/licenses/gpl.txt
-* ***********************************************************************/
+ * ***********************************************************************/
- /**
+/**
* @author Ozgur Demirtas
*
-
-
-
-
-
+
-
-
-
+
-
+
-
-
-
-
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
*/
/* $$Id$$ */
@@ -135,141 +135,117 @@
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.lamsfoundation.lams.web.util.SessionMap;
+public class QaMonitoringAction extends LamsDispatchAction implements QaAppConstants {
+ static Logger logger = Logger.getLogger(QaMonitoringAction.class.getName());
-public class QaMonitoringAction extends LamsDispatchAction implements QaAppConstants
-{
- static Logger logger = Logger.getLogger(QaMonitoringAction.class.getName());
+ public static String SELECTBOX_SELECTED_TOOL_SESSION = "selectBoxSelectedToolSession";
+ public static Integer READABLE_TOOL_SESSION_COUNT = new Integer(1);
- public static String SELECTBOX_SELECTED_TOOL_SESSION ="selectBoxSelectedToolSession";
- public static Integer READABLE_TOOL_SESSION_COUNT = new Integer(1);
-
- public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException, ToolException{
- logger.debug("dispatching unspecified...");
- return null;
+ @Override
+ public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException, ToolException {
+ QaMonitoringAction.logger.debug("dispatching unspecified...");
+ return null;
}
-
-
- public void initStatsContent(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response, GeneralMonitoringDTO generalMonitoringDTO) throws IOException,
- ServletException
- {
- logger.debug("starting initStatsContent...");
-
-
- QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
- logger.debug("qaMonitoringForm: " + qaMonitoringForm);
-
- IQaService qaService = null;
- if (getServlet() != null)
- qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
- else
- qaService=qaMonitoringForm.getQaService();
-
- logger.debug("qaService: " + qaService);
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
- qaMonitoringForm.setToolContentID(strToolContentID);
-
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaMonitoringForm.setContentFolderID(contentFolderID);
-
+ public void initStatsContent(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response, GeneralMonitoringDTO generalMonitoringDTO) throws IOException,
+ ServletException {
+ QaMonitoringAction.logger.debug("starting initStatsContent...");
- String editResponse=request.getParameter(EDIT_RESPONSE);
- logger.debug("editResponse: " + editResponse);
- qaMonitoringForm.setEditResponse(editResponse);
+ QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
+ QaMonitoringAction.logger.debug("qaMonitoringForm: " + qaMonitoringForm);
-
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("existing qaContent:" + qaContent);
+ IQaService qaService = null;
+ if (getServlet() != null) {
+ qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ } else {
+ qaService = qaMonitoringForm.getQaService();
+ }
-
- Map summaryToolSessions=MonitoringUtil.populateToolSessions(request, qaContent, qaService);
- logger.debug("summaryToolSessions: " + summaryToolSessions);
- request.setAttribute(SUMMARY_TOOL_SESSIONS, summaryToolSessions);
- logger.debug("SUMMARY_TOOL_SESSIONS: " + request.getAttribute(SUMMARY_TOOL_SESSIONS));
-
- Map summaryToolSessionsId=MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
- logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
- request.setAttribute(SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
+ QaMonitoringAction.logger.debug("qaService: " + qaService);
-
- if (qaService.studentActivityOccurredGlobal(qaContent))
- {
- generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
- }
- else
- {
- generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
- }
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID);
+ qaMonitoringForm.setToolContentID(strToolContentID);
- refreshStatsData(request, qaMonitoringForm, qaService, generalMonitoringDTO);
- generalMonitoringDTO.setEditResponse(new Boolean(false).toString());
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaMonitoringForm.setContentFolderID(contentFolderID);
- EditActivityDTO editActivityDTO = new EditActivityDTO();
- boolean isContentInUse=QaUtils.isContentInUse(qaContent);
- logger.debug("isContentInUse:" + isContentInUse);
- if (isContentInUse == true)
- {
- editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
- }
- request.setAttribute(EDIT_ACTIVITY_DTO, editActivityDTO);
-
- prepareReflectionData(request, qaContent, qaService, null, false, "All");
-
- prepareEditActivityScreenData(request, qaContent);
+ String editResponse = request.getParameter(QaAppConstants.EDIT_RESPONSE);
+ QaMonitoringAction.logger.debug("editResponse: " + editResponse);
+ qaMonitoringForm.setEditResponse(editResponse);
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaMonitoringAction.logger.debug("existing qaContent:" + qaContent);
- /*find out if there are any reflection entries, from here*/
- boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(qaService, qaContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
-
- if (notebookEntriesExist)
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
- }
- else
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
- }
- /* ... till here*/
-
-
- /**getting instructions screen content from here... */
- generalMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
- generalMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
-
- List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
- logger.debug("attachmentList: " + attachmentList);
- generalMonitoringDTO.setAttachmentList(attachmentList);
- generalMonitoringDTO.setDeletedAttachmentList(new ArrayList());
- /** ...till here **/
+ Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions);
+ QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: "
+ + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS));
-
- logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO );
- request.setAttribute(QA_GENERAL_MONITORING_DTO, generalMonitoringDTO);
- logger.debug("ending initStatsContent...");
-
- MonitoringUtil.buildQaStatsDTO(request,qaService, qaContent);
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
-
+ Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
+
+ if (qaService.studentActivityOccurredGlobal(qaContent)) {
+ generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
+ } else {
+ generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
}
-
+ refreshStatsData(request, qaMonitoringForm, qaService, generalMonitoringDTO);
+ generalMonitoringDTO.setEditResponse(new Boolean(false).toString());
+
+ EditActivityDTO editActivityDTO = new EditActivityDTO();
+ boolean isContentInUse = QaUtils.isContentInUse(qaContent);
+ QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse);
+ if (isContentInUse == true) {
+ editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
+ }
+ request.setAttribute(QaAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO);
+
+ prepareReflectionData(request, qaContent, qaService, null, false, "All");
+
+ prepareEditActivityScreenData(request, qaContent);
+
+ /* find out if there are any reflection entries, from here */
+ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent);
+ QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist);
+
+ if (notebookEntriesExist) {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+ } else {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
+ }
+ /* ... till here */
+
+ /** getting instructions screen content from here... */
+ generalMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
+ generalMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
+
+ List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
+ QaMonitoringAction.logger.debug("attachmentList: " + attachmentList);
+ generalMonitoringDTO.setAttachmentList(attachmentList);
+ generalMonitoringDTO.setDeletedAttachmentList(new ArrayList());
+ /** ...till here * */
+
+ QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO);
+ QaMonitoringAction.logger.debug("ending initStatsContent...");
+
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
+
+ }
+
/**
- * switches to instructions tab of the monitoring url.
- * getInstructions(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
+ * switches to instructions tab of the monitoring url. getInstructions(ActionMapping mapping, ActionForm form,
+ * HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
*
* @param mapping
* @param form
@@ -279,137 +255,113 @@
* @throws IOException
* @throws ServletException
*/
- public ActionForward getInstructions(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
- {
- logger.debug("dispatching getInstructions..." + request);
- initInstructionsContent(mapping, form, request, response);
+ public ActionForward getInstructions(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaMonitoringAction.logger.debug("dispatching getInstructions..." + request);
+ initInstructionsContent(mapping, form, request, response);
- return (mapping.findForward(LOAD_MONITORING));
+ return mapping.findForward(QaAppConstants.LOAD_MONITORING);
+ }
+
+ public void initInstructionsContent(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaMonitoringAction.logger.debug("starting initInstructionsContent...");
+ QaMonitoringAction.logger.debug("dispatching getInstructions..." + request);
+
+ QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
+ QaMonitoringAction.logger.debug("qaMonitoringForm: " + qaMonitoringForm);
+
+ GeneralMonitoringDTO generalMonitoringDTO = new GeneralMonitoringDTO();
+
+ IQaService qaService = null;
+ if (getServlet() != null) {
+ qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ } else {
+ qaService = qaMonitoringForm.getQaService();
}
-
- public void initInstructionsContent(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
- {
- logger.debug("starting initInstructionsContent...");
- logger.debug("dispatching getInstructions..." + request);
-
- QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
- logger.debug("qaMonitoringForm: " + qaMonitoringForm);
+ QaMonitoringAction.logger.debug("qaService: " + qaService);
- GeneralMonitoringDTO generalMonitoringDTO= new GeneralMonitoringDTO();
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID);
+ qaMonitoringForm.setToolContentID(strToolContentID);
- IQaService qaService = null;
- if (getServlet() != null)
- qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
- else
- qaService=qaMonitoringForm.getQaService();
-
- logger.debug("qaService: " + qaService);
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaMonitoringForm.setContentFolderID(contentFolderID);
-
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
- qaMonitoringForm.setToolContentID(strToolContentID);
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaMonitoringForm.setContentFolderID(contentFolderID);
+ String editResponse = request.getParameter(QaAppConstants.EDIT_RESPONSE);
+ QaMonitoringAction.logger.debug("editResponse: " + editResponse);
+ qaMonitoringForm.setEditResponse(editResponse);
-
- String editResponse=request.getParameter(EDIT_RESPONSE);
- logger.debug("editResponse: " + editResponse);
- qaMonitoringForm.setEditResponse(editResponse);
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaMonitoringAction.logger.debug("existing qaContent:" + qaContent);
+ Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions);
+ QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: "
+ + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS));
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("existing qaContent:" + qaContent);
-
- Map summaryToolSessions=MonitoringUtil.populateToolSessions(request, qaContent, qaService);
- logger.debug("summaryToolSessions: " + summaryToolSessions);
- request.setAttribute(SUMMARY_TOOL_SESSIONS, summaryToolSessions);
- logger.debug("SUMMARY_TOOL_SESSIONS: " + request.getAttribute(SUMMARY_TOOL_SESSIONS));
+ Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
-
- Map summaryToolSessionsId=MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
- logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
- request.setAttribute(SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
+ if (qaService.studentActivityOccurredGlobal(qaContent)) {
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
+ generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
+ } else {
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
+ generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
+ }
-
- if (qaService.studentActivityOccurredGlobal(qaContent))
- {
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
- generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
- }
- else
- {
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
- generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
- }
-
- generalMonitoringDTO.setEditResponse(new Boolean(false).toString());
-
- prepareReflectionData(request, qaContent, qaService,null, false, "All");
-
- prepareEditActivityScreenData(request, qaContent);
+ generalMonitoringDTO.setEditResponse(new Boolean(false).toString());
- EditActivityDTO editActivityDTO = new EditActivityDTO();
- boolean isContentInUse=QaUtils.isContentInUse(qaContent);
- logger.debug("isContentInUse:" + isContentInUse);
- if (isContentInUse == true)
- {
- editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
- }
- request.setAttribute(EDIT_ACTIVITY_DTO, editActivityDTO);
+ prepareReflectionData(request, qaContent, qaService, null, false, "All");
- /*find out if there are any reflection entries, from here*/
- boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(qaService, qaContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
-
- if (notebookEntriesExist)
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
- }
- else
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
- }
- /* ... till here*/
+ prepareEditActivityScreenData(request, qaContent);
- /**getting instructions screen content from here... */
- generalMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
- generalMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
-
- List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
- logger.debug("attachmentList: " + attachmentList);
- generalMonitoringDTO.setAttachmentList(attachmentList);
- generalMonitoringDTO.setDeletedAttachmentList(new ArrayList());
- /** ...till here **/
+ EditActivityDTO editActivityDTO = new EditActivityDTO();
+ boolean isContentInUse = QaUtils.isContentInUse(qaContent);
+ QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse);
+ if (isContentInUse == true) {
+ editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
+ }
+ request.setAttribute(QaAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO);
-
- logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO );
- request.setAttribute(QA_GENERAL_MONITORING_DTO, generalMonitoringDTO);
-
- MonitoringUtil.buildQaStatsDTO(request,qaService, qaContent);
+ /* find out if there are any reflection entries, from here */
+ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent);
+ QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist);
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
- logger.debug("ending initInstructionsContent...");
+ if (notebookEntriesExist) {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+ } else {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
}
+ /* ... till here */
+ /** getting instructions screen content from here... */
+ generalMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
+ generalMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
+
+ List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
+ QaMonitoringAction.logger.debug("attachmentList: " + attachmentList);
+ generalMonitoringDTO.setAttachmentList(attachmentList);
+ generalMonitoringDTO.setDeletedAttachmentList(new ArrayList());
+ /** ...till here * */
+
+ QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO);
+
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
+
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
+ QaMonitoringAction.logger.debug("ending initInstructionsContent...");
+ }
+
/**
- * activates editActivity screen
- * ActionForward editActivity(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
+ * activates editActivity screen ActionForward editActivity(ActionMapping mapping, ActionForm form,
+ * HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
*
* @param mapping
* @param form
@@ -419,139 +371,123 @@
* @throws IOException
* @throws ServletException
*/
- public ActionForward editActivity(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
- {
- logger.debug("dispatching editActivity...");
- QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
- logger.debug("qaMonitoringForm: " + qaMonitoringForm);
+ public ActionForward editActivity(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaMonitoringAction.logger.debug("dispatching editActivity...");
+ QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
+ QaMonitoringAction.logger.debug("qaMonitoringForm: " + qaMonitoringForm);
- IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
-
- if (qaService == null)
- qaService=qaMonitoringForm.getQaService();
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaMonitoringAction.logger.debug("qaService: " + qaService);
+ if (qaService == null) {
+ qaService = qaMonitoringForm.getQaService();
+ }
- QaStarterAction qaStarterAction= new QaStarterAction();
-
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
- qaMonitoringForm.setToolContentID(strToolContentID);
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaMonitoringForm.setContentFolderID(contentFolderID);
+ QaStarterAction qaStarterAction = new QaStarterAction();
-
- String editResponse=request.getParameter(EDIT_RESPONSE);
- logger.debug("editResponse: " + editResponse);
- qaMonitoringForm.setEditResponse(editResponse);
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID);
+ qaMonitoringForm.setToolContentID(strToolContentID);
-
- request.setAttribute(SOURCE_MC_STARTER, "monitoring");
- logger.debug("SOURCE_MC_STARTER: monitoring");
-
- /* it is possible that the content is being used by some learners. In this situation, the content is marked as "in use" and
- content in use is not modifiable*/
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("qaContent:" + qaContent);
-
- Map summaryToolSessions=MonitoringUtil.populateToolSessions(request, qaContent, qaService);
- logger.debug("summaryToolSessions: " + summaryToolSessions);
- request.setAttribute(SUMMARY_TOOL_SESSIONS, summaryToolSessions);
- logger.debug("SUMMARY_TOOL_SESSIONS: " + request.getAttribute(SUMMARY_TOOL_SESSIONS));
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaMonitoringForm.setContentFolderID(contentFolderID);
- Map summaryToolSessionsId=MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
- logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
- request.setAttribute(SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
+ String editResponse = request.getParameter(QaAppConstants.EDIT_RESPONSE);
+ QaMonitoringAction.logger.debug("editResponse: " + editResponse);
+ qaMonitoringForm.setEditResponse(editResponse);
- GeneralMonitoringDTO generalMonitoringDTO= new GeneralMonitoringDTO();
- if (qaService.studentActivityOccurredGlobal(qaContent))
- {
- logger.debug("student activity occurred on this content:" + qaContent);
- generalMonitoringDTO.setUserExceptionContentInUse(new Boolean(true).toString());
- logger.debug("forwarding to: " + LOAD_MONITORING);
- return (mapping.findForward(LOAD_MONITORING));
- }
-
- if (qaContent.getTitle() == null)
- {
- generalMonitoringDTO.setActivityTitle("Questions and Answers");
- generalMonitoringDTO.setActivityInstructions("Please answer the questions.");
- }
- else
- {
- generalMonitoringDTO.setActivityTitle(qaContent.getTitle());
- generalMonitoringDTO.setActivityInstructions(qaContent.getInstructions());
- }
-
- logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO );
- request.setAttribute(QA_GENERAL_MONITORING_DTO, generalMonitoringDTO);
+ request.setAttribute(QaAppConstants.SOURCE_MC_STARTER, "monitoring");
+ QaMonitoringAction.logger.debug("SOURCE_MC_STARTER: monitoring");
- EditActivityDTO editActivityDTO = new EditActivityDTO();
- boolean isContentInUse=QaUtils.isContentInUse(qaContent);
- logger.debug("isContentInUse:" + isContentInUse);
- if (isContentInUse == true)
- {
- editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
- }
- request.setAttribute(EDIT_ACTIVITY_DTO, editActivityDTO);
+ /*
+ * it is possible that the content is being used by some learners. In this situation, the content is marked as
+ * "in use" and content in use is not modifiable
+ */
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaMonitoringAction.logger.debug("qaContent:" + qaContent);
- /**getting instructions screen content from here... */
- generalMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
- generalMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
-
- List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
- logger.debug("attachmentList: " + attachmentList);
- generalMonitoringDTO.setAttachmentList(attachmentList);
- generalMonitoringDTO.setDeletedAttachmentList(new ArrayList());
- /** ...till here **/
+ Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions);
+ QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: "
+ + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS));
- logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO );
- request.setAttribute(QA_GENERAL_MONITORING_DTO, generalMonitoringDTO);
-
- prepareReflectionData(request, qaContent, qaService,null, false, "All");
-
- prepareEditActivityScreenData(request, qaContent);
+ Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
+ GeneralMonitoringDTO generalMonitoringDTO = new GeneralMonitoringDTO();
+ if (qaService.studentActivityOccurredGlobal(qaContent)) {
+ QaMonitoringAction.logger.debug("student activity occurred on this content:" + qaContent);
+ generalMonitoringDTO.setUserExceptionContentInUse(new Boolean(true).toString());
+ QaMonitoringAction.logger.debug("forwarding to: " + QaAppConstants.LOAD_MONITORING);
+ return mapping.findForward(QaAppConstants.LOAD_MONITORING);
+ }
- /*find out if there are any reflection entries, from here*/
- boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(qaService, qaContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
-
- if (notebookEntriesExist)
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
- }
- else
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
- }
- /* ... till here*/
+ if (qaContent.getTitle() == null) {
+ generalMonitoringDTO.setActivityTitle("Questions and Answers");
+ generalMonitoringDTO.setActivityInstructions("Please answer the questions.");
+ } else {
+ generalMonitoringDTO.setActivityTitle(qaContent.getTitle());
+ generalMonitoringDTO.setActivityInstructions(qaContent.getInstructions());
+ }
- MonitoringUtil.buildQaStatsDTO(request,qaService, qaContent);
-
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
-
- /* note that we are casting monitoring form subclass into Authoring form*/
- logger.debug("watch here: note that we are casting monitoring form subclass into Authoring form");
- return qaStarterAction.executeDefineLater(mapping, qaMonitoringForm, request, response, qaService);
+ QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO);
+
+ EditActivityDTO editActivityDTO = new EditActivityDTO();
+ boolean isContentInUse = QaUtils.isContentInUse(qaContent);
+ QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse);
+ if (isContentInUse == true) {
+ editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
}
+ request.setAttribute(QaAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO);
-
-
+ /** getting instructions screen content from here... */
+ generalMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
+ generalMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
+
+ List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
+ QaMonitoringAction.logger.debug("attachmentList: " + attachmentList);
+ generalMonitoringDTO.setAttachmentList(attachmentList);
+ generalMonitoringDTO.setDeletedAttachmentList(new ArrayList());
+ /** ...till here * */
+
+ QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO);
+
+ prepareReflectionData(request, qaContent, qaService, null, false, "All");
+
+ prepareEditActivityScreenData(request, qaContent);
+
+ /* find out if there are any reflection entries, from here */
+ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent);
+ QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist);
+
+ if (notebookEntriesExist) {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+ } else {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
+ }
+ /* ... till here */
+
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
+
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
+
+ /* note that we are casting monitoring form subclass into Authoring form */
+ QaMonitoringAction.logger
+ .debug("watch here: note that we are casting monitoring form subclass into Authoring form");
+ return qaStarterAction.executeDefineLater(mapping, qaMonitoringForm, request, response, qaService);
+ }
+
/**
* switches to summary tab of the monitoring url
*
- * getSummary(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
+ * getSummary(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
+ * throws IOException, ServletException
*
* @param mapping
* @param form
@@ -561,293 +497,249 @@
* @throws IOException
* @throws ServletException
*/
- public ActionForward getSummary(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
- {
- logger.debug("start getSummary...");
- initSummaryContent(mapping, form, request, response);
- return (mapping.findForward(LOAD_MONITORING));
+ public ActionForward getSummary(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaMonitoringAction.logger.debug("start getSummary...");
+ initSummaryContent(mapping, form, request, response);
+ return mapping.findForward(QaAppConstants.LOAD_MONITORING);
+ }
+
+ public void initSummaryContent(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaMonitoringAction.logger.debug("initSummaryContent...");
+ QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
+ QaMonitoringAction.logger.debug("qaMonitoringForm: " + qaMonitoringForm);
+
+ GeneralMonitoringDTO generalMonitoringDTO = new GeneralMonitoringDTO();
+
+ IQaService qaService = null;
+ if (getServlet() != null) {
+ qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ } else {
+ qaService = qaMonitoringForm.getQaService();
}
-
-
- public void initSummaryContent(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
- {
- logger.debug("initSummaryContent...");
- QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
- logger.debug("qaMonitoringForm: " + qaMonitoringForm);
+ QaMonitoringAction.logger.debug("qaService: " + qaService);
- GeneralMonitoringDTO generalMonitoringDTO= new GeneralMonitoringDTO();
-
- IQaService qaService = null;
- if (getServlet() != null)
- qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
- else
- qaService=qaMonitoringForm.getQaService();
-
- logger.debug("qaService: " + qaService);
-
-
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
- qaMonitoringForm.setToolContentID(strToolContentID);
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaMonitoringForm.setContentFolderID(contentFolderID);
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID);
+ qaMonitoringForm.setToolContentID(strToolContentID);
-
- String editResponse=request.getParameter(EDIT_RESPONSE);
- logger.debug("editResponse: " + editResponse);
- qaMonitoringForm.setEditResponse(editResponse);
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaMonitoringForm.setContentFolderID(contentFolderID);
+ String editResponse = request.getParameter(QaAppConstants.EDIT_RESPONSE);
+ QaMonitoringAction.logger.debug("editResponse: " + editResponse);
+ qaMonitoringForm.setEditResponse(editResponse);
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("existing qaContent:" + qaContent);
-
-
- /* this section is related to summary tab. Starts here. */
- Map summaryToolSessions=MonitoringUtil.populateToolSessions(request, qaContent, qaService);
- logger.debug("summaryToolSessions: " + summaryToolSessions);
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaMonitoringAction.logger.debug("existing qaContent:" + qaContent);
- request.setAttribute(SUMMARY_TOOL_SESSIONS, summaryToolSessions);
- logger.debug("SUMMARY_TOOL_SESSIONS: " + request.getAttribute(SUMMARY_TOOL_SESSIONS));
-
- Map summaryToolSessionsId=MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
- logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
- request.setAttribute(SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
+ /* this section is related to summary tab. Starts here. */
+ Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions);
-
- /*true means there is at least 1 response*/
- if (qaService.studentActivityOccurredGlobal(qaContent))
- {
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
- generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
- }
- else
- {
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
- generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
- }
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions);
+ QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: "
+ + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS));
- generalMonitoringDTO.setEditResponse(new Boolean(false).toString());
+ Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
- EditActivityDTO editActivityDTO = new EditActivityDTO();
- boolean isContentInUse=QaUtils.isContentInUse(qaContent);
- logger.debug("isContentInUse:" + isContentInUse);
- if (isContentInUse == true)
- {
- editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
- }
- request.setAttribute(EDIT_ACTIVITY_DTO, editActivityDTO);
+ /* true means there is at least 1 response */
+ if (qaService.studentActivityOccurredGlobal(qaContent)) {
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
+ generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
+ } else {
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
+ generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
+ }
- prepareReflectionData(request, qaContent, qaService,null, false, "All");
-
- prepareEditActivityScreenData(request, qaContent);
+ generalMonitoringDTO.setEditResponse(new Boolean(false).toString());
-
- /*find out if there are any reflection entries, from here*/
- boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(qaService, qaContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
-
- if (notebookEntriesExist)
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
- }
- else
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
- }
- /* ... till here*/
+ EditActivityDTO editActivityDTO = new EditActivityDTO();
+ boolean isContentInUse = QaUtils.isContentInUse(qaContent);
+ QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse);
+ if (isContentInUse == true) {
+ editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
+ }
+ request.setAttribute(QaAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO);
- /*getting instructions screen content from here... */
- generalMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
- generalMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
-
- List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
- logger.debug("attachmentList: " + attachmentList);
- generalMonitoringDTO.setAttachmentList(attachmentList);
- generalMonitoringDTO.setDeletedAttachmentList(new ArrayList());
- /* ...till here */
+ prepareReflectionData(request, qaContent, qaService, null, false, "All");
- // setting up the advanced summary for LDEV-1662
- request.setAttribute("showOtherAnswers", qaContent.isShowOtherAnswers());
- request.setAttribute("usernameVisible", qaContent.isUsernameVisible());
- request.setAttribute("questionsSequenced", qaContent.isQuestionsSequenced());
- request.setAttribute("lockWhenFinished", qaContent.isLockWhenFinished());
- request.setAttribute("reflect", qaContent.isReflect());
- request.setAttribute("reflectionSubject", qaContent.getReflectionSubject());
-
- logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO );
- request.setAttribute(QA_GENERAL_MONITORING_DTO, generalMonitoringDTO);
+ prepareEditActivityScreenData(request, qaContent);
- MonitoringUtil.buildQaStatsDTO(request,qaService, qaContent);
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
-
- logger.debug("end initSummaryContent...");
+ /* find out if there are any reflection entries, from here */
+ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent);
+ QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist);
+
+ if (notebookEntriesExist) {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+ } else {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
}
+ /* ... till here */
-
- public ActionForward editActivityQuestions(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException,
- ToolException
- {
- logger.debug("dispatching editActivityQuestions...");
-
- QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
- logger.debug("qaMonitoringForm: " + qaMonitoringForm);
+ /* getting instructions screen content from here... */
+ generalMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
+ generalMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
- IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
-
- GeneralMonitoringDTO generalMonitoringDTO = new GeneralMonitoringDTO();
-
- generalMonitoringDTO.setMonitoredContentInUse(new Boolean(false).toString());
-
- EditActivityDTO editActivityDTO = new EditActivityDTO();
- editActivityDTO.setMonitoredContentInUse(new Boolean(false).toString());
- request.setAttribute(EDIT_ACTIVITY_DTO, editActivityDTO);
-
- generalMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
-
-
- logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO );
- request.setAttribute(QA_GENERAL_MONITORING_DTO, generalMonitoringDTO);
+ List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
+ QaMonitoringAction.logger.debug("attachmentList: " + attachmentList);
+ generalMonitoringDTO.setAttachmentList(attachmentList);
+ generalMonitoringDTO.setDeletedAttachmentList(new ArrayList());
+ /* ...till here */
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
- qaMonitoringForm.setToolContentID(strToolContentID);
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaMonitoringForm.setContentFolderID(contentFolderID);
-
- String httpSessionID=request.getParameter("httpSessionID");
- logger.debug("httpSessionID: " + httpSessionID);
- qaMonitoringForm.setHttpSessionID(httpSessionID);
+ // setting up the advanced summary for LDEV-1662
+ request.setAttribute("showOtherAnswers", qaContent.isShowOtherAnswers());
+ request.setAttribute("usernameVisible", qaContent.isUsernameVisible());
+ request.setAttribute("questionsSequenced", qaContent.isQuestionsSequenced());
+ request.setAttribute("lockWhenFinished", qaContent.isLockWhenFinished());
+ request.setAttribute("reflect", qaContent.isReflect());
+ request.setAttribute("reflectionSubject", qaContent.getReflectionSubject());
-
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("existing qaContent:" + qaContent);
-
- qaMonitoringForm.setTitle(qaContent.getTitle());
+ QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO);
- QaUtils.setDefineLater(request, true,strToolContentID, qaService);
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
- prepareEditActivityScreenData(request, qaContent);
-
- prepareReflectionData(request, qaContent, qaService, null, false, "All");
-
- if (qaService.studentActivityOccurredGlobal(qaContent))
- {
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
- generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
- }
- else
- {
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
- generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
- }
-
- /**getting instructions screen content from here... */
- generalMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
- generalMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
-
- List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
- logger.debug("attachmentList: " + attachmentList);
- generalMonitoringDTO.setAttachmentList(attachmentList);
- generalMonitoringDTO.setDeletedAttachmentList(new ArrayList());
- /** ...till here **/
+ QaMonitoringAction.logger.debug("end initSummaryContent...");
+ }
-
-
- logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO );
- request.setAttribute(QA_GENERAL_MONITORING_DTO, generalMonitoringDTO);
-
-
- List listQuestionContentDTO= new LinkedList();
+ public ActionForward editActivityQuestions(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException, ToolException {
+ QaMonitoringAction.logger.debug("dispatching editActivityQuestions...");
- Iterator queIterator=qaContent.getQaQueContents().iterator();
- while (queIterator.hasNext())
- {
- QaQuestionContentDTO qaQuestionContentDTO=new QaQuestionContentDTO();
-
- QaQueContent qaQueContent=(QaQueContent) queIterator.next();
- if (qaQueContent != null)
- {
- logger.debug("question: " + qaQueContent.getQuestion());
- logger.debug("displayorder: " + new Integer(qaQueContent.getDisplayOrder()).toString());
- logger.debug("feedback: " + qaQueContent.getFeedback());
-
- qaQuestionContentDTO.setQuestion(qaQueContent.getQuestion());
- qaQuestionContentDTO.setDisplayOrder(new Integer(qaQueContent.getDisplayOrder()).toString());
- qaQuestionContentDTO.setFeedback(qaQueContent.getFeedback());
- listQuestionContentDTO.add(qaQuestionContentDTO);
- }
- }
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
- request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
+ QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
+ QaMonitoringAction.logger.debug("qaMonitoringForm: " + qaMonitoringForm);
- request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
-
- QaGeneralAuthoringDTO qaGeneralAuthoringDTO = (QaGeneralAuthoringDTO)request.getAttribute(QA_GENERAL_AUTHORING_DTO);
- qaGeneralAuthoringDTO.setActiveModule(MONITORING);
-
- qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
- qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
- qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaMonitoringAction.logger.debug("qaService: " + qaService);
- request.setAttribute(QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
-
-
- /*find out if there are any reflection entries, from here*/
- boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(qaService, qaContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
-
- if (notebookEntriesExist)
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
-
- String userExceptionNoToolSessions=(String)generalMonitoringDTO.getUserExceptionNoToolSessions();
- logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions);
-
- if (userExceptionNoToolSessions.equals("true"))
- {
- logger.debug("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*/
+ GeneralMonitoringDTO generalMonitoringDTO = new GeneralMonitoringDTO();
- MonitoringUtil.buildQaStatsDTO(request,qaService, qaContent);
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
-
- return (mapping.findForward(LOAD_MONITORING));
+ generalMonitoringDTO.setMonitoredContentInUse(new Boolean(false).toString());
+
+ EditActivityDTO editActivityDTO = new EditActivityDTO();
+ editActivityDTO.setMonitoredContentInUse(new Boolean(false).toString());
+ request.setAttribute(QaAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO);
+
+ generalMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
+
+ QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO);
+
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID);
+ qaMonitoringForm.setToolContentID(strToolContentID);
+
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaMonitoringForm.setContentFolderID(contentFolderID);
+
+ String httpSessionID = request.getParameter("httpSessionID");
+ QaMonitoringAction.logger.debug("httpSessionID: " + httpSessionID);
+ qaMonitoringForm.setHttpSessionID(httpSessionID);
+
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaMonitoringAction.logger.debug("existing qaContent:" + qaContent);
+
+ qaMonitoringForm.setTitle(qaContent.getTitle());
+
+ QaUtils.setDefineLater(request, true, strToolContentID, qaService);
+
+ prepareEditActivityScreenData(request, qaContent);
+
+ prepareReflectionData(request, qaContent, qaService, null, false, "All");
+
+ if (qaService.studentActivityOccurredGlobal(qaContent)) {
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
+ generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
+ } else {
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
+ generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
+ }
+
+ /** getting instructions screen content from here... */
+ generalMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
+ generalMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
+
+ List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
+ QaMonitoringAction.logger.debug("attachmentList: " + attachmentList);
+ generalMonitoringDTO.setAttachmentList(attachmentList);
+ generalMonitoringDTO.setDeletedAttachmentList(new ArrayList());
+ /** ...till here * */
+
+ QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO);
+
+ List listQuestionContentDTO = new LinkedList();
+
+ Iterator queIterator = qaContent.getQaQueContents().iterator();
+ while (queIterator.hasNext()) {
+ QaQuestionContentDTO qaQuestionContentDTO = new QaQuestionContentDTO();
+
+ QaQueContent qaQueContent = (QaQueContent) queIterator.next();
+ if (qaQueContent != null) {
+ QaMonitoringAction.logger.debug("question: " + qaQueContent.getQuestion());
+ QaMonitoringAction.logger.debug("displayorder: "
+ + new Integer(qaQueContent.getDisplayOrder()).toString());
+ QaMonitoringAction.logger.debug("feedback: " + qaQueContent.getFeedback());
+
+ qaQuestionContentDTO.setQuestion(qaQueContent.getQuestion());
+ qaQuestionContentDTO.setDisplayOrder(new Integer(qaQueContent.getDisplayOrder()).toString());
+ qaQuestionContentDTO.setFeedback(qaQueContent.getFeedback());
+ listQuestionContentDTO.add(qaQuestionContentDTO);
+ }
+ }
+ QaMonitoringAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
+ request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
+
+ request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
+
+ QaGeneralAuthoringDTO qaGeneralAuthoringDTO = (QaGeneralAuthoringDTO) request
+ .getAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO);
+ qaGeneralAuthoringDTO.setActiveModule(QaAppConstants.MONITORING);
+
+ qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
+ qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
+ qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
+
+ request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+
+ /* find out if there are any reflection entries, from here */
+ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent);
+ QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist);
+
+ if (notebookEntriesExist) {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+
+ String userExceptionNoToolSessions = generalMonitoringDTO.getUserExceptionNoToolSessions();
+ QaMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions);
+
+ if (userExceptionNoToolSessions.equals("true")) {
+ QaMonitoringAction.logger.debug("there are no online student activity but there are reflections : ");
+ request.setAttribute(QaAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+ }
+ } else {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
+ }
+ /* ... till here */
+
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
+
+ return mapping.findForward(QaAppConstants.LOAD_MONITORING);
}
-
-
+
/**
- * gets called when the user selects a group from dropdown box in the summary tab
+ * gets called when the user selects a group from dropdown box in the summary tab
*
- * submitSession(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
+ * submitSession(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
+ * throws IOException, ServletException
*
* @param mapping
* @param form
@@ -857,352 +749,296 @@
* @throws IOException
* @throws ServletException
*/
- public ActionForward submitSession(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
- {
- logger.debug("dispatching submitSession...");
-
- IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
-
- QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
+ public ActionForward submitSession(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaMonitoringAction.logger.debug("dispatching submitSession...");
- String currentMonitoredToolSession=qaMonitoringForm.getSelectedToolSessionId();
- logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
-
- if (currentMonitoredToolSession.equals("All"))
- {
- request.setAttribute(SELECTION_CASE, new Long(2));
- }
- else
- {
- request.setAttribute(SELECTION_CASE, new Long(1));
-
- QaSession qaSession=qaService.retrieveQaSessionOrNullById(new Long(currentMonitoredToolSession).longValue());
- logger.debug("retrieving qaSession name: " + qaSession.getSession_name());
- request.setAttribute(CURRENT_SESSION_NAME, qaSession.getSession_name());
- }
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaMonitoringAction.logger.debug("qaService: " + qaService);
- logger.debug("SELECTION_CASE: " + request.getAttribute(SELECTION_CASE));
- request.setAttribute(CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession);
+ QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
- qaMonitoringForm.setToolContentID(strToolContentID);
+ String currentMonitoredToolSession = qaMonitoringForm.getSelectedToolSessionId();
+ QaMonitoringAction.logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaMonitoringForm.setContentFolderID(contentFolderID);
+ if (currentMonitoredToolSession.equals("All")) {
+ request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(2));
+ } else {
+ request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(1));
-
- String editResponse=request.getParameter(EDIT_RESPONSE);
- logger.debug("editResponse: " + editResponse);
- qaMonitoringForm.setEditResponse(editResponse);
+ QaSession qaSession = qaService.retrieveQaSessionOrNullById(new Long(currentMonitoredToolSession)
+ .longValue());
+ QaMonitoringAction.logger.debug("retrieving qaSession name: " + qaSession.getSession_name());
+ request.setAttribute(QaAppConstants.CURRENT_SESSION_NAME, qaSession.getSession_name());
+ }
-
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("existing qaContent:" + qaContent);
-
- Map summaryToolSessions=MonitoringUtil.populateToolSessions(request, qaContent, qaService);
- logger.debug("summaryToolSessions: " + summaryToolSessions);
- request.setAttribute(SUMMARY_TOOL_SESSIONS, summaryToolSessions);
- logger.debug("SUMMARY_TOOL_SESSIONS: " + request.getAttribute(SUMMARY_TOOL_SESSIONS));
+ QaMonitoringAction.logger.debug("SELECTION_CASE: " + request.getAttribute(QaAppConstants.SELECTION_CASE));
+ request.setAttribute(QaAppConstants.CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession);
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID);
+ qaMonitoringForm.setToolContentID(strToolContentID);
- Map summaryToolSessionsId=MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
- logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
- request.setAttribute(SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaMonitoringForm.setContentFolderID(contentFolderID);
-
- GeneralLearnerFlowDTO generalLearnerFlowDTO= LearningUtil.buildGeneralLearnerFlowDTO(qaContent);
- logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO);
-
- prepareReflectionData(request, qaContent, qaService,null, false, currentMonitoredToolSession);
-
- prepareEditActivityScreenData(request, qaContent);
+ String editResponse = request.getParameter(QaAppConstants.EDIT_RESPONSE);
+ QaMonitoringAction.logger.debug("editResponse: " + editResponse);
+ qaMonitoringForm.setEditResponse(editResponse);
- EditActivityDTO editActivityDTO = new EditActivityDTO();
- boolean isContentInUse=QaUtils.isContentInUse(qaContent);
- logger.debug("isContentInUse:" + isContentInUse);
- if (isContentInUse == true)
- {
- editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
- }
- request.setAttribute(EDIT_ACTIVITY_DTO, editActivityDTO);
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaMonitoringAction.logger.debug("existing qaContent:" + qaContent);
- refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, false, currentMonitoredToolSession);
+ Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions);
+ QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: "
+ + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS));
-
- /*find out if there are any reflection entries, from here*/
- boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(qaService, qaContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
-
- if (notebookEntriesExist)
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
- }
- else
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
- }
- /* ... till here*/
+ Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
- MonitoringUtil.buildQaStatsDTO(request,qaService, qaContent);
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
-
- return (mapping.findForward(LOAD_MONITORING));
+ GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent);
+ QaMonitoringAction.logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO);
+
+ prepareReflectionData(request, qaContent, qaService, null, false, currentMonitoredToolSession);
+
+ prepareEditActivityScreenData(request, qaContent);
+
+ EditActivityDTO editActivityDTO = new EditActivityDTO();
+ boolean isContentInUse = QaUtils.isContentInUse(qaContent);
+ QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse);
+ if (isContentInUse == true) {
+ editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
}
+ request.setAttribute(QaAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO);
-
- /**
- * enables the user to edit responses
- * ActionForward editResponse(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
- * @param mapping
- * @param form
- * @param request
- * @param response
- * @return
- * @throws IOException
- * @throws ServletException
- */
- public ActionForward editResponse(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
- {
- logger.debug("dispatching editResponse...");
+ refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, false,
+ currentMonitoredToolSession);
- IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
-
- QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
-
- String editResponse=request.getParameter(EDIT_RESPONSE);
- logger.debug("editResponse: " + editResponse);
- qaMonitoringForm.setEditResponse(editResponse);
+ /* find out if there are any reflection entries, from here */
+ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent);
+ QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist);
+ if (notebookEntriesExist) {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+ } else {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
+ }
+ /* ... till here */
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaMonitoringForm.setContentFolderID(contentFolderID);
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
-
- String responseId=qaMonitoringForm.getResponseId();
- logger.debug("responseId: " + responseId);
- request.getSession().setAttribute(EDITABLE_RESPONSE_ID, responseId);
+ return mapping.findForward(QaAppConstants.LOAD_MONITORING);
+ }
- QaUsrResp qaUsrResp= qaService.retrieveQaUsrResp(new Long(responseId).longValue());
- logger.debug("qaUsrResp: " + qaUsrResp);
+ /**
+ * enables the user to edit responses ActionForward editResponse(ActionMapping mapping, ActionForm form,
+ * HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ * @throws IOException
+ * @throws ServletException
+ */
+ public ActionForward editResponse(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaMonitoringAction.logger.debug("dispatching editResponse...");
- refreshUserInput(request, qaMonitoringForm);
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaMonitoringAction.logger.debug("qaService: " + qaService);
- QaContent qaContent=qaUsrResp.getQaQueContent().getQaContent();
- logger.debug("qaContent: " + qaContent);
-
- String currentMonitoredToolSession=qaMonitoringForm.getSelectedToolSessionId();
- logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
+ QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
- if (currentMonitoredToolSession.equals(""))
- {
- currentMonitoredToolSession="All";
- }
+ String editResponse = request.getParameter(QaAppConstants.EDIT_RESPONSE);
+ QaMonitoringAction.logger.debug("editResponse: " + editResponse);
+ qaMonitoringForm.setEditResponse(editResponse);
- if (currentMonitoredToolSession.equals("All"))
- {
- request.setAttribute(SELECTION_CASE, new Long(2));
- }
- else
- {
- request.setAttribute(SELECTION_CASE, new Long(1));
-
- QaSession qaSession=qaService.retrieveQaSessionOrNullById(new Long(currentMonitoredToolSession).longValue());
- logger.debug("retrieving qaSession name: " + qaSession.getSession_name());
- request.setAttribute(CURRENT_SESSION_NAME, qaSession.getSession_name());
- }
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaMonitoringForm.setContentFolderID(contentFolderID);
- logger.debug("SELECTION_CASE: " + request.getAttribute(SELECTION_CASE));
- request.setAttribute(CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession);
-
-
- Map summaryToolSessions=MonitoringUtil.populateToolSessions(request, qaContent, qaService);
- logger.debug("summaryToolSessions: " + summaryToolSessions);
- request.setAttribute(SUMMARY_TOOL_SESSIONS, summaryToolSessions);
- logger.debug("SUMMARY_TOOL_SESSIONS: " + request.getAttribute(SUMMARY_TOOL_SESSIONS));
+ String responseId = qaMonitoringForm.getResponseId();
+ QaMonitoringAction.logger.debug("responseId: " + responseId);
+ request.getSession().setAttribute(QaAppConstants.EDITABLE_RESPONSE_ID, responseId);
+ QaUsrResp qaUsrResp = qaService.retrieveQaUsrResp(new Long(responseId).longValue());
+ QaMonitoringAction.logger.debug("qaUsrResp: " + qaUsrResp);
- Map summaryToolSessionsId=MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
- logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
- request.setAttribute(SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
-
- GeneralLearnerFlowDTO generalLearnerFlowDTO= LearningUtil.buildGeneralLearnerFlowDTO(qaContent);
- logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO);
-
- refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, true, currentMonitoredToolSession);
+ refreshUserInput(request, qaMonitoringForm);
- prepareReflectionData(request, qaContent, qaService,null, false, currentMonitoredToolSession);
-
- prepareEditActivityScreenData(request, qaContent);
+ QaContent qaContent = qaUsrResp.getQaQueContent().getQaContent();
+ QaMonitoringAction.logger.debug("qaContent: " + qaContent);
- EditActivityDTO editActivityDTO = new EditActivityDTO();
- boolean isContentInUse=QaUtils.isContentInUse(qaContent);
- logger.debug("isContentInUse:" + isContentInUse);
- if (isContentInUse == true)
- {
- editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
- }
- request.setAttribute(EDIT_ACTIVITY_DTO, editActivityDTO);
-
-
- /*find out if there are any reflection entries, from here*/
- boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(qaService, qaContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
-
- if (notebookEntriesExist)
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
- }
- else
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
- }
- /* ... till here*/
+ String currentMonitoredToolSession = qaMonitoringForm.getSelectedToolSessionId();
+ QaMonitoringAction.logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
- MonitoringUtil.buildQaStatsDTO(request,qaService, qaContent);
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
-
- return (mapping.findForward(LOAD_MONITORING));
+ if (currentMonitoredToolSession.equals("")) {
+ currentMonitoredToolSession = "All";
}
-
-
-
- public ActionForward editGroupResponse(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
- {
- logger.debug("dispatching editGroupResponse...");
+ if (currentMonitoredToolSession.equals("All")) {
+ request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(2));
+ } else {
+ request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(1));
- IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
-
- QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
-
- String editResponse=request.getParameter(EDIT_RESPONSE);
- logger.debug("editResponse: " + editResponse);
- qaMonitoringForm.setEditResponse(editResponse);
-
- String editableSessionId=request.getParameter("sessionId");
- logger.debug("editableSessionId: " + editableSessionId);
- request.setAttribute("editableSessionId", editableSessionId);
-
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaMonitoringForm.setContentFolderID(contentFolderID);
+ QaSession qaSession = qaService.retrieveQaSessionOrNullById(new Long(currentMonitoredToolSession)
+ .longValue());
+ QaMonitoringAction.logger.debug("retrieving qaSession name: " + qaSession.getSession_name());
+ request.setAttribute(QaAppConstants.CURRENT_SESSION_NAME, qaSession.getSession_name());
+ }
-
- String responseId=qaMonitoringForm.getResponseId();
- logger.debug("responseId: " + responseId);
- request.getSession().setAttribute(EDITABLE_RESPONSE_ID, responseId);
+ QaMonitoringAction.logger.debug("SELECTION_CASE: " + request.getAttribute(QaAppConstants.SELECTION_CASE));
+ request.setAttribute(QaAppConstants.CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession);
- QaUsrResp qaUsrResp= qaService.retrieveQaUsrResp(new Long(responseId).longValue());
- logger.debug("qaUsrResp: " + qaUsrResp);
+ Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions);
+ QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: "
+ + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS));
- refreshUserInput(request, qaMonitoringForm);
+ Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
- QaContent qaContent=qaUsrResp.getQaQueContent().getQaContent();
- logger.debug("qaContent: " + qaContent);
-
- String currentMonitoredToolSession=qaMonitoringForm.getSelectedToolSessionId();
- logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
+ GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent);
+ QaMonitoringAction.logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO);
- if (currentMonitoredToolSession.equals(""))
- {
- currentMonitoredToolSession="All";
- }
+ refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, true,
+ currentMonitoredToolSession);
- if (currentMonitoredToolSession.equals("All"))
- {
- request.setAttribute(SELECTION_CASE, new Long(2));
- }
- else
- {
- request.setAttribute(SELECTION_CASE, new Long(1));
- }
+ prepareReflectionData(request, qaContent, qaService, null, false, currentMonitoredToolSession);
- logger.debug("SELECTION_CASE: " + request.getAttribute(SELECTION_CASE));
+ prepareEditActivityScreenData(request, qaContent);
-
- Map summaryToolSessions=MonitoringUtil.populateToolSessions(request, qaContent, qaService);
- logger.debug("summaryToolSessions: " + summaryToolSessions);
- request.setAttribute(SUMMARY_TOOL_SESSIONS, summaryToolSessions);
- logger.debug("SUMMARY_TOOL_SESSIONS: " + request.getAttribute(SUMMARY_TOOL_SESSIONS));
+ EditActivityDTO editActivityDTO = new EditActivityDTO();
+ boolean isContentInUse = QaUtils.isContentInUse(qaContent);
+ QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse);
+ if (isContentInUse == true) {
+ editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
+ }
+ request.setAttribute(QaAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO);
+ /* find out if there are any reflection entries, from here */
+ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent);
+ QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist);
- Map summaryToolSessionsId=MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
- logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
- request.setAttribute(SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
-
- GeneralLearnerFlowDTO generalLearnerFlowDTO= LearningUtil.buildGeneralLearnerFlowDTO(qaContent);
- logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO);
-
- refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, true, currentMonitoredToolSession);
+ if (notebookEntriesExist) {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+ } else {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
+ }
+ /* ... till here */
- prepareReflectionData(request, qaContent, qaService,null, false, currentMonitoredToolSession);
-
- prepareEditActivityScreenData(request, qaContent);
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
- EditActivityDTO editActivityDTO = new EditActivityDTO();
- boolean isContentInUse=QaUtils.isContentInUse(qaContent);
- logger.debug("isContentInUse:" + isContentInUse);
- if (isContentInUse == true)
- {
- editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
- }
- request.setAttribute(EDIT_ACTIVITY_DTO, editActivityDTO);
-
-
- /*find out if there are any reflection entries, from here*/
- boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(qaService, qaContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
-
- if (notebookEntriesExist)
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
- }
- else
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
- }
- /* ... till here*/
+ return mapping.findForward(QaAppConstants.LOAD_MONITORING);
+ }
- MonitoringUtil.buildQaStatsDTO(request,qaService, qaContent);
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
- request.setAttribute("currentMonitoredToolSession", "All");
-
- return (mapping.findForward(LOAD_MONITORING));
+ public ActionForward editGroupResponse(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaMonitoringAction.logger.debug("dispatching editGroupResponse...");
+
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaMonitoringAction.logger.debug("qaService: " + qaService);
+
+ QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
+
+ String editResponse = request.getParameter(QaAppConstants.EDIT_RESPONSE);
+ QaMonitoringAction.logger.debug("editResponse: " + editResponse);
+ qaMonitoringForm.setEditResponse(editResponse);
+
+ String editableSessionId = request.getParameter("sessionId");
+ QaMonitoringAction.logger.debug("editableSessionId: " + editableSessionId);
+ request.setAttribute("editableSessionId", editableSessionId);
+
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaMonitoringForm.setContentFolderID(contentFolderID);
+
+ String responseId = qaMonitoringForm.getResponseId();
+ QaMonitoringAction.logger.debug("responseId: " + responseId);
+ request.getSession().setAttribute(QaAppConstants.EDITABLE_RESPONSE_ID, responseId);
+
+ QaUsrResp qaUsrResp = qaService.retrieveQaUsrResp(new Long(responseId).longValue());
+ QaMonitoringAction.logger.debug("qaUsrResp: " + qaUsrResp);
+
+ refreshUserInput(request, qaMonitoringForm);
+
+ QaContent qaContent = qaUsrResp.getQaQueContent().getQaContent();
+ QaMonitoringAction.logger.debug("qaContent: " + qaContent);
+
+ String currentMonitoredToolSession = qaMonitoringForm.getSelectedToolSessionId();
+ QaMonitoringAction.logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
+
+ if (currentMonitoredToolSession.equals("")) {
+ currentMonitoredToolSession = "All";
}
-
-
-
-
+
+ if (currentMonitoredToolSession.equals("All")) {
+ request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(2));
+ } else {
+ request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(1));
+ }
+
+ QaMonitoringAction.logger.debug("SELECTION_CASE: " + request.getAttribute(QaAppConstants.SELECTION_CASE));
+
+ Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions);
+ QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: "
+ + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS));
+
+ Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
+
+ GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent);
+ QaMonitoringAction.logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO);
+
+ refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, true,
+ currentMonitoredToolSession);
+
+ prepareReflectionData(request, qaContent, qaService, null, false, currentMonitoredToolSession);
+
+ prepareEditActivityScreenData(request, qaContent);
+
+ EditActivityDTO editActivityDTO = new EditActivityDTO();
+ boolean isContentInUse = QaUtils.isContentInUse(qaContent);
+ QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse);
+ if (isContentInUse == true) {
+ editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
+ }
+ request.setAttribute(QaAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO);
+
+ /* find out if there are any reflection entries, from here */
+ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent);
+ QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist);
+
+ if (notebookEntriesExist) {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+ } else {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
+ }
+ /* ... till here */
+
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
+ request.setAttribute("currentMonitoredToolSession", "All");
+
+ return mapping.findForward(QaAppConstants.LOAD_MONITORING);
+ }
+
/**
- * enables the user to update responses
- * ActionForward updateResponse(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
+ * enables the user to update responses ActionForward updateResponse(ActionMapping mapping, ActionForm form,
+ * HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
*
* @param mapping
* @param form
@@ -1212,254 +1048,216 @@
* @throws IOException
* @throws ServletException
*/
- public ActionForward updateResponse(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
- {
- logger.debug("dispatching updateResponse...");
+ public ActionForward updateResponse(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaMonitoringAction.logger.debug("dispatching updateResponse...");
- IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaMonitoringAction.logger.debug("qaService: " + qaService);
- QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
+ QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaMonitoringForm.setContentFolderID(contentFolderID);
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaMonitoringForm.setContentFolderID(contentFolderID);
+ String editResponse = request.getParameter(QaAppConstants.EDIT_RESPONSE);
+ QaMonitoringAction.logger.debug("editResponse: " + editResponse);
+ qaMonitoringForm.setEditResponse(editResponse);
-
- String editResponse=request.getParameter(EDIT_RESPONSE);
- logger.debug("editResponse: " + editResponse);
- qaMonitoringForm.setEditResponse(editResponse);
+ String responseId = qaMonitoringForm.getResponseId();
+ QaMonitoringAction.logger.debug("responseId: " + responseId);
-
- String responseId=qaMonitoringForm.getResponseId();
- logger.debug("responseId: " + responseId);
-
- String updatedResponse=request.getParameter("updatedResponse");
- logger.debug("updatedResponse: " + updatedResponse);
- QaUsrResp qaUsrResp= qaService.retrieveQaUsrResp(new Long(responseId).longValue());
- logger.debug("qaUsrResp: " + qaUsrResp);
-
- /* write out the audit log entry. If you move this after the update of the response,
- then make sure you update the audit call to use a copy of the original answer */
- qaService.getAuditService().logChange(MY_SIGNATURE,
- qaUsrResp.getQaQueUser().getQueUsrId(),qaUsrResp.getQaQueUser().getUsername(),
- qaUsrResp.getAnswer(), updatedResponse);
+ String updatedResponse = request.getParameter("updatedResponse");
+ QaMonitoringAction.logger.debug("updatedResponse: " + updatedResponse);
+ QaUsrResp qaUsrResp = qaService.retrieveQaUsrResp(new Long(responseId).longValue());
+ QaMonitoringAction.logger.debug("qaUsrResp: " + qaUsrResp);
- qaUsrResp.setAnswer(updatedResponse);
- qaService.updateQaUsrResp(qaUsrResp);
- logger.debug("response updated.");
-
- refreshUserInput(request, qaMonitoringForm);
-
-
- String currentMonitoredToolSession=qaMonitoringForm.getSelectedToolSessionId();
- logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
+ /*
+ * write out the audit log entry. If you move this after the update of the response, then make sure you update
+ * the audit call to use a copy of the original answer
+ */
+ qaService.getAuditService().logChange(QaAppConstants.MY_SIGNATURE, qaUsrResp.getQaQueUser().getQueUsrId(),
+ qaUsrResp.getQaQueUser().getUsername(), qaUsrResp.getAnswer(), updatedResponse);
- if (currentMonitoredToolSession.equals(""))
- {
- currentMonitoredToolSession="All";
- }
+ qaUsrResp.setAnswer(updatedResponse);
+ qaService.updateQaUsrResp(qaUsrResp);
+ QaMonitoringAction.logger.debug("response updated.");
- if (currentMonitoredToolSession.equals("All"))
- {
- request.setAttribute(SELECTION_CASE, new Long(2));
-
- QaSession qaSession=qaService.retrieveQaSessionOrNullById(new Long(currentMonitoredToolSession).longValue());
- logger.debug("retrieving qaSession name: " + qaSession.getSession_name());
- request.setAttribute(CURRENT_SESSION_NAME, qaSession.getSession_name());
- }
- else
- {
- request.setAttribute(SELECTION_CASE, new Long(1));
- }
- logger.debug("SELECTION_CASE: " + request.getAttribute(SELECTION_CASE));
- request.setAttribute(CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession);
-
+ refreshUserInput(request, qaMonitoringForm);
- QaContent qaContent=qaUsrResp.getQaQueContent().getQaContent();
- logger.debug("qaContent: " + qaContent);
+ String currentMonitoredToolSession = qaMonitoringForm.getSelectedToolSessionId();
+ QaMonitoringAction.logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
- Map summaryToolSessions=MonitoringUtil.populateToolSessions(request, qaContent, qaService);
- logger.debug("summaryToolSessions: " + summaryToolSessions);
- request.setAttribute(SUMMARY_TOOL_SESSIONS, summaryToolSessions);
- logger.debug("SUMMARY_TOOL_SESSIONS: " + request.getAttribute(SUMMARY_TOOL_SESSIONS));
+ if (currentMonitoredToolSession.equals("")) {
+ currentMonitoredToolSession = "All";
+ }
+ if (currentMonitoredToolSession.equals("All")) {
+ request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(2));
- Map summaryToolSessionsId=MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
- logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
- request.setAttribute(SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
+ QaSession qaSession = qaService.retrieveQaSessionOrNullById(new Long(currentMonitoredToolSession)
+ .longValue());
+ QaMonitoringAction.logger.debug("retrieving qaSession name: " + qaSession.getSession_name());
+ request.setAttribute(QaAppConstants.CURRENT_SESSION_NAME, qaSession.getSession_name());
+ } else {
+ request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(1));
+ }
+ QaMonitoringAction.logger.debug("SELECTION_CASE: " + request.getAttribute(QaAppConstants.SELECTION_CASE));
+ request.setAttribute(QaAppConstants.CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession);
- GeneralLearnerFlowDTO generalLearnerFlowDTO= LearningUtil.buildGeneralLearnerFlowDTO(qaContent);
- logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO);
-
- refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, false, currentMonitoredToolSession);
-
- prepareReflectionData(request, qaContent, qaService,null, false, currentMonitoredToolSession);
-
- prepareEditActivityScreenData(request, qaContent);
-
- EditActivityDTO editActivityDTO = new EditActivityDTO();
- boolean isContentInUse=QaUtils.isContentInUse(qaContent);
- logger.debug("isContentInUse:" + isContentInUse);
- if (isContentInUse == true)
- {
- editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
- }
- request.setAttribute(EDIT_ACTIVITY_DTO, editActivityDTO);
-
-
- /*find out if there are any reflection entries, from here*/
- boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(qaService, qaContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
-
- if (notebookEntriesExist)
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
- }
- else
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
- }
- /* ... till here*/
-
- MonitoringUtil.buildQaStatsDTO(request,qaService, qaContent);
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
-
- return (mapping.findForward(LOAD_MONITORING));
+ QaContent qaContent = qaUsrResp.getQaQueContent().getQaContent();
+ QaMonitoringAction.logger.debug("qaContent: " + qaContent);
+
+ Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions);
+ QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: "
+ + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS));
+
+ Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
+
+ GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent);
+ QaMonitoringAction.logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO);
+
+ refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, false,
+ currentMonitoredToolSession);
+
+ prepareReflectionData(request, qaContent, qaService, null, false, currentMonitoredToolSession);
+
+ prepareEditActivityScreenData(request, qaContent);
+
+ EditActivityDTO editActivityDTO = new EditActivityDTO();
+ boolean isContentInUse = QaUtils.isContentInUse(qaContent);
+ QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse);
+ if (isContentInUse == true) {
+ editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
}
+ request.setAttribute(QaAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO);
-
-
-
- public ActionForward updateGroupResponse(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
- {
- logger.debug("dispatching updateGroupResponse...");
+ /* find out if there are any reflection entries, from here */
+ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent);
+ QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist);
- IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
+ if (notebookEntriesExist) {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+ } else {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
+ }
+ /* ... till here */
- QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
+ return mapping.findForward(QaAppConstants.LOAD_MONITORING);
+ }
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaMonitoringForm.setContentFolderID(contentFolderID);
+ public ActionForward updateGroupResponse(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaMonitoringAction.logger.debug("dispatching updateGroupResponse...");
-
- String editResponse=request.getParameter(EDIT_RESPONSE);
- logger.debug("editResponse: " + editResponse);
- qaMonitoringForm.setEditResponse(editResponse);
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaMonitoringAction.logger.debug("qaService: " + qaService);
-
- String responseId=qaMonitoringForm.getResponseId();
- logger.debug("responseId: " + responseId);
-
- String updatedResponse=request.getParameter("updatedResponse");
- logger.debug("updatedResponse: " + updatedResponse);
- QaUsrResp qaUsrResp= qaService.retrieveQaUsrResp(new Long(responseId).longValue());
- logger.debug("qaUsrResp: " + qaUsrResp);
-
- /* write out the audit log entry. If you move this after the update of the response,
- then make sure you update the audit call to use a copy of the original answer */
- qaService.getAuditService().logChange(MY_SIGNATURE,
- qaUsrResp.getQaQueUser().getQueUsrId(),qaUsrResp.getQaQueUser().getUsername(),
- qaUsrResp.getAnswer(), updatedResponse);
+ QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
- qaUsrResp.setAnswer(updatedResponse);
- qaService.updateQaUsrResp(qaUsrResp);
- logger.debug("response updated.");
-
- refreshUserInput(request, qaMonitoringForm);
-
-
- String currentMonitoredToolSession=qaMonitoringForm.getSelectedToolSessionId();
- logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaMonitoringForm.setContentFolderID(contentFolderID);
- if (currentMonitoredToolSession.equals(""))
- {
- currentMonitoredToolSession="All";
- }
+ String editResponse = request.getParameter(QaAppConstants.EDIT_RESPONSE);
+ QaMonitoringAction.logger.debug("editResponse: " + editResponse);
+ qaMonitoringForm.setEditResponse(editResponse);
- if (currentMonitoredToolSession.equals("All"))
- {
- request.setAttribute(SELECTION_CASE, new Long(2));
- }
- else
- {
- request.setAttribute(SELECTION_CASE, new Long(1));
- }
- logger.debug("SELECTION_CASE: " + request.getAttribute(SELECTION_CASE));
+ String responseId = qaMonitoringForm.getResponseId();
+ QaMonitoringAction.logger.debug("responseId: " + responseId);
- QaContent qaContent=qaUsrResp.getQaQueContent().getQaContent();
- logger.debug("qaContent: " + qaContent);
+ String updatedResponse = request.getParameter("updatedResponse");
+ QaMonitoringAction.logger.debug("updatedResponse: " + updatedResponse);
+ QaUsrResp qaUsrResp = qaService.retrieveQaUsrResp(new Long(responseId).longValue());
+ QaMonitoringAction.logger.debug("qaUsrResp: " + qaUsrResp);
- Map summaryToolSessions=MonitoringUtil.populateToolSessions(request, qaContent, qaService);
- logger.debug("summaryToolSessions: " + summaryToolSessions);
- request.setAttribute(SUMMARY_TOOL_SESSIONS, summaryToolSessions);
- logger.debug("SUMMARY_TOOL_SESSIONS: " + request.getAttribute(SUMMARY_TOOL_SESSIONS));
+ /*
+ * write out the audit log entry. If you move this after the update of the response, then make sure you update
+ * the audit call to use a copy of the original answer
+ */
+ qaService.getAuditService().logChange(QaAppConstants.MY_SIGNATURE, qaUsrResp.getQaQueUser().getQueUsrId(),
+ qaUsrResp.getQaQueUser().getUsername(), qaUsrResp.getAnswer(), updatedResponse);
+ qaUsrResp.setAnswer(updatedResponse);
+ qaService.updateQaUsrResp(qaUsrResp);
+ QaMonitoringAction.logger.debug("response updated.");
- Map summaryToolSessionsId=MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
- logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
- request.setAttribute(SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
+ refreshUserInput(request, qaMonitoringForm);
- GeneralLearnerFlowDTO generalLearnerFlowDTO= LearningUtil.buildGeneralLearnerFlowDTO(qaContent);
- logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO);
-
- refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, false, currentMonitoredToolSession);
-
- prepareReflectionData(request, qaContent, qaService,null, false, currentMonitoredToolSession);
-
- prepareEditActivityScreenData(request, qaContent);
-
- EditActivityDTO editActivityDTO = new EditActivityDTO();
- boolean isContentInUse=QaUtils.isContentInUse(qaContent);
- logger.debug("isContentInUse:" + isContentInUse);
- if (isContentInUse == true)
- {
- editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
- }
- request.setAttribute(EDIT_ACTIVITY_DTO, editActivityDTO);
-
-
- /*find out if there are any reflection entries, from here*/
- boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(qaService, qaContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
-
- if (notebookEntriesExist)
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
- }
- else
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
- }
- /* ... till here*/
-
- MonitoringUtil.buildQaStatsDTO(request,qaService, qaContent);
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
- request.setAttribute("currentMonitoredToolSession", "All");
-
- return (mapping.findForward(LOAD_MONITORING));
+ String currentMonitoredToolSession = qaMonitoringForm.getSelectedToolSessionId();
+ QaMonitoringAction.logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
+
+ if (currentMonitoredToolSession.equals("")) {
+ currentMonitoredToolSession = "All";
}
-
-
+
+ if (currentMonitoredToolSession.equals("All")) {
+ request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(2));
+ } else {
+ request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(1));
+ }
+ QaMonitoringAction.logger.debug("SELECTION_CASE: " + request.getAttribute(QaAppConstants.SELECTION_CASE));
+
+ QaContent qaContent = qaUsrResp.getQaQueContent().getQaContent();
+ QaMonitoringAction.logger.debug("qaContent: " + qaContent);
+
+ Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions);
+ QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: "
+ + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS));
+
+ Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
+
+ GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent);
+ QaMonitoringAction.logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO);
+
+ refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, false,
+ currentMonitoredToolSession);
+
+ prepareReflectionData(request, qaContent, qaService, null, false, currentMonitoredToolSession);
+
+ prepareEditActivityScreenData(request, qaContent);
+
+ EditActivityDTO editActivityDTO = new EditActivityDTO();
+ boolean isContentInUse = QaUtils.isContentInUse(qaContent);
+ QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse);
+ if (isContentInUse == true) {
+ editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
+ }
+ request.setAttribute(QaAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO);
+
+ /* find out if there are any reflection entries, from here */
+ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent);
+ QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist);
+
+ if (notebookEntriesExist) {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+ } else {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
+ }
+ /* ... till here */
+
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
+ request.setAttribute("currentMonitoredToolSession", "All");
+
+ return mapping.findForward(QaAppConstants.LOAD_MONITORING);
+ }
+
/**
- * enables the user to delete responses
- * ActionForward deleteResponse(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
+ * enables the user to delete responses ActionForward deleteResponse(ActionMapping mapping, ActionForm form,
+ * HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
*
* @param mapping
* @param form
@@ -1469,209 +1267,183 @@
* @throws IOException
* @throws ServletException
*/
- public ActionForward deleteResponse(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
- {
- logger.debug("dispatching deleteResponse...");
+ public ActionForward deleteResponse(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaMonitoringAction.logger.debug("dispatching deleteResponse...");
- IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaMonitoringAction.logger.debug("qaService: " + qaService);
- QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaMonitoringForm.setContentFolderID(contentFolderID);
+ QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaMonitoringForm.setContentFolderID(contentFolderID);
- String editResponse=request.getParameter(EDIT_RESPONSE);
- logger.debug("editResponse: " + editResponse);
- qaMonitoringForm.setEditResponse(editResponse);
+ String editResponse = request.getParameter(QaAppConstants.EDIT_RESPONSE);
+ QaMonitoringAction.logger.debug("editResponse: " + editResponse);
+ qaMonitoringForm.setEditResponse(editResponse);
-
- String currentMonitoredToolSession=qaMonitoringForm.getSelectedToolSessionId();
- logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
+ String currentMonitoredToolSession = qaMonitoringForm.getSelectedToolSessionId();
+ QaMonitoringAction.logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
- if (currentMonitoredToolSession.equals(""))
- {
- currentMonitoredToolSession="All";
- }
+ if (currentMonitoredToolSession.equals("")) {
+ currentMonitoredToolSession = "All";
+ }
- if (currentMonitoredToolSession.equals("All"))
- {
- request.setAttribute(SELECTION_CASE, new Long(2));
- }
- else
- {
- request.setAttribute(SELECTION_CASE, new Long(1));
- }
+ if (currentMonitoredToolSession.equals("All")) {
+ request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(2));
+ } else {
+ request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(1));
+ }
- logger.debug("SELECTION_CASE: " + request.getAttribute(SELECTION_CASE));
-
- String responseId=qaMonitoringForm.getResponseId();
- logger.debug("responseId: " + responseId);
-
- QaUsrResp qaUsrResp= qaService.retrieveQaUsrResp(new Long(responseId).longValue());
- logger.debug("qaUsrResp: " + qaUsrResp);
-
- qaService.removeUserResponse(qaUsrResp);
- logger.debug("response deleted.");
-
- refreshUserInput(request, qaMonitoringForm);
-
- QaContent qaContent=qaUsrResp.getQaQueContent().getQaContent();
- logger.debug("qaContent: " + qaContent);
+ QaMonitoringAction.logger.debug("SELECTION_CASE: " + request.getAttribute(QaAppConstants.SELECTION_CASE));
-
- Map summaryToolSessions=MonitoringUtil.populateToolSessions(request, qaContent, qaService);
- logger.debug("summaryToolSessions: " + summaryToolSessions);
- request.setAttribute(SUMMARY_TOOL_SESSIONS, summaryToolSessions);
- logger.debug("SUMMARY_TOOL_SESSIONS: " + request.getAttribute(SUMMARY_TOOL_SESSIONS));
+ String responseId = qaMonitoringForm.getResponseId();
+ QaMonitoringAction.logger.debug("responseId: " + responseId);
+ QaUsrResp qaUsrResp = qaService.retrieveQaUsrResp(new Long(responseId).longValue());
+ QaMonitoringAction.logger.debug("qaUsrResp: " + qaUsrResp);
- Map summaryToolSessionsId=MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
- logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
- request.setAttribute(SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
+ qaService.removeUserResponse(qaUsrResp);
+ QaMonitoringAction.logger.debug("response deleted.");
-
- GeneralLearnerFlowDTO generalLearnerFlowDTO= LearningUtil.buildGeneralLearnerFlowDTO(qaContent);
- logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO);
-
- refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, false ,currentMonitoredToolSession);
-
- prepareReflectionData(request, qaContent, qaService,null, false, currentMonitoredToolSession);
-
- prepareEditActivityScreenData(request, qaContent);
-
- EditActivityDTO editActivityDTO = new EditActivityDTO();
- boolean isContentInUse=QaUtils.isContentInUse(qaContent);
- logger.debug("isContentInUse:" + isContentInUse);
- if (isContentInUse == true)
- {
- editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
- }
- request.setAttribute(EDIT_ACTIVITY_DTO, editActivityDTO);
-
-
- /*find out if there are any reflection entries, from here*/
- boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(qaService, qaContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
-
- if (notebookEntriesExist)
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
- }
- else
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
- }
- /* ... till here*/
-
- MonitoringUtil.buildQaStatsDTO(request,qaService, qaContent);
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
-
- return (mapping.findForward(LOAD_MONITORING));
+ refreshUserInput(request, qaMonitoringForm);
+
+ QaContent qaContent = qaUsrResp.getQaQueContent().getQaContent();
+ QaMonitoringAction.logger.debug("qaContent: " + qaContent);
+
+ Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions);
+ QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: "
+ + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS));
+
+ Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
+
+ GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent);
+ QaMonitoringAction.logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO);
+
+ refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, false,
+ currentMonitoredToolSession);
+
+ prepareReflectionData(request, qaContent, qaService, null, false, currentMonitoredToolSession);
+
+ prepareEditActivityScreenData(request, qaContent);
+
+ EditActivityDTO editActivityDTO = new EditActivityDTO();
+ boolean isContentInUse = QaUtils.isContentInUse(qaContent);
+ QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse);
+ if (isContentInUse == true) {
+ editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
}
+ request.setAttribute(QaAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO);
-
+ /* find out if there are any reflection entries, from here */
+ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent);
+ QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist);
+
+ if (notebookEntriesExist) {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+ } else {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
+ }
+ /* ... till here */
+
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
+
+ return mapping.findForward(QaAppConstants.LOAD_MONITORING);
+ }
+
/**
* refreshUserInput(HttpServletRequest request)
+ *
* @param request
*/
- public void refreshUserInput(HttpServletRequest request, QaMonitoringForm qaMonitoringForm)
- {
- logger.debug("starting refreshUserInput: " + qaMonitoringForm);
+ public void refreshUserInput(HttpServletRequest request, QaMonitoringForm qaMonitoringForm) {
+ QaMonitoringAction.logger.debug("starting refreshUserInput: " + qaMonitoringForm);
- IQaService qaService = null;
- if (getServlet() != null)
- qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
- else
- qaService=qaMonitoringForm.getQaService();
-
- logger.debug("qaService: " + qaService);
- logger.debug("qaMonitoringForm: " + qaMonitoringForm);
-
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
- qaMonitoringForm.setToolContentID(strToolContentID);
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaMonitoringForm.setContentFolderID(contentFolderID);
+ IQaService qaService = null;
+ if (getServlet() != null) {
+ qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ } else {
+ qaService = qaMonitoringForm.getQaService();
+ }
+ QaMonitoringAction.logger.debug("qaService: " + qaService);
+ QaMonitoringAction.logger.debug("qaMonitoringForm: " + qaMonitoringForm);
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("existing qaContent:" + qaContent);
-
- Map summaryToolSessions=MonitoringUtil.populateToolSessions(request, qaContent, qaService);
- logger.debug("summaryToolSessions: " + summaryToolSessions);
- request.setAttribute(SUMMARY_TOOL_SESSIONS, summaryToolSessions);
- logger.debug("SUMMARY_TOOL_SESSIONS: " + request.getAttribute(SUMMARY_TOOL_SESSIONS));
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID);
+ qaMonitoringForm.setToolContentID(strToolContentID);
- Map summaryToolSessionsId=MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
- logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
-
- //prepareReflectionData(request, qaContent, qaService,null, false);
-
- prepareEditActivityScreenData(request, qaContent);
-
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaMonitoringForm.setContentFolderID(contentFolderID);
- EditActivityDTO editActivityDTO = new EditActivityDTO();
- boolean isContentInUse=QaUtils.isContentInUse(qaContent);
- logger.debug("isContentInUse:" + isContentInUse);
- if (isContentInUse == true)
- {
- editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
- }
- request.setAttribute(EDIT_ACTIVITY_DTO, editActivityDTO);
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaMonitoringAction.logger.debug("existing qaContent:" + qaContent);
- /*find out if there are any reflection entries, from here*/
- boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(qaService, qaContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
-
- if (notebookEntriesExist)
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
- }
- else
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
- }
- /* ... till here*/
-
- request.setAttribute(SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
-
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
- MonitoringUtil.buildQaStatsDTO(request,qaService, qaContent);
+ Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions);
+ QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: "
+ + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS));
+
+ Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
+
+ // prepareReflectionData(request, qaContent, qaService,null, false);
+
+ prepareEditActivityScreenData(request, qaContent);
+
+ EditActivityDTO editActivityDTO = new EditActivityDTO();
+ boolean isContentInUse = QaUtils.isContentInUse(qaContent);
+ QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse);
+ if (isContentInUse == true) {
+ editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
+ }
+ request.setAttribute(QaAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO);
+
+ /* find out if there are any reflection entries, from here */
+ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent);
+ QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist);
+
+ if (notebookEntriesExist) {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+ } else {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
+ }
+ /* ... till here */
+
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
+
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
}
-
-
-
- /**
- * persists error messages to request scope
- * persistError(HttpServletRequest request, String message)
+
+ /**
+ * persists error messages to request scope persistError(HttpServletRequest request, String message)
+ *
* @param request
* @param message
*/
- public void persistError(HttpServletRequest request, String message)
- {
- ActionMessages errors= new ActionMessages();
- errors.add(Globals.ERROR_KEY, new ActionMessage(message));
- logger.debug("add " + message +" to ActionMessages:");
- saveErrors(request,errors);
- }
-
-
-
+ public void persistError(HttpServletRequest request, String message) {
+ ActionMessages errors = new ActionMessages();
+ errors.add(Globals.ERROR_KEY, new ActionMessage(message));
+ QaMonitoringAction.logger.debug("add " + message + " to ActionMessages:");
+ saveErrors(request, errors);
+ }
+
/**
* populates data for summary screen, view all results screen and export portfolio.
- *
- * User id is needed if isUserNamesVisible is false && learnerRequest is true,
- * as it is required to work out if the data being analysed is the current user.
- *
+ *
+ * User id is needed if isUserNamesVisible is false && learnerRequest is true, as it is required to work out if the
+ * data being analysed is the current user.
+ *
* @param request
* @param qaContent
* @param qaService
@@ -1680,2553 +1452,2244 @@
* @param currentSessionId
* @param userId
*/
- public void refreshSummaryData(HttpServletRequest request, QaContent qaContent, IQaService qaService,
- boolean isUserNamesVisible, boolean isLearnerRequest, String currentSessionId, String userId,
- GeneralLearnerFlowDTO generalLearnerFlowDTO, boolean setEditResponse, String currentMonitoredToolSession)
- {
- logger.debug("starting refreshSummaryData: setEditResponse + " + setEditResponse);
- logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
- logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO);
- logger.debug("qaService: " + isUserNamesVisible);
-
- logger.debug("isUserNamesVisible: " + isUserNamesVisible);
- logger.debug("isLearnerRequest: " + isLearnerRequest);
-
- GeneralMonitoringDTO generalMonitoringDTO= new GeneralMonitoringDTO();
-
- /* this section is related to summary tab. Starts here. */
- Map summaryToolSessions=MonitoringUtil.populateToolSessions(request, qaContent, qaService);
- logger.debug("summaryToolSessions: " + summaryToolSessions);
- request.setAttribute(SUMMARY_TOOL_SESSIONS, summaryToolSessions);
-
- if (qaContent.getTitle() == null)
- {
- generalMonitoringDTO.setActivityTitle("Questions and Answers");
- generalMonitoringDTO.setActivityInstructions("Please answer the questions.");
- }
- else
- {
- generalMonitoringDTO.setActivityTitle(qaContent.getTitle());
- generalMonitoringDTO.setActivityInstructions(qaContent.getInstructions());
- }
+ public void refreshSummaryData(HttpServletRequest request, QaContent qaContent, IQaService qaService,
+ boolean isUserNamesVisible, boolean isLearnerRequest, String currentSessionId, String userId,
+ GeneralLearnerFlowDTO generalLearnerFlowDTO, boolean setEditResponse, String currentMonitoredToolSession) {
+ QaMonitoringAction.logger.debug("starting refreshSummaryData: setEditResponse + " + setEditResponse);
+ QaMonitoringAction.logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
+ QaMonitoringAction.logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO);
+ QaMonitoringAction.logger.debug("qaService: " + isUserNamesVisible);
- if (qaService.studentActivityOccurredGlobal(qaContent))
- {
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
- generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
- }
- else
- {
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
- generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
- }
-
-
- boolean isContentInUse=QaUtils.isContentInUse(qaContent);
- logger.debug("isContentInUse:" + isContentInUse);
-
- generalMonitoringDTO.setMonitoredContentInUse(new Boolean(false).toString());
- if (isContentInUse == true)
- {
- logger.debug("monitoring url does not allow editActivity since the content is in use.");
- persistError(request,"error.content.inUse");
- generalMonitoringDTO.setMonitoredContentInUse(new Boolean(true).toString());
- }
+ QaMonitoringAction.logger.debug("isUserNamesVisible: " + isUserNamesVisible);
+ QaMonitoringAction.logger.debug("isLearnerRequest: " + isLearnerRequest);
- EditActivityDTO editActivityDTO = new EditActivityDTO();
- if (isContentInUse == true)
- {
- editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
- }
- request.setAttribute(EDIT_ACTIVITY_DTO, editActivityDTO);
-
- Map summaryToolSessionsId=MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
- logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
- request.setAttribute(SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
-
- currentSessionId=currentMonitoredToolSession;
-
- logger.debug("using allUsersData to retrieve data: " + isUserNamesVisible);
- List listMonitoredAnswersContainerDTO=MonitoringUtil.buildGroupsQuestionData(request, qaContent, qaService,
- isUserNamesVisible, isLearnerRequest, currentSessionId, userId);
-
- logger.debug("listMonitoredAnswersContainerDTO: " + listMonitoredAnswersContainerDTO);
-
-
- /*getting stats screen content from here... */
- int countAllUsers=qaService.getTotalNumberOfUsers(qaContent);
- logger.debug("countAllUsers: " + countAllUsers);
-
- if (countAllUsers == 0)
- {
- logger.debug("error: countAllUsers is 0");
- generalMonitoringDTO.setUserExceptionNoStudentActivity(new Boolean(true).toString());
- }
-
+ GeneralMonitoringDTO generalMonitoringDTO = new GeneralMonitoringDTO();
- generalMonitoringDTO.setCountAllUsers(new Integer(countAllUsers).toString());
-
- int countSessionComplete=qaService.countSessionComplete(qaContent);
- logger.debug("countSessionComplete: " + countSessionComplete);
+ /* this section is related to summary tab. Starts here. */
+ Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions);
- generalMonitoringDTO.setCountSessionComplete(new Integer(countSessionComplete).toString());
- logger.debug("ending refreshStatsData with generalMonitoringDTO: " + generalMonitoringDTO);
- /* till here*/
+ if (qaContent.getTitle() == null) {
+ generalMonitoringDTO.setActivityTitle("Questions and Answers");
+ generalMonitoringDTO.setActivityInstructions("Please answer the questions.");
+ } else {
+ generalMonitoringDTO.setActivityTitle(qaContent.getTitle());
+ generalMonitoringDTO.setActivityInstructions(qaContent.getInstructions());
+ }
-
- generalMonitoringDTO.setEditResponse(new Boolean(setEditResponse).toString());
-
- /*getting instructions screen content from here... */
- generalMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
- generalMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
-
+ if (qaService.studentActivityOccurredGlobal(qaContent)) {
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
+ generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
+ } else {
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
+ generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
+ }
- List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
- logger.debug("attachmentList: " + attachmentList);
- generalMonitoringDTO.setAttachmentList(attachmentList);
- generalMonitoringDTO.setDeletedAttachmentList(new ArrayList());
- /* ...till here **/
+ boolean isContentInUse = QaUtils.isContentInUse(qaContent);
+ QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse);
-
- if (generalLearnerFlowDTO != null)
- {
- logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO);
- logger.debug("placing LIST_MONITORED_ANSWERS_CONTAINER_DTO within generalLearnerFlowDTO");
- generalLearnerFlowDTO.setListMonitoredAnswersContainerDTO(listMonitoredAnswersContainerDTO);
-
-
- if (isLearnerRequest)
- {
- logger.debug("isLearnerRequest is true.");
- generalLearnerFlowDTO.setRequestLearningReportProgress(new Boolean(true).toString());
- }
-
- logger.debug("end of refreshSummaryData, generalLearnerFlowDTO : " + generalLearnerFlowDTO);
- request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO);
+ generalMonitoringDTO.setMonitoredContentInUse(new Boolean(false).toString());
+ if (isContentInUse == true) {
+ QaMonitoringAction.logger.debug("monitoring url does not allow editActivity since the content is in use.");
+ persistError(request, "error.content.inUse");
+ generalMonitoringDTO.setMonitoredContentInUse(new Boolean(true).toString());
+ }
+
+ EditActivityDTO editActivityDTO = new EditActivityDTO();
+ if (isContentInUse == true) {
+ editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
+ }
+ request.setAttribute(QaAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO);
+
+ Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
+
+ currentSessionId = currentMonitoredToolSession;
+
+ QaMonitoringAction.logger.debug("using allUsersData to retrieve data: " + isUserNamesVisible);
+ List listMonitoredAnswersContainerDTO = MonitoringUtil.buildGroupsQuestionData(request, qaContent, qaService,
+ isUserNamesVisible, isLearnerRequest, currentSessionId, userId);
+
+ QaMonitoringAction.logger.debug("listMonitoredAnswersContainerDTO: " + listMonitoredAnswersContainerDTO);
+
+ /* getting stats screen content from here... */
+ int countAllUsers = qaService.getTotalNumberOfUsers(qaContent);
+ QaMonitoringAction.logger.debug("countAllUsers: " + countAllUsers);
+
+ if (countAllUsers == 0) {
+ QaMonitoringAction.logger.debug("error: countAllUsers is 0");
+ generalMonitoringDTO.setUserExceptionNoStudentActivity(new Boolean(true).toString());
+ }
+
+ generalMonitoringDTO.setCountAllUsers(new Integer(countAllUsers).toString());
+
+ int countSessionComplete = qaService.countSessionComplete(qaContent);
+ QaMonitoringAction.logger.debug("countSessionComplete: " + countSessionComplete);
+
+ generalMonitoringDTO.setCountSessionComplete(new Integer(countSessionComplete).toString());
+ QaMonitoringAction.logger.debug("ending refreshStatsData with generalMonitoringDTO: " + generalMonitoringDTO);
+ /* till here */
+
+ generalMonitoringDTO.setEditResponse(new Boolean(setEditResponse).toString());
+
+ /* getting instructions screen content from here... */
+ generalMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
+ generalMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
+
+ List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
+ QaMonitoringAction.logger.debug("attachmentList: " + attachmentList);
+ generalMonitoringDTO.setAttachmentList(attachmentList);
+ generalMonitoringDTO.setDeletedAttachmentList(new ArrayList());
+ /* ...till here * */
+
+ if (generalLearnerFlowDTO != null) {
+ QaMonitoringAction.logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO);
+ QaMonitoringAction.logger
+ .debug("placing LIST_MONITORED_ANSWERS_CONTAINER_DTO within generalLearnerFlowDTO");
+ generalLearnerFlowDTO.setListMonitoredAnswersContainerDTO(listMonitoredAnswersContainerDTO);
+
+ if (isLearnerRequest) {
+ QaMonitoringAction.logger.debug("isLearnerRequest is true.");
+ generalLearnerFlowDTO.setRequestLearningReportProgress(new Boolean(true).toString());
}
-
- prepareReflectionData(request, qaContent, qaService,null, false, currentMonitoredToolSession);
- prepareEditActivityScreenData(request, qaContent);
-
- /*find out if there are any reflection entries, from here*/
- boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(qaService, qaContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
-
- if (notebookEntriesExist)
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
- }
- else
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
- }
- /* ... till here*/
-
-
- logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO );
- request.setAttribute(QA_GENERAL_MONITORING_DTO, generalMonitoringDTO);
-
- MonitoringUtil.buildQaStatsDTO(request,qaService, qaContent);
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
+ QaMonitoringAction.logger.debug("end of refreshSummaryData, generalLearnerFlowDTO : "
+ + generalLearnerFlowDTO);
+ request.setAttribute(QaAppConstants.GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO);
}
-
+ prepareReflectionData(request, qaContent, qaService, null, false, currentMonitoredToolSession);
+
+ prepareEditActivityScreenData(request, qaContent);
+
+ /* find out if there are any reflection entries, from here */
+ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent);
+ QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist);
+
+ if (notebookEntriesExist) {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+ } else {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
+ }
+ /* ... till here */
+
+ QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO);
+
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
+ }
+
/**
- * populates data for stats screen
- * refreshStatsData(HttpServletRequest request)
+ * populates data for stats screen refreshStatsData(HttpServletRequest request)
+ *
* @param request
*/
- public void refreshStatsData(HttpServletRequest request , QaMonitoringForm qaMonitoringForm, IQaService qaService,
- GeneralMonitoringDTO generalMonitoringDTO)
- {
- logger.debug("starting refreshStatsData: " + qaService);
- logger.debug("starting refreshStatsData with generalMonitoringDTO: " + generalMonitoringDTO);
- /* it is possible that no users has ever logged in for the activity yet*/
+ public void refreshStatsData(HttpServletRequest request, QaMonitoringForm qaMonitoringForm, IQaService qaService,
+ GeneralMonitoringDTO generalMonitoringDTO) {
+ QaMonitoringAction.logger.debug("starting refreshStatsData: " + qaService);
+ QaMonitoringAction.logger.debug("starting refreshStatsData with generalMonitoringDTO: " + generalMonitoringDTO);
+ /* it is possible that no users has ever logged in for the activity yet */
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
- qaMonitoringForm.setToolContentID(strToolContentID);
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID);
+ qaMonitoringForm.setToolContentID(strToolContentID);
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("existing qaContent:" + qaContent);
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaMonitoringAction.logger.debug("existing qaContent:" + qaContent);
- Map summaryToolSessions=MonitoringUtil.populateToolSessions(request, qaContent, qaService);
- logger.debug("summaryToolSessions: " + summaryToolSessions);
- request.setAttribute(SUMMARY_TOOL_SESSIONS, summaryToolSessions);
- logger.debug("SUMMARY_TOOL_SESSIONS: " + request.getAttribute(SUMMARY_TOOL_SESSIONS));
+ Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions);
+ QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: "
+ + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS));
+ Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
- Map summaryToolSessionsId=MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
- logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
- request.setAttribute(SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
+ int countAllUsers = qaService.getTotalNumberOfUsers(qaContent);
+ QaMonitoringAction.logger.debug("countAllUsers: " + countAllUsers);
+ if (countAllUsers == 0) {
+ QaMonitoringAction.logger.debug("error: countAllUsers is 0");
+ generalMonitoringDTO.setUserExceptionNoStudentActivity(new Boolean(true).toString());
+ }
- int countAllUsers=qaService.getTotalNumberOfUsers(qaContent);
- logger.debug("countAllUsers: " + countAllUsers);
-
- if (countAllUsers == 0)
- {
- logger.debug("error: countAllUsers is 0");
- generalMonitoringDTO.setUserExceptionNoStudentActivity(new Boolean(true).toString());
- }
-
+ generalMonitoringDTO.setCountAllUsers(new Integer(countAllUsers).toString());
- generalMonitoringDTO.setCountAllUsers(new Integer(countAllUsers).toString());
-
- int countSessionComplete=qaService.countSessionComplete(qaContent);
- logger.debug("countSessionComplete: " + countSessionComplete);
+ int countSessionComplete = qaService.countSessionComplete(qaContent);
+ QaMonitoringAction.logger.debug("countSessionComplete: " + countSessionComplete);
- generalMonitoringDTO.setCountSessionComplete(new Integer(countSessionComplete).toString());
-
- prepareReflectionData(request, qaContent, qaService,null, false, "All");
-
- prepareEditActivityScreenData(request, qaContent);
+ generalMonitoringDTO.setCountSessionComplete(new Integer(countSessionComplete).toString());
- EditActivityDTO editActivityDTO = new EditActivityDTO();
- boolean isContentInUse=QaUtils.isContentInUse(qaContent);
- logger.debug("isContentInUse:" + isContentInUse);
- if (isContentInUse == true)
- {
- editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
- }
-
-
- List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
- logger.debug("attachmentList: " + attachmentList);
- generalMonitoringDTO.setAttachmentList(attachmentList);
- logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO );
-
-
- request.setAttribute(EDIT_ACTIVITY_DTO, editActivityDTO);
- logger.debug("ending refreshStatsData with generalMonitoringDTO: " + generalMonitoringDTO);
- request.setAttribute(QA_GENERAL_MONITORING_DTO, generalMonitoringDTO);
-
- /*find out if there are any reflection entries, from here*/
- boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(qaService, qaContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
-
- if (notebookEntriesExist)
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
- }
- else
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
- }
- /* ... till here*/
-
- MonitoringUtil.buildQaStatsDTO(request,qaService, qaContent);
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
+ prepareReflectionData(request, qaContent, qaService, null, false, "All");
+
+ prepareEditActivityScreenData(request, qaContent);
+
+ EditActivityDTO editActivityDTO = new EditActivityDTO();
+ boolean isContentInUse = QaUtils.isContentInUse(qaContent);
+ QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse);
+ if (isContentInUse == true) {
+ editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
}
-
-
- public ActionForward showResponse(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException, ToolException
- {
- logger.debug("dispatching showResponse...");
- IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
-
- QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
-
- String currentUid=qaMonitoringForm.getCurrentUid();
- logger.debug("currentUid: " + currentUid);
- QaUsrResp qaUsrResp =qaService.getAttemptByUID(new Long(currentUid));
- logger.debug("qaUsrResp: " + qaUsrResp);
- qaUsrResp.setVisible(true);
- qaService.updateUserResponse(qaUsrResp);
- qaService.showResponse(qaUsrResp);
- logger.debug("qaUsrResp: " + qaUsrResp);
+ List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
+ QaMonitoringAction.logger.debug("attachmentList: " + attachmentList);
+ generalMonitoringDTO.setAttachmentList(attachmentList);
+ QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO);
-
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
- qaMonitoringForm.setToolContentID(strToolContentID);
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaMonitoringForm.setContentFolderID(contentFolderID);
+ request.setAttribute(QaAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO);
+ QaMonitoringAction.logger.debug("ending refreshStatsData with generalMonitoringDTO: " + generalMonitoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO);
-
- String editResponse=request.getParameter(EDIT_RESPONSE);
- logger.debug("editResponse: " + editResponse);
- qaMonitoringForm.setEditResponse(editResponse);
+ /* find out if there are any reflection entries, from here */
+ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent);
+ QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist);
+ if (notebookEntriesExist) {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+ } else {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
+ }
+ /* ... till here */
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("existing qaContent:" + qaContent);
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
+ }
- Map summaryToolSessions=MonitoringUtil.populateToolSessions(request, qaContent, qaService);
- logger.debug("summaryToolSessions: " + summaryToolSessions);
- request.setAttribute(SUMMARY_TOOL_SESSIONS, summaryToolSessions);
- logger.debug("SUMMARY_TOOL_SESSIONS: " + request.getAttribute(SUMMARY_TOOL_SESSIONS));
+ public ActionForward showResponse(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException, ToolException {
+ QaMonitoringAction.logger.debug("dispatching showResponse...");
- Map summaryToolSessionsId=MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
- logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
- request.setAttribute(SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaMonitoringAction.logger.debug("qaService: " + qaService);
+ QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
- String currentMonitoredToolSession=qaMonitoringForm.getSelectedToolSessionId();
- logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
+ String currentUid = qaMonitoringForm.getCurrentUid();
+ QaMonitoringAction.logger.debug("currentUid: " + currentUid);
+ QaUsrResp qaUsrResp = qaService.getAttemptByUID(new Long(currentUid));
+ QaMonitoringAction.logger.debug("qaUsrResp: " + qaUsrResp);
+ qaUsrResp.setVisible(true);
+ qaService.updateUserResponse(qaUsrResp);
+ qaService.showResponse(qaUsrResp);
+ QaMonitoringAction.logger.debug("qaUsrResp: " + qaUsrResp);
- if (currentMonitoredToolSession.equals(""))
- {
- currentMonitoredToolSession="All";
- }
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID);
+ qaMonitoringForm.setToolContentID(strToolContentID);
- GeneralLearnerFlowDTO generalLearnerFlowDTO= LearningUtil.buildGeneralLearnerFlowDTO(qaContent);
- logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO);
-
- refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, false, currentMonitoredToolSession);
-
- logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
- if (currentMonitoredToolSession.equals("All"))
- {
- request.setAttribute(SELECTION_CASE, new Long(2));
- }
- else
- {
- request.setAttribute(SELECTION_CASE, new Long(1));
-
- QaSession qaSession=qaService.retrieveQaSessionOrNullById(new Long(currentMonitoredToolSession).longValue());
- logger.debug("retrieving qaSession name: " + qaSession.getSession_name());
- request.setAttribute(CURRENT_SESSION_NAME, qaSession.getSession_name());
- }
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaMonitoringForm.setContentFolderID(contentFolderID);
- logger.debug("SELECTION_CASE: " + request.getAttribute(SELECTION_CASE));
- request.setAttribute(CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession);
-
- prepareReflectionData(request, qaContent, qaService,null, false, currentMonitoredToolSession);
-
- prepareEditActivityScreenData(request, qaContent);
+ String editResponse = request.getParameter(QaAppConstants.EDIT_RESPONSE);
+ QaMonitoringAction.logger.debug("editResponse: " + editResponse);
+ qaMonitoringForm.setEditResponse(editResponse);
- EditActivityDTO editActivityDTO = new EditActivityDTO();
- boolean isContentInUse=QaUtils.isContentInUse(qaContent);
- logger.debug("isContentInUse:" + isContentInUse);
- if (isContentInUse == true)
- {
- editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
- }
- request.setAttribute(EDIT_ACTIVITY_DTO, editActivityDTO);
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaMonitoringAction.logger.debug("existing qaContent:" + qaContent);
- /*find out if there are any reflection entries, from here*/
- boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(qaService, qaContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
-
- if (notebookEntriesExist)
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
- }
- else
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
- }
- /* ... till here*/
+ Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions);
+ QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: "
+ + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS));
-
- MonitoringUtil.buildQaStatsDTO(request,qaService, qaContent);
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
-
- logger.debug("submitting session to refresh the data from the database: ");
- return (mapping.findForward(LOAD_MONITORING));
- }
+ Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
-
-
- public ActionForward showGroupResponse(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException, ToolException
- {
- logger.debug("dispatching showGroupResponse...");
+ String currentMonitoredToolSession = qaMonitoringForm.getSelectedToolSessionId();
+ QaMonitoringAction.logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
- IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
-
- QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
-
- String currentUid=qaMonitoringForm.getCurrentUid();
- logger.debug("currentUid: " + currentUid);
- QaUsrResp qaUsrResp =qaService.getAttemptByUID(new Long(currentUid));
- logger.debug("qaUsrResp: " + qaUsrResp);
- qaUsrResp.setVisible(true);
- qaService.updateUserResponse(qaUsrResp);
- qaService.showResponse(qaUsrResp);
- logger.debug("qaUsrResp: " + qaUsrResp);
+ if (currentMonitoredToolSession.equals("")) {
+ currentMonitoredToolSession = "All";
+ }
-
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
- qaMonitoringForm.setToolContentID(strToolContentID);
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaMonitoringForm.setContentFolderID(contentFolderID);
+ GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent);
+ QaMonitoringAction.logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO);
-
- String editResponse=request.getParameter(EDIT_RESPONSE);
- logger.debug("editResponse: " + editResponse);
- qaMonitoringForm.setEditResponse(editResponse);
+ refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, false,
+ currentMonitoredToolSession);
+ QaMonitoringAction.logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
+ if (currentMonitoredToolSession.equals("All")) {
+ request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(2));
+ } else {
+ request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(1));
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("existing qaContent:" + qaContent);
+ QaSession qaSession = qaService.retrieveQaSessionOrNullById(new Long(currentMonitoredToolSession)
+ .longValue());
+ QaMonitoringAction.logger.debug("retrieving qaSession name: " + qaSession.getSession_name());
+ request.setAttribute(QaAppConstants.CURRENT_SESSION_NAME, qaSession.getSession_name());
+ }
- Map summaryToolSessions=MonitoringUtil.populateToolSessions(request, qaContent, qaService);
- logger.debug("summaryToolSessions: " + summaryToolSessions);
- request.setAttribute(SUMMARY_TOOL_SESSIONS, summaryToolSessions);
- logger.debug("SUMMARY_TOOL_SESSIONS: " + request.getAttribute(SUMMARY_TOOL_SESSIONS));
+ QaMonitoringAction.logger.debug("SELECTION_CASE: " + request.getAttribute(QaAppConstants.SELECTION_CASE));
+ request.setAttribute(QaAppConstants.CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession);
- Map summaryToolSessionsId=MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
- logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
- request.setAttribute(SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
+ prepareReflectionData(request, qaContent, qaService, null, false, currentMonitoredToolSession);
+ prepareEditActivityScreenData(request, qaContent);
- String currentMonitoredToolSession=qaMonitoringForm.getSelectedToolSessionId();
- logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
+ EditActivityDTO editActivityDTO = new EditActivityDTO();
+ boolean isContentInUse = QaUtils.isContentInUse(qaContent);
+ QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse);
+ if (isContentInUse == true) {
+ editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
+ }
+ request.setAttribute(QaAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO);
- if (currentMonitoredToolSession.equals(""))
- {
- currentMonitoredToolSession="All";
- }
+ /* find out if there are any reflection entries, from here */
+ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent);
+ QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist);
- GeneralLearnerFlowDTO generalLearnerFlowDTO= LearningUtil.buildGeneralLearnerFlowDTO(qaContent);
- logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO);
-
- refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, false, currentMonitoredToolSession);
-
- logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
- if (currentMonitoredToolSession.equals("All"))
- {
- request.setAttribute(SELECTION_CASE, new Long(2));
- }
- else
- {
- request.setAttribute(SELECTION_CASE, new Long(1));
- }
+ if (notebookEntriesExist) {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+ } else {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
+ }
+ /* ... till here */
- logger.debug("SELECTION_CASE: " + request.getAttribute(SELECTION_CASE));
-
- prepareReflectionData(request, qaContent, qaService,null, false, currentMonitoredToolSession);
-
- prepareEditActivityScreenData(request, qaContent);
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
- EditActivityDTO editActivityDTO = new EditActivityDTO();
- boolean isContentInUse=QaUtils.isContentInUse(qaContent);
- logger.debug("isContentInUse:" + isContentInUse);
- if (isContentInUse == true)
- {
- editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
- }
- request.setAttribute(EDIT_ACTIVITY_DTO, editActivityDTO);
+ QaMonitoringAction.logger.debug("submitting session to refresh the data from the database: ");
+ return mapping.findForward(QaAppConstants.LOAD_MONITORING);
+ }
- /*find out if there are any reflection entries, from here*/
- boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(qaService, qaContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
-
- if (notebookEntriesExist)
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
- }
- else
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
- }
- /* ... till here*/
+ public ActionForward showGroupResponse(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException, ToolException {
+ QaMonitoringAction.logger.debug("dispatching showGroupResponse...");
-
- MonitoringUtil.buildQaStatsDTO(request,qaService, qaContent);
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
- request.setAttribute("currentMonitoredToolSession", "All");
-
- logger.debug("submitting session to refresh the data from the database: ");
- return (mapping.findForward(LOAD_MONITORING));
- }
-
-
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaMonitoringAction.logger.debug("qaService: " + qaService);
- public ActionForward hideResponse(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException, ToolException
- {
- logger.debug("dispatching hideResponse...");
- IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
-
- QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaMonitoringForm.setContentFolderID(contentFolderID);
+ QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
+ String currentUid = qaMonitoringForm.getCurrentUid();
+ QaMonitoringAction.logger.debug("currentUid: " + currentUid);
+ QaUsrResp qaUsrResp = qaService.getAttemptByUID(new Long(currentUid));
+ QaMonitoringAction.logger.debug("qaUsrResp: " + qaUsrResp);
+ qaUsrResp.setVisible(true);
+ qaService.updateUserResponse(qaUsrResp);
+ qaService.showResponse(qaUsrResp);
+ QaMonitoringAction.logger.debug("qaUsrResp: " + qaUsrResp);
- String currentUid=qaMonitoringForm.getCurrentUid();
- logger.debug("currentUid: " + currentUid);
- QaUsrResp qaUsrResp =qaService.getAttemptByUID(new Long(currentUid));
- logger.debug("qaUsrResp: " + qaUsrResp);
- qaUsrResp.setVisible(false);
- qaService.updateUserResponse(qaUsrResp);
- qaService.hideResponse(qaUsrResp);
- logger.debug("qaUsrResp: " + qaUsrResp);
-
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
- qaMonitoringForm.setToolContentID(strToolContentID);
-
- String editResponse=request.getParameter(EDIT_RESPONSE);
- logger.debug("editResponse: " + editResponse);
- qaMonitoringForm.setEditResponse(editResponse);
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID);
+ qaMonitoringForm.setToolContentID(strToolContentID);
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaMonitoringForm.setContentFolderID(contentFolderID);
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("existing qaContent:" + qaContent);
-
- Map summaryToolSessions=MonitoringUtil.populateToolSessions(request, qaContent, qaService);
- logger.debug("summaryToolSessions: " + summaryToolSessions);
- request.setAttribute(SUMMARY_TOOL_SESSIONS, summaryToolSessions);
- logger.debug("SUMMARY_TOOL_SESSIONS: " + request.getAttribute(SUMMARY_TOOL_SESSIONS));
+ String editResponse = request.getParameter(QaAppConstants.EDIT_RESPONSE);
+ QaMonitoringAction.logger.debug("editResponse: " + editResponse);
+ qaMonitoringForm.setEditResponse(editResponse);
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaMonitoringAction.logger.debug("existing qaContent:" + qaContent);
- Map summaryToolSessionsId=MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
- logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
- request.setAttribute(SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
+ Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions);
+ QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: "
+ + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS));
+ Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
- String currentMonitoredToolSession=qaMonitoringForm.getSelectedToolSessionId();
- logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
+ String currentMonitoredToolSession = qaMonitoringForm.getSelectedToolSessionId();
+ QaMonitoringAction.logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
- if (currentMonitoredToolSession.equals(""))
- {
- currentMonitoredToolSession="All";
- }
+ if (currentMonitoredToolSession.equals("")) {
+ currentMonitoredToolSession = "All";
+ }
- if (currentMonitoredToolSession.equals("All"))
- {
- request.setAttribute(SELECTION_CASE, new Long(2));
-
- QaSession qaSession=qaService.retrieveQaSessionOrNullById(new Long(currentMonitoredToolSession).longValue());
- logger.debug("retrieving qaSession name: " + qaSession.getSession_name());
- request.setAttribute(CURRENT_SESSION_NAME, qaSession.getSession_name());
- }
- else
- {
- request.setAttribute(SELECTION_CASE, new Long(1));
- }
+ GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent);
+ QaMonitoringAction.logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO);
- logger.debug("SELECTION_CASE: " + request.getAttribute(SELECTION_CASE));
- request.setAttribute(CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession);
+ refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, false,
+ currentMonitoredToolSession);
- GeneralLearnerFlowDTO generalLearnerFlowDTO= LearningUtil.buildGeneralLearnerFlowDTO(qaContent);
- logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO);
-
- refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, false, currentMonitoredToolSession);
-
- prepareReflectionData(request, qaContent, qaService,null, false, currentMonitoredToolSession);
-
- prepareEditActivityScreenData(request, qaContent);
-
- EditActivityDTO editActivityDTO = new EditActivityDTO();
- boolean isContentInUse=QaUtils.isContentInUse(qaContent);
- logger.debug("isContentInUse:" + isContentInUse);
- if (isContentInUse == true)
- {
- editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
- }
- request.setAttribute(EDIT_ACTIVITY_DTO, editActivityDTO);
+ QaMonitoringAction.logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
+ if (currentMonitoredToolSession.equals("All")) {
+ request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(2));
+ } else {
+ request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(1));
+ }
- /*find out if there are any reflection entries, from here*/
- boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(qaService, qaContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
-
- if (notebookEntriesExist)
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
- }
- else
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
- }
-
- MonitoringUtil.buildQaStatsDTO(request,qaService, qaContent);
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
-
- logger.debug("submitting session to refresh the data from the database: ");
- return (mapping.findForward(LOAD_MONITORING));
- }
-
-
- public ActionForward hideGroupResponse(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException, ToolException
- {
- logger.debug("dispatching hideGroupResponse...");
- IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
-
- QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaMonitoringForm.setContentFolderID(contentFolderID);
+ QaMonitoringAction.logger.debug("SELECTION_CASE: " + request.getAttribute(QaAppConstants.SELECTION_CASE));
+ prepareReflectionData(request, qaContent, qaService, null, false, currentMonitoredToolSession);
- String currentUid=qaMonitoringForm.getCurrentUid();
- logger.debug("currentUid: " + currentUid);
- QaUsrResp qaUsrResp =qaService.getAttemptByUID(new Long(currentUid));
- logger.debug("qaUsrResp: " + qaUsrResp);
- qaUsrResp.setVisible(false);
- qaService.updateUserResponse(qaUsrResp);
- qaService.hideResponse(qaUsrResp);
- logger.debug("qaUsrResp: " + qaUsrResp);
-
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
- qaMonitoringForm.setToolContentID(strToolContentID);
-
- String editResponse=request.getParameter(EDIT_RESPONSE);
- logger.debug("editResponse: " + editResponse);
- qaMonitoringForm.setEditResponse(editResponse);
+ prepareEditActivityScreenData(request, qaContent);
+ EditActivityDTO editActivityDTO = new EditActivityDTO();
+ boolean isContentInUse = QaUtils.isContentInUse(qaContent);
+ QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse);
+ if (isContentInUse == true) {
+ editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
+ }
+ request.setAttribute(QaAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO);
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("existing qaContent:" + qaContent);
-
- Map summaryToolSessions=MonitoringUtil.populateToolSessions(request, qaContent, qaService);
- logger.debug("summaryToolSessions: " + summaryToolSessions);
- request.setAttribute(SUMMARY_TOOL_SESSIONS, summaryToolSessions);
- logger.debug("SUMMARY_TOOL_SESSIONS: " + request.getAttribute(SUMMARY_TOOL_SESSIONS));
+ /* find out if there are any reflection entries, from here */
+ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent);
+ QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist);
+ if (notebookEntriesExist) {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+ } else {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
+ }
+ /* ... till here */
- Map summaryToolSessionsId=MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
- logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
- request.setAttribute(SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
+ request.setAttribute("currentMonitoredToolSession", "All");
+ QaMonitoringAction.logger.debug("submitting session to refresh the data from the database: ");
+ return mapping.findForward(QaAppConstants.LOAD_MONITORING);
+ }
- String currentMonitoredToolSession=qaMonitoringForm.getSelectedToolSessionId();
- logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
+ public ActionForward hideResponse(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException, ToolException {
+ QaMonitoringAction.logger.debug("dispatching hideResponse...");
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaMonitoringAction.logger.debug("qaService: " + qaService);
- if (currentMonitoredToolSession.equals(""))
- {
- currentMonitoredToolSession="All";
- }
+ QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
- if (currentMonitoredToolSession.equals("All"))
- {
- request.setAttribute(SELECTION_CASE, new Long(2));
- }
- else
- {
- request.setAttribute(SELECTION_CASE, new Long(1));
- }
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaMonitoringForm.setContentFolderID(contentFolderID);
- logger.debug("SELECTION_CASE: " + request.getAttribute(SELECTION_CASE));
+ String currentUid = qaMonitoringForm.getCurrentUid();
+ QaMonitoringAction.logger.debug("currentUid: " + currentUid);
+ QaUsrResp qaUsrResp = qaService.getAttemptByUID(new Long(currentUid));
+ QaMonitoringAction.logger.debug("qaUsrResp: " + qaUsrResp);
+ qaUsrResp.setVisible(false);
+ qaService.updateUserResponse(qaUsrResp);
+ qaService.hideResponse(qaUsrResp);
+ QaMonitoringAction.logger.debug("qaUsrResp: " + qaUsrResp);
- GeneralLearnerFlowDTO generalLearnerFlowDTO= LearningUtil.buildGeneralLearnerFlowDTO(qaContent);
- logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO);
-
- refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, false , currentMonitoredToolSession);
-
- prepareReflectionData(request, qaContent, qaService,null, false, currentMonitoredToolSession);
-
- prepareEditActivityScreenData(request, qaContent);
-
- EditActivityDTO editActivityDTO = new EditActivityDTO();
- boolean isContentInUse=QaUtils.isContentInUse(qaContent);
- logger.debug("isContentInUse:" + isContentInUse);
- if (isContentInUse == true)
- {
- editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
- }
- request.setAttribute(EDIT_ACTIVITY_DTO, editActivityDTO);
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID);
+ qaMonitoringForm.setToolContentID(strToolContentID);
- /*find out if there are any reflection entries, from here*/
- boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(qaService, qaContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
-
- if (notebookEntriesExist)
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
- }
- else
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
- }
-
- MonitoringUtil.buildQaStatsDTO(request,qaService, qaContent);
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
- request.setAttribute("currentMonitoredToolSession", "All");
-
- logger.debug("submitting session to refresh the data from the database: ");
- return (mapping.findForward(LOAD_MONITORING));
- }
-
-
-
- public ActionForward openNotebook(ActionMapping mapping,
- ActionForm form, HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException, ToolException
- {
- logger.debug("dispatching openNotebook...");
- QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
-
- IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
+ String editResponse = request.getParameter(QaAppConstants.EDIT_RESPONSE);
+ QaMonitoringAction.logger.debug("editResponse: " + editResponse);
+ qaMonitoringForm.setEditResponse(editResponse);
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaMonitoringAction.logger.debug("existing qaContent:" + qaContent);
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaMonitoringForm.setContentFolderID(contentFolderID);
+ Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions);
+ QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: "
+ + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS));
-
- String uid=request.getParameter("uid");
- logger.debug("uid: " + uid);
-
- String userId=request.getParameter("userId");
- logger.debug("userId: " + userId);
-
- String userName=request.getParameter("userName");
- logger.debug("userName: " + userName);
+ Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
- String sessionId=request.getParameter("sessionId");
- logger.debug("sessionId: " + sessionId);
-
-
- NotebookEntry notebookEntry = qaService.getEntry(new Long(sessionId),
- CoreNotebookConstants.NOTEBOOK_TOOL,
- MY_SIGNATURE, new Integer(userId));
-
- logger.debug("notebookEntry: " + notebookEntry);
-
- GeneralLearnerFlowDTO generalLearnerFlowDTO= new GeneralLearnerFlowDTO();
- if (notebookEntry != null) {
- String notebookEntryPresentable=QaUtils.replaceNewLines(notebookEntry.getEntry());
- generalLearnerFlowDTO.setNotebookEntry(notebookEntryPresentable);
- generalLearnerFlowDTO.setUserName(userName);
- }
+ String currentMonitoredToolSession = qaMonitoringForm.getSelectedToolSessionId();
+ QaMonitoringAction.logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
- logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO);
- request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO);
-
- QaSession qaSession=qaService.retrieveQaSessionOrNullById(new Long(sessionId).longValue());
- logger.debug("qaSession: " + qaSession);
-
- QaContent qaContent=qaSession.getQaContent();
- logger.debug("qaContent: " + qaContent);
-
- prepareEditActivityScreenData(request, qaContent);
-
- GeneralMonitoringDTO generalMonitoringDTO= new GeneralMonitoringDTO();
- List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
- logger.debug("attachmentList: " + attachmentList);
- generalMonitoringDTO.setAttachmentList(attachmentList);
-
-
-
- if (qaService.studentActivityOccurredGlobal(qaContent))
- {
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
- generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
- }
- else
- {
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
- generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
- }
+ if (currentMonitoredToolSession.equals("")) {
+ currentMonitoredToolSession = "All";
+ }
-
- logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO );
- request.setAttribute(QA_GENERAL_MONITORING_DTO, generalMonitoringDTO);
+ if (currentMonitoredToolSession.equals("All")) {
+ request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(2));
-
+ QaSession qaSession = qaService.retrieveQaSessionOrNullById(new Long(currentMonitoredToolSession)
+ .longValue());
+ QaMonitoringAction.logger.debug("retrieving qaSession name: " + qaSession.getSession_name());
+ request.setAttribute(QaAppConstants.CURRENT_SESSION_NAME, qaSession.getSession_name());
+ } else {
+ request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(1));
+ }
- /*find out if there are any reflection entries, from here*/
- boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(qaService, qaContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
-
- if (notebookEntriesExist)
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
-
- String userExceptionNoToolSessions=(String)generalMonitoringDTO.getUserExceptionNoToolSessions();
- logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions);
-
- if (userExceptionNoToolSessions.equals("true"))
- {
- logger.debug("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.buildQaStatsDTO(request,qaService, qaContent);
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
-
- return mapping.findForward(LEARNER_NOTEBOOK);
+ QaMonitoringAction.logger.debug("SELECTION_CASE: " + request.getAttribute(QaAppConstants.SELECTION_CASE));
+ request.setAttribute(QaAppConstants.CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession);
+
+ GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent);
+ QaMonitoringAction.logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO);
+
+ refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, false,
+ currentMonitoredToolSession);
+
+ prepareReflectionData(request, qaContent, qaService, null, false, currentMonitoredToolSession);
+
+ prepareEditActivityScreenData(request, qaContent);
+
+ EditActivityDTO editActivityDTO = new EditActivityDTO();
+ boolean isContentInUse = QaUtils.isContentInUse(qaContent);
+ QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse);
+ if (isContentInUse == true) {
+ editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
}
-
-
- public void prepareEditActivityScreenData(HttpServletRequest request, QaContent qaContent)
- {
- logger.debug("starting prepareEditActivityScreenData: " + qaContent);
- QaGeneralAuthoringDTO qaGeneralAuthoringDTO= new QaGeneralAuthoringDTO();
-
- qaGeneralAuthoringDTO.setActivityTitle(qaContent.getTitle());
- qaGeneralAuthoringDTO.setActivityInstructions(qaContent.getInstructions());
-
- logger.debug("final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- request.setAttribute(QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+ request.setAttribute(QaAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO);
+
+ /* find out if there are any reflection entries, from here */
+ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent);
+ QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist);
+
+ if (notebookEntriesExist) {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+ } else {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
}
-
-
- public ActionForward submitAllContent(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException {
- logger.debug("dispatching proxy submitAllContent...");
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
- /*start authoring code*/
- QaAuthoringForm qaAuthoringForm = (QaMonitoringForm) form;
- logger.debug("dispathcing submitAllContent :" +form);
+ QaMonitoringAction.logger.debug("submitting session to refresh the data from the database: ");
+ return mapping.findForward(QaAppConstants.LOAD_MONITORING);
+ }
- IQaService qaService =QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
-
- String httpSessionID=request.getParameter("httpSessionID");
- logger.debug("httpSessionID: " + httpSessionID);
-
- SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
+ public ActionForward hideGroupResponse(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException, ToolException {
+ QaMonitoringAction.logger.debug("dispatching hideGroupResponse...");
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaMonitoringAction.logger.debug("qaService: " + qaService);
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaAuthoringForm.setContentFolderID(contentFolderID);
+ QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
- String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaMonitoringForm.setContentFolderID(contentFolderID);
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
+ String currentUid = qaMonitoringForm.getCurrentUid();
+ QaMonitoringAction.logger.debug("currentUid: " + currentUid);
+ QaUsrResp qaUsrResp = qaService.getAttemptByUID(new Long(currentUid));
+ QaMonitoringAction.logger.debug("qaUsrResp: " + qaUsrResp);
+ qaUsrResp.setVisible(false);
+ qaService.updateUserResponse(qaUsrResp);
+ qaService.hideResponse(qaUsrResp);
+ QaMonitoringAction.logger.debug("qaUsrResp: " + qaUsrResp);
- String defaultContentIdStr=request.getParameter(DEFAULT_CONTENT_ID_STR);
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
- List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
-
- Map mapQuestionContent=AuthoringUtil.extractMapQuestionContent(listQuestionContentDTO);
- logger.debug("extracted mapQuestionContent: " + mapQuestionContent);
-
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID);
+ qaMonitoringForm.setToolContentID(strToolContentID);
- Map mapFeedback=AuthoringUtil.extractMapFeedback(listQuestionContentDTO);
- logger.debug("extracted mapFeedback: " + mapFeedback);
+ String editResponse = request.getParameter(QaAppConstants.EDIT_RESPONSE);
+ QaMonitoringAction.logger.debug("editResponse: " + editResponse);
+ qaMonitoringForm.setEditResponse(editResponse);
- ActionMessages errors = new ActionMessages();
- logger.debug("mapQuestionContent size: " + mapQuestionContent.size());
-
- if (mapQuestionContent.size() == 0)
- {
- ActionMessage error = new ActionMessage("questions.none.submitted");
- errors.add(ActionMessages.GLOBAL_MESSAGE, error);
- }
- logger.debug("errors: " + errors);
-
- AuthoringUtil authoringUtil= new AuthoringUtil();
-
- QaGeneralAuthoringDTO qaGeneralAuthoringDTO= new QaGeneralAuthoringDTO();
- qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
-
- String richTextTitle = request.getParameter(TITLE);
- String richTextInstructions = request.getParameter(INSTRUCTIONS);
-
- logger.debug("richTextTitle: " + richTextTitle);
- logger.debug("richTextInstructions: " + richTextInstructions);
-
- qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
- qaAuthoringForm.setTitle(richTextTitle);
-
- qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
-
- sessionMap.put(ACTIVITY_TITLE_KEY, richTextTitle);
- sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
-
- qaGeneralAuthoringDTO.setMapQuestionContent(mapQuestionContent);
- logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
-
-
- logger.debug("qaGeneralAuthoringDTO now: " + qaGeneralAuthoringDTO);
- request.setAttribute(QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
-
- logger.debug("there are no issues with input, continue and submit data");
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaMonitoringAction.logger.debug("existing qaContent:" + qaContent);
- QaContent qaContentTest=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("qaContentTest: " + qaContentTest);
+ Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS, summaryToolSessions);
+ QaMonitoringAction.logger.debug("SUMMARY_TOOL_SESSIONS: "
+ + request.getAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS));
- logger.debug("errors: " + errors);
- if(!errors.isEmpty()){
- saveErrors(request, errors);
- logger.debug("errors saved: " + errors);
- }
-
+ Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, qaContent, qaService);
+ QaMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId);
+ request.setAttribute(QaAppConstants.SUMMARY_TOOL_SESSIONS_ID, summaryToolSessionsId);
- GeneralMonitoringDTO qaGeneralMonitoringDTO=new GeneralMonitoringDTO();
-
- QaContent qaContent=qaContentTest;
- if(errors.isEmpty()){
- logger.debug("errors is empty: " + errors);
- /*to remove deleted entries in the questions table based on mapQuestionContent */
- authoringUtil.removeRedundantQuestions(mapQuestionContent, qaService, qaAuthoringForm, request, strToolContentID);
- logger.debug("end of removing unused entries... ");
+ String currentMonitoredToolSession = qaMonitoringForm.getSelectedToolSessionId();
+ QaMonitoringAction.logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
- qaContent=authoringUtil.saveOrUpdateQaContent(mapQuestionContent, mapFeedback, qaService, qaAuthoringForm, request, qaContentTest, strToolContentID);
- logger.debug("qaContent: " + qaContent);
-
-
- long defaultContentID=0;
- logger.debug("attempt retrieving tool with signatute : " + MY_SIGNATURE);
- defaultContentID=qaService.getToolDefaultContentIdBySignature(MY_SIGNATURE);
- logger.debug("retrieved tool default contentId: " + defaultContentID);
-
- if (qaContent != null)
- {
- qaGeneralAuthoringDTO.setDefaultContentIdStr(new Long(defaultContentID).toString());
- }
- logger.debug("updated qaGeneralAuthoringDTO to: " + qaGeneralAuthoringDTO);
-
- authoringUtil.reOrganizeDisplayOrder(mapQuestionContent, qaService, qaAuthoringForm, qaContent);
-
- logger.debug("strToolContentID: " + strToolContentID);
- QaUtils.setDefineLater(request, false, strToolContentID, qaService);
- logger.debug("define later set to false");
-
- QaUtils.setFormProperties(request, qaService,
- qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID, defaultContentIdStr, activeModule, sessionMap, httpSessionID);
+ if (currentMonitoredToolSession.equals("")) {
+ currentMonitoredToolSession = "All";
+ }
- qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(false).toString());
- }
- else
- {
- logger.debug("errors is not empty: " + errors);
-
- if (qaContent != null)
- {
- long defaultContentID=0;
- logger.debug("attempt retrieving tool with signatute : " + MY_SIGNATURE);
- defaultContentID=qaService.getToolDefaultContentIdBySignature(MY_SIGNATURE);
- logger.debug("retrieved tool default contentId: " + defaultContentID);
-
- if (qaContent != null)
- {
- qaGeneralAuthoringDTO.setDefaultContentIdStr(new Long(defaultContentID).toString());
- }
+ if (currentMonitoredToolSession.equals("All")) {
+ request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(2));
+ } else {
+ request.setAttribute(QaAppConstants.SELECTION_CASE, new Long(1));
+ }
- QaUtils.setFormProperties(request, qaService,
- qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID, defaultContentIdStr, activeModule, sessionMap, httpSessionID);
-
- }
- qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
- }
-
- qaGeneralAuthoringDTO.setSbmtSuccess(new Integer(1).toString());
-
- qaAuthoringForm.resetUserAction();
- qaGeneralAuthoringDTO.setMapQuestionContent(mapQuestionContent);
-
- logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- request.setAttribute(QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+ QaMonitoringAction.logger.debug("SELECTION_CASE: " + request.getAttribute(QaAppConstants.SELECTION_CASE));
- request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
- sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
- request.getSession().setAttribute(httpSessionID, sessionMap);
-
- request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
-
-
- qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
- qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
- qaGeneralAuthoringDTO.setActiveModule(activeModule);
- qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
-
- qaAuthoringForm.setToolContentID(strToolContentID);
- qaAuthoringForm.setHttpSessionID(httpSessionID);
- qaAuthoringForm.setActiveModule(activeModule);
- qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
- qaAuthoringForm.setCurrentTab("3");
-
+ GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent);
+ QaMonitoringAction.logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO);
- /*start monitoring code*/
+ refreshSummaryData(request, qaContent, qaService, true, false, null, null, generalLearnerFlowDTO, false,
+ currentMonitoredToolSession);
- if (qaService.studentActivityOccurredGlobal(qaContent))
- {
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
- qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
- }
- else
- {
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
- qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
- }
+ prepareReflectionData(request, qaContent, qaService, null, false, currentMonitoredToolSession);
- qaGeneralMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
- qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
+ prepareEditActivityScreenData(request, qaContent);
- List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
- logger.debug("attachmentList: " + attachmentList);
- qaGeneralMonitoringDTO.setAttachmentList(attachmentList);
- logger.debug("final qaGeneralMonitoringDTO: " + qaGeneralMonitoringDTO );
-
- logger.debug("final generalMonitoringDTO: " + qaGeneralMonitoringDTO );
- request.setAttribute(QA_GENERAL_MONITORING_DTO, qaGeneralMonitoringDTO);
+ EditActivityDTO editActivityDTO = new EditActivityDTO();
+ boolean isContentInUse = QaUtils.isContentInUse(qaContent);
+ QaMonitoringAction.logger.debug("isContentInUse:" + isContentInUse);
+ if (isContentInUse == true) {
+ editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
+ }
+ request.setAttribute(QaAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO);
- prepareReflectionData(request, qaContent, qaService, null, false , "All");
-
- /*find out if there are any reflection entries, from here*/
- boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(qaService, qaContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
-
- if (notebookEntriesExist)
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
-
- String userExceptionNoToolSessions=(String)qaGeneralMonitoringDTO.getUserExceptionNoToolSessions();
- logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions);
-
- if (userExceptionNoToolSessions.equals("true"))
- {
- logger.debug("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.buildQaStatsDTO(request,qaService, qaContent);
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
+ /* find out if there are any reflection entries, from here */
+ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent);
+ QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist);
- return mapping.findForward(LOAD_MONITORING);
+ if (notebookEntriesExist) {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+ } else {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
+ }
+
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
+ request.setAttribute("currentMonitoredToolSession", "All");
+
+ QaMonitoringAction.logger.debug("submitting session to refresh the data from the database: ");
+ return mapping.findForward(QaAppConstants.LOAD_MONITORING);
}
-
-
-
- public ActionForward saveSingleQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException {
-
- logger.debug("dispathcing proxy saveSingleQuestion");
-
- /*start authoring code*/
- QaAuthoringForm qaAuthoringForm = (QaMonitoringForm) form;
- logger.debug("dispathcing saveSingleQuestion");
-
- IQaService qaService =QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
-
- String httpSessionID=request.getParameter("httpSessionID");
- logger.debug("httpSessionID: " + httpSessionID);
-
-
- SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaAuthoringForm.setContentFolderID(contentFolderID);
-
- String editQuestionBoxRequest=request.getParameter("editQuestionBoxRequest");
- logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
-
-
- String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
-
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
- String defaultContentIdStr=request.getParameter(DEFAULT_CONTENT_ID_STR);
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("qaContent: " + qaContent);
-
- if (qaContent == null)
- {
- logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
- qaContent=qaService.loadQa(new Long(defaultContentIdStr).longValue());
- }
- logger.debug("final qaContent: " + qaContent);
-
- QaGeneralAuthoringDTO qaGeneralAuthoringDTO= new QaGeneralAuthoringDTO();
-
- logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
-
- qaGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString());
-
- AuthoringUtil authoringUtil= new AuthoringUtil();
-
- List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
-
-
- String newQuestion=request.getParameter("newQuestion");
- logger.debug("newQuestion: " + newQuestion);
-
- String feedback=request.getParameter("feedback");
- logger.debug("feedback: " + feedback);
-
- String editableQuestionIndex=request.getParameter("editableQuestionIndex");
- logger.debug("editableQuestionIndex: " + editableQuestionIndex);
-
+ public ActionForward openNotebook(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException, ToolException {
+ QaMonitoringAction.logger.debug("dispatching openNotebook...");
+ QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
- if ((newQuestion != null) && (newQuestion.length() > 0))
- {
- if ((editQuestionBoxRequest != null) && (editQuestionBoxRequest.equals("false")))
- {
- logger.debug("request for add and save");
- boolean duplicates=AuthoringUtil.checkDuplicateQuestions(listQuestionContentDTO, newQuestion);
- logger.debug("duplicates: " + duplicates);
-
- if (!duplicates)
- {
- QaQuestionContentDTO qaQuestionContentDTO= null;
- Iterator listIterator=listQuestionContentDTO.iterator();
- while (listIterator.hasNext())
- {
- qaQuestionContentDTO= (QaQuestionContentDTO)listIterator.next();
- logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO);
- logger.debug("qaQuestionContentDTO question:" + qaQuestionContentDTO.getQuestion());
-
- String question=qaQuestionContentDTO.getQuestion();
- String displayOrder=qaQuestionContentDTO.getDisplayOrder();
- logger.debug("displayOrder:" + displayOrder);
-
- if ((displayOrder != null) && (!displayOrder.equals("")))
- {
- if (displayOrder.equals(editableQuestionIndex))
- {
- break;
- }
-
- }
- }
- logger.debug("qaQuestionContentDTO found:" + qaQuestionContentDTO);
-
- qaQuestionContentDTO.setQuestion(newQuestion);
- qaQuestionContentDTO.setFeedback(feedback);
- qaQuestionContentDTO.setDisplayOrder(editableQuestionIndex);
-
- listQuestionContentDTO=AuthoringUtil.reorderUpdateListQuestionContentDTO(listQuestionContentDTO, qaQuestionContentDTO, editableQuestionIndex);
- logger.debug("post reorderUpdateListQuestionContentDTO listQuestionContentDTO: " + listQuestionContentDTO);
- }
- else
- {
- logger.debug("duplicate question entry, not adding");
- }
- }
- else
- {
- logger.debug("request for edit and save.");
- QaQuestionContentDTO qaQuestionContentDTO= null;
- Iterator listIterator=listQuestionContentDTO.iterator();
- while (listIterator.hasNext())
- {
- qaQuestionContentDTO= (QaQuestionContentDTO)listIterator.next();
- logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO);
- logger.debug("qaQuestionContentDTO question:" + qaQuestionContentDTO.getQuestion());
-
- String question=qaQuestionContentDTO.getQuestion();
- String displayOrder=qaQuestionContentDTO.getDisplayOrder();
- logger.debug("displayOrder:" + displayOrder);
-
- if ((displayOrder != null) && (!displayOrder.equals("")))
- {
- if (displayOrder.equals(editableQuestionIndex))
- {
- break;
- }
-
- }
- }
- logger.debug("qaQuestionContentDTO found:" + qaQuestionContentDTO);
-
- qaQuestionContentDTO.setQuestion(newQuestion);
- qaQuestionContentDTO.setFeedback(feedback);
- qaQuestionContentDTO.setDisplayOrder(editableQuestionIndex);
-
- listQuestionContentDTO=AuthoringUtil.reorderUpdateListQuestionContentDTO(listQuestionContentDTO, qaQuestionContentDTO, editableQuestionIndex);
- logger.debug("post reorderUpdateListQuestionContentDTO listQuestionContentDTO: " + listQuestionContentDTO);
- }
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaMonitoringAction.logger.debug("qaService: " + qaService);
+
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaMonitoringForm.setContentFolderID(contentFolderID);
+
+ String uid = request.getParameter("uid");
+ QaMonitoringAction.logger.debug("uid: " + uid);
+
+ String userId = request.getParameter("userId");
+ QaMonitoringAction.logger.debug("userId: " + userId);
+
+ String userName = request.getParameter("userName");
+ QaMonitoringAction.logger.debug("userName: " + userName);
+
+ String sessionId = request.getParameter("sessionId");
+ QaMonitoringAction.logger.debug("sessionId: " + sessionId);
+
+ NotebookEntry notebookEntry = qaService.getEntry(new Long(sessionId), CoreNotebookConstants.NOTEBOOK_TOOL,
+ QaAppConstants.MY_SIGNATURE, new Integer(userId));
+
+ QaMonitoringAction.logger.debug("notebookEntry: " + notebookEntry);
+
+ GeneralLearnerFlowDTO generalLearnerFlowDTO = new GeneralLearnerFlowDTO();
+ if (notebookEntry != null) {
+ String notebookEntryPresentable = QaUtils.replaceNewLines(notebookEntry.getEntry());
+ generalLearnerFlowDTO.setNotebookEntry(notebookEntryPresentable);
+ generalLearnerFlowDTO.setUserName(userName);
+ }
+
+ QaMonitoringAction.logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO);
+ request.setAttribute(QaAppConstants.GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO);
+
+ QaSession qaSession = qaService.retrieveQaSessionOrNullById(new Long(sessionId).longValue());
+ QaMonitoringAction.logger.debug("qaSession: " + qaSession);
+
+ QaContent qaContent = qaSession.getQaContent();
+ QaMonitoringAction.logger.debug("qaContent: " + qaContent);
+
+ prepareEditActivityScreenData(request, qaContent);
+
+ GeneralMonitoringDTO generalMonitoringDTO = new GeneralMonitoringDTO();
+ List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
+ QaMonitoringAction.logger.debug("attachmentList: " + attachmentList);
+ generalMonitoringDTO.setAttachmentList(attachmentList);
+
+ if (qaService.studentActivityOccurredGlobal(qaContent)) {
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
+ generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
+ } else {
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
+ generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
+ }
+
+ QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO);
+
+ /* find out if there are any reflection entries, from here */
+ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent);
+ QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist);
+
+ if (notebookEntriesExist) {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+
+ String userExceptionNoToolSessions = generalMonitoringDTO.getUserExceptionNoToolSessions();
+ QaMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions);
+
+ if (userExceptionNoToolSessions.equals("true")) {
+ QaMonitoringAction.logger.debug("there are no online student activity but there are reflections : ");
+ request.setAttribute(QaAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
}
- else
- {
- logger.debug("entry blank, not adding");
- }
-
+ } else {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
+ }
+ /* ... till here */
- request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
- sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
- logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
-
-
- String richTextTitle = request.getParameter(TITLE);
- String richTextInstructions = request.getParameter(INSTRUCTIONS);
-
- logger.debug("richTextTitle: " + richTextTitle);
- logger.debug("richTextInstructions: " + richTextInstructions);
- qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
- qaAuthoringForm.setTitle(richTextTitle);
-
- qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
-
- sessionMap.put(ACTIVITY_TITLE_KEY, richTextTitle);
- sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
-
- qaGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString());
-
- request.getSession().setAttribute(httpSessionID, sessionMap);
- sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
-
- QaUtils.setFormProperties(request, qaService,
- qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID, defaultContentIdStr, activeModule, sessionMap, httpSessionID);
-
-
- qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
- qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
- qaGeneralAuthoringDTO.setActiveModule(activeModule);
- qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
-
- qaAuthoringForm.setToolContentID(strToolContentID);
- qaAuthoringForm.setHttpSessionID(httpSessionID);
- qaAuthoringForm.setActiveModule(activeModule);
- qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
- qaAuthoringForm.setCurrentTab("3");
-
-
- logger.debug("qaGeneralAuthoringDTO now: " + qaGeneralAuthoringDTO);
- request.setAttribute(QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
-
- logger.debug("httpSessionID: " + httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
- request.getSession().setAttribute(httpSessionID, sessionMap);
- logger.debug("qaGeneralAuthoringDTO.getMapQuestionContent(); " + qaGeneralAuthoringDTO.getMapQuestionContent());
-
- request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
-
- /*start monitoring code*/
- GeneralMonitoringDTO qaGeneralMonitoringDTO=new GeneralMonitoringDTO();
- qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(false).toString());
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
- if (qaService.studentActivityOccurredGlobal(qaContent))
- {
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
- qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
- }
- else
- {
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
- qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
- }
- qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
+ return mapping.findForward(QaAppConstants.LEARNER_NOTEBOOK);
+ }
- qaGeneralMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
- qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
+ public void prepareEditActivityScreenData(HttpServletRequest request, QaContent qaContent) {
+ QaMonitoringAction.logger.debug("starting prepareEditActivityScreenData: " + qaContent);
+ QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO();
- List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
- logger.debug("attachmentList: " + attachmentList);
- qaGeneralMonitoringDTO.setAttachmentList(attachmentList);
- logger.debug("final qaGeneralMonitoringDTO: " + qaGeneralMonitoringDTO );
+ qaGeneralAuthoringDTO.setActivityTitle(qaContent.getTitle());
+ qaGeneralAuthoringDTO.setActivityInstructions(qaContent.getInstructions());
-
- logger.debug("final generalMonitoringDTO: " + qaGeneralMonitoringDTO );
- request.setAttribute(QA_GENERAL_MONITORING_DTO, qaGeneralMonitoringDTO);
+ QaMonitoringAction.logger.debug("final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+ }
- prepareReflectionData(request, qaContent, qaService, null, false , "All");
-
- /*find out if there are any reflection entries, from here*/
- boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(qaService, qaContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
-
- if (notebookEntriesExist)
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
-
- String userExceptionNoToolSessions=(String)qaGeneralMonitoringDTO.getUserExceptionNoToolSessions();
- logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions);
-
- if (userExceptionNoToolSessions.equals("true"))
- {
- logger.debug("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.buildQaStatsDTO(request,qaService, qaContent);
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
-
- return mapping.findForward(LOAD_MONITORING);
+ public ActionForward submitAllContent(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaMonitoringAction.logger.debug("dispatching proxy submitAllContent...");
+
+ /* start authoring code */
+ QaAuthoringForm qaAuthoringForm = (QaMonitoringForm) form;
+ QaMonitoringAction.logger.debug("dispathcing submitAllContent :" + form);
+
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaMonitoringAction.logger.debug("qaService: " + qaService);
+
+ String httpSessionID = request.getParameter("httpSessionID");
+ QaMonitoringAction.logger.debug("httpSessionID: " + httpSessionID);
+
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
+ QaMonitoringAction.logger.debug("sessionMap: " + sessionMap);
+
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaAuthoringForm.setContentFolderID(contentFolderID);
+
+ String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE);
+ QaMonitoringAction.logger.debug("activeModule: " + activeModule);
+
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID);
+
+ String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR);
+ QaMonitoringAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
+
+ List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
+ QaMonitoringAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
+
+ Map mapQuestionContent = AuthoringUtil.extractMapQuestionContent(listQuestionContentDTO);
+ QaMonitoringAction.logger.debug("extracted mapQuestionContent: " + mapQuestionContent);
+
+ Map mapFeedback = AuthoringUtil.extractMapFeedback(listQuestionContentDTO);
+ QaMonitoringAction.logger.debug("extracted mapFeedback: " + mapFeedback);
+
+ ActionMessages errors = new ActionMessages();
+ QaMonitoringAction.logger.debug("mapQuestionContent size: " + mapQuestionContent.size());
+
+ if (mapQuestionContent.size() == 0) {
+ ActionMessage error = new ActionMessage("questions.none.submitted");
+ errors.add(ActionMessages.GLOBAL_MESSAGE, error);
}
+ QaMonitoringAction.logger.debug("errors: " + errors);
-
-
- public ActionForward addSingleQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException
- {
- logger.debug("dispathcing proxy addSingleQuestion");
+ AuthoringUtil authoringUtil = new AuthoringUtil();
- /*start authoring code*/
- QaAuthoringForm qaAuthoringForm = (QaMonitoringForm) form;
- logger.debug("dispathcing addSingleQuestion");
-
- IQaService qaService =QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
-
- String httpSessionID=request.getParameter("httpSessionID");
- logger.debug("httpSessionID: " + httpSessionID);
-
- SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaAuthoringForm.setContentFolderID(contentFolderID);
-
-
- String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
-
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
- String defaultContentIdStr=request.getParameter(DEFAULT_CONTENT_ID_STR);
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("qaContent: " + qaContent);
-
- if (qaContent == null)
- {
- logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
- qaContent=qaService.loadQa(new Long(defaultContentIdStr).longValue());
- }
- logger.debug("final qaContent: " + qaContent);
-
- QaGeneralAuthoringDTO qaGeneralAuthoringDTO= new QaGeneralAuthoringDTO();
- logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
-
- qaGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString());
-
- AuthoringUtil authoringUtil= new AuthoringUtil();
-
- List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
-
- String newQuestion=request.getParameter("newQuestion");
- logger.debug("newQuestion: " + newQuestion);
-
- String feedback=request.getParameter("feedback");
- logger.debug("feedback: " + feedback);
-
-
- int listSize=listQuestionContentDTO.size();
- logger.debug("listSize: " + listSize);
-
- if ((newQuestion != null) && (newQuestion.length() > 0))
- {
- boolean duplicates=AuthoringUtil.checkDuplicateQuestions(listQuestionContentDTO, newQuestion);
- logger.debug("duplicates: " + duplicates);
-
- if (!duplicates)
- {
- QaQuestionContentDTO qaQuestionContentDTO=new QaQuestionContentDTO();
- qaQuestionContentDTO.setDisplayOrder(new Long(listSize+1).toString());
- qaQuestionContentDTO.setFeedback(feedback);
- qaQuestionContentDTO.setQuestion(newQuestion);
-
- listQuestionContentDTO.add(qaQuestionContentDTO);
- logger.debug("updated listQuestionContentDTO: " + listQuestionContentDTO);
- }
- else
- {
- logger.debug("entry duplicate, not adding");
- }
+ QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO();
+ qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
+
+ String richTextTitle = request.getParameter(QaAppConstants.TITLE);
+ String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS);
+
+ QaMonitoringAction.logger.debug("richTextTitle: " + richTextTitle);
+ QaMonitoringAction.logger.debug("richTextInstructions: " + richTextInstructions);
+
+ qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
+ qaAuthoringForm.setTitle(richTextTitle);
+
+ qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
+
+ sessionMap.put(QaAppConstants.ACTIVITY_TITLE_KEY, richTextTitle);
+ sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
+
+ qaGeneralAuthoringDTO.setMapQuestionContent(mapQuestionContent);
+ QaMonitoringAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+
+ QaMonitoringAction.logger.debug("qaGeneralAuthoringDTO now: " + qaGeneralAuthoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+
+ QaMonitoringAction.logger.debug("there are no issues with input, continue and submit data");
+
+ QaContent qaContentTest = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaMonitoringAction.logger.debug("qaContentTest: " + qaContentTest);
+
+ QaMonitoringAction.logger.debug("errors: " + errors);
+ if (!errors.isEmpty()) {
+ saveErrors(request, errors);
+ QaMonitoringAction.logger.debug("errors saved: " + errors);
+ }
+
+ GeneralMonitoringDTO qaGeneralMonitoringDTO = new GeneralMonitoringDTO();
+
+ QaContent qaContent = qaContentTest;
+ if (errors.isEmpty()) {
+ QaMonitoringAction.logger.debug("errors is empty: " + errors);
+ /*
+ * to remove deleted entries in the questions table based on mapQuestionContent
+ */
+ authoringUtil.removeRedundantQuestions(mapQuestionContent, qaService, qaAuthoringForm, request,
+ strToolContentID);
+ QaMonitoringAction.logger.debug("end of removing unused entries... ");
+
+ qaContent = authoringUtil.saveOrUpdateQaContent(mapQuestionContent, mapFeedback, qaService,
+ qaAuthoringForm, request, qaContentTest, strToolContentID, null);
+ QaMonitoringAction.logger.debug("qaContent: " + qaContent);
+
+ long defaultContentID = 0;
+ QaMonitoringAction.logger.debug("attempt retrieving tool with signatute : " + QaAppConstants.MY_SIGNATURE);
+ defaultContentID = qaService.getToolDefaultContentIdBySignature(QaAppConstants.MY_SIGNATURE);
+ QaMonitoringAction.logger.debug("retrieved tool default contentId: " + defaultContentID);
+
+ if (qaContent != null) {
+ qaGeneralAuthoringDTO.setDefaultContentIdStr(new Long(defaultContentID).toString());
}
- else
- {
- logger.debug("entry blank, not adding");
- }
-
-
- request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
- sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
-
-
- String richTextTitle = request.getParameter(TITLE);
- String richTextInstructions = request.getParameter(INSTRUCTIONS);
-
- logger.debug("richTextTitle: " + richTextTitle);
- logger.debug("richTextInstructions: " + richTextInstructions);
- qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
- qaAuthoringForm.setTitle(richTextTitle);
-
- qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
-
- sessionMap.put(ACTIVITY_TITLE_KEY, richTextTitle);
- sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
-
- qaGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString());
- request.getSession().setAttribute(httpSessionID, sessionMap);
-
- QaUtils.setFormProperties(request, qaService,
- qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID, defaultContentIdStr, activeModule, sessionMap, httpSessionID);
-
-
- qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
- qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
- qaGeneralAuthoringDTO.setActiveModule(activeModule);
- qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
-
- qaAuthoringForm.setToolContentID(strToolContentID);
- qaAuthoringForm.setHttpSessionID(httpSessionID);
- qaAuthoringForm.setActiveModule(activeModule);
- qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
- qaAuthoringForm.setCurrentTab("3");
-
- logger.debug("qaGeneralAuthoringDTO now: " + qaGeneralAuthoringDTO);
- request.setAttribute(QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
-
- logger.debug("httpSessionID: " + httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
- request.getSession().setAttribute(httpSessionID, sessionMap);
-
- logger.debug("qaGeneralAuthoringDTO.getMapQuestionContent(); " + qaGeneralAuthoringDTO.getMapQuestionContent());
-
- request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
-
- /*start monitoring code*/
- GeneralMonitoringDTO qaGeneralMonitoringDTO=new GeneralMonitoringDTO();
- qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(false).toString());
+ QaMonitoringAction.logger.debug("updated qaGeneralAuthoringDTO to: " + qaGeneralAuthoringDTO);
- if (qaService.studentActivityOccurredGlobal(qaContent))
- {
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
- qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
- }
- else
- {
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
- qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
- }
+ authoringUtil.reOrganizeDisplayOrder(mapQuestionContent, qaService, qaAuthoringForm, qaContent);
- qaGeneralMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
- qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
+ QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID);
+ QaUtils.setDefineLater(request, false, strToolContentID, qaService);
+ QaMonitoringAction.logger.debug("define later set to false");
-
- List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
- logger.debug("attachmentList: " + attachmentList);
- qaGeneralMonitoringDTO.setAttachmentList(attachmentList);
- logger.debug("final qaGeneralMonitoringDTO: " + qaGeneralMonitoringDTO );
+ QaUtils.setFormProperties(request, qaService, qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID,
+ defaultContentIdStr, activeModule, sessionMap, httpSessionID);
-
- qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
- logger.debug("final generalMonitoringDTO: " + qaGeneralMonitoringDTO );
- request.setAttribute(QA_GENERAL_MONITORING_DTO, qaGeneralMonitoringDTO);
+ qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(false).toString());
+ } else {
+ QaMonitoringAction.logger.debug("errors is not empty: " + errors);
- prepareReflectionData(request, qaContent, qaService, null, false, "All");
-
- /*find out if there are any reflection entries, from here*/
- boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(qaService, qaContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
-
- if (notebookEntriesExist)
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
-
- String userExceptionNoToolSessions=(String)qaGeneralMonitoringDTO.getUserExceptionNoToolSessions();
- logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions);
-
- if (userExceptionNoToolSessions.equals("true"))
- {
- logger.debug("there are no online student activity but there are reflections : ");
- request.setAttribute(NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
- }
+ if (qaContent != null) {
+ long defaultContentID = 0;
+ QaMonitoringAction.logger.debug("attempt retrieving tool with signatute : "
+ + QaAppConstants.MY_SIGNATURE);
+ defaultContentID = qaService.getToolDefaultContentIdBySignature(QaAppConstants.MY_SIGNATURE);
+ QaMonitoringAction.logger.debug("retrieved tool default contentId: " + defaultContentID);
+
+ if (qaContent != null) {
+ qaGeneralAuthoringDTO.setDefaultContentIdStr(new Long(defaultContentID).toString());
}
- else
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
- }
- /* ... till here*/
-
- MonitoringUtil.buildQaStatsDTO(request,qaService, qaContent);
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
-
- return mapping.findForward(LOAD_MONITORING);
+
+ QaUtils.setFormProperties(request, qaService, qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID,
+ defaultContentIdStr, activeModule, sessionMap, httpSessionID);
+
+ }
+ qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
+ }
+
+ qaGeneralAuthoringDTO.setSbmtSuccess(new Integer(1).toString());
+
+ qaAuthoringForm.resetUserAction();
+ qaGeneralAuthoringDTO.setMapQuestionContent(mapQuestionContent);
+
+ QaMonitoringAction.logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+
+ request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
+ sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
+ request.getSession().setAttribute(httpSessionID, sessionMap);
+
+ request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
+
+ qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
+ qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
+ qaGeneralAuthoringDTO.setActiveModule(activeModule);
+ qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
+
+ qaAuthoringForm.setToolContentID(strToolContentID);
+ qaAuthoringForm.setHttpSessionID(httpSessionID);
+ qaAuthoringForm.setActiveModule(activeModule);
+ qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
+ qaAuthoringForm.setCurrentTab("3");
+
+ /* start monitoring code */
+
+ if (qaService.studentActivityOccurredGlobal(qaContent)) {
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
+ qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
+ } else {
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
+ qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
+ }
+
+ qaGeneralMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
+ qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
+
+ List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
+ QaMonitoringAction.logger.debug("attachmentList: " + attachmentList);
+ qaGeneralMonitoringDTO.setAttachmentList(attachmentList);
+ QaMonitoringAction.logger.debug("final qaGeneralMonitoringDTO: " + qaGeneralMonitoringDTO);
+
+ QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + qaGeneralMonitoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, qaGeneralMonitoringDTO);
+
+ prepareReflectionData(request, qaContent, qaService, null, false, "All");
+
+ /* find out if there are any reflection entries, from here */
+ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent);
+ QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist);
+
+ if (notebookEntriesExist) {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+
+ String userExceptionNoToolSessions = qaGeneralMonitoringDTO.getUserExceptionNoToolSessions();
+ QaMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions);
+
+ if (userExceptionNoToolSessions.equals("true")) {
+ QaMonitoringAction.logger.debug("there are no online student activity but there are reflections : ");
+ request.setAttribute(QaAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+ }
+ } else {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
+ }
+ /* ... till here */
+
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
+
+ return mapping.findForward(QaAppConstants.LOAD_MONITORING);
}
-
-
-
- public ActionForward newQuestionBox(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException
- {
- logger.debug("dispathcing proxy newQuestionBox");
- /*start authoring code*/
- QaAuthoringForm qaAuthoringForm = (QaMonitoringForm) form;
- logger.debug("dispathcing newQuestionBox");
-
- IQaService qaService =QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
-
- String httpSessionID=request.getParameter("httpSessionID");
- logger.debug("httpSessionID: " + httpSessionID);
-
- SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaAuthoringForm.setContentFolderID(contentFolderID);
+ public ActionForward saveSingleQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaMonitoringAction.logger.debug("dispathcing proxy saveSingleQuestion");
- String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
+ /* start authoring code */
+ QaAuthoringForm qaAuthoringForm = (QaMonitoringForm) form;
+ QaMonitoringAction.logger.debug("dispathcing saveSingleQuestion");
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
- String defaultContentIdStr=request.getParameter(DEFAULT_CONTENT_ID_STR);
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("qaContent: " + qaContent);
-
- if (qaContent == null)
- {
- logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
- qaContent=qaService.loadQa(new Long(defaultContentIdStr).longValue());
- }
- logger.debug("final qaContent: " + qaContent);
-
- QaGeneralAuthoringDTO qaGeneralAuthoringDTO= new QaGeneralAuthoringDTO();
- logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaMonitoringAction.logger.debug("qaService: " + qaService);
- String richTextTitle = request.getParameter(TITLE);
- String richTextInstructions = request.getParameter(INSTRUCTIONS);
-
- logger.debug("richTextTitle: " + richTextTitle);
- logger.debug("richTextInstructions: " + richTextInstructions);
- qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
- qaAuthoringForm.setTitle(richTextTitle);
-
- qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
-
-
- QaUtils.setFormProperties(request, qaService,
- qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID, defaultContentIdStr, activeModule, sessionMap, httpSessionID);
-
- List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
+ String httpSessionID = request.getParameter("httpSessionID");
+ QaMonitoringAction.logger.debug("httpSessionID: " + httpSessionID);
- request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
+ QaMonitoringAction.logger.debug("sessionMap: " + sessionMap);
- /*start monitoring code*/
- GeneralMonitoringDTO qaGeneralMonitoringDTO=new GeneralMonitoringDTO();
- qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(false).toString());
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaAuthoringForm.setContentFolderID(contentFolderID);
- if (qaService.studentActivityOccurredGlobal(qaContent))
- {
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
- qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
- }
- else
- {
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
- qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
- }
+ String editQuestionBoxRequest = request.getParameter("editQuestionBoxRequest");
+ QaMonitoringAction.logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
-
- qaGeneralMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
- qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
+ String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE);
+ QaMonitoringAction.logger.debug("activeModule: " + activeModule);
- List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
- logger.debug("attachmentList: " + attachmentList);
- qaGeneralMonitoringDTO.setAttachmentList(attachmentList);
- logger.debug("final qaGeneralMonitoringDTO: " + qaGeneralMonitoringDTO );
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID);
- qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
- logger.debug("final generalMonitoringDTO: " + qaGeneralMonitoringDTO );
- request.setAttribute(QA_GENERAL_MONITORING_DTO, qaGeneralMonitoringDTO);
+ String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR);
+ QaMonitoringAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
- prepareReflectionData(request, qaContent, qaService, null, false, "All");
-
- /*find out if there are any reflection entries, from here*/
- boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(qaService, qaContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
-
- if (notebookEntriesExist)
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
-
- String userExceptionNoToolSessions=(String)qaGeneralMonitoringDTO.getUserExceptionNoToolSessions();
- logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions);
-
- if (userExceptionNoToolSessions.equals("true"))
- {
- logger.debug("there are no online student activity but there are reflections : ");
- request.setAttribute(NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaMonitoringAction.logger.debug("qaContent: " + qaContent);
+
+ if (qaContent == null) {
+ QaMonitoringAction.logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
+ qaContent = qaService.loadQa(new Long(defaultContentIdStr).longValue());
+ }
+ QaMonitoringAction.logger.debug("final qaContent: " + qaContent);
+
+ QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO();
+
+ QaMonitoringAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
+
+ qaGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString());
+
+ AuthoringUtil authoringUtil = new AuthoringUtil();
+
+ List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
+ QaMonitoringAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
+
+ String newQuestion = request.getParameter("newQuestion");
+ QaMonitoringAction.logger.debug("newQuestion: " + newQuestion);
+
+ String feedback = request.getParameter("feedback");
+ QaMonitoringAction.logger.debug("feedback: " + feedback);
+
+ String editableQuestionIndex = request.getParameter("editableQuestionIndex");
+ QaMonitoringAction.logger.debug("editableQuestionIndex: " + editableQuestionIndex);
+
+ if (newQuestion != null && newQuestion.length() > 0) {
+ if (editQuestionBoxRequest != null && editQuestionBoxRequest.equals("false")) {
+ QaMonitoringAction.logger.debug("request for add and save");
+ boolean duplicates = AuthoringUtil.checkDuplicateQuestions(listQuestionContentDTO, newQuestion);
+ QaMonitoringAction.logger.debug("duplicates: " + duplicates);
+
+ if (!duplicates) {
+ QaQuestionContentDTO qaQuestionContentDTO = null;
+ Iterator listIterator = listQuestionContentDTO.iterator();
+ while (listIterator.hasNext()) {
+ qaQuestionContentDTO = (QaQuestionContentDTO) listIterator.next();
+ QaMonitoringAction.logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO);
+ QaMonitoringAction.logger.debug("qaQuestionContentDTO question:"
+ + qaQuestionContentDTO.getQuestion());
+
+ String question = qaQuestionContentDTO.getQuestion();
+ String displayOrder = qaQuestionContentDTO.getDisplayOrder();
+ QaMonitoringAction.logger.debug("displayOrder:" + displayOrder);
+
+ if (displayOrder != null && !displayOrder.equals("")) {
+ if (displayOrder.equals(editableQuestionIndex)) {
+ break;
+ }
+
+ }
}
+ QaMonitoringAction.logger.debug("qaQuestionContentDTO found:" + qaQuestionContentDTO);
+
+ qaQuestionContentDTO.setQuestion(newQuestion);
+ qaQuestionContentDTO.setFeedback(feedback);
+ qaQuestionContentDTO.setDisplayOrder(editableQuestionIndex);
+
+ listQuestionContentDTO = AuthoringUtil.reorderUpdateListQuestionContentDTO(listQuestionContentDTO,
+ qaQuestionContentDTO, editableQuestionIndex);
+ QaMonitoringAction.logger.debug("post reorderUpdateListQuestionContentDTO listQuestionContentDTO: "
+ + listQuestionContentDTO);
+ } else {
+ QaMonitoringAction.logger.debug("duplicate question entry, not adding");
}
- else
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
+ } else {
+ QaMonitoringAction.logger.debug("request for edit and save.");
+ QaQuestionContentDTO qaQuestionContentDTO = null;
+ Iterator listIterator = listQuestionContentDTO.iterator();
+ while (listIterator.hasNext()) {
+ qaQuestionContentDTO = (QaQuestionContentDTO) listIterator.next();
+ QaMonitoringAction.logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO);
+ QaMonitoringAction.logger.debug("qaQuestionContentDTO question:"
+ + qaQuestionContentDTO.getQuestion());
+
+ String question = qaQuestionContentDTO.getQuestion();
+ String displayOrder = qaQuestionContentDTO.getDisplayOrder();
+ QaMonitoringAction.logger.debug("displayOrder:" + displayOrder);
+
+ if (displayOrder != null && !displayOrder.equals("")) {
+ if (displayOrder.equals(editableQuestionIndex)) {
+ break;
+ }
+
+ }
}
- /* ... till here*/
-
- MonitoringUtil.buildQaStatsDTO(request,qaService, qaContent);
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
-
- logger.debug("fwd ing to newQuestionBox: ");
- return (mapping.findForward("newQuestionBox"));
+ QaMonitoringAction.logger.debug("qaQuestionContentDTO found:" + qaQuestionContentDTO);
+
+ qaQuestionContentDTO.setQuestion(newQuestion);
+ qaQuestionContentDTO.setFeedback(feedback);
+ qaQuestionContentDTO.setDisplayOrder(editableQuestionIndex);
+
+ listQuestionContentDTO = AuthoringUtil.reorderUpdateListQuestionContentDTO(listQuestionContentDTO,
+ qaQuestionContentDTO, editableQuestionIndex);
+ QaMonitoringAction.logger.debug("post reorderUpdateListQuestionContentDTO listQuestionContentDTO: "
+ + listQuestionContentDTO);
+ }
+ } else {
+ QaMonitoringAction.logger.debug("entry blank, not adding");
+ }
+
+ request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
+ sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
+ QaMonitoringAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
+
+ String richTextTitle = request.getParameter(QaAppConstants.TITLE);
+ String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS);
+
+ QaMonitoringAction.logger.debug("richTextTitle: " + richTextTitle);
+ QaMonitoringAction.logger.debug("richTextInstructions: " + richTextInstructions);
+ qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
+ qaAuthoringForm.setTitle(richTextTitle);
+
+ qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
+
+ sessionMap.put(QaAppConstants.ACTIVITY_TITLE_KEY, richTextTitle);
+ sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
+
+ qaGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString());
+
+ request.getSession().setAttribute(httpSessionID, sessionMap);
+ sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
+
+ QaUtils.setFormProperties(request, qaService, qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID,
+ defaultContentIdStr, activeModule, sessionMap, httpSessionID);
+
+ qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
+ qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
+ qaGeneralAuthoringDTO.setActiveModule(activeModule);
+ qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
+
+ qaAuthoringForm.setToolContentID(strToolContentID);
+ qaAuthoringForm.setHttpSessionID(httpSessionID);
+ qaAuthoringForm.setActiveModule(activeModule);
+ qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
+ qaAuthoringForm.setCurrentTab("3");
+
+ QaMonitoringAction.logger.debug("qaGeneralAuthoringDTO now: " + qaGeneralAuthoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+
+ QaMonitoringAction.logger.debug("httpSessionID: " + httpSessionID);
+ QaMonitoringAction.logger.debug("sessionMap: " + sessionMap);
+
+ request.getSession().setAttribute(httpSessionID, sessionMap);
+ QaMonitoringAction.logger.debug("qaGeneralAuthoringDTO.getMapQuestionContent(); "
+ + qaGeneralAuthoringDTO.getMapQuestionContent());
+
+ request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
+
+ /* start monitoring code */
+ GeneralMonitoringDTO qaGeneralMonitoringDTO = new GeneralMonitoringDTO();
+ qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(false).toString());
+
+ if (qaService.studentActivityOccurredGlobal(qaContent)) {
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
+ qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
+ } else {
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
+ qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
+ }
+ qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
+
+ qaGeneralMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
+ qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
+
+ List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
+ QaMonitoringAction.logger.debug("attachmentList: " + attachmentList);
+ qaGeneralMonitoringDTO.setAttachmentList(attachmentList);
+ QaMonitoringAction.logger.debug("final qaGeneralMonitoringDTO: " + qaGeneralMonitoringDTO);
+
+ QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + qaGeneralMonitoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, qaGeneralMonitoringDTO);
+
+ prepareReflectionData(request, qaContent, qaService, null, false, "All");
+
+ /* find out if there are any reflection entries, from here */
+ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent);
+ QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist);
+
+ if (notebookEntriesExist) {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+
+ String userExceptionNoToolSessions = qaGeneralMonitoringDTO.getUserExceptionNoToolSessions();
+ QaMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions);
+
+ if (userExceptionNoToolSessions.equals("true")) {
+ QaMonitoringAction.logger.debug("there are no online student activity but there are reflections : ");
+ request.setAttribute(QaAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+ }
+ } else {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
+ }
+ /* ... till here */
+
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
+
+ return mapping.findForward(QaAppConstants.LOAD_MONITORING);
}
-
-
-
- public ActionForward newEditableQuestionBox(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException
- {
- logger.debug("dispathcing proxy newEditableQuestionBox");
- /*start authoring code*/
- QaAuthoringForm qaAuthoringForm = (QaMonitoringForm) form;
- logger.debug("dispathcing newEditableQuestionBox");
-
- IQaService qaService =QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
-
- String httpSessionID=request.getParameter("httpSessionID");
- logger.debug("httpSessionID: " + httpSessionID);
-
- SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
+ public ActionForward addSingleQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaMonitoringAction.logger.debug("dispathcing proxy addSingleQuestion");
-
- String questionIndex=request.getParameter("questionIndex");
- logger.debug("questionIndex: " + questionIndex);
-
- qaAuthoringForm.setEditableQuestionIndex(questionIndex);
-
- List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
+ /* start authoring code */
+ QaAuthoringForm qaAuthoringForm = (QaMonitoringForm) form;
+ QaMonitoringAction.logger.debug("dispathcing addSingleQuestion");
- String editableQuestion="";
- String editableFeedback="";
- Iterator listIterator=listQuestionContentDTO.iterator();
- while (listIterator.hasNext())
- {
- QaQuestionContentDTO qaQuestionContentDTO= (QaQuestionContentDTO)listIterator.next();
- logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO);
- logger.debug("qaQuestionContentDTO question:" + qaQuestionContentDTO.getQuestion());
- String question=qaQuestionContentDTO.getQuestion();
- String displayOrder=qaQuestionContentDTO.getDisplayOrder();
-
- if ((displayOrder != null) && (!displayOrder.equals("")))
- {
- if (displayOrder.equals(questionIndex))
- {
- editableFeedback=qaQuestionContentDTO.getFeedback();
- editableQuestion=qaQuestionContentDTO.getQuestion();
- logger.debug("editableFeedback found :" + editableFeedback);
- break;
- }
-
- }
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaMonitoringAction.logger.debug("qaService: " + qaService);
+
+ String httpSessionID = request.getParameter("httpSessionID");
+ QaMonitoringAction.logger.debug("httpSessionID: " + httpSessionID);
+
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
+ QaMonitoringAction.logger.debug("sessionMap: " + sessionMap);
+
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaAuthoringForm.setContentFolderID(contentFolderID);
+
+ String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE);
+ QaMonitoringAction.logger.debug("activeModule: " + activeModule);
+
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID);
+
+ String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR);
+ QaMonitoringAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
+
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaMonitoringAction.logger.debug("qaContent: " + qaContent);
+
+ if (qaContent == null) {
+ QaMonitoringAction.logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
+ qaContent = qaService.loadQa(new Long(defaultContentIdStr).longValue());
+ }
+ QaMonitoringAction.logger.debug("final qaContent: " + qaContent);
+
+ QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO();
+ QaMonitoringAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
+
+ qaGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString());
+
+ AuthoringUtil authoringUtil = new AuthoringUtil();
+
+ List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
+ QaMonitoringAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
+
+ String newQuestion = request.getParameter("newQuestion");
+ QaMonitoringAction.logger.debug("newQuestion: " + newQuestion);
+
+ String feedback = request.getParameter("feedback");
+ QaMonitoringAction.logger.debug("feedback: " + feedback);
+
+ int listSize = listQuestionContentDTO.size();
+ QaMonitoringAction.logger.debug("listSize: " + listSize);
+
+ if (newQuestion != null && newQuestion.length() > 0) {
+ boolean duplicates = AuthoringUtil.checkDuplicateQuestions(listQuestionContentDTO, newQuestion);
+ QaMonitoringAction.logger.debug("duplicates: " + duplicates);
+
+ if (!duplicates) {
+ QaQuestionContentDTO qaQuestionContentDTO = new QaQuestionContentDTO();
+ qaQuestionContentDTO.setDisplayOrder(new Long(listSize + 1).toString());
+ qaQuestionContentDTO.setFeedback(feedback);
+ qaQuestionContentDTO.setQuestion(newQuestion);
+
+ listQuestionContentDTO.add(qaQuestionContentDTO);
+ QaMonitoringAction.logger.debug("updated listQuestionContentDTO: " + listQuestionContentDTO);
+ } else {
+ QaMonitoringAction.logger.debug("entry duplicate, not adding");
}
- logger.debug("editableFeedback found :" + editableFeedback);
- logger.debug("editableQuestion found :" + editableQuestion);
+ } else {
+ QaMonitoringAction.logger.debug("entry blank, not adding");
+ }
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaAuthoringForm.setContentFolderID(contentFolderID);
+ request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
+ sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
+ String richTextTitle = request.getParameter(QaAppConstants.TITLE);
+ String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS);
- String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
+ QaMonitoringAction.logger.debug("richTextTitle: " + richTextTitle);
+ QaMonitoringAction.logger.debug("richTextInstructions: " + richTextInstructions);
+ qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
+ qaAuthoringForm.setTitle(richTextTitle);
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
- String defaultContentIdStr=request.getParameter(DEFAULT_CONTENT_ID_STR);
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("qaContent: " + qaContent);
-
- if (qaContent == null)
- {
- logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
- qaContent=qaService.loadQa(new Long(defaultContentIdStr).longValue());
- }
- logger.debug("final qaContent: " + qaContent);
-
- QaGeneralAuthoringDTO qaGeneralAuthoringDTO= new QaGeneralAuthoringDTO();
- logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
+ qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
-
- String richTextTitle = request.getParameter(TITLE);
- String richTextInstructions = request.getParameter(INSTRUCTIONS);
-
- logger.debug("richTextTitle: " + richTextTitle);
- logger.debug("richTextInstructions: " + richTextInstructions);
- qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
- qaAuthoringForm.setTitle(richTextTitle);
-
- qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
-
- QaUtils.setFormProperties(request, qaService,
- qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID, defaultContentIdStr, activeModule, sessionMap, httpSessionID);
-
- qaGeneralAuthoringDTO.setEditableQuestionText(editableQuestion);
- qaGeneralAuthoringDTO.setEditableQuestionFeedback (editableFeedback);
- qaAuthoringForm.setFeedback(editableFeedback);
-
- logger.debug("qaGeneralAuthoringDTO now: " + qaGeneralAuthoringDTO);
- request.setAttribute(QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
-
- request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
-
- /*start monitoring code*/
- GeneralMonitoringDTO qaGeneralMonitoringDTO=new GeneralMonitoringDTO();
- qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(false).toString());
+ sessionMap.put(QaAppConstants.ACTIVITY_TITLE_KEY, richTextTitle);
+ sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
- if (qaService.studentActivityOccurredGlobal(qaContent))
- {
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
- qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
- }
- else
- {
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
- qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
- }
+ qaGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString());
+ request.getSession().setAttribute(httpSessionID, sessionMap);
- qaGeneralMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
- qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
-
- List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
- logger.debug("attachmentList: " + attachmentList);
- qaGeneralMonitoringDTO.setAttachmentList(attachmentList);
- logger.debug("final qaGeneralMonitoringDTO: " + qaGeneralMonitoringDTO );
+ QaUtils.setFormProperties(request, qaService, qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID,
+ defaultContentIdStr, activeModule, sessionMap, httpSessionID);
-
- qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
- logger.debug("final generalMonitoringDTO: " + qaGeneralMonitoringDTO );
- request.setAttribute(QA_GENERAL_MONITORING_DTO, qaGeneralMonitoringDTO);
+ qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
+ qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
+ qaGeneralAuthoringDTO.setActiveModule(activeModule);
+ qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
- prepareReflectionData(request, qaContent, qaService, null, false ,"All");
-
- /*find out if there are any reflection entries, from here*/
- boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(qaService, qaContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
-
- if (notebookEntriesExist)
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
-
- String userExceptionNoToolSessions=(String)qaGeneralMonitoringDTO.getUserExceptionNoToolSessions();
- logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions);
-
- if (userExceptionNoToolSessions.equals("true"))
- {
- logger.debug("there are no online student activity but there are reflections : ");
- request.setAttribute(NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
- }
+ qaAuthoringForm.setToolContentID(strToolContentID);
+ qaAuthoringForm.setHttpSessionID(httpSessionID);
+ qaAuthoringForm.setActiveModule(activeModule);
+ qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
+ qaAuthoringForm.setCurrentTab("3");
- }
- else
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
- }
- /* ... till here*/
-
- MonitoringUtil.buildQaStatsDTO(request,qaService, qaContent);
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
-
- logger.debug("fwd ing to editQuestionBox: ");
- return (mapping.findForward("editQuestionBox"));
+ QaMonitoringAction.logger.debug("qaGeneralAuthoringDTO now: " + qaGeneralAuthoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+
+ QaMonitoringAction.logger.debug("httpSessionID: " + httpSessionID);
+ QaMonitoringAction.logger.debug("sessionMap: " + sessionMap);
+
+ request.getSession().setAttribute(httpSessionID, sessionMap);
+
+ QaMonitoringAction.logger.debug("qaGeneralAuthoringDTO.getMapQuestionContent(); "
+ + qaGeneralAuthoringDTO.getMapQuestionContent());
+
+ request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
+
+ /* start monitoring code */
+ GeneralMonitoringDTO qaGeneralMonitoringDTO = new GeneralMonitoringDTO();
+ qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(false).toString());
+
+ if (qaService.studentActivityOccurredGlobal(qaContent)) {
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
+ qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
+ } else {
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
+ qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
+ }
+
+ qaGeneralMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
+ qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
+
+ List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
+ QaMonitoringAction.logger.debug("attachmentList: " + attachmentList);
+ qaGeneralMonitoringDTO.setAttachmentList(attachmentList);
+ QaMonitoringAction.logger.debug("final qaGeneralMonitoringDTO: " + qaGeneralMonitoringDTO);
+
+ qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
+ QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + qaGeneralMonitoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, qaGeneralMonitoringDTO);
+
+ prepareReflectionData(request, qaContent, qaService, null, false, "All");
+
+ /* find out if there are any reflection entries, from here */
+ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent);
+ QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist);
+
+ if (notebookEntriesExist) {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+
+ String userExceptionNoToolSessions = qaGeneralMonitoringDTO.getUserExceptionNoToolSessions();
+ QaMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions);
+
+ if (userExceptionNoToolSessions.equals("true")) {
+ QaMonitoringAction.logger.debug("there are no online student activity but there are reflections : ");
+ request.setAttribute(QaAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+ }
+ } else {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
+ }
+ /* ... till here */
+
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
+
+ return mapping.findForward(QaAppConstants.LOAD_MONITORING);
}
-
-
-
-
- public ActionForward removeQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException {
- logger.debug("dispathcing proxy removeQuestion");
- /*start authoring code*/
- QaAuthoringForm qaAuthoringForm = (QaMonitoringForm) form;
- logger.debug("dispathcing removeQuestion");
-
- IQaService qaService =QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
-
- String httpSessionID=request.getParameter("httpSessionID");
- logger.debug("httpSessionID: " + httpSessionID);
-
- SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
- String questionIndex=request.getParameter("questionIndex");
- logger.debug("questionIndex: " + questionIndex);
-
-
- List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
-
- QaQuestionContentDTO qaQuestionContentDTO= null;
- Iterator listIterator=listQuestionContentDTO.iterator();
- while (listIterator.hasNext())
- {
- qaQuestionContentDTO= (QaQuestionContentDTO)listIterator.next();
- logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO);
- logger.debug("qaQuestionContentDTO question:" + qaQuestionContentDTO.getQuestion());
-
- String question=qaQuestionContentDTO.getQuestion();
- String displayOrder=qaQuestionContentDTO.getDisplayOrder();
- logger.debug("displayOrder:" + displayOrder);
-
- if ((displayOrder != null) && (!displayOrder.equals("")))
- {
- if (displayOrder.equals(questionIndex))
- {
- break;
- }
-
- }
+ public ActionForward newQuestionBox(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaMonitoringAction.logger.debug("dispathcing proxy newQuestionBox");
+
+ /* start authoring code */
+ QaAuthoringForm qaAuthoringForm = (QaMonitoringForm) form;
+ QaMonitoringAction.logger.debug("dispathcing newQuestionBox");
+
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaMonitoringAction.logger.debug("qaService: " + qaService);
+
+ String httpSessionID = request.getParameter("httpSessionID");
+ QaMonitoringAction.logger.debug("httpSessionID: " + httpSessionID);
+
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
+ QaMonitoringAction.logger.debug("sessionMap: " + sessionMap);
+
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaAuthoringForm.setContentFolderID(contentFolderID);
+
+ String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE);
+ QaMonitoringAction.logger.debug("activeModule: " + activeModule);
+
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID);
+
+ String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR);
+ QaMonitoringAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
+
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaMonitoringAction.logger.debug("qaContent: " + qaContent);
+
+ if (qaContent == null) {
+ QaMonitoringAction.logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
+ qaContent = qaService.loadQa(new Long(defaultContentIdStr).longValue());
+ }
+ QaMonitoringAction.logger.debug("final qaContent: " + qaContent);
+
+ QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO();
+ QaMonitoringAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
+
+ String richTextTitle = request.getParameter(QaAppConstants.TITLE);
+ String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS);
+
+ QaMonitoringAction.logger.debug("richTextTitle: " + richTextTitle);
+ QaMonitoringAction.logger.debug("richTextInstructions: " + richTextInstructions);
+ qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
+ qaAuthoringForm.setTitle(richTextTitle);
+
+ qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
+
+ QaUtils.setFormProperties(request, qaService, qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID,
+ defaultContentIdStr, activeModule, sessionMap, httpSessionID);
+
+ List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
+ QaMonitoringAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
+
+ request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
+
+ /* start monitoring code */
+ GeneralMonitoringDTO qaGeneralMonitoringDTO = new GeneralMonitoringDTO();
+ qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(false).toString());
+
+ if (qaService.studentActivityOccurredGlobal(qaContent)) {
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
+ qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
+ } else {
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
+ qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
+ }
+
+ qaGeneralMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
+ qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
+
+ List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
+ QaMonitoringAction.logger.debug("attachmentList: " + attachmentList);
+ qaGeneralMonitoringDTO.setAttachmentList(attachmentList);
+ QaMonitoringAction.logger.debug("final qaGeneralMonitoringDTO: " + qaGeneralMonitoringDTO);
+
+ qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
+ QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + qaGeneralMonitoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, qaGeneralMonitoringDTO);
+
+ prepareReflectionData(request, qaContent, qaService, null, false, "All");
+
+ /* find out if there are any reflection entries, from here */
+ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent);
+ QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist);
+
+ if (notebookEntriesExist) {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+
+ String userExceptionNoToolSessions = qaGeneralMonitoringDTO.getUserExceptionNoToolSessions();
+ QaMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions);
+
+ if (userExceptionNoToolSessions.equals("true")) {
+ QaMonitoringAction.logger.debug("there are no online student activity but there are reflections : ");
+ request.setAttribute(QaAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
}
-
- logger.debug("qaQuestionContentDTO found:" + qaQuestionContentDTO);
- qaQuestionContentDTO.setQuestion("");
- logger.debug("listQuestionContentDTO after remove:" + listQuestionContentDTO);
-
-
- listQuestionContentDTO=AuthoringUtil.reorderListQuestionContentDTO(listQuestionContentDTO, questionIndex );
- logger.debug("listQuestionContentDTO reordered:" + listQuestionContentDTO);
-
-
- sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
-
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaAuthoringForm.setContentFolderID(contentFolderID);
-
-
- String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
-
- String richTextTitle = request.getParameter(TITLE);
- logger.debug("richTextTitle: " + richTextTitle);
-
- String richTextInstructions = request.getParameter(INSTRUCTIONS);
- logger.debug("richTextInstructions: " + richTextInstructions);
-
-
- sessionMap.put(ACTIVITY_TITLE_KEY, richTextTitle);
- sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
-
-
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
- String defaultContentIdStr=request.getParameter(DEFAULT_CONTENT_ID_STR);
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("qaContent: " + qaContent);
-
- if (qaContent == null)
- {
- logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
- qaContent=qaService.loadQa(new Long(defaultContentIdStr).longValue());
- }
- logger.debug("final qaContent: " + qaContent);
-
- QaGeneralAuthoringDTO qaGeneralAuthoringDTO= new QaGeneralAuthoringDTO();
- logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
-
- qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
- qaAuthoringForm.setTitle(richTextTitle);
-
- qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
-
-
- AuthoringUtil authoringUtil= new AuthoringUtil();
-
- qaGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString());
-
- request.getSession().setAttribute(httpSessionID, sessionMap);
-
- QaUtils.setFormProperties(request, qaService,
- qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID, defaultContentIdStr, activeModule, sessionMap, httpSessionID);
-
-
- qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
- qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
- qaGeneralAuthoringDTO.setActiveModule(activeModule);
- qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
- qaAuthoringForm.setToolContentID(strToolContentID);
- qaAuthoringForm.setHttpSessionID(httpSessionID);
- qaAuthoringForm.setActiveModule(activeModule);
- qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
- qaAuthoringForm.setCurrentTab("3");
-
- request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
- logger.debug("qaQuestionContentDTO now: " + qaQuestionContentDTO);
- logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
-
-
- logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- request.setAttribute(QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
-
- request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
-
- /*start monitoring code*/
- GeneralMonitoringDTO qaGeneralMonitoringDTO=new GeneralMonitoringDTO();
+ } else {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
+ }
+ /* ... till here */
- if (qaService.studentActivityOccurredGlobal(qaContent))
- {
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
- qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
- }
- else
- {
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
- qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
- }
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
- qaGeneralMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
- qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
+ QaMonitoringAction.logger.debug("fwd ing to newQuestionBox: ");
+ return mapping.findForward("newQuestionBox");
+ }
- List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
- logger.debug("attachmentList: " + attachmentList);
- qaGeneralMonitoringDTO.setAttachmentList(attachmentList);
- logger.debug("final qaGeneralMonitoringDTO: " + qaGeneralMonitoringDTO );
+ public ActionForward newEditableQuestionBox(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaMonitoringAction.logger.debug("dispathcing proxy newEditableQuestionBox");
-
- qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
- logger.debug("final generalMonitoringDTO: " + qaGeneralMonitoringDTO );
- request.setAttribute(QA_GENERAL_MONITORING_DTO, qaGeneralMonitoringDTO);
+ /* start authoring code */
+ QaAuthoringForm qaAuthoringForm = (QaMonitoringForm) form;
+ QaMonitoringAction.logger.debug("dispathcing newEditableQuestionBox");
- prepareReflectionData(request, qaContent, qaService, null, false , "All");
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaMonitoringAction.logger.debug("qaService: " + qaService);
- /*find out if there are any reflection entries, from here*/
- boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(qaService, qaContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
-
- if (notebookEntriesExist)
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
-
- String userExceptionNoToolSessions=(String)qaGeneralMonitoringDTO.getUserExceptionNoToolSessions();
- logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions);
-
- if (userExceptionNoToolSessions.equals("true"))
- {
- logger.debug("there are no online student activity but there are reflections : ");
- request.setAttribute(NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
- }
+ String httpSessionID = request.getParameter("httpSessionID");
+ QaMonitoringAction.logger.debug("httpSessionID: " + httpSessionID);
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
+ QaMonitoringAction.logger.debug("sessionMap: " + sessionMap);
+
+ String questionIndex = request.getParameter("questionIndex");
+ QaMonitoringAction.logger.debug("questionIndex: " + questionIndex);
+
+ qaAuthoringForm.setEditableQuestionIndex(questionIndex);
+
+ List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
+ QaMonitoringAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
+
+ String editableQuestion = "";
+ String editableFeedback = "";
+ Iterator listIterator = listQuestionContentDTO.iterator();
+ while (listIterator.hasNext()) {
+ QaQuestionContentDTO qaQuestionContentDTO = (QaQuestionContentDTO) listIterator.next();
+ QaMonitoringAction.logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO);
+ QaMonitoringAction.logger.debug("qaQuestionContentDTO question:" + qaQuestionContentDTO.getQuestion());
+ String question = qaQuestionContentDTO.getQuestion();
+ String displayOrder = qaQuestionContentDTO.getDisplayOrder();
+
+ if (displayOrder != null && !displayOrder.equals("")) {
+ if (displayOrder.equals(questionIndex)) {
+ editableFeedback = qaQuestionContentDTO.getFeedback();
+ editableQuestion = qaQuestionContentDTO.getQuestion();
+ QaMonitoringAction.logger.debug("editableFeedback found :" + editableFeedback);
+ break;
}
- else
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
- }
- /* ... till here*/
-
- MonitoringUtil.buildQaStatsDTO(request,qaService, qaContent);
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
-
-
- return mapping.findForward(LOAD_MONITORING);
+
+ }
+ }
+ QaMonitoringAction.logger.debug("editableFeedback found :" + editableFeedback);
+ QaMonitoringAction.logger.debug("editableQuestion found :" + editableQuestion);
+
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaAuthoringForm.setContentFolderID(contentFolderID);
+
+ String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE);
+ QaMonitoringAction.logger.debug("activeModule: " + activeModule);
+
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID);
+
+ String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR);
+ QaMonitoringAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
+
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaMonitoringAction.logger.debug("qaContent: " + qaContent);
+
+ if (qaContent == null) {
+ QaMonitoringAction.logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
+ qaContent = qaService.loadQa(new Long(defaultContentIdStr).longValue());
+ }
+ QaMonitoringAction.logger.debug("final qaContent: " + qaContent);
+
+ QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO();
+ QaMonitoringAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
+
+ String richTextTitle = request.getParameter(QaAppConstants.TITLE);
+ String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS);
+
+ QaMonitoringAction.logger.debug("richTextTitle: " + richTextTitle);
+ QaMonitoringAction.logger.debug("richTextInstructions: " + richTextInstructions);
+ qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
+ qaAuthoringForm.setTitle(richTextTitle);
+
+ qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
+
+ QaUtils.setFormProperties(request, qaService, qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID,
+ defaultContentIdStr, activeModule, sessionMap, httpSessionID);
+
+ qaGeneralAuthoringDTO.setEditableQuestionText(editableQuestion);
+ qaGeneralAuthoringDTO.setEditableQuestionFeedback(editableFeedback);
+ qaAuthoringForm.setFeedback(editableFeedback);
+
+ QaMonitoringAction.logger.debug("qaGeneralAuthoringDTO now: " + qaGeneralAuthoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+
+ request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
+
+ /* start monitoring code */
+ GeneralMonitoringDTO qaGeneralMonitoringDTO = new GeneralMonitoringDTO();
+ qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(false).toString());
+
+ if (qaService.studentActivityOccurredGlobal(qaContent)) {
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
+ qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
+ } else {
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
+ qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
+ }
+
+ qaGeneralMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
+ qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
+
+ List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
+ QaMonitoringAction.logger.debug("attachmentList: " + attachmentList);
+ qaGeneralMonitoringDTO.setAttachmentList(attachmentList);
+ QaMonitoringAction.logger.debug("final qaGeneralMonitoringDTO: " + qaGeneralMonitoringDTO);
+
+ qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
+ QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + qaGeneralMonitoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, qaGeneralMonitoringDTO);
+
+ prepareReflectionData(request, qaContent, qaService, null, false, "All");
+
+ /* find out if there are any reflection entries, from here */
+ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent);
+ QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist);
+
+ if (notebookEntriesExist) {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+
+ String userExceptionNoToolSessions = qaGeneralMonitoringDTO.getUserExceptionNoToolSessions();
+ QaMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions);
+
+ if (userExceptionNoToolSessions.equals("true")) {
+ QaMonitoringAction.logger.debug("there are no online student activity but there are reflections : ");
+ request.setAttribute(QaAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+ }
+
+ } else {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
+ }
+ /* ... till here */
+
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
+
+ QaMonitoringAction.logger.debug("fwd ing to editQuestionBox: ");
+ return mapping.findForward("editQuestionBox");
}
-
-
-
- public ActionForward moveQuestionDown(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException {
- logger.debug("dispathcing proxy moveQuestionDown");
+ public ActionForward removeQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaMonitoringAction.logger.debug("dispathcing proxy removeQuestion");
- /*start authoring code*/
- QaAuthoringForm qaAuthoringForm = (QaMonitoringForm) form;
- logger.debug("dispathcing moveQuestionDown");
-
- IQaService qaService =QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
-
- String httpSessionID=request.getParameter("httpSessionID");
- logger.debug("httpSessionID: " + httpSessionID);
-
- SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
- String questionIndex=request.getParameter("questionIndex");
- logger.debug("questionIndex: " + questionIndex);
-
-
- List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
-
- listQuestionContentDTO=AuthoringUtil.swapNodes(listQuestionContentDTO, questionIndex, "down");
- logger.debug("listQuestionContentDTO after swap: " + listQuestionContentDTO);
-
- listQuestionContentDTO=AuthoringUtil.reorderSimpleListQuestionContentDTO(listQuestionContentDTO);
- logger.debug("listQuestionContentDTO after reordersimple: " + listQuestionContentDTO);
+ /* start authoring code */
+ QaAuthoringForm qaAuthoringForm = (QaMonitoringForm) form;
+ QaMonitoringAction.logger.debug("dispathcing removeQuestion");
-
- sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
-
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaAuthoringForm.setContentFolderID(contentFolderID);
-
-
- String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
-
- String richTextTitle = request.getParameter(TITLE);
- logger.debug("richTextTitle: " + richTextTitle);
-
- String richTextInstructions = request.getParameter(INSTRUCTIONS);
- logger.debug("richTextInstructions: " + richTextInstructions);
-
-
- sessionMap.put(ACTIVITY_TITLE_KEY, richTextTitle);
- sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
-
-
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
- String defaultContentIdStr=request.getParameter(DEFAULT_CONTENT_ID_STR);
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("qaContent: " + qaContent);
-
- if (qaContent == null)
- {
- logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
- qaContent=qaService.loadQa(new Long(defaultContentIdStr).longValue());
- }
- logger.debug("final qaContent: " + qaContent);
-
- QaGeneralAuthoringDTO qaGeneralAuthoringDTO= new QaGeneralAuthoringDTO();
- logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
-
- qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
- qaAuthoringForm.setTitle(richTextTitle);
-
- qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
-
- AuthoringUtil authoringUtil= new AuthoringUtil();
-
- qaGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString());
- request.getSession().setAttribute(httpSessionID, sessionMap);
-
- QaUtils.setFormProperties(request, qaService,
- qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID, defaultContentIdStr, activeModule, sessionMap, httpSessionID);
-
-
- qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
- qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
- qaGeneralAuthoringDTO.setActiveModule(activeModule);
- qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
- qaAuthoringForm.setToolContentID(strToolContentID);
- qaAuthoringForm.setHttpSessionID(httpSessionID);
- qaAuthoringForm.setActiveModule(activeModule);
- qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
- qaAuthoringForm.setCurrentTab("3");
-
- request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
- logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
-
-
- logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- request.setAttribute(QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
-
- request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
-
- /*start monitoring code*/
- GeneralMonitoringDTO qaGeneralMonitoringDTO=new GeneralMonitoringDTO();
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaMonitoringAction.logger.debug("qaService: " + qaService);
- if (qaService.studentActivityOccurredGlobal(qaContent))
- {
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
- qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
- }
- else
- {
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
- qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
- }
+ String httpSessionID = request.getParameter("httpSessionID");
+ QaMonitoringAction.logger.debug("httpSessionID: " + httpSessionID);
- qaGeneralMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
- qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
+ QaMonitoringAction.logger.debug("sessionMap: " + sessionMap);
- List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
- logger.debug("attachmentList: " + attachmentList);
- qaGeneralMonitoringDTO.setAttachmentList(attachmentList);
- logger.debug("final qaGeneralMonitoringDTO: " + qaGeneralMonitoringDTO );
+ String questionIndex = request.getParameter("questionIndex");
+ QaMonitoringAction.logger.debug("questionIndex: " + questionIndex);
-
- qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
- logger.debug("final generalMonitoringDTO: " + qaGeneralMonitoringDTO );
- request.setAttribute(QA_GENERAL_MONITORING_DTO, qaGeneralMonitoringDTO);
+ List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
+ QaMonitoringAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
- prepareReflectionData(request, qaContent, qaService, null, false , "All");
+ QaQuestionContentDTO qaQuestionContentDTO = null;
+ Iterator listIterator = listQuestionContentDTO.iterator();
+ while (listIterator.hasNext()) {
+ qaQuestionContentDTO = (QaQuestionContentDTO) listIterator.next();
+ QaMonitoringAction.logger.debug("qaQuestionContentDTO:" + qaQuestionContentDTO);
+ QaMonitoringAction.logger.debug("qaQuestionContentDTO question:" + qaQuestionContentDTO.getQuestion());
- /*find out if there are any reflection entries, from here*/
- boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(qaService, qaContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
-
- if (notebookEntriesExist)
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
-
- String userExceptionNoToolSessions=(String)qaGeneralMonitoringDTO.getUserExceptionNoToolSessions();
- logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions);
-
- if (userExceptionNoToolSessions.equals("true"))
- {
- logger.debug("there are no online student activity but there are reflections : ");
- request.setAttribute(NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
- }
+ String question = qaQuestionContentDTO.getQuestion();
+ String displayOrder = qaQuestionContentDTO.getDisplayOrder();
+ QaMonitoringAction.logger.debug("displayOrder:" + displayOrder);
+ if (displayOrder != null && !displayOrder.equals("")) {
+ if (displayOrder.equals(questionIndex)) {
+ break;
}
- else
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
- }
- /* ... till here*/
-
- MonitoringUtil.buildQaStatsDTO(request,qaService, qaContent);
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
-
- return mapping.findForward(LOAD_MONITORING);
+ }
+ }
+
+ QaMonitoringAction.logger.debug("qaQuestionContentDTO found:" + qaQuestionContentDTO);
+ qaQuestionContentDTO.setQuestion("");
+ QaMonitoringAction.logger.debug("listQuestionContentDTO after remove:" + listQuestionContentDTO);
+
+ listQuestionContentDTO = AuthoringUtil.reorderListQuestionContentDTO(listQuestionContentDTO, questionIndex);
+ QaMonitoringAction.logger.debug("listQuestionContentDTO reordered:" + listQuestionContentDTO);
+
+ sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
+
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaAuthoringForm.setContentFolderID(contentFolderID);
+
+ String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE);
+ QaMonitoringAction.logger.debug("activeModule: " + activeModule);
+
+ String richTextTitle = request.getParameter(QaAppConstants.TITLE);
+ QaMonitoringAction.logger.debug("richTextTitle: " + richTextTitle);
+
+ String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS);
+ QaMonitoringAction.logger.debug("richTextInstructions: " + richTextInstructions);
+
+ sessionMap.put(QaAppConstants.ACTIVITY_TITLE_KEY, richTextTitle);
+ sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
+
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID);
+
+ String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR);
+ QaMonitoringAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
+
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaMonitoringAction.logger.debug("qaContent: " + qaContent);
+
+ if (qaContent == null) {
+ QaMonitoringAction.logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
+ qaContent = qaService.loadQa(new Long(defaultContentIdStr).longValue());
+ }
+ QaMonitoringAction.logger.debug("final qaContent: " + qaContent);
+
+ QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO();
+ QaMonitoringAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
+
+ qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
+ qaAuthoringForm.setTitle(richTextTitle);
+
+ qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
+
+ AuthoringUtil authoringUtil = new AuthoringUtil();
+
+ qaGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString());
+
+ request.getSession().setAttribute(httpSessionID, sessionMap);
+
+ QaUtils.setFormProperties(request, qaService, qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID,
+ defaultContentIdStr, activeModule, sessionMap, httpSessionID);
+
+ qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
+ qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
+ qaGeneralAuthoringDTO.setActiveModule(activeModule);
+ qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
+ qaAuthoringForm.setToolContentID(strToolContentID);
+ qaAuthoringForm.setHttpSessionID(httpSessionID);
+ qaAuthoringForm.setActiveModule(activeModule);
+ qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
+ qaAuthoringForm.setCurrentTab("3");
+
+ request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
+ QaMonitoringAction.logger.debug("qaQuestionContentDTO now: " + qaQuestionContentDTO);
+ QaMonitoringAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
+
+ QaMonitoringAction.logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+
+ request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
+
+ /* start monitoring code */
+ GeneralMonitoringDTO qaGeneralMonitoringDTO = new GeneralMonitoringDTO();
+
+ if (qaService.studentActivityOccurredGlobal(qaContent)) {
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
+ qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
+ } else {
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
+ qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
+ }
+
+ qaGeneralMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
+ qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
+
+ List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
+ QaMonitoringAction.logger.debug("attachmentList: " + attachmentList);
+ qaGeneralMonitoringDTO.setAttachmentList(attachmentList);
+ QaMonitoringAction.logger.debug("final qaGeneralMonitoringDTO: " + qaGeneralMonitoringDTO);
+
+ qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
+ QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + qaGeneralMonitoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, qaGeneralMonitoringDTO);
+
+ prepareReflectionData(request, qaContent, qaService, null, false, "All");
+
+ /* find out if there are any reflection entries, from here */
+ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent);
+ QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist);
+
+ if (notebookEntriesExist) {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+
+ String userExceptionNoToolSessions = qaGeneralMonitoringDTO.getUserExceptionNoToolSessions();
+ QaMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions);
+
+ if (userExceptionNoToolSessions.equals("true")) {
+ QaMonitoringAction.logger.debug("there are no online student activity but there are reflections : ");
+ request.setAttribute(QaAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+ }
+
+ } else {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
+ }
+ /* ... till here */
+
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
+
+ return mapping.findForward(QaAppConstants.LOAD_MONITORING);
}
-
-
-
- public ActionForward moveQuestionUp(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException {
- logger.debug("dispathcing proxy moveQuestionUp");
- /*start authoring code*/
- QaAuthoringForm qaAuthoringForm = (QaMonitoringForm) form;
- logger.debug("dispathcing moveQuestionDown");
-
- IQaService qaService =QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
-
- String httpSessionID=request.getParameter("httpSessionID");
- logger.debug("httpSessionID: " + httpSessionID);
-
- SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
- String questionIndex=request.getParameter("questionIndex");
- logger.debug("questionIndex: " + questionIndex);
-
-
- List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
-
- listQuestionContentDTO=AuthoringUtil.swapNodes(listQuestionContentDTO, questionIndex, "up");
- logger.debug("listQuestionContentDTO after swap: " + listQuestionContentDTO);
-
- listQuestionContentDTO=AuthoringUtil.reorderSimpleListQuestionContentDTO(listQuestionContentDTO);
- logger.debug("listQuestionContentDTO after reordersimple: " + listQuestionContentDTO);
-
- sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaAuthoringForm.setContentFolderID(contentFolderID);
-
-
- String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
-
- String richTextTitle = request.getParameter(TITLE);
- logger.debug("richTextTitle: " + richTextTitle);
-
- String richTextInstructions = request.getParameter(INSTRUCTIONS);
- logger.debug("richTextInstructions: " + richTextInstructions);
-
-
- sessionMap.put(ACTIVITY_TITLE_KEY, richTextTitle);
- sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
-
-
- String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
- String defaultContentIdStr=request.getParameter(DEFAULT_CONTENT_ID_STR);
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
- QaContent qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("qaContent: " + qaContent);
-
- if (qaContent == null)
- {
- logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
- qaContent=qaService.loadQa(new Long(defaultContentIdStr).longValue());
- }
- logger.debug("final qaContent: " + qaContent);
-
- QaGeneralAuthoringDTO qaGeneralAuthoringDTO= new QaGeneralAuthoringDTO();
- logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
-
- qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
- qaAuthoringForm.setTitle(richTextTitle);
-
- qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
-
- AuthoringUtil authoringUtil= new AuthoringUtil();
-
- qaGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString());
-
- request.getSession().setAttribute(httpSessionID, sessionMap);
-
- QaUtils.setFormProperties(request, qaService,
- qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID, defaultContentIdStr, activeModule, sessionMap, httpSessionID);
-
-
- qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
- qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
- qaGeneralAuthoringDTO.setActiveModule(activeModule);
- qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
- qaAuthoringForm.setToolContentID(strToolContentID);
- qaAuthoringForm.setHttpSessionID(httpSessionID);
- qaAuthoringForm.setActiveModule(activeModule);
- qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
- qaAuthoringForm.setCurrentTab("3");
-
-
- request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
- logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
-
-
- logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- request.setAttribute(QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
-
- request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
-
- /*start monitoring code*/
- GeneralMonitoringDTO qaGeneralMonitoringDTO=new GeneralMonitoringDTO();
+ public ActionForward moveQuestionDown(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaMonitoringAction.logger.debug("dispathcing proxy moveQuestionDown");
- if (qaService.studentActivityOccurredGlobal(qaContent))
- {
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
- qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
- }
- else
- {
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
- qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
- }
+ /* start authoring code */
+ QaAuthoringForm qaAuthoringForm = (QaMonitoringForm) form;
+ QaMonitoringAction.logger.debug("dispathcing moveQuestionDown");
- qaGeneralMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
- qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaMonitoringAction.logger.debug("qaService: " + qaService);
- List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
- logger.debug("attachmentList: " + attachmentList);
- qaGeneralMonitoringDTO.setAttachmentList(attachmentList);
- logger.debug("final qaGeneralMonitoringDTO: " + qaGeneralMonitoringDTO );
+ String httpSessionID = request.getParameter("httpSessionID");
+ QaMonitoringAction.logger.debug("httpSessionID: " + httpSessionID);
-
- qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
- logger.debug("final generalMonitoringDTO: " + qaGeneralMonitoringDTO );
- request.setAttribute(QA_GENERAL_MONITORING_DTO, qaGeneralMonitoringDTO);
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
+ QaMonitoringAction.logger.debug("sessionMap: " + sessionMap);
- prepareReflectionData(request, qaContent, qaService, null, false , "All");
-
- /*find out if there are any reflection entries, from here*/
- boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(qaService, qaContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
-
- if (notebookEntriesExist)
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
-
- String userExceptionNoToolSessions=(String)qaGeneralMonitoringDTO.getUserExceptionNoToolSessions();
- logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions);
-
- if (userExceptionNoToolSessions.equals("true"))
- {
- logger.debug("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.buildQaStatsDTO(request,qaService, qaContent);
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
-
- return mapping.findForward(LOAD_MONITORING);
+ String questionIndex = request.getParameter("questionIndex");
+ QaMonitoringAction.logger.debug("questionIndex: " + questionIndex);
+
+ List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
+ QaMonitoringAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
+
+ listQuestionContentDTO = AuthoringUtil.swapNodes(listQuestionContentDTO, questionIndex, "down", null);
+ QaMonitoringAction.logger.debug("listQuestionContentDTO after swap: " + listQuestionContentDTO);
+
+ listQuestionContentDTO = AuthoringUtil.reorderSimpleListQuestionContentDTO(listQuestionContentDTO);
+ QaMonitoringAction.logger.debug("listQuestionContentDTO after reordersimple: " + listQuestionContentDTO);
+
+ sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
+
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaAuthoringForm.setContentFolderID(contentFolderID);
+
+ String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE);
+ QaMonitoringAction.logger.debug("activeModule: " + activeModule);
+
+ String richTextTitle = request.getParameter(QaAppConstants.TITLE);
+ QaMonitoringAction.logger.debug("richTextTitle: " + richTextTitle);
+
+ String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS);
+ QaMonitoringAction.logger.debug("richTextInstructions: " + richTextInstructions);
+
+ sessionMap.put(QaAppConstants.ACTIVITY_TITLE_KEY, richTextTitle);
+ sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
+
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID);
+
+ String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR);
+ QaMonitoringAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
+
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaMonitoringAction.logger.debug("qaContent: " + qaContent);
+
+ if (qaContent == null) {
+ QaMonitoringAction.logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
+ qaContent = qaService.loadQa(new Long(defaultContentIdStr).longValue());
+ }
+ QaMonitoringAction.logger.debug("final qaContent: " + qaContent);
+
+ QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO();
+ QaMonitoringAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
+
+ qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
+ qaAuthoringForm.setTitle(richTextTitle);
+
+ qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
+
+ AuthoringUtil authoringUtil = new AuthoringUtil();
+
+ qaGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString());
+ request.getSession().setAttribute(httpSessionID, sessionMap);
+
+ QaUtils.setFormProperties(request, qaService, qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID,
+ defaultContentIdStr, activeModule, sessionMap, httpSessionID);
+
+ qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
+ qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
+ qaGeneralAuthoringDTO.setActiveModule(activeModule);
+ qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
+ qaAuthoringForm.setToolContentID(strToolContentID);
+ qaAuthoringForm.setHttpSessionID(httpSessionID);
+ qaAuthoringForm.setActiveModule(activeModule);
+ qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
+ qaAuthoringForm.setCurrentTab("3");
+
+ request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
+ QaMonitoringAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
+
+ QaMonitoringAction.logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+
+ request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
+
+ /* start monitoring code */
+ GeneralMonitoringDTO qaGeneralMonitoringDTO = new GeneralMonitoringDTO();
+
+ if (qaService.studentActivityOccurredGlobal(qaContent)) {
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
+ qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
+ } else {
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
+ qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
+ }
+
+ qaGeneralMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
+ qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
+
+ List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
+ QaMonitoringAction.logger.debug("attachmentList: " + attachmentList);
+ qaGeneralMonitoringDTO.setAttachmentList(attachmentList);
+ QaMonitoringAction.logger.debug("final qaGeneralMonitoringDTO: " + qaGeneralMonitoringDTO);
+
+ qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
+ QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + qaGeneralMonitoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, qaGeneralMonitoringDTO);
+
+ prepareReflectionData(request, qaContent, qaService, null, false, "All");
+
+ /* find out if there are any reflection entries, from here */
+ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent);
+ QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist);
+
+ if (notebookEntriesExist) {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+
+ String userExceptionNoToolSessions = qaGeneralMonitoringDTO.getUserExceptionNoToolSessions();
+ QaMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions);
+
+ if (userExceptionNoToolSessions.equals("true")) {
+ QaMonitoringAction.logger.debug("there are no online student activity but there are reflections : ");
+ request.setAttribute(QaAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+ }
+
+ } else {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
+ }
+ /* ... till here */
+
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
+
+ return mapping.findForward(QaAppConstants.LOAD_MONITORING);
+
}
-
-
-
- public void prepareReflectionData(HttpServletRequest request, QaContent qaContent,
- IQaService qaService, String userID, boolean exportMode, String currentSessionId)
- {
- logger.debug("starting prepareReflectionData: " + qaContent);
- logger.debug("currentSessionId: " + currentSessionId);
- logger.debug("userID: " + userID);
- logger.debug("exportMode: " + exportMode);
+ public ActionForward moveQuestionUp(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ QaMonitoringAction.logger.debug("dispathcing proxy moveQuestionUp");
- List reflectionsContainerDTO= new LinkedList();
- /*
- if (currentSessionId.equals("All"))
- {
- reflectionsContainerDTO=getReflectionList(qaContent, userID, qaService);
+ /* start authoring code */
+ QaAuthoringForm qaAuthoringForm = (QaMonitoringForm) form;
+ QaMonitoringAction.logger.debug("dispathcing moveQuestionDown");
+
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ QaMonitoringAction.logger.debug("qaService: " + qaService);
+
+ String httpSessionID = request.getParameter("httpSessionID");
+ QaMonitoringAction.logger.debug("httpSessionID: " + httpSessionID);
+
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
+ QaMonitoringAction.logger.debug("sessionMap: " + sessionMap);
+
+ String questionIndex = request.getParameter("questionIndex");
+ QaMonitoringAction.logger.debug("questionIndex: " + questionIndex);
+
+ List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
+ QaMonitoringAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
+
+ listQuestionContentDTO = AuthoringUtil.swapNodes(listQuestionContentDTO, questionIndex, "up", null);
+ QaMonitoringAction.logger.debug("listQuestionContentDTO after swap: " + listQuestionContentDTO);
+
+ listQuestionContentDTO = AuthoringUtil.reorderSimpleListQuestionContentDTO(listQuestionContentDTO);
+ QaMonitoringAction.logger.debug("listQuestionContentDTO after reordersimple: " + listQuestionContentDTO);
+
+ sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
+
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaMonitoringAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaAuthoringForm.setContentFolderID(contentFolderID);
+
+ String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE);
+ QaMonitoringAction.logger.debug("activeModule: " + activeModule);
+
+ String richTextTitle = request.getParameter(QaAppConstants.TITLE);
+ QaMonitoringAction.logger.debug("richTextTitle: " + richTextTitle);
+
+ String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS);
+ QaMonitoringAction.logger.debug("richTextInstructions: " + richTextInstructions);
+
+ sessionMap.put(QaAppConstants.ACTIVITY_TITLE_KEY, richTextTitle);
+ sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
+
+ String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaMonitoringAction.logger.debug("strToolContentID: " + strToolContentID);
+
+ String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR);
+ QaMonitoringAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
+
+ QaContent qaContent = qaService.loadQa(new Long(strToolContentID).longValue());
+ QaMonitoringAction.logger.debug("qaContent: " + qaContent);
+
+ if (qaContent == null) {
+ QaMonitoringAction.logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
+ qaContent = qaService.loadQa(new Long(defaultContentIdStr).longValue());
+ }
+ QaMonitoringAction.logger.debug("final qaContent: " + qaContent);
+
+ QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO();
+ QaMonitoringAction.logger.debug("qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
+
+ qaGeneralAuthoringDTO.setActivityTitle(richTextTitle);
+ qaAuthoringForm.setTitle(richTextTitle);
+
+ qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
+
+ AuthoringUtil authoringUtil = new AuthoringUtil();
+
+ qaGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString());
+
+ request.getSession().setAttribute(httpSessionID, sessionMap);
+
+ QaUtils.setFormProperties(request, qaService, qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID,
+ defaultContentIdStr, activeModule, sessionMap, httpSessionID);
+
+ qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
+ qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
+ qaGeneralAuthoringDTO.setActiveModule(activeModule);
+ qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr);
+ qaAuthoringForm.setToolContentID(strToolContentID);
+ qaAuthoringForm.setHttpSessionID(httpSessionID);
+ qaAuthoringForm.setActiveModule(activeModule);
+ qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
+ qaAuthoringForm.setCurrentTab("3");
+
+ request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
+ QaMonitoringAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
+
+ QaMonitoringAction.logger.debug("before saving final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
+
+ request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
+
+ /* start monitoring code */
+ GeneralMonitoringDTO qaGeneralMonitoringDTO = new GeneralMonitoringDTO();
+
+ if (qaService.studentActivityOccurredGlobal(qaContent)) {
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
+ qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
+ } else {
+ QaMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
+ qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
+ }
+
+ qaGeneralMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
+ qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
+
+ List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
+ QaMonitoringAction.logger.debug("attachmentList: " + attachmentList);
+ qaGeneralMonitoringDTO.setAttachmentList(attachmentList);
+ QaMonitoringAction.logger.debug("final qaGeneralMonitoringDTO: " + qaGeneralMonitoringDTO);
+
+ qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
+ QaMonitoringAction.logger.debug("final generalMonitoringDTO: " + qaGeneralMonitoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, qaGeneralMonitoringDTO);
+
+ prepareReflectionData(request, qaContent, qaService, null, false, "All");
+
+ /* find out if there are any reflection entries, from here */
+ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(qaService, qaContent);
+ QaMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist);
+
+ if (notebookEntriesExist) {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
+
+ String userExceptionNoToolSessions = qaGeneralMonitoringDTO.getUserExceptionNoToolSessions();
+ QaMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions);
+
+ if (userExceptionNoToolSessions.equals("true")) {
+ QaMonitoringAction.logger.debug("there are no online student activity but there are reflections : ");
+ request.setAttribute(QaAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
}
- else
- {
- reflectionsContainerDTO=getReflectionListForSession(qaContent, userID, qaService, currentSessionId);
- }
- */
-
- reflectionsContainerDTO=getReflectionList(qaContent, userID, qaService);
-
- logger.debug("reflectionsContainerDTO: " + reflectionsContainerDTO);
- request.setAttribute(REFLECTIONS_CONTAINER_DTO, reflectionsContainerDTO);
-
- if (exportMode)
- {
- request.getSession().setAttribute(REFLECTIONS_CONTAINER_DTO, reflectionsContainerDTO);
- }
+ } else {
+ request.setAttribute(QaAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
}
-
+ /* ... till here */
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
+
+ return mapping.findForward(QaAppConstants.LOAD_MONITORING);
+ }
+
+ public void prepareReflectionData(HttpServletRequest request, QaContent qaContent, IQaService qaService,
+ String userID, boolean exportMode, String currentSessionId) {
+ QaMonitoringAction.logger.debug("starting prepareReflectionData: " + qaContent);
+ QaMonitoringAction.logger.debug("currentSessionId: " + currentSessionId);
+ QaMonitoringAction.logger.debug("userID: " + userID);
+ QaMonitoringAction.logger.debug("exportMode: " + exportMode);
+
+ List reflectionsContainerDTO = new LinkedList();
+ /*
+ * if (currentSessionId.equals("All")) { reflectionsContainerDTO=getReflectionList(qaContent, userID,
+ * qaService); } else { reflectionsContainerDTO=getReflectionListForSession(qaContent, userID, qaService,
+ * currentSessionId); }
+ */
+
+ reflectionsContainerDTO = getReflectionList(qaContent, userID, qaService);
+
+ QaMonitoringAction.logger.debug("reflectionsContainerDTO: " + reflectionsContainerDTO);
+ request.setAttribute(QaAppConstants.REFLECTIONS_CONTAINER_DTO, reflectionsContainerDTO);
+
+ if (exportMode) {
+ request.getSession().setAttribute(QaAppConstants.REFLECTIONS_CONTAINER_DTO, reflectionsContainerDTO);
+ }
+ }
+
/**
* returns reflection data for all sessions
*
* getReflectionList
+ *
* @param qaContent
* @param userID
* @param qaService
* @return
*/
- public List getReflectionList(QaContent qaContent, String userID, IQaService qaService)
- {
- logger.debug("getting reflections for all sessions");
- List reflectionsContainerDTO= new LinkedList();
- if (userID == null)
- {
- logger.debug("all users mode");
- for (Iterator sessionIter = qaContent.getQaSessions().iterator(); sessionIter.hasNext();)
- {
- QaSession qaSession = (QaSession) sessionIter.next();
- logger.debug("qaSession: " + qaSession);
- logger.debug("qaSession sessionId: " + qaSession.getQaSessionId());
-
- for (Iterator userIter = qaSession.getQaQueUsers().iterator(); userIter.hasNext();)
- {
- QaQueUsr user = (QaQueUsr) userIter.next();
- logger.debug("user: " + user);
+ public List getReflectionList(QaContent qaContent, String userID, IQaService qaService) {
+ QaMonitoringAction.logger.debug("getting reflections for all sessions");
+ List reflectionsContainerDTO = new LinkedList();
+ if (userID == null) {
+ QaMonitoringAction.logger.debug("all users mode");
+ for (Iterator sessionIter = qaContent.getQaSessions().iterator(); sessionIter.hasNext();) {
+ QaSession qaSession = (QaSession) sessionIter.next();
+ QaMonitoringAction.logger.debug("qaSession: " + qaSession);
+ QaMonitoringAction.logger.debug("qaSession sessionId: " + qaSession.getQaSessionId());
- NotebookEntry notebookEntry = qaService.getEntry(qaSession.getQaSessionId(),
- CoreNotebookConstants.NOTEBOOK_TOOL,
- MY_SIGNATURE, new Integer(user.getQueUsrId().toString()));
-
- logger.debug("notebookEntry: " + notebookEntry);
-
- if (notebookEntry != null) {
- ReflectionDTO reflectionDTO = new ReflectionDTO();
- reflectionDTO.setUserId(user.getQueUsrId().toString());
- reflectionDTO.setSessionId(qaSession.getQaSessionId().toString());
- reflectionDTO.setUserName(user.getFullname());
- reflectionDTO.setReflectionUid (notebookEntry.getUid().toString());
- String notebookEntryPresentable=QaUtils.replaceNewLines(notebookEntry.getEntry());
- reflectionDTO.setEntry(notebookEntryPresentable);
- reflectionsContainerDTO.add(reflectionDTO);
- }
- }
- }
- }
- else
- {
- logger.debug("single user mode");
- for (Iterator sessionIter = qaContent.getQaSessions().iterator(); sessionIter.hasNext();)
- {
- QaSession qaSession = (QaSession) sessionIter.next();
- logger.debug("qaSession: " + qaSession);
- for (Iterator userIter = qaSession.getQaQueUsers().iterator(); userIter.hasNext();)
- {
- QaQueUsr user = (QaQueUsr) userIter.next();
- logger.debug("user: " + user);
-
- if (user.getQueUsrId().toString().equals(userID))
- {
- logger.debug("getting reflection for user with userID: " + userID);
- NotebookEntry notebookEntry = qaService.getEntry(qaSession.getQaSessionId(),
- CoreNotebookConstants.NOTEBOOK_TOOL,
- MY_SIGNATURE, new Integer(user.getQueUsrId().toString()));
-
- logger.debug("notebookEntry: " + notebookEntry);
-
- if (notebookEntry != null) {
- ReflectionDTO reflectionDTO = new ReflectionDTO();
- reflectionDTO.setUserId(user.getQueUsrId().toString());
- reflectionDTO.setSessionId(qaSession.getQaSessionId().toString());
- reflectionDTO.setUserName(user.getFullname());
- reflectionDTO.setReflectionUid (notebookEntry.getUid().toString());
- String notebookEntryPresentable=QaUtils.replaceNewLines(notebookEntry.getEntry());
- reflectionDTO.setEntry(notebookEntryPresentable);
- reflectionsContainerDTO.add(reflectionDTO);
- }
- }
- }
- }
- }
-
- return reflectionsContainerDTO;
+ for (Iterator userIter = qaSession.getQaQueUsers().iterator(); userIter.hasNext();) {
+ QaQueUsr user = (QaQueUsr) userIter.next();
+ QaMonitoringAction.logger.debug("user: " + user);
+
+ NotebookEntry notebookEntry = qaService.getEntry(qaSession.getQaSessionId(),
+ CoreNotebookConstants.NOTEBOOK_TOOL, QaAppConstants.MY_SIGNATURE, new Integer(user
+ .getQueUsrId().toString()));
+
+ QaMonitoringAction.logger.debug("notebookEntry: " + notebookEntry);
+
+ if (notebookEntry != null) {
+ ReflectionDTO reflectionDTO = new ReflectionDTO();
+ reflectionDTO.setUserId(user.getQueUsrId().toString());
+ reflectionDTO.setSessionId(qaSession.getQaSessionId().toString());
+ reflectionDTO.setUserName(user.getFullname());
+ reflectionDTO.setReflectionUid(notebookEntry.getUid().toString());
+ String notebookEntryPresentable = QaUtils.replaceNewLines(notebookEntry.getEntry());
+ reflectionDTO.setEntry(notebookEntryPresentable);
+ reflectionsContainerDTO.add(reflectionDTO);
+ }
+ }
+ }
+ } else {
+ QaMonitoringAction.logger.debug("single user mode");
+ for (Iterator sessionIter = qaContent.getQaSessions().iterator(); sessionIter.hasNext();) {
+ QaSession qaSession = (QaSession) sessionIter.next();
+ QaMonitoringAction.logger.debug("qaSession: " + qaSession);
+ for (Iterator userIter = qaSession.getQaQueUsers().iterator(); userIter.hasNext();) {
+ QaQueUsr user = (QaQueUsr) userIter.next();
+ QaMonitoringAction.logger.debug("user: " + user);
+
+ if (user.getQueUsrId().toString().equals(userID)) {
+ QaMonitoringAction.logger.debug("getting reflection for user with userID: " + userID);
+ NotebookEntry notebookEntry = qaService.getEntry(qaSession.getQaSessionId(),
+ CoreNotebookConstants.NOTEBOOK_TOOL, QaAppConstants.MY_SIGNATURE, new Integer(user
+ .getQueUsrId().toString()));
+
+ QaMonitoringAction.logger.debug("notebookEntry: " + notebookEntry);
+
+ if (notebookEntry != null) {
+ ReflectionDTO reflectionDTO = new ReflectionDTO();
+ reflectionDTO.setUserId(user.getQueUsrId().toString());
+ reflectionDTO.setSessionId(qaSession.getQaSessionId().toString());
+ reflectionDTO.setUserName(user.getFullname());
+ reflectionDTO.setReflectionUid(notebookEntry.getUid().toString());
+ String notebookEntryPresentable = QaUtils.replaceNewLines(notebookEntry.getEntry());
+ reflectionDTO.setEntry(notebookEntryPresentable);
+ reflectionsContainerDTO.add(reflectionDTO);
+ }
+ }
+ }
+ }
+ }
+
+ return reflectionsContainerDTO;
}
-
+
/**
* returns reflection data for a specific session
*
* getReflectionListForSession(QaContent qaContent, String userID, IQaService qaService, String currentSessionId)
+ *
* @param qaContent
* @param userID
* @param qaService
* @param currentSessionId
* @return
*/
- public List getReflectionListForSession(QaContent qaContent, String userID, IQaService qaService, String currentSessionId)
- {
- logger.debug("getting reflections for a specific session");
- logger.debug("currentSessionId: " + currentSessionId);
-
- List reflectionsContainerDTO= new LinkedList();
- if (userID == null)
- {
- logger.debug("all users mode");
- for (Iterator sessionIter = qaContent.getQaSessions().iterator(); sessionIter.hasNext();)
- {
- QaSession qaSession = (QaSession) sessionIter.next();
- logger.debug("qaSession: " + qaSession);
- logger.debug("qaSession sessionId: " + qaSession.getQaSessionId());
-
- if (currentSessionId.equals(qaSession.getQaSessionId()))
- {
-
- for (Iterator userIter = qaSession.getQaQueUsers().iterator(); userIter.hasNext();)
- {
- QaQueUsr user = (QaQueUsr) userIter.next();
- logger.debug("user: " + user);
+ public List getReflectionListForSession(QaContent qaContent, String userID, IQaService qaService,
+ String currentSessionId) {
+ QaMonitoringAction.logger.debug("getting reflections for a specific session");
+ QaMonitoringAction.logger.debug("currentSessionId: " + currentSessionId);
- NotebookEntry notebookEntry = qaService.getEntry(qaSession.getQaSessionId(),
- CoreNotebookConstants.NOTEBOOK_TOOL,
- MY_SIGNATURE, new Integer(user.getQueUsrId().toString()));
-
- logger.debug("notebookEntry: " + notebookEntry);
-
- if (notebookEntry != null) {
- ReflectionDTO reflectionDTO = new ReflectionDTO();
- reflectionDTO.setUserId(user.getQueUsrId().toString());
- reflectionDTO.setSessionId(qaSession.getQaSessionId().toString());
- reflectionDTO.setUserName(user.getFullname());
- reflectionDTO.setReflectionUid (notebookEntry.getUid().toString());
- String notebookEntryPresentable=QaUtils.replaceNewLines(notebookEntry.getEntry());
- reflectionDTO.setEntry(notebookEntryPresentable);
- reflectionsContainerDTO.add(reflectionDTO);
- }
- }
- }
- }
- }
- else
- {
- logger.debug("single user mode");
- for (Iterator sessionIter = qaContent.getQaSessions().iterator(); sessionIter.hasNext();)
- {
- QaSession qaSession = (QaSession) sessionIter.next();
- logger.debug("qaSession: " + qaSession);
-
- if (currentSessionId.equals(qaSession.getQaSessionId()))
- {
- for (Iterator userIter = qaSession.getQaQueUsers().iterator(); userIter.hasNext();)
- {
- QaQueUsr user = (QaQueUsr) userIter.next();
- logger.debug("user: " + user);
-
- if (user.getQueUsrId().toString().equals(userID))
- {
- logger.debug("getting reflection for user with userID: " + userID);
- NotebookEntry notebookEntry = qaService.getEntry(qaSession.getQaSessionId(),
- CoreNotebookConstants.NOTEBOOK_TOOL,
- MY_SIGNATURE, new Integer(user.getQueUsrId().toString()));
-
- logger.debug("notebookEntry: " + notebookEntry);
-
- if (notebookEntry != null) {
- ReflectionDTO reflectionDTO = new ReflectionDTO();
- reflectionDTO.setUserId(user.getQueUsrId().toString());
- reflectionDTO.setSessionId(qaSession.getQaSessionId().toString());
- reflectionDTO.setUserName(user.getFullname());
- reflectionDTO.setReflectionUid (notebookEntry.getUid().toString());
- String notebookEntryPresentable=QaUtils.replaceNewLines(notebookEntry.getEntry());
- reflectionDTO.setEntry(notebookEntryPresentable);
- reflectionsContainerDTO.add(reflectionDTO);
- }
- }
- }
-
- }
- }
- }
-
- return reflectionsContainerDTO;
+ List reflectionsContainerDTO = new LinkedList();
+ if (userID == null) {
+ QaMonitoringAction.logger.debug("all users mode");
+ for (Iterator sessionIter = qaContent.getQaSessions().iterator(); sessionIter.hasNext();) {
+ QaSession qaSession = (QaSession) sessionIter.next();
+ QaMonitoringAction.logger.debug("qaSession: " + qaSession);
+ QaMonitoringAction.logger.debug("qaSession sessionId: " + qaSession.getQaSessionId());
+
+ if (currentSessionId.equals(qaSession.getQaSessionId())) {
+
+ for (Iterator userIter = qaSession.getQaQueUsers().iterator(); userIter.hasNext();) {
+ QaQueUsr user = (QaQueUsr) userIter.next();
+ QaMonitoringAction.logger.debug("user: " + user);
+
+ NotebookEntry notebookEntry = qaService.getEntry(qaSession.getQaSessionId(),
+ CoreNotebookConstants.NOTEBOOK_TOOL, QaAppConstants.MY_SIGNATURE, new Integer(user
+ .getQueUsrId().toString()));
+
+ QaMonitoringAction.logger.debug("notebookEntry: " + notebookEntry);
+
+ if (notebookEntry != null) {
+ ReflectionDTO reflectionDTO = new ReflectionDTO();
+ reflectionDTO.setUserId(user.getQueUsrId().toString());
+ reflectionDTO.setSessionId(qaSession.getQaSessionId().toString());
+ reflectionDTO.setUserName(user.getFullname());
+ reflectionDTO.setReflectionUid(notebookEntry.getUid().toString());
+ String notebookEntryPresentable = QaUtils.replaceNewLines(notebookEntry.getEntry());
+ reflectionDTO.setEntry(notebookEntryPresentable);
+ reflectionsContainerDTO.add(reflectionDTO);
+ }
+ }
+ }
+ }
+ } else {
+ QaMonitoringAction.logger.debug("single user mode");
+ for (Iterator sessionIter = qaContent.getQaSessions().iterator(); sessionIter.hasNext();) {
+ QaSession qaSession = (QaSession) sessionIter.next();
+ QaMonitoringAction.logger.debug("qaSession: " + qaSession);
+
+ if (currentSessionId.equals(qaSession.getQaSessionId())) {
+ for (Iterator userIter = qaSession.getQaQueUsers().iterator(); userIter.hasNext();) {
+ QaQueUsr user = (QaQueUsr) userIter.next();
+ QaMonitoringAction.logger.debug("user: " + user);
+
+ if (user.getQueUsrId().toString().equals(userID)) {
+ QaMonitoringAction.logger.debug("getting reflection for user with userID: " + userID);
+ NotebookEntry notebookEntry = qaService.getEntry(qaSession.getQaSessionId(),
+ CoreNotebookConstants.NOTEBOOK_TOOL, QaAppConstants.MY_SIGNATURE, new Integer(user
+ .getQueUsrId().toString()));
+
+ QaMonitoringAction.logger.debug("notebookEntry: " + notebookEntry);
+
+ if (notebookEntry != null) {
+ ReflectionDTO reflectionDTO = new ReflectionDTO();
+ reflectionDTO.setUserId(user.getQueUsrId().toString());
+ reflectionDTO.setSessionId(qaSession.getQaSessionId().toString());
+ reflectionDTO.setUserName(user.getFullname());
+ reflectionDTO.setReflectionUid(notebookEntry.getUid().toString());
+ String notebookEntryPresentable = QaUtils.replaceNewLines(notebookEntry.getEntry());
+ reflectionDTO.setEntry(notebookEntryPresentable);
+ reflectionsContainerDTO.add(reflectionDTO);
+ }
+ }
+ }
+
+ }
+ }
+ }
+
+ return reflectionsContainerDTO;
}
-
+
}
\ No newline at end of file
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java
===================================================================
diff -u -r06fc623e39b864fa777669c1a52bd8d6ee19b23e -r0af4ed13b963a588f3499b080801863d57f8ad95
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java (.../QaStarterAction.java) (revision 06fc623e39b864fa777669c1a52bd8d6ee19b23e)
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java (.../QaStarterAction.java) (revision 0af4ed13b963a588f3499b080801863d57f8ad95)
@@ -55,81 +55,83 @@
* The tool content id for this content is created as part of the installation process.
* Whenever a tool is asked for some tool content that does not exist, it should supply the default tool content.
* This will allow the system to render the normal screen, albeit with useless information, rather than crashing.
-*/
+ */
/**
-*
-* Authoring URL:
-*
-* The tool must supply an authoring module, which will be called to create new content or edit existing content. It will be called by an authoring URL using the following format: ?????
-* The initial data displayed on the authoring screen for a new tool content id may be the default tool content.
-*
-* Authoring UI data consists of general Activity data fields and the Tool specific data fields.
-* The authoring interface will have three tabs. The mandatory (and suggested) fields are given. Each tool will have its own fields which it will add on any of the three tabs, as appropriate to the tabs' function.
-*
-* Basic: Displays the basic set of fields that are needed for the tool, and it could be expected that a new LAMS user would use. Mandatory fields: Title, Instructions.
-* Advanced: Displays the extra fields that would be used by experienced LAMS users. Optional fields: Lock On Finish, Make Responses Anonymous
-* Instructions: Displays the "instructions" fields for teachers. Mandatory fields: Online instructions, Offline instructions, Document upload.
-* The "Define Later" and "Run Offline" options are set on the Flash authoring part, and not on the tool's authoring screens.
-*
-* Preview The tool must be able to show the specified content as if it was running in a lesson. It will be the learner url with tool access mode set to ToolAccessMode.AUTHOR.
-* Export The tool must be able to export its tool content for part of the overall learning design export.
-*
-* The format of the serialization for export is XML. Tool will define extra namespace inside the element to add a new data element (type). Inside the data element, it can further define more structures and types as it seems fit.
-* The data elements must be "version" aware. The data elements must be "type" aware if they are to be shared between Tools.
-*
-*
-
-
-
-
+ *
+ * Authoring URL:
+ *
+ * The tool must supply an authoring module, which will be called to create new content or edit existing content. It will be called by an authoring URL using the following format: ?????
+ * The initial data displayed on the authoring screen for a new tool content id may be the default tool content.
+ *
+ * Authoring UI data consists of general Activity data fields and the Tool specific data fields.
+ * The authoring interface will have three tabs. The mandatory (and suggested) fields are given. Each tool will have its own fields which it will add on any of the three tabs, as appropriate to the tabs' function.
+ *
+ * Basic: Displays the basic set of fields that are needed for the tool, and it could be expected that a new LAMS user would use. Mandatory fields: Title, Instructions.
+ * Advanced: Displays the extra fields that would be used by experienced LAMS users. Optional fields: Lock On Finish, Make Responses Anonymous
+ * Instructions: Displays the "instructions" fields for teachers. Mandatory fields: Online instructions, Offline instructions, Document upload.
+ * The "Define Later" and "Run Offline" options are set on the Flash authoring part, and not on the tool's authoring screens.
+ *
+ * Preview The tool must be able to show the specified content as if it was running in a lesson. It will be the learner url with tool access mode set to ToolAccessMode.AUTHOR.
+ * Export The tool must be able to export its tool content for part of the overall learning design export.
+ *
+ * The format of the serialization for export is XML. Tool will define extra namespace inside the element to add a new data element (type). Inside the data element, it can further define more structures and types as it seems fit.
+ * The data elements must be "version" aware. The data elements must be "type" aware if they are to be shared between Tools.
+ *
+ *
+
+
+
+
-
-
-
+
-
-
-
+
-
+
-*
-*/
+
+
+ *
+ */
+
/* $$Id$$ */
package org.lamsfoundation.lams.tool.qa.web;
+
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.SortedSet;
import java.util.TreeMap;
+import java.util.TreeSet;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
@@ -146,508 +148,629 @@
import org.lamsfoundation.lams.tool.qa.QaAppConstants;
import org.lamsfoundation.lams.tool.qa.QaApplicationException;
import org.lamsfoundation.lams.tool.qa.QaComparator;
+import org.lamsfoundation.lams.tool.qa.QaCondition;
import org.lamsfoundation.lams.tool.qa.QaContent;
import org.lamsfoundation.lams.tool.qa.QaGeneralAuthoringDTO;
import org.lamsfoundation.lams.tool.qa.QaQueContent;
import org.lamsfoundation.lams.tool.qa.QaQuestionContentDTO;
import org.lamsfoundation.lams.tool.qa.QaUtils;
import org.lamsfoundation.lams.tool.qa.service.IQaService;
import org.lamsfoundation.lams.tool.qa.service.QaServiceProxy;
+import org.lamsfoundation.lams.tool.qa.util.QaConditionComparator;
import org.lamsfoundation.lams.util.WebUtil;
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.lamsfoundation.lams.web.util.SessionMap;
/**
*
* @author Ozgur Demirtas
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
*
+ * TODO To change the template for this generated type comment go to Window -
+ * Preferences - Java - Code Style - Code Templates
+ *
* A Map data structure is used to present the UI.
*/
public class QaStarterAction extends Action implements QaAppConstants {
- static Logger logger = Logger.getLogger(QaStarterAction.class.getName());
-
- public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException, QaApplicationException {
-
- QaUtils.cleanUpSessionAbsolute(request);
- logger.debug("init authoring mode.");
- QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
- logger.debug("qaAuthoringForm: " + qaAuthoringForm);
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaAuthoringForm.setContentFolderID(contentFolderID);
-
- QaGeneralAuthoringDTO qaGeneralAuthoringDTO= new QaGeneralAuthoringDTO();
- qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
-
- Map mapQuestionContent= new TreeMap(new QaComparator());
- logger.debug("mapQuestionContent: " + mapQuestionContent);
-
- qaAuthoringForm.resetRadioBoxes();
-
- IQaService qaService =null;
- if ((getServlet() == null) || (getServlet().getServletContext() == null))
- {
- logger.debug("obtaining qaService from the form");
- qaService=qaAuthoringForm.getQaService();
- }
- else
- {
- logger.debug("obtaining qaService via proxy");
- qaService =QaServiceProxy.getQaService(getServlet().getServletContext());
- }
- logger.debug("qaService: " + qaService);
-
- qaGeneralAuthoringDTO.setCurrentTab("1");
- logger.debug("setting currrent tab to 1:");
-
-
- qaGeneralAuthoringDTO.setMonitoringOriginatedDefineLater(new Boolean(false).toString());
- String servletPath=request.getServletPath();
- logger.debug("getServletPath: "+ servletPath);
- String requestedModule=null;
- if (servletPath.indexOf("authoringStarter") > 0)
- {
- logger.debug("request is for authoring module");
- qaGeneralAuthoringDTO.setActiveModule(AUTHORING);
- qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
- qaGeneralAuthoringDTO.setShowAuthoringTabs(new Boolean(true).toString());
- qaAuthoringForm.setActiveModule(AUTHORING);
- requestedModule=AUTHORING;
- }
- else
- {
- logger.debug("request is for define later module either direcly from define later url or monitoring url");
- qaGeneralAuthoringDTO.setActiveModule(DEFINE_LATER);
- qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
- qaGeneralAuthoringDTO.setShowAuthoringTabs(new Boolean(false).toString());
- qaAuthoringForm.setActiveModule(DEFINE_LATER);
- requestedModule=DEFINE_LATER;
-
- if (servletPath.indexOf("monitoring") > 0)
- {
- logger.debug("request is from monitoring url.");
- qaGeneralAuthoringDTO.setMonitoringOriginatedDefineLater(new Boolean(true).toString());
- }
- }
- logger.debug("requestedModule: " + requestedModule);
- qaGeneralAuthoringDTO.setRequestedModule(requestedModule);
+ static Logger logger = Logger.getLogger(QaStarterAction.class.getName());
-
- /* in development this needs to be called only once. */
- /* QaUtils.configureContentRepository(request); */
-
- String sourceMcStarter = (String) request.getAttribute(SOURCE_MC_STARTER);
- logger.debug("sourceMcStarter: " + sourceMcStarter);
-
- boolean validateSignature=readSignature(request,mapping, qaService, qaGeneralAuthoringDTO, qaAuthoringForm);
- logger.debug("validateSignature: " + validateSignature);
- if (validateSignature == false)
- {
- logger.debug("error during validation");
- }
-
- /* mark the http session as an authoring activity */
- qaGeneralAuthoringDTO.setTargetMode(TARGET_MODE_AUTHORING);
-
- /*
- * find out whether the request is coming from monitoring module for EditActivity tab or from authoring environment url
- */
- logger.debug("no problems getting the default content, will render authoring screen");
- String strToolContentID="";
- /*the authoring url must be passed a tool content id*/
- strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
- qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
-
- SessionMap sessionMap = new SessionMap();
- List sequentialCheckedCa= new LinkedList();
- sessionMap.put(ATTACHMENT_LIST_KEY, new ArrayList());
- sessionMap.put(DELETED_ATTACHMENT_LIST_KEY, new ArrayList());
- sessionMap.put(ACTIVITY_TITLE_KEY, "");
- sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, "");
- qaAuthoringForm.setHttpSessionID(sessionMap.getSessionID());
- qaGeneralAuthoringDTO.setHttpSessionID(sessionMap.getSessionID());
-
- String defaultContentId=null;
- //pay attention here: remove request.getSession().getAttribute(TOOL_CONTENT_ID);
- if (strToolContentID == null)
- {
- /*it is possible that the original request for authoring module is coming from monitoring url which keeps the
- TOOL_CONTENT_ID in the session*/
- logger.debug("strToolContentID is null, handle this");
-
- Long toolContentID =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID);
- logger.debug("toolContentID: " + toolContentID);
- if (toolContentID != null)
- {
- strToolContentID= toolContentID.toString();
- logger.debug("cached strToolContentID from the session: " + strToolContentID);
- }
- else
- {
- logger.debug("we should IDEALLY not arrive here. The TOOL_CONTENT_ID is NOT available from the url or the session.");
- /*use default content instead of giving a warning*/
- defaultContentId=qaAuthoringForm.getDefaultContentIdStr();
- logger.debug("using MCQ defaultContentId: " + defaultContentId);
- strToolContentID=defaultContentId;
- }
- }
- logger.debug("final strToolContentID: " + strToolContentID);
-
- if ((strToolContentID == null) || (strToolContentID.equals("")))
- {
- QaUtils.cleanUpSessionAbsolute(request);
- logger.debug("forwarding to: " + ERROR_LIST);
- return (mapping.findForward(ERROR_LIST));
- }
+ @Override
+ public ActionForward execute(ActionMapping mapping, ActionForm form,
+ HttpServletRequest request, HttpServletResponse response)
+ throws IOException, ServletException, QaApplicationException {
- qaAuthoringForm.setToolContentID(strToolContentID);
+ QaUtils.cleanUpSessionAbsolute(request);
+ QaStarterAction.logger.debug("init authoring mode.");
+ QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
+ QaStarterAction.logger.debug("qaAuthoringForm: " + qaAuthoringForm);
- /*
- * find out if the passed tool content id exists in the db
- * present user either a first timer screen with default content data or fetch the existing content.
- *
- * if the toolcontentid does not exist in the db, create the default Map,
- * there is no need to check if the content is locked in this case.
- * It is always unlocked since it is the default content.
- */
-
- String defaultContentIdStr=null;
- QaContent qaContent=null;
- if (!existsContent(new Long(strToolContentID).longValue(), qaService))
- {
- logger.debug("getting default content");
- /*fetch default content*/
- defaultContentIdStr=qaAuthoringForm.getDefaultContentIdStr();
- logger.debug("defaultContentIdStr:" + defaultContentIdStr);
- qaContent=retrieveContent(request, mapping, qaAuthoringForm, mapQuestionContent,
- new Long(defaultContentIdStr).longValue(), true, qaService, qaGeneralAuthoringDTO, sessionMap);
-
- logger.debug("post retrive content :" + sessionMap);
+ String contentFolderID = WebUtil.readStrParam(request,
+ AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ QaStarterAction.logger.debug("contentFolderID: " + contentFolderID);
+ qaAuthoringForm.setContentFolderID(contentFolderID);
- }
- else
- {
- logger.debug("getting existing content");
- /* it is possible that the content is in use by learners.*/
- qaContent=qaService.loadQa(new Long(strToolContentID).longValue());
- logger.debug("qaContent: " + qaContent);
- if (qaService.studentActivityOccurredGlobal(qaContent))
- {
- QaUtils.cleanUpSessionAbsolute(request);
- logger.debug("student activity occurred on this content:" + qaContent);
- persistError(request, "error.content.inUse");
- logger.debug("add error.content.inUse to ActionMessages.");
- return (mapping.findForward(ERROR_LIST));
- }
- qaContent=retrieveContent(request, mapping, qaAuthoringForm, mapQuestionContent,
- new Long(strToolContentID).longValue(),false, qaService, qaGeneralAuthoringDTO, sessionMap);
-
- logger.debug("post retrive content :" + sessionMap);
- }
-
- logger.debug("qaGeneralAuthoringDTO.getOnlineInstructions() :" + qaGeneralAuthoringDTO.getOnlineInstructions());
- logger.debug("qaGeneralAuthoringDTO.getOfflineInstructions():" + qaGeneralAuthoringDTO.getOfflineInstructions());
-
- if ((qaGeneralAuthoringDTO.getOnlineInstructions() == null) || (qaGeneralAuthoringDTO.getOnlineInstructions().length() == 0))
- {
- qaGeneralAuthoringDTO.setOnlineInstructions(DEFAULT_ONLINE_INST);
- qaAuthoringForm.setOnlineInstructions(DEFAULT_ONLINE_INST);
- sessionMap.put(ONLINE_INSTRUCTIONS_KEY, DEFAULT_ONLINE_INST);
+ QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO();
+ qaGeneralAuthoringDTO.setContentFolderID(contentFolderID);
+
+ Map mapQuestionContent = new TreeMap(new QaComparator());
+ QaStarterAction.logger.debug("mapQuestionContent: "
+ + mapQuestionContent);
+
+ qaAuthoringForm.resetRadioBoxes();
+
+ IQaService qaService = null;
+ if (getServlet() == null || getServlet().getServletContext() == null) {
+ QaStarterAction.logger.debug("obtaining qaService from the form");
+ qaService = qaAuthoringForm.getQaService();
+ } else {
+ QaStarterAction.logger.debug("obtaining qaService via proxy");
+ qaService = QaServiceProxy.getQaService(getServlet()
+ .getServletContext());
+ }
+ QaStarterAction.logger.debug("qaService: " + qaService);
+
+ qaGeneralAuthoringDTO.setCurrentTab("1");
+ QaStarterAction.logger.debug("setting currrent tab to 1:");
+
+ qaGeneralAuthoringDTO.setMonitoringOriginatedDefineLater(new Boolean(
+ false).toString());
+ String servletPath = request.getServletPath();
+ QaStarterAction.logger.debug("getServletPath: " + servletPath);
+ String requestedModule = null;
+ if (servletPath.indexOf("authoringStarter") > 0) {
+ QaStarterAction.logger.debug("request is for authoring module");
+ qaGeneralAuthoringDTO.setActiveModule(QaAppConstants.AUTHORING);
+ qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true)
+ .toString());
+ qaGeneralAuthoringDTO.setShowAuthoringTabs(new Boolean(true)
+ .toString());
+ qaAuthoringForm.setActiveModule(QaAppConstants.AUTHORING);
+ requestedModule = QaAppConstants.AUTHORING;
+ } else {
+ QaStarterAction.logger
+ .debug("request is for define later module either direcly from define later url or monitoring url");
+ qaGeneralAuthoringDTO.setActiveModule(QaAppConstants.DEFINE_LATER);
+ qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true)
+ .toString());
+ qaGeneralAuthoringDTO.setShowAuthoringTabs(new Boolean(false)
+ .toString());
+ qaAuthoringForm.setActiveModule(QaAppConstants.DEFINE_LATER);
+ requestedModule = QaAppConstants.DEFINE_LATER;
+
+ if (servletPath.indexOf("monitoring") > 0) {
+ QaStarterAction.logger
+ .debug("request is from monitoring url.");
+ qaGeneralAuthoringDTO
+ .setMonitoringOriginatedDefineLater(new Boolean(true)
+ .toString());
}
-
- if ((qaGeneralAuthoringDTO.getOfflineInstructions() == null) || (qaGeneralAuthoringDTO.getOfflineInstructions().length() == 0))
- {
- qaGeneralAuthoringDTO.setOfflineInstructions(DEFAULT_OFFLINE_INST);
- qaAuthoringForm.setOfflineInstructions(DEFAULT_OFFLINE_INST);
- sessionMap.put(OFFLINE_INSTRUCTIONS_KEY, DEFAULT_OFFLINE_INST);
- }
+ }
+ QaStarterAction.logger.debug("requestedModule: " + requestedModule);
+ qaGeneralAuthoringDTO.setRequestedModule(requestedModule);
-
- logger.debug("final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- logger.debug("will return to jsp with: " + sourceMcStarter);
- String destination=QaUtils.getDestination(sourceMcStarter, requestedModule);
- logger.debug("destination: " + destination);
-
- Map mapQuestionContentLocal=qaGeneralAuthoringDTO.getMapQuestionContent();
- logger.debug("mapQuestionContentLocal: " + mapQuestionContentLocal);
-
- logger.debug("mapQuestionContent: " + mapQuestionContent);
- sessionMap.put(MAP_QUESTION_CONTENT_KEY, mapQuestionContent);
-
- logger.debug("persisting sessionMap into session: " + sessionMap);
- request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap);
-
- logger.debug("before fwding to jsp, qaAuthoringForm : " + qaAuthoringForm);
- logger.debug("final qaGeneralAuthoringDTO: " + qaGeneralAuthoringDTO);
- request.setAttribute(QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO);
-
- return (mapping.findForward(destination));
- }
-
-
-
- /**
- * retrives the existing content information from the db and prepares the data for presentation purposes.
- * ActionForward retrieveExistingContent(HttpServletRequest request, ActionMapping mapping, QaAuthoringForm qaAuthoringForm, Map mapQuestionContent, long toolContentID)
- *
- * @param request
- * @param mapping
- * @param qaAuthoringForm
- * @param mapQuestionContent
- * @param toolContentID
- * @return ActionForward
- */
- protected QaContent retrieveContent(HttpServletRequest request, ActionMapping mapping, QaAuthoringForm qaAuthoringForm,
- Map mapQuestionContent, long toolContentID, boolean isDefaultContent, IQaService qaService,
- QaGeneralAuthoringDTO qaGeneralAuthoringDTO, SessionMap sessionMap)
- {
- logger.debug("starting retrieveContent: " + qaService);
- logger.debug("toolContentID: " + toolContentID);
- logger.debug("isDefaultContent: " + isDefaultContent);
+ /* in development this needs to be called only once. */
+ /* QaUtils.configureContentRepository(request); */
- logger.debug("getting content with id:" + toolContentID);
- QaContent qaContent = qaService.retrieveQa(toolContentID);
- logger.debug("QaContent: " + qaContent);
-
- QaUtils.populateAuthoringDTO(request, qaContent, qaGeneralAuthoringDTO);
-
- qaAuthoringForm.setUsernameVisible(qaContent.isUsernameVisible()?"1":"0");
- qaAuthoringForm.setShowOtherAnswers(qaContent.isShowOtherAnswers()?"1":"0");
- qaAuthoringForm.setSynchInMonitor(qaContent.isSynchInMonitor()?"1":"0");
- qaAuthoringForm.setQuestionsSequenced(qaContent.isQuestionsSequenced()?"1":"0");
- qaAuthoringForm.setLockWhenFinished(qaContent.isLockWhenFinished()?"1":"0");
-
- qaGeneralAuthoringDTO.setReflect(qaContent.isReflect()?"1":"0");
-
- logger.debug("QaContent isReflect: " + qaContent.isReflect());
- qaAuthoringForm.setReflect(qaContent.isReflect()?"1":"0");
-
- qaAuthoringForm.setReflectionSubject(qaContent.getReflectionSubject());
- qaGeneralAuthoringDTO.setReflectionSubject(qaContent.getReflectionSubject());
-
- List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
- qaGeneralAuthoringDTO.setAttachmentList(attachmentList);
- qaGeneralAuthoringDTO.setDeletedAttachmentList(new ArrayList());
+ String sourceMcStarter = (String) request
+ .getAttribute(QaAppConstants.SOURCE_MC_STARTER);
+ QaStarterAction.logger.debug("sourceMcStarter: " + sourceMcStarter);
- sessionMap.put(ATTACHMENT_LIST_KEY, attachmentList);
- sessionMap.put(DELETED_ATTACHMENT_LIST_KEY, new ArrayList());
+ boolean validateSignature = readSignature(request, mapping, qaService,
+ qaGeneralAuthoringDTO, qaAuthoringForm);
+ QaStarterAction.logger
+ .debug("validateSignature: " + validateSignature);
+ if (validateSignature == false) {
+ QaStarterAction.logger.debug("error during validation");
+ }
+ /* mark the http session as an authoring activity */
+ qaGeneralAuthoringDTO
+ .setTargetMode(QaAppConstants.TARGET_MODE_AUTHORING);
- qaGeneralAuthoringDTO.setIsDefineLater(new Boolean(qaContent.isDefineLater()).toString());
-
- qaGeneralAuthoringDTO.setActivityTitle(qaContent.getTitle());
- qaAuthoringForm.setTitle(qaContent.getTitle());
+ /*
+ * find out whether the request is coming from monitoring module for
+ * EditActivity tab or from authoring environment url
+ */
+ QaStarterAction.logger
+ .debug("no problems getting the default content, will render authoring screen");
+ String strToolContentID = "";
+ /* the authoring url must be passed a tool content id */
+ strToolContentID = request
+ .getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ QaStarterAction.logger.debug("strToolContentID: " + strToolContentID);
+ qaGeneralAuthoringDTO.setToolContentID(strToolContentID);
- qaGeneralAuthoringDTO.setActivityInstructions( qaContent.getInstructions());
- qaAuthoringForm.setInstructions(qaContent.getInstructions());
-
- sessionMap.put(ACTIVITY_TITLE_KEY, qaGeneralAuthoringDTO.getActivityTitle());
- sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, qaGeneralAuthoringDTO.getActivityInstructions());
+ SessionMap sessionMap = new SessionMap();
+ List sequentialCheckedCa = new LinkedList();
+ sessionMap.put(QaAppConstants.ATTACHMENT_LIST_KEY, new ArrayList());
+ sessionMap.put(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY,
+ new ArrayList());
+ sessionMap.put(QaAppConstants.ACTIVITY_TITLE_KEY, "");
+ sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, "");
+ qaAuthoringForm.setHttpSessionID(sessionMap.getSessionID());
+ qaGeneralAuthoringDTO.setHttpSessionID(sessionMap.getSessionID());
-
- List listQuestionContentDTO= new LinkedList();
-
+ String defaultContentId = null;
+ // pay attention here: remove
+ // request.getSession().getAttribute(TOOL_CONTENT_ID);
+ if (strToolContentID == null) {
/*
- * get the existing question content
- */
- logger.debug("setting content data from the db");
- mapQuestionContent.clear();
- Iterator queIterator=qaContent.getQaQueContents().iterator();
- Long mapIndex=new Long(1);
- logger.debug("mapQuestionContent: " + mapQuestionContent);
- while (queIterator.hasNext())
- {
- QaQuestionContentDTO qaQuestionContentDTO=new QaQuestionContentDTO();
-
- QaQueContent qaQueContent=(QaQueContent) queIterator.next();
- if (qaQueContent != null)
- {
- logger.debug("question: " + qaQueContent.getQuestion());
- logger.debug("displayorder: " + new Integer(qaQueContent.getDisplayOrder()).toString());
- logger.debug("feedback: " + qaQueContent.getFeedback());
-
- mapQuestionContent.put(mapIndex.toString(),qaQueContent.getQuestion());
-
- qaQuestionContentDTO.setQuestion(qaQueContent.getQuestion());
- qaQuestionContentDTO.setDisplayOrder(new Integer(qaQueContent.getDisplayOrder()).toString());
- qaQuestionContentDTO.setFeedback(qaQueContent.getFeedback());
- listQuestionContentDTO.add(qaQuestionContentDTO);
- /**
- * make the first entry the default(first) one for jsp
- */
- if (mapIndex.longValue() == 1)
- qaGeneralAuthoringDTO.setDefaultQuestionContent(qaQueContent.getQuestion());
- mapIndex=new Long(mapIndex.longValue()+1);
- }
- }
- logger.debug("Map initialized with existing contentid to: " + mapQuestionContent);
-
- request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(mapQuestionContent.size()));
-
-
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
- request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
- sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
-
-
- if (isDefaultContent)
- {
- logger.debug("overwriting default question.");
- qaGeneralAuthoringDTO.setDefaultQuestionContent("Sample Question 1?");
-
- }
-
- logger.debug("mapQuestionContent is:" + mapQuestionContent);
- qaGeneralAuthoringDTO.setMapQuestionContent(mapQuestionContent);
+ * it is possible that the original request for authoring module is
+ * coming from monitoring url which keeps the TOOL_CONTENT_ID in the
+ * session
+ */
+ QaStarterAction.logger
+ .debug("strToolContentID is null, handle this");
-
- logger.debug("qaContent.getOnlineInstructions():" + qaContent.getOnlineInstructions());
- logger.debug("qaContent.getOfflineInstructions():" + qaContent.getOfflineInstructions());
- qaGeneralAuthoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions());
- qaGeneralAuthoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions());
-
- qaAuthoringForm.setOnlineInstructions(qaContent.getOnlineInstructions());
- qaAuthoringForm.setOfflineInstructions(qaContent.getOfflineInstructions());
- sessionMap.put(ONLINE_INSTRUCTIONS_KEY, qaContent.getOnlineInstructions());
- sessionMap.put(OFFLINE_INSTRUCTIONS_KEY, qaContent.getOfflineInstructions());
-
- logger.debug("ACTIVITY_TITLE_KEY set to:" + sessionMap.get(ACTIVITY_TITLE_KEY ));
-
- qaAuthoringForm.resetUserAction();
- logger.debug("returning qaContent:" + qaContent);
- return qaContent;
+ Long toolContentID = (Long) request.getSession().getAttribute(
+ QaAppConstants.TOOL_CONTENT_ID);
+ QaStarterAction.logger.debug("toolContentID: " + toolContentID);
+ if (toolContentID != null) {
+ strToolContentID = toolContentID.toString();
+ QaStarterAction.logger
+ .debug("cached strToolContentID from the session: "
+ + strToolContentID);
+ } else {
+ QaStarterAction.logger
+ .debug("we should IDEALLY not arrive here. The TOOL_CONTENT_ID is NOT available from the url or the session.");
+ /* use default content instead of giving a warning */
+ defaultContentId = qaAuthoringForm.getDefaultContentIdStr();
+ QaStarterAction.logger.debug("using MCQ defaultContentId: "
+ + defaultContentId);
+ strToolContentID = defaultContentId;
+ }
}
+ QaStarterAction.logger.debug("final strToolContentID: "
+ + strToolContentID);
-
- /**
- * each tool has a signature. QA 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.
+ if (strToolContentID == null || strToolContentID.equals("")) {
+ QaUtils.cleanUpSessionAbsolute(request);
+ QaStarterAction.logger.debug("forwarding to: "
+ + QaAppConstants.ERROR_LIST);
+ return mapping.findForward(QaAppConstants.ERROR_LIST);
+ }
+
+ qaAuthoringForm.setToolContentID(strToolContentID);
+
+ /*
+ * find out if the passed tool content id exists in the db present user
+ * either a first timer screen with default content data or fetch the
+ * existing content.
*
- * readSignature(HttpServletRequest request, ActionMapping mapping)
- * @param request
- * @param mapping
- * @return ActionForward
+ * if the toolcontentid does not exist in the db, create the default
+ * Map, there is no need to check if the content is locked in this case.
+ * It is always unlocked since it is the default content.
*/
- public boolean readSignature(HttpServletRequest request, ActionMapping mapping, IQaService qaService,
- QaGeneralAuthoringDTO qaGeneralAuthoringDTO, QaAuthoringForm qaAuthoringForm)
- {
- logger.debug("qaService: " + qaService);
- /*
- * retrieve the default content id based on tool signature
+
+ String defaultContentIdStr = null;
+ QaContent qaContent = null;
+ if (!existsContent(new Long(strToolContentID).longValue(), qaService)) {
+ QaStarterAction.logger.debug("getting default content");
+ /* fetch default content */
+ defaultContentIdStr = qaAuthoringForm.getDefaultContentIdStr();
+ QaStarterAction.logger.debug("defaultContentIdStr:"
+ + defaultContentIdStr);
+ qaContent = retrieveContent(request, mapping, qaAuthoringForm,
+ mapQuestionContent, new Long(defaultContentIdStr)
+ .longValue(), true, qaService,
+ qaGeneralAuthoringDTO, sessionMap);
+
+ QaStarterAction.logger.debug("post retrive content :" + sessionMap);
+
+ } else {
+ QaStarterAction.logger.debug("getting existing content");
+ /* it is possible that the content is in use by learners. */
+ qaContent = qaService
+ .loadQa(new Long(strToolContentID).longValue());
+ QaStarterAction.logger.debug("qaContent: " + qaContent);
+ if (qaService.studentActivityOccurredGlobal(qaContent)) {
+ QaUtils.cleanUpSessionAbsolute(request);
+ QaStarterAction.logger
+ .debug("student activity occurred on this content:"
+ + qaContent);
+ persistError(request, "error.content.inUse");
+ QaStarterAction.logger
+ .debug("add error.content.inUse to ActionMessages.");
+ return mapping.findForward(QaAppConstants.ERROR_LIST);
+ }
+ qaContent = retrieveContent(request, mapping, qaAuthoringForm,
+ mapQuestionContent, new Long(strToolContentID).longValue(),
+ false, qaService, qaGeneralAuthoringDTO, sessionMap);
+
+ QaStarterAction.logger.debug("post retrive content :" + sessionMap);
+ }
+
+ QaStarterAction.logger
+ .debug("qaGeneralAuthoringDTO.getOnlineInstructions() :"
+ + qaGeneralAuthoringDTO.getOnlineInstructions());
+ QaStarterAction.logger
+ .debug("qaGeneralAuthoringDTO.getOfflineInstructions():"
+ + qaGeneralAuthoringDTO.getOfflineInstructions());
+
+ if (qaGeneralAuthoringDTO.getOnlineInstructions() == null
+ || qaGeneralAuthoringDTO.getOnlineInstructions().length() == 0) {
+ qaGeneralAuthoringDTO
+ .setOnlineInstructions(QaAppConstants.DEFAULT_ONLINE_INST);
+ qaAuthoringForm
+ .setOnlineInstructions(QaAppConstants.DEFAULT_ONLINE_INST);
+ sessionMap.put(QaAppConstants.ONLINE_INSTRUCTIONS_KEY,
+ QaAppConstants.DEFAULT_ONLINE_INST);
+ }
+
+ if (qaGeneralAuthoringDTO.getOfflineInstructions() == null
+ || qaGeneralAuthoringDTO.getOfflineInstructions().length() == 0) {
+ qaGeneralAuthoringDTO
+ .setOfflineInstructions(QaAppConstants.DEFAULT_OFFLINE_INST);
+ qaAuthoringForm
+ .setOfflineInstructions(QaAppConstants.DEFAULT_OFFLINE_INST);
+ sessionMap.put(QaAppConstants.OFFLINE_INSTRUCTIONS_KEY,
+ QaAppConstants.DEFAULT_OFFLINE_INST);
+ }
+
+ SortedSet conditionList = getTaskListConditionList(sessionMap);
+ conditionList.clear();
+ conditionList.addAll(qaContent.getConditions());
+
+ sessionMap.put(QaAppConstants.ATTR_QA_AUTHORING_FORM, qaAuthoringForm);
+
+ QaStarterAction.logger.debug("final qaGeneralAuthoringDTO: "
+ + qaGeneralAuthoringDTO);
+ QaStarterAction.logger.debug("will return to jsp with: "
+ + sourceMcStarter);
+ String destination = QaUtils.getDestination(sourceMcStarter,
+ requestedModule);
+ QaStarterAction.logger.debug("destination: " + destination);
+
+ Map mapQuestionContentLocal = qaGeneralAuthoringDTO
+ .getMapQuestionContent();
+ QaStarterAction.logger.debug("mapQuestionContentLocal: "
+ + mapQuestionContentLocal);
+
+ QaStarterAction.logger.debug("mapQuestionContent: "
+ + mapQuestionContent);
+ sessionMap.put(QaAppConstants.MAP_QUESTION_CONTENT_KEY,
+ mapQuestionContent);
+
+ QaStarterAction.logger.debug("persisting sessionMap into session: "
+ + sessionMap);
+ request.getSession()
+ .setAttribute(sessionMap.getSessionID(), sessionMap);
+
+ QaStarterAction.logger.debug("before fwding to jsp, qaAuthoringForm : "
+ + qaAuthoringForm);
+ QaStarterAction.logger.debug("final qaGeneralAuthoringDTO: "
+ + qaGeneralAuthoringDTO);
+ request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO,
+ qaGeneralAuthoringDTO);
+
+ return mapping.findForward(destination);
+ }
+
+ /**
+ * retrives the existing content information from the db and prepares the
+ * data for presentation purposes. ActionForward
+ * retrieveExistingContent(HttpServletRequest request, ActionMapping
+ * mapping, QaAuthoringForm qaAuthoringForm, Map mapQuestionContent, long
+ * toolContentID)
+ *
+ * @param request
+ * @param mapping
+ * @param qaAuthoringForm
+ * @param mapQuestionContent
+ * @param toolContentID
+ * @return ActionForward
+ */
+ protected QaContent retrieveContent(HttpServletRequest request,
+ ActionMapping mapping, QaAuthoringForm qaAuthoringForm,
+ Map mapQuestionContent, long toolContentID,
+ boolean isDefaultContent, IQaService qaService,
+ QaGeneralAuthoringDTO qaGeneralAuthoringDTO, SessionMap sessionMap) {
+ QaStarterAction.logger.debug("starting retrieveContent: " + qaService);
+ QaStarterAction.logger.debug("toolContentID: " + toolContentID);
+ QaStarterAction.logger.debug("isDefaultContent: " + isDefaultContent);
+
+ QaStarterAction.logger
+ .debug("getting content with id:" + toolContentID);
+ QaContent qaContent = qaService.retrieveQa(toolContentID);
+ QaStarterAction.logger.debug("QaContent: " + qaContent);
+
+ QaUtils.populateAuthoringDTO(request, qaContent, qaGeneralAuthoringDTO);
+
+ qaAuthoringForm.setUsernameVisible(qaContent.isUsernameVisible() ? "1"
+ : "0");
+ qaAuthoringForm
+ .setShowOtherAnswers(qaContent.isShowOtherAnswers() ? "1" : "0");
+ qaAuthoringForm.setSynchInMonitor(qaContent.isSynchInMonitor() ? "1"
+ : "0");
+ qaAuthoringForm
+ .setQuestionsSequenced(qaContent.isQuestionsSequenced() ? "1"
+ : "0");
+ qaAuthoringForm
+ .setLockWhenFinished(qaContent.isLockWhenFinished() ? "1" : "0");
+
+ qaGeneralAuthoringDTO.setReflect(qaContent.isReflect() ? "1" : "0");
+
+ QaStarterAction.logger.debug("QaContent isReflect: "
+ + qaContent.isReflect());
+ qaAuthoringForm.setReflect(qaContent.isReflect() ? "1" : "0");
+
+ qaAuthoringForm.setReflectionSubject(qaContent.getReflectionSubject());
+ qaGeneralAuthoringDTO.setReflectionSubject(qaContent
+ .getReflectionSubject());
+
+ List attachmentList = qaService.retrieveQaUploadedFiles(qaContent);
+ qaGeneralAuthoringDTO.setAttachmentList(attachmentList);
+ qaGeneralAuthoringDTO.setDeletedAttachmentList(new ArrayList());
+
+ sessionMap.put(QaAppConstants.ATTACHMENT_LIST_KEY, attachmentList);
+ sessionMap.put(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY,
+ new ArrayList());
+
+ qaGeneralAuthoringDTO.setIsDefineLater(new Boolean(qaContent
+ .isDefineLater()).toString());
+
+ qaGeneralAuthoringDTO.setActivityTitle(qaContent.getTitle());
+ qaAuthoringForm.setTitle(qaContent.getTitle());
+
+ qaGeneralAuthoringDTO.setActivityInstructions(qaContent
+ .getInstructions());
+ qaAuthoringForm.setInstructions(qaContent.getInstructions());
+
+ sessionMap.put(QaAppConstants.ACTIVITY_TITLE_KEY, qaGeneralAuthoringDTO
+ .getActivityTitle());
+ sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY,
+ qaGeneralAuthoringDTO.getActivityInstructions());
+
+ List listQuestionContentDTO = new LinkedList();
+
+ /*
+ * get the existing question content
+ */
+ QaStarterAction.logger.debug("setting content data from the db");
+ mapQuestionContent.clear();
+ Iterator queIterator = qaContent.getQaQueContents().iterator();
+ Long mapIndex = new Long(1);
+ QaStarterAction.logger.debug("mapQuestionContent: "
+ + mapQuestionContent);
+ while (queIterator.hasNext()) {
+ QaQuestionContentDTO qaQuestionContentDTO = new QaQuestionContentDTO();
+
+ QaQueContent qaQueContent = (QaQueContent) queIterator.next();
+ if (qaQueContent != null) {
+ QaStarterAction.logger.debug("question: "
+ + qaQueContent.getQuestion());
+ QaStarterAction.logger.debug("displayorder: "
+ + new Integer(qaQueContent.getDisplayOrder())
+ .toString());
+ QaStarterAction.logger.debug("feedback: "
+ + qaQueContent.getFeedback());
+
+ mapQuestionContent.put(mapIndex.toString(), qaQueContent
+ .getQuestion());
+
+ qaQuestionContentDTO.setQuestion(qaQueContent.getQuestion());
+ qaQuestionContentDTO.setDisplayOrder(new Integer(qaQueContent
+ .getDisplayOrder()).toString());
+ qaQuestionContentDTO.setFeedback(qaQueContent.getFeedback());
+ listQuestionContentDTO.add(qaQuestionContentDTO);
+ /**
+ * make the first entry the default(first) one for jsp
*/
- long defaultContentID=0;
- try
- {
- logger.debug("attempt retrieving tool with signatute : " + MY_SIGNATURE);
- defaultContentID=qaService.getToolDefaultContentIdBySignature(MY_SIGNATURE);
- logger.debug("retrieved tool default contentId: " + defaultContentID);
- if (defaultContentID == 0)
- {
- logger.debug("default content id has not been setup");
- return false;
- }
+ if (mapIndex.longValue() == 1) {
+ qaGeneralAuthoringDTO
+ .setDefaultQuestionContent(qaQueContent
+ .getQuestion());
}
- catch(Exception e)
- {
- logger.debug("error getting the default content id: " + e.getMessage());
- persistError(request,"error.defaultContent.notSetup");
- return false;
- }
+ mapIndex = new Long(mapIndex.longValue() + 1);
+ }
+ }
+ QaStarterAction.logger
+ .debug("Map initialized with existing contentid to: "
+ + mapQuestionContent);
-
- /* retrieve uid of the content based on default content id determined above */
- long contentUID=0;
- try
- {
- logger.debug("retrieve uid of the content based on default content id determined above: " + defaultContentID);
- QaContent qaContent=qaService.loadQa(defaultContentID);
- if (qaContent == null)
- {
- logger.debug("Exception occured: No default content");
- persistError(request,"error.defaultContent.notSetup");
- return false;
- }
- logger.debug("using qaContent: " + qaContent);
- logger.debug("using qaContent uid: " + qaContent.getUid());
- contentUID=qaContent.getUid().longValue();
- logger.debug("contentUID: " + contentUID);
+ request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(
+ mapQuestionContent.size()));
+
+ QaStarterAction.logger.debug("listQuestionContentDTO: "
+ + listQuestionContentDTO);
+ request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO,
+ listQuestionContentDTO);
+ sessionMap.put(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY,
+ listQuestionContentDTO);
+
+ SortedSet conditionSet = new TreeSet(
+ new QaConditionComparator());
+ for (QaCondition condition : qaContent.getConditions()) {
+ conditionSet.add(condition);
+ for (QaQuestionContentDTO dto : (List) listQuestionContentDTO) {
+ if (dto.getDisplayOrder().equals(
+ String.valueOf(condition.getOrderId()))) {
+ condition.temporaryQuestionDTOSet.add(dto);
}
- catch(Exception e)
- {
- logger.debug("Exception occured: No default question content");
- persistError(request,"error.defaultContent.notSetup");
- return false;
- }
+ }
+ }
+ sessionMap.put(QaAppConstants.ATTR_CONDITION_SET, conditionSet);
-
- logger.debug("QA tool has the default content id: " + defaultContentID);
- qaGeneralAuthoringDTO.setDefaultContentIdStr(new Long(defaultContentID).toString());
- qaAuthoringForm.setDefaultContentIdStr(new Long(defaultContentID).toString());
-
- return true;
+ if (isDefaultContent) {
+ QaStarterAction.logger.debug("overwriting default question.");
+ qaGeneralAuthoringDTO
+ .setDefaultQuestionContent("Sample Question 1?");
+
}
-
-
-
- /**
- * existsContent(long toolContentID)
- * @param long toolContentID
- * @return boolean
- * determine whether a specific toolContentID exists in the db
+
+ QaStarterAction.logger.debug("mapQuestionContent is:"
+ + mapQuestionContent);
+ qaGeneralAuthoringDTO.setMapQuestionContent(mapQuestionContent);
+
+ QaStarterAction.logger.debug("qaContent.getOnlineInstructions():"
+ + qaContent.getOnlineInstructions());
+ QaStarterAction.logger.debug("qaContent.getOfflineInstructions():"
+ + qaContent.getOfflineInstructions());
+ qaGeneralAuthoringDTO.setOnlineInstructions(qaContent
+ .getOnlineInstructions());
+ qaGeneralAuthoringDTO.setOfflineInstructions(qaContent
+ .getOfflineInstructions());
+
+ qaAuthoringForm
+ .setOnlineInstructions(qaContent.getOnlineInstructions());
+ qaAuthoringForm.setOfflineInstructions(qaContent
+ .getOfflineInstructions());
+ sessionMap.put(QaAppConstants.ONLINE_INSTRUCTIONS_KEY, qaContent
+ .getOnlineInstructions());
+ sessionMap.put(QaAppConstants.OFFLINE_INSTRUCTIONS_KEY, qaContent
+ .getOfflineInstructions());
+
+ QaStarterAction.logger.debug("ACTIVITY_TITLE_KEY set to:"
+ + sessionMap.get(QaAppConstants.ACTIVITY_TITLE_KEY));
+
+ qaAuthoringForm.resetUserAction();
+ QaStarterAction.logger.debug("returning qaContent:" + qaContent);
+ return qaContent;
+ }
+
+ /**
+ * each tool has a signature. QA 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.
+ *
+ * readSignature(HttpServletRequest request, ActionMapping mapping)
+ *
+ * @param request
+ * @param mapping
+ * @return ActionForward
+ */
+ public boolean readSignature(HttpServletRequest request,
+ ActionMapping mapping, IQaService qaService,
+ QaGeneralAuthoringDTO qaGeneralAuthoringDTO,
+ QaAuthoringForm qaAuthoringForm) {
+ QaStarterAction.logger.debug("qaService: " + qaService);
+ /*
+ * retrieve the default content id based on tool signature
*/
- protected boolean existsContent(long toolContentID, IQaService qaService)
- {
- QaContent qaContent=qaService.loadQa(toolContentID);
- if (qaContent == null)
- return false;
-
- return true;
+ long defaultContentID = 0;
+ try {
+ QaStarterAction.logger
+ .debug("attempt retrieving tool with signatute : "
+ + QaAppConstants.MY_SIGNATURE);
+ defaultContentID = qaService
+ .getToolDefaultContentIdBySignature(QaAppConstants.MY_SIGNATURE);
+ QaStarterAction.logger.debug("retrieved tool default contentId: "
+ + defaultContentID);
+ if (defaultContentID == 0) {
+ QaStarterAction.logger
+ .debug("default content id has not been setup");
+ return false;
+ }
+ } catch (Exception e) {
+ QaStarterAction.logger
+ .debug("error getting the default content id: "
+ + e.getMessage());
+ persistError(request, "error.defaultContent.notSetup");
+ return false;
}
-
-
- /**
- * bridges define later url request to authoring functionality
- *
- * executeDefineLater(ActionMapping mapping, ActionForm form,
- HttpServletRequest request, HttpServletResponse response, IQaService qaService)
- throws IOException, ServletException, QaApplicationException
- *
- * @param mapping
- * @param form
- * @param request
- * @param response
- * @param qaService
- * @return
- * @throws IOException
- * @throws ServletException
- * @throws QaApplicationException
+
+ /*
+ * retrieve uid of the content based on default content id determined
+ * above
*/
- public ActionForward executeDefineLater(ActionMapping mapping, QaAuthoringForm qaAuthoringForm,
- HttpServletRequest request, HttpServletResponse response, IQaService qaService)
- throws IOException, ServletException, QaApplicationException {
- logger.debug("calling execute..., qaService will be needed next.");
- return execute(mapping, qaAuthoringForm, request, response);
+ long contentUID = 0;
+ try {
+ QaStarterAction.logger
+ .debug("retrieve uid of the content based on default content id determined above: "
+ + defaultContentID);
+ QaContent qaContent = qaService.loadQa(defaultContentID);
+ if (qaContent == null) {
+ QaStarterAction.logger
+ .debug("Exception occured: No default content");
+ persistError(request, "error.defaultContent.notSetup");
+ return false;
+ }
+ QaStarterAction.logger.debug("using qaContent: " + qaContent);
+ QaStarterAction.logger.debug("using qaContent uid: "
+ + qaContent.getUid());
+ contentUID = qaContent.getUid().longValue();
+ QaStarterAction.logger.debug("contentUID: " + contentUID);
+ } catch (Exception e) {
+ QaStarterAction.logger
+ .debug("Exception occured: No default question content");
+ persistError(request, "error.defaultContent.notSetup");
+ return false;
}
-
- /**
+ QaStarterAction.logger.debug("QA tool has the default content id: "
+ + defaultContentID);
+ qaGeneralAuthoringDTO.setDefaultContentIdStr(new Long(defaultContentID)
+ .toString());
+ qaAuthoringForm.setDefaultContentIdStr(new Long(defaultContentID)
+ .toString());
+
+ return true;
+ }
+
+ /**
+ * existsContent(long toolContentID)
+ *
+ * @param long
+ * toolContentID
+ * @return boolean determine whether a specific toolContentID exists in the
+ * db
+ */
+ protected boolean existsContent(long toolContentID, IQaService qaService) {
+ QaContent qaContent = qaService.loadQa(toolContentID);
+ if (qaContent == null) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * bridges define later url request to authoring functionality
+ *
+ * executeDefineLater(ActionMapping mapping, ActionForm form,
+ * HttpServletRequest request, HttpServletResponse response, IQaService
+ * qaService) throws IOException, ServletException, QaApplicationException
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @param qaService
+ * @return
+ * @throws IOException
+ * @throws ServletException
+ * @throws QaApplicationException
+ */
+ public ActionForward executeDefineLater(ActionMapping mapping,
+ QaAuthoringForm qaAuthoringForm, HttpServletRequest request,
+ HttpServletResponse response, IQaService qaService)
+ throws IOException, ServletException, QaApplicationException {
+ QaStarterAction.logger
+ .debug("calling execute..., qaService will be needed next.");
+ return execute(mapping, qaAuthoringForm, request, response);
+ }
+
+ /**
* 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));
- logger.debug("add " + message +" to ActionMessages:");
- saveErrors(request,errors);
- }
-}
+ public void persistError(HttpServletRequest request, String message) {
+ ActionMessages errors = new ActionMessages();
+ errors.add(Globals.ERROR_KEY, new ActionMessage(message));
+ QaStarterAction.logger.debug("add " + message + " to ActionMessages:");
+ saveErrors(request, errors);
+ }
+ private SortedSet getTaskListConditionList(
+ SessionMap sessionMap) {
+ SortedSet list = (SortedSet) sessionMap
+ .get(QaAppConstants.ATTR_CONDITION_SET);
+ if (list == null) {
+ list = new TreeSet(new QaConditionComparator());
+ sessionMap.put(QaAppConstants.ATTR_CONDITION_SET, list);
+ }
+ return list;
+ }
+}
Index: lams_tool_laqa/web/WEB-INF/lams.tld
===================================================================
diff -u -rc5b655c3c11fa9d9b1d76e0ef602acf6363e45f9 -r0af4ed13b963a588f3499b080801863d57f8ad95
--- lams_tool_laqa/web/WEB-INF/lams.tld (.../lams.tld) (revision c5b655c3c11fa9d9b1d76e0ef602acf6363e45f9)
+++ lams_tool_laqa/web/WEB-INF/lams.tld (.../lams.tld) (revision 0af4ed13b963a588f3499b080801863d57f8ad95)
@@ -13,28 +13,36 @@
- Output the basic URL for the current webapp. e.g. http://server/lams/tool/nb11/
- Base URL for the current web app
+ Output the Server URL as defined in the lams.xml configuration file.
+ LAMS URL
- WebAppURL
- org.lamsfoundation.lams.web.tag.WebAppURLTag
+ LAMSURL
+ org.lamsfoundation.lams.web.tag.LAMSURLTag
empty
- Output a random number for the learner and passon flash movies to communicate directly.
- generate unique ID
+ Converts text from \n or \r\n to <BR> before rendering
+ Converts text from \n or \r\n to <BR> before rendering
- generateID
- org.lamsfoundation.lams.web.tag.GenerateIDTag
+ out
+ org.lamsfoundation.lams.web.tag.MultiLinesOutputTag
empty
- Output a random number for the learner and passon flash movies to communicate directly.
- id
+ Converts text from \n or \r\n to <BR> before rendering
+ value
+ true
+
+ true
+
+
+
+ Converts text from \n or \r\n to <BR> before rendering
+ escapeHtml
false
true
@@ -44,6 +52,26 @@
+ Render html tag with direction and language
+ Render html tag with direction and language
+
+
+ html
+ org.lamsfoundation.lams.web.tag.HtmlTag
+ JSP
+
+
+ Render html tag with direction and language
+ xhtml
+ false
+
+ true
+
+
+
+
+
+
Get the configuration value for the specified key
Configuration value
@@ -64,28 +92,17 @@
- Output the Server URL as defined in the lams.xml configuration file.
- LAMS URL
+ Output a random number for the learner and passon flash movies to communicate directly.
+ generate unique ID
- LAMSURL
- org.lamsfoundation.lams.web.tag.LAMSURLTag
+ generateID
+ org.lamsfoundation.lams.web.tag.GenerateIDTag
empty
-
-
-
- Render html tag with direction and language
- Render html tag with direction and language
-
-
- html
- org.lamsfoundation.lams.web.tag.HtmlTag
- JSP
-
- Render html tag with direction and language
- xhtml
+ Output a random number for the learner and passon flash movies to communicate directly.
+ id
false
true
@@ -95,26 +112,29 @@
- Converts text from \n or \r\n to <BR> before rendering
- Converts text from \n or \r\n to <BR> before rendering
+ Output the basic URL for the current webapp. e.g. http://server/lams/tool/nb11/
+ Base URL for the current web app
- out
- org.lamsfoundation.lams.web.tag.MultiLinesOutputTag
+ WebAppURL
+ org.lamsfoundation.lams.web.tag.WebAppURLTag
empty
-
- Converts text from \n or \r\n to <BR> before rendering
- value
- true
+
+
- true
+ Converts role name into form usable as message resources key
+ Converts role name into form usable as message resources key
+
+
+ role
+ org.lamsfoundation.lams.web.tag.RoleTag
+ empty
-
- Converts text from \n or \r\n to <BR> before rendering
- escapeHtml
- false
+ Converts role name into form usable as message resources key
+ role
+ true
true
@@ -167,17 +187,17 @@
- Converts role name into form usable as message resources key
- Converts role name into form usable as message resources key
+ Output details from the shared session UserDTO object
+ user details
- role
- org.lamsfoundation.lams.web.tag.RoleTag
+ user
+ org.lamsfoundation.lams.web.tag.UserTag
empty
- Converts role name into form usable as message resources key
- role
+ Output details from the shared session UserDTO object
+ property
true
true
@@ -213,27 +233,7 @@
-
- Output details from the shared session UserDTO object
- user details
-
-
- user
- org.lamsfoundation.lams.web.tag.UserTag
- empty
-
-
- Output details from the shared session UserDTO object
- property
- true
-
- true
-
-
-
-
-
STRUTS-textarea
org.lamsfoundation.lams.web.tag.MultiLinesTextareaTag
@@ -289,11 +289,6 @@
true
- index
- false
- true
-
-
indexed
false
true
@@ -466,6 +461,10 @@
ImgButtonWrapper
/WEB-INF/tags/ImgButtonWrapper.tag
+
+
+ TextSearch
+ /WEB-INF/tags/TextSearch.tag
textarea
Index: lams_tool_laqa/web/WEB-INF/struts-config.xml
===================================================================
diff -u -r47ed08dc3daff962ae3af84bef5d38bb531eeabb -r0af4ed13b963a588f3499b080801863d57f8ad95
--- lams_tool_laqa/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 47ed08dc3daff962ae3af84bef5d38bb531eeabb)
+++ lams_tool_laqa/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 0af4ed13b963a588f3499b080801863d57f8ad95)
@@ -16,6 +16,7 @@
+
@@ -72,7 +73,7 @@
redirect="false"
/>
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<%@ tag body-content="scriptless" %>
+<%@ taglib uri="tags-core" prefix="c" %>
+<%@ taglib uri="tags-fmt" prefix="fmt" %>
+<%@ taglib uri="tags-html" prefix="html" %>
+<%@ taglib uri="tags-lams" prefix="lams" %>
+
+<%-- Required attributes --%>
+<%@ attribute name="sessionMapID" required="true" rtexprvalue="true" %>
+<%@ attribute name="wrapInFormTag" required="true" rtexprvalue="true" %>
+
+<%-- Optional attributes --%>
+<%@ attribute name="action" required="false" rtexprvalue="true" %>
+<%@ attribute name="formID" required="false" rtexprvalue="true" %>
+<%@ attribute name="headingLabelKey" required="false" rtexprvalue="true" %>
+<%@ attribute name="allWordsLabelKey" required="false" rtexprvalue="true" %>
+<%@ attribute name="phraseLabelKey" required="false" rtexprvalue="true" %>
+<%@ attribute name="anyWordsLabelKey" required="false" rtexprvalue="true" %>
+<%@ attribute name="excludedWordsLabelKey" required="false" rtexprvalue="true" %>
+<%@ attribute name="saveButtonLabelKey" required="false" rtexprvalue="true" %>
+<%@ attribute name="cancelButtonLabelKey" required="false" rtexprvalue="true" %>
+<%@ attribute name="cancelAction" required="false" rtexprvalue="true" %>
+
+<%-- Default value for message key --%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: lams_tool_laqa/web/authoring/AuthoringTabsHolder.jsp
===================================================================
diff -u -r18e5e690d2e1a7c3d918759f7a2827c8205feaac -r0af4ed13b963a588f3499b080801863d57f8ad95
--- lams_tool_laqa/web/authoring/AuthoringTabsHolder.jsp (.../AuthoringTabsHolder.jsp) (revision 18e5e690d2e1a7c3d918759f7a2827c8205feaac)
+++ lams_tool_laqa/web/authoring/AuthoringTabsHolder.jsp (.../AuthoringTabsHolder.jsp) (revision 0af4ed13b963a588f3499b080801863d57f8ad95)
@@ -33,6 +33,7 @@
tabs.add("label.basic");
tabs.add("label.advanced");
tabs.add("label.instructions");
+ tabs.add("label.conditions");
pageContext.setAttribute("tabs", tabs);
Set tabsBasic = new LinkedHashSet();
@@ -154,7 +155,10 @@
-
+
+
+
+
+<%@ include file="/common/taglibs.jsp"%>
+
+
+
+ <%@ include file="/common/header.jsp"%>
+
+
+
+
+
+ <%@ include file="/common/messages.jsp"%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <%-- Text search form fields are being included --%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_laqa/web/authoring/conditionList.jsp
===================================================================
diff -u
--- lams_tool_laqa/web/authoring/conditionList.jsp (revision 0)
+++ lams_tool_laqa/web/authoring/conditionList.jsp (revision 0af4ed13b963a588f3499b080801863d57f8ad95)
@@ -0,0 +1,92 @@
+<%@ include file="/common/taglibs.jsp"%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ${status.index + 1}
+
+
+
+ ${condition.displayName}
+
+
+
+
+
"
+ onclick="upCondition(${status.index},'${sessionMapID}')">
+
+
">
+
+
+
+
+
+
">
+
+
+
"
+ onclick="downCondition(${status.index},'${sessionMapID}')">
+
+
+
+
+
"
+ onclick="editCondition(${status.index},'${sessionMapID}')" />
+
+
+
+
"
+ onclick="deleteCondition(${status.index},'${sessionMapID}')" />
+
+
+
+
+
+
+<%-- This script will works when a new resoruce Condition submit in order to refresh "TaskList List" panel. --%>
+
Index: lams_tool_laqa/web/authoring/conditions.jsp
===================================================================
diff -u
--- lams_tool_laqa/web/authoring/conditions.jsp (revision 0)
+++ lams_tool_laqa/web/authoring/conditions.jsp (revision 0af4ed13b963a588f3499b080801863d57f8ad95)
@@ -0,0 +1,110 @@
+<%@ include file="/common/taglibs.jsp"%>
+
+
+
+
+
+
+
+ <%@ include file="/authoring/conditionList.jsp"%>
+
+
+
+ ');" class="button-add-item">
+
+
+
+
+
+
+