Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/EditActivityDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/Attic/EditActivityDTO.java,v diff -u -r1.3 -r1.4 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/EditActivityDTO.java 20 Sep 2006 15:15:44 -0000 1.3 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/EditActivityDTO.java 19 Feb 2009 04:25:01 -0000 1.4 @@ -26,44 +26,42 @@ import org.apache.commons.lang.builder.ToStringBuilder; - /** - *
DTO that holds question and user attempts data for jsp purposes + *
+ * DTO that holds question and user attempts data for jsp purposes *
* * @author Ozgur Demirtas */ -public class EditActivityDTO implements Comparable -{ +public class EditActivityDTO implements Comparable { private String monitoredContentInUse; - - + /** * @return Returns the monitoredContentInUse. */ public String getMonitoredContentInUse() { - return monitoredContentInUse; + return monitoredContentInUse; } + /** - * @param monitoredContentInUse The monitoredContentInUse to set. + * @param monitoredContentInUse + * The monitoredContentInUse to set. */ public void setMonitoredContentInUse(String monitoredContentInUse) { - this.monitoredContentInUse = monitoredContentInUse; + this.monitoredContentInUse = monitoredContentInUse; } - public String toString() { - return new ToStringBuilder(this) - .append("monitoredContentInUse", monitoredContentInUse) - .toString(); + + public String toString() { + return new ToStringBuilder(this).append("monitoredContentInUse", monitoredContentInUse).toString(); } - - public int compareTo(Object o) - { - EditActivityDTO editActivityDTO = (EditActivityDTO) o; - - if (editActivityDTO == null) - return 1; - else - return 0; + + public int compareTo(Object o) { + EditActivityDTO editActivityDTO = (EditActivityDTO) o; + + if (editActivityDTO == null) + return 1; + else + return 0; } - + } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/GeneralLearnerFlowDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/Attic/GeneralLearnerFlowDTO.java,v diff -u -r1.16 -r1.17 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/GeneralLearnerFlowDTO.java 15 Nov 2006 00:38:13 -0000 1.16 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/GeneralLearnerFlowDTO.java 19 Feb 2009 04:25:01 -0000 1.17 @@ -28,601 +28,684 @@ import org.apache.commons.lang.builder.ToStringBuilder; - - - /** - *DTO that holds learner flow decision properties and some other view-only properties + *
+ * DTO that holds learner flow decision properties and some other view-only + * properties *
* * @author Ozgur Demirtas */ -public class GeneralLearnerFlowDTO implements Comparable -{ +public class GeneralLearnerFlowDTO implements Comparable { protected String activityOffline; - + protected Integer totalQuestionCount; - + protected String activityInstructions; - + protected String activityTitle; - + protected String countSessionComplete; - + protected String userName; - + protected String toolSessionID; - + protected String httpSessionID; - + protected String toolContentID; - + protected Integer currentQuestionIndex; - + protected String questionListingMode; - + protected String currentAnswer; - + protected String remainingQuestionCount; - + protected String teacherViewOnly; - + protected String notebookEntriesVisible; - + protected String reflection; - + protected String reflectionSubject; - + protected String notebookEntry; - + protected String reportTitleLearner; - + protected String endLearningMessage; - + protected String userNameVisible; - + protected String showOtherAnswers; - - protected String requestLearningReport; - protected String requestLearningReportProgress; - - protected String requestLearningReportViewOnly; + protected String requestLearningReport; + protected String requestLearningReportProgress; + + protected String requestLearningReportViewOnly; + protected Map mapAnswers; - + protected Map mapAnswersPresentable; - + protected Map mapQuestions; - + protected Map mapFeedback; - + protected Map mapQuestionContentLearner; - + protected List listMonitoredAnswersContainerDTO; - + protected String currentMonitoredToolSession; - + protected String initialScreen; - + protected String lockWhenFinished; - + protected String userUid; - + protected String existMultipleUserResponses; - + protected String usernameVisible; - - + /** * @return Returns the usernameVisible. */ public String getUsernameVisible() { - return usernameVisible; + return usernameVisible; } + /** - * @param usernameVisible The usernameVisible to set. + * @param usernameVisible + * The usernameVisible to set. */ public void setUsernameVisible(String usernameVisible) { - this.usernameVisible = usernameVisible; + this.usernameVisible = usernameVisible; } + /** * @return Returns the currentMonitoredToolSession. */ public String getCurrentMonitoredToolSession() { - return currentMonitoredToolSession; + return currentMonitoredToolSession; } + /** - * @param currentMonitoredToolSession The currentMonitoredToolSession to set. + * @param currentMonitoredToolSession + * The currentMonitoredToolSession to set. */ - public void setCurrentMonitoredToolSession( - String currentMonitoredToolSession) { - this.currentMonitoredToolSession = currentMonitoredToolSession; + public void setCurrentMonitoredToolSession(String currentMonitoredToolSession) { + this.currentMonitoredToolSession = currentMonitoredToolSession; } + /** * @return Returns the currentAnswer. */ public String getCurrentAnswer() { - return currentAnswer; + return currentAnswer; } + /** - * @param currentAnswer The currentAnswer to set. + * @param currentAnswer + * The currentAnswer to set. */ public void setCurrentAnswer(String currentAnswer) { - this.currentAnswer = currentAnswer; + this.currentAnswer = currentAnswer; } + protected String userFeedback; - - - + /** * @return Returns the mapQuestionContentLearner. */ public Map getMapQuestionContentLearner() { - return mapQuestionContentLearner; + return mapQuestionContentLearner; } + /** - * @param mapQuestionContentLearner The mapQuestionContentLearner to set. + * @param mapQuestionContentLearner + * The mapQuestionContentLearner to set. */ public void setMapQuestionContentLearner(Map mapQuestionContentLearner) { - this.mapQuestionContentLearner = mapQuestionContentLearner; + this.mapQuestionContentLearner = mapQuestionContentLearner; } + /** * @return Returns the userFeedback. */ public String getUserFeedback() { - return userFeedback; + return userFeedback; } + /** - * @param userFeedback The userFeedback to set. + * @param userFeedback + * The userFeedback to set. */ public void setUserFeedback(String userFeedback) { - this.userFeedback = userFeedback; + this.userFeedback = userFeedback; } + /** * @return Returns the activityInstructions. */ public String getActivityInstructions() { - return activityInstructions; + return activityInstructions; } + /** - * @param activityInstructions The activityInstructions to set. + * @param activityInstructions + * The activityInstructions to set. */ public void setActivityInstructions(String activityInstructions) { - this.activityInstructions = activityInstructions; + this.activityInstructions = activityInstructions; } + /** * @return Returns the activityOffline. */ public String getActivityOffline() { - return activityOffline; + return activityOffline; } + /** - * @param activityOffline The activityOffline to set. + * @param activityOffline + * The activityOffline to set. */ public void setActivityOffline(String activityOffline) { - this.activityOffline = activityOffline; + this.activityOffline = activityOffline; } + /** * @return Returns the activityTitle. */ public String getActivityTitle() { - return activityTitle; + return activityTitle; } + /** - * @param activityTitle The activityTitle to set. + * @param activityTitle + * The activityTitle to set. */ public void setActivityTitle(String activityTitle) { - this.activityTitle = activityTitle; + this.activityTitle = activityTitle; } + /** * @return Returns the countSessionComplete. */ public String getCountSessionComplete() { - return countSessionComplete; + return countSessionComplete; } + /** - * @param countSessionComplete The countSessionComplete to set. + * @param countSessionComplete + * The countSessionComplete to set. */ public void setCountSessionComplete(String countSessionComplete) { - this.countSessionComplete = countSessionComplete; + this.countSessionComplete = countSessionComplete; } /** * @return Returns the questionListingMode. */ public String getQuestionListingMode() { - return questionListingMode; + return questionListingMode; } + /** - * @param questionListingMode The questionListingMode to set. + * @param questionListingMode + * The questionListingMode to set. */ public void setQuestionListingMode(String questionListingMode) { - this.questionListingMode = questionListingMode; + this.questionListingMode = questionListingMode; } - - public int compareTo(Object o) - { - GeneralLearnerFlowDTO gneralLearnerFlowDTO = (GeneralLearnerFlowDTO) o; - - if (gneralLearnerFlowDTO == null) - return 1; - else - return 0; + + public int compareTo(Object o) { + GeneralLearnerFlowDTO gneralLearnerFlowDTO = (GeneralLearnerFlowDTO) o; + + if (gneralLearnerFlowDTO == null) + return 1; + else + return 0; } - - public String toString() { - return new ToStringBuilder(this) - .append("activityOffline: ", activityOffline) - .append("remainingQuestionCount: ", remainingQuestionCount) - .append("totalQuestionCount : ", totalQuestionCount) - .append("activityInstructions: ", activityInstructions) - .append("teacherViewOnly: ", teacherViewOnly) - .append("lockWhenFinished: ", lockWhenFinished) - .append("activityTitle: ", activityTitle) - .append("countSessionComplete: ", countSessionComplete) - .append("toolSessionID: ", toolSessionID) - .append("currentQuestionIndex: ", currentQuestionIndex) - .append("questionListingMode: ", questionListingMode) - .append("reportTitleLearner: ", reportTitleLearner) - .append("userNameVisible: ", userNameVisible) - .append("requestLearningReport: ", requestLearningReport) - .append("requestLearningReportProgress: ", requestLearningReportProgress) - .append("requestLearningReportViewOnly: ", requestLearningReportViewOnly) - .append("mapAnswers: ", mapAnswers) - .append("mapQuestions: ", mapQuestions) - .append("mapQuestionContentLearner: ", mapQuestionContentLearner) - .append("listMonitoredAnswersContainerDTO: ", listMonitoredAnswersContainerDTO) - .append("currentMonitoredToolSession: ", currentMonitoredToolSession) - .append("mapFeedback: ", mapFeedback) - .toString(); + public String toString() { + return new ToStringBuilder(this).append("activityOffline: ", activityOffline).append( + "remainingQuestionCount: ", remainingQuestionCount).append("totalQuestionCount : ", totalQuestionCount) + .append("activityInstructions: ", activityInstructions).append("teacherViewOnly: ", teacherViewOnly) + .append("lockWhenFinished: ", lockWhenFinished).append("activityTitle: ", activityTitle).append( + "countSessionComplete: ", countSessionComplete).append("toolSessionID: ", toolSessionID) + .append("currentQuestionIndex: ", currentQuestionIndex).append("questionListingMode: ", + questionListingMode).append("reportTitleLearner: ", reportTitleLearner).append( + "userNameVisible: ", userNameVisible).append("requestLearningReport: ", requestLearningReport) + .append("requestLearningReportProgress: ", requestLearningReportProgress).append( + "requestLearningReportViewOnly: ", requestLearningReportViewOnly).append("mapAnswers: ", + mapAnswers).append("mapQuestions: ", mapQuestions).append("mapQuestionContentLearner: ", + mapQuestionContentLearner).append("listMonitoredAnswersContainerDTO: ", + listMonitoredAnswersContainerDTO).append("currentMonitoredToolSession: ", + currentMonitoredToolSession).append("mapFeedback: ", mapFeedback).toString(); } - /** - * @param currentQuestionIndex The currentQuestionIndex to set. + * @param currentQuestionIndex + * The currentQuestionIndex to set. */ public void setCurrentQuestionIndex(Integer currentQuestionIndex) { - this.currentQuestionIndex = currentQuestionIndex; + this.currentQuestionIndex = currentQuestionIndex; } + /** - * @param totalQuestionCount The totalQuestionCount to set. + * @param totalQuestionCount + * The totalQuestionCount to set. */ public void setTotalQuestionCount(Integer totalQuestionCount) { - this.totalQuestionCount = totalQuestionCount; + this.totalQuestionCount = totalQuestionCount; } + /** * @return Returns the toolContentID. */ public String getToolContentID() { - return toolContentID; + return toolContentID; } + /** - * @param toolContentID The toolContentID to set. + * @param toolContentID + * The toolContentID to set. */ public void setToolContentID(String toolContentID) { - this.toolContentID = toolContentID; + this.toolContentID = toolContentID; } + /** * @return Returns the toolSessionID. */ public String getToolSessionID() { - return toolSessionID; + return toolSessionID; } + /** - * @param toolSessionID The toolSessionID to set. + * @param toolSessionID + * The toolSessionID to set. */ public void setToolSessionID(String toolSessionID) { - this.toolSessionID = toolSessionID; + this.toolSessionID = toolSessionID; } + /** * @return Returns the currentQuestionIndex. */ public Integer getCurrentQuestionIndex() { - return currentQuestionIndex; + return currentQuestionIndex; } + /** * @return Returns the totalQuestionCount. */ public Integer getTotalQuestionCount() { - return totalQuestionCount; + return totalQuestionCount; } + /** * @return Returns the endLearningMessage. */ public String getEndLearningMessage() { - return endLearningMessage; + return endLearningMessage; } + /** - * @param endLearningMessage The endLearningMessage to set. + * @param endLearningMessage + * The endLearningMessage to set. */ public void setEndLearningMessage(String endLearningMessage) { - this.endLearningMessage = endLearningMessage; + this.endLearningMessage = endLearningMessage; } + /** * @return Returns the reportTitleLearner. */ public String getReportTitleLearner() { - return reportTitleLearner; + return reportTitleLearner; } + /** - * @param reportTitleLearner The reportTitleLearner to set. + * @param reportTitleLearner + * The reportTitleLearner to set. */ public void setReportTitleLearner(String reportTitleLearner) { - this.reportTitleLearner = reportTitleLearner; + this.reportTitleLearner = reportTitleLearner; } + /** * @return Returns the userNameVisible. */ public String getUserNameVisible() { - return userNameVisible; + return userNameVisible; } + /** - * @param userNameVisible The userNameVisible to set. + * @param userNameVisible + * The userNameVisible to set. */ public void setUserNameVisible(String userNameVisible) { - this.userNameVisible = userNameVisible; + this.userNameVisible = userNameVisible; } + /** * @return Returns the mapAnswers. */ public Map getMapAnswers() { - return mapAnswers; + return mapAnswers; } + /** - * @param mapAnswers The mapAnswers to set. + * @param mapAnswers + * The mapAnswers to set. */ public void setMapAnswers(Map mapAnswers) { - this.mapAnswers = mapAnswers; + this.mapAnswers = mapAnswers; } + /** * @return Returns the mapQuestions. */ public Map getMapQuestions() { - return mapQuestions; + return mapQuestions; } + /** - * @param mapQuestions The mapQuestions to set. + * @param mapQuestions + * The mapQuestions to set. */ public void setMapQuestions(Map mapQuestions) { - this.mapQuestions = mapQuestions; + this.mapQuestions = mapQuestions; } - + /** * @return Returns the httpSessionID. */ public String getHttpSessionID() { - return httpSessionID; + return httpSessionID; } + /** - * @param httpSessionID The httpSessionID to set. + * @param httpSessionID + * The httpSessionID to set. */ public void setHttpSessionID(String httpSessionID) { - this.httpSessionID = httpSessionID; - } + this.httpSessionID = httpSessionID; + } + /** * @return Returns the requestLearningReport. */ public String getRequestLearningReport() { - return requestLearningReport; + return requestLearningReport; } + /** - * @param requestLearningReport The requestLearningReport to set. + * @param requestLearningReport + * The requestLearningReport to set. */ public void setRequestLearningReport(String requestLearningReport) { - this.requestLearningReport = requestLearningReport; + this.requestLearningReport = requestLearningReport; } + /** * @return Returns the requestLearningReportProgress. */ public String getRequestLearningReportProgress() { - return requestLearningReportProgress; + return requestLearningReportProgress; } + /** - * @param requestLearningReportProgress The requestLearningReportProgress to set. + * @param requestLearningReportProgress + * The requestLearningReportProgress to set. */ - public void setRequestLearningReportProgress( - String requestLearningReportProgress) { - this.requestLearningReportProgress = requestLearningReportProgress; + public void setRequestLearningReportProgress(String requestLearningReportProgress) { + this.requestLearningReportProgress = requestLearningReportProgress; } - + /** * @return Returns the requestLearningReportViewOnly. */ public String getRequestLearningReportViewOnly() { - return requestLearningReportViewOnly; + return requestLearningReportViewOnly; } + /** - * @param requestLearningReportViewOnly The requestLearningReportViewOnly to set. + * @param requestLearningReportViewOnly + * The requestLearningReportViewOnly to set. */ - public void setRequestLearningReportViewOnly( - String requestLearningReportViewOnly) { - this.requestLearningReportViewOnly = requestLearningReportViewOnly; + public void setRequestLearningReportViewOnly(String requestLearningReportViewOnly) { + this.requestLearningReportViewOnly = requestLearningReportViewOnly; } /** * @return Returns the listMonitoredAnswersContainerDTO. */ public List getListMonitoredAnswersContainerDTO() { - return listMonitoredAnswersContainerDTO; + return listMonitoredAnswersContainerDTO; } + /** - * @param listMonitoredAnswersContainerDTO The listMonitoredAnswersContainerDTO to set. + * @param listMonitoredAnswersContainerDTO + * The listMonitoredAnswersContainerDTO to set. */ - public void setListMonitoredAnswersContainerDTO( - List listMonitoredAnswersContainerDTO) { - this.listMonitoredAnswersContainerDTO = listMonitoredAnswersContainerDTO; + public void setListMonitoredAnswersContainerDTO(List listMonitoredAnswersContainerDTO) { + this.listMonitoredAnswersContainerDTO = listMonitoredAnswersContainerDTO; } /** * @return Returns the mapAnswersPresentable. */ public Map getMapAnswersPresentable() { - return mapAnswersPresentable; + return mapAnswersPresentable; } + /** - * @param mapAnswersPresentable The mapAnswersPresentable to set. + * @param mapAnswersPresentable + * The mapAnswersPresentable to set. */ public void setMapAnswersPresentable(Map mapAnswersPresentable) { - this.mapAnswersPresentable = mapAnswersPresentable; + this.mapAnswersPresentable = mapAnswersPresentable; } + /** * @return Returns the reflection. */ public String getReflection() { - return reflection; + return reflection; } + /** - * @param reflection The reflection to set. + * @param reflection + * The reflection to set. */ public void setReflection(String reflection) { - this.reflection = reflection; + this.reflection = reflection; } + /** * @return Returns the reflectionSubject. */ public String getReflectionSubject() { - return reflectionSubject; + return reflectionSubject; } + /** - * @param reflectionSubject The reflectionSubject to set. + * @param reflectionSubject + * The reflectionSubject to set. */ public void setReflectionSubject(String reflectionSubject) { - this.reflectionSubject = reflectionSubject; + this.reflectionSubject = reflectionSubject; } + /** * @return Returns the notebookEntry. */ public String getNotebookEntry() { - return notebookEntry; + return notebookEntry; } + /** - * @param notebookEntry The notebookEntry to set. + * @param notebookEntry + * The notebookEntry to set. */ public void setNotebookEntry(String notebookEntry) { - this.notebookEntry = notebookEntry; + this.notebookEntry = notebookEntry; } - + /** * @return Returns the notebookEntriesVisible. */ public String getNotebookEntriesVisible() { - return notebookEntriesVisible; + return notebookEntriesVisible; } + /** - * @param notebookEntriesVisible The notebookEntriesVisible to set. + * @param notebookEntriesVisible + * The notebookEntriesVisible to set. */ public void setNotebookEntriesVisible(String notebookEntriesVisible) { - this.notebookEntriesVisible = notebookEntriesVisible; + this.notebookEntriesVisible = notebookEntriesVisible; } + /** * @return Returns the userName. */ public String getUserName() { - return userName; + return userName; } + /** - * @param userName The userName to set. + * @param userName + * The userName to set. */ public void setUserName(String userName) { - this.userName = userName; + this.userName = userName; } + /** * @return Returns the mapFeedback. */ public Map getMapFeedback() { - return mapFeedback; + return mapFeedback; } + /** - * @param mapFeedback The mapFeedback to set. + * @param mapFeedback + * The mapFeedback to set. */ public void setMapFeedback(Map mapFeedback) { - this.mapFeedback = mapFeedback; + this.mapFeedback = mapFeedback; } + /** * @return Returns the teacherViewOnly. */ public String getTeacherViewOnly() { - return teacherViewOnly; + return teacherViewOnly; } + /** - * @param teacherViewOnly The teacherViewOnly to set. + * @param teacherViewOnly + * The teacherViewOnly to set. */ public void setTeacherViewOnly(String teacherViewOnly) { - this.teacherViewOnly = teacherViewOnly; + this.teacherViewOnly = teacherViewOnly; } + /** * @return Returns the remainingQuestionCount. */ public String getRemainingQuestionCount() { - return remainingQuestionCount; + return remainingQuestionCount; } + /** - * @param remainingQuestionCount The remainingQuestionCount to set. + * @param remainingQuestionCount + * The remainingQuestionCount to set. */ public void setRemainingQuestionCount(String remainingQuestionCount) { - this.remainingQuestionCount = remainingQuestionCount; + this.remainingQuestionCount = remainingQuestionCount; } + /** * @return Returns the initialScreen. */ public String getInitialScreen() { - return initialScreen; + return initialScreen; } + /** - * @param initialScreen The initialScreen to set. + * @param initialScreen + * The initialScreen to set. */ public void setInitialScreen(String initialScreen) { - this.initialScreen = initialScreen; + this.initialScreen = initialScreen; } /** * @return Returns the lockWhenFinished. */ public String getLockWhenFinished() { - return lockWhenFinished; + return lockWhenFinished; } + /** - * @param lockWhenFinished The lockWhenFinished to set. + * @param lockWhenFinished + * The lockWhenFinished to set. */ public void setLockWhenFinished(String lockWhenFinished) { - this.lockWhenFinished = lockWhenFinished; + this.lockWhenFinished = lockWhenFinished; } + /** * @return Returns the showOtherAnswers. */ public String getShowOtherAnswers() { - return showOtherAnswers; + return showOtherAnswers; } + /** - * @param showOtherAnswers The showOtherAnswers to set. + * @param showOtherAnswers + * The showOtherAnswers to set. */ public void setShowOtherAnswers(String showOtherAnswers) { - this.showOtherAnswers = showOtherAnswers; + this.showOtherAnswers = showOtherAnswers; } + /** * @return Returns the userUid. */ public String getUserUid() { - return userUid; + return userUid; } + /** - * @param userUid The userUid to set. + * @param userUid + * The userUid to set. */ public void setUserUid(String userUid) { - this.userUid = userUid; + this.userUid = userUid; } + /** * @return Returns the existMultipleUserResponses. */ public String getExistMultipleUserResponses() { - return existMultipleUserResponses; + return existMultipleUserResponses; } + /** - * @param existMultipleUserResponses The existMultipleUserResponses to set. + * @param existMultipleUserResponses + * The existMultipleUserResponses to set. */ public void setExistMultipleUserResponses(String existMultipleUserResponses) { - this.existMultipleUserResponses = existMultipleUserResponses; + this.existMultipleUserResponses = existMultipleUserResponses; } - } +} Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/Nullable.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/Nullable.java,v diff -u -r1.6 -r1.7 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/Nullable.java 20 Sep 2006 15:15:44 -0000 1.6 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/Nullable.java 19 Feb 2009 04:25:01 -0000 1.7 @@ -24,19 +24,18 @@ /* $$Id$$ */ package org.lamsfoundation.lams.tool.qa; - /** - * Null Object pattern. This interface is defined to avoid the use of NULL. - * The domain object that allows NULL as return value should implement this + * Null Object pattern. This interface is defined to avoid the use of NULL. The + * domain object that allows NULL as return value should implement this * interface. * * @author Ozgur Demirtas * */ -public interface Nullable -{ +public interface Nullable { /** * contract to indicate whether current object is null. + * * @return */ public boolean isNull(); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAllGroupsDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/Attic/QaAllGroupsDTO.java,v diff -u -r1.1 -r1.2 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAllGroupsDTO.java 23 Sep 2006 15:11:03 -0000 1.1 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAllGroupsDTO.java 19 Feb 2009 04:25:01 -0000 1.2 @@ -28,77 +28,77 @@ import org.apache.commons.lang.builder.ToStringBuilder; - /** - *DTO that holds question and user attempts data for jsp purposes + *
+ * DTO that holds question and user attempts data for jsp purposes *
* * @author Ozgur Demirtas */ -public class QaAllGroupsDTO implements Comparable -{ +public class QaAllGroupsDTO implements Comparable { private String sessionId; - + private String sessionName; - - private List groupData; - - - - public String toString() { - return new ToStringBuilder(this) - .append("sessionId:", sessionId) - .append("sessionName:", sessionName) - .append("groupData: ", groupData) - .toString(); + + private List groupData; + + public String toString() { + return new ToStringBuilder(this).append("sessionId:", sessionId).append("sessionName:", sessionName).append( + "groupData: ", groupData).toString(); } - - public int compareTo(Object o) - { - QaAllGroupsDTO qaAllGroupsDTO = (QaAllGroupsDTO) o; - - if (qaAllGroupsDTO == null) - return 1; - else - return 0; + + public int compareTo(Object o) { + QaAllGroupsDTO qaAllGroupsDTO = (QaAllGroupsDTO) o; + + if (qaAllGroupsDTO == null) + return 1; + else + return 0; } - /** * @return Returns the groupData. */ public List getGroupData() { - return groupData; + return groupData; } + /** - * @param groupData The groupData to set. + * @param groupData + * The groupData to set. */ public void setGroupData(List groupData) { - this.groupData = groupData; + this.groupData = groupData; } + /** * @return Returns the sessionName. */ public String getSessionName() { - return sessionName; + return sessionName; } + /** - * @param sessionName The sessionName to set. + * @param sessionName + * The sessionName to set. */ public void setSessionName(String sessionName) { - this.sessionName = sessionName; + this.sessionName = sessionName; } + /** * @return Returns the sessionId. */ public String getSessionId() { - return sessionId; + return sessionId; } + /** - * @param sessionId The sessionId to set. + * @param sessionId + * The sessionId to set. */ public void setSessionId(String sessionId) { - this.sessionId = sessionId; + this.sessionId = sessionId; } } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaApplicationException.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/Attic/QaApplicationException.java,v diff -u -r1.6 -r1.7 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaApplicationException.java 20 Sep 2006 15:15:44 -0000 1.6 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaApplicationException.java 19 Feb 2009 04:25:01 -0000 1.7 @@ -24,52 +24,51 @@ /* $$Id$$ */ package org.lamsfoundation.lams.tool.qa; - /** - *This exception wraps all basic exception occured in the q/a tool. It is - * not suppose to be try and catched in any level. The struts should be taking - * care of handling this exception.
+ *+ * This exception wraps all basic exception occured in the q/a tool. It is not + * suppose to be try and catched in any level. The struts should be taking care + * of handling this exception. + *
* -* @author Ozgur Demirtas + * @author Ozgur Demirtas * */ -public class QaApplicationException extends RuntimeException -{ +public class QaApplicationException extends RuntimeException { /** * Default Constructor */ - public QaApplicationException() - { - super(); + public QaApplicationException() { + super(); } /** * Constructor for customized error message + * * @param message */ - public QaApplicationException(String message) - { - super(message); + public QaApplicationException(String message) { + super(message); } /** * Constructor for wrapping the throwable object + * * @param cause */ - public QaApplicationException(Throwable cause) - { - super(cause); + public QaApplicationException(Throwable cause) { + super(cause); } /** - * Constructor for wrapping both the customized error message and - * throwable exception object. + * Constructor for wrapping both the customized error message and throwable + * exception object. + * * @param message * @param cause */ - public QaApplicationException(String message, Throwable cause) - { - super(message, cause); + public QaApplicationException(String message, Throwable cause) { + super(message, cause); } } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaComparator.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/Attic/QaComparator.java,v diff -u -r1.6 -r1.7 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaComparator.java 20 Sep 2006 15:15:44 -0000 1.6 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaComparator.java 19 Feb 2009 04:25:01 -0000 1.7 @@ -31,30 +31,30 @@ /** * @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 comparator implementation that can be used as a constructor to collections. - * The TreeMap in the web layer makes use of it. + * A comparator implementation that can be used as a constructor to collections. + * The TreeMap in the web layer makes use of it. * */ public class QaComparator implements Comparator, Serializable { - static Logger logger = Logger.getLogger(QaComparator.class.getName()); - - public int compare(Object o1, Object o2) { - String s1 = (String)o1; - String s2 = (String)o2; - - int key1=new Long(s1).intValue(); - int key2=new Long(s2).intValue(); - return key1 - key2; - } + static Logger logger = Logger.getLogger(QaComparator.class.getName()); - public boolean equals(Object o) { - String s = (String)o; - return compare(this, o)==0; - } + public int compare(Object o1, Object o2) { + String s1 = (String) o1; + String s2 = (String) o2; + + int key1 = new Long(s1).intValue(); + int key2 = new Long(s2).intValue(); + return key1 - key2; + } + + public boolean equals(Object o) { + String s = (String) o; + return compare(this, o) == 0; + } } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaCondition.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaCondition.java,v diff -u -r1.6 -r1.7 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaCondition.java 9 Dec 2008 05:38:14 -0000 1.6 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaCondition.java 19 Feb 2009 04:25:01 -0000 1.7 @@ -40,15 +40,16 @@ import org.lamsfoundation.lams.util.WebUtil; /** - * A text search condition with a set of questions on answers to which the search should be performed. + * 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. + * Questions linked to this condition. Answers to them will be scanned for + * the words that make the condition's parameters. */ private SetDTO that holds authoring properties for authoring jsps + *
+ * DTO that holds authoring properties for authoring jsps *
* * @author Ozgur Demirtas */ -public class QaGeneralAuthoringDTO implements Comparable -{ +public class QaGeneralAuthoringDTO implements Comparable { protected String toolContentID; protected String currentTab; protected String activeModule; @@ -48,7 +46,7 @@ protected String targetMode; protected String defaultQuestionContent; protected String defaultContentIdStr; - + protected String activityTitle; protected String activityInstructions; protected String onlineInstructions; @@ -61,7 +59,7 @@ protected String lockWhenFinished; protected String editActivityEditMode; protected String reflectionSubject; - + protected String monitoredContentInUse; protected String httpSessionID; @@ -71,474 +69,535 @@ protected List attachmentList; protected List deletedAttachmentList; - + protected String sbmtSuccess; protected String userExceptionQuestionsDuplicate; - + protected String contentFolderID; protected String editableQuestionText; protected String editableQuestionFeedback; - - - public String toString() { - return new ToStringBuilder(this) - .append("toolContentID: ", toolContentID) - .append("contentFolderID: ", contentFolderID) - .append("httpSessionID: ", httpSessionID) - .append("currentTab: ", currentTab) - .append("activeModule: ", activeModule) - .append("defineLaterInEditMode: ", defineLaterInEditMode) - .append("showAuthoringTabs: ", showAuthoringTabs) - .append("monitoringOriginatedDefineLater: ", monitoringOriginatedDefineLater) - .append("targetMode: ", targetMode) - .append("defaultQuestionContent: ", defaultQuestionContent) - .append("defaultContentIdStr: ", defaultContentIdStr) - .append("activityTitle: ", activityTitle) - .append("activityInstructions: ", activityInstructions) - .append("reflect: ", reflect) - .append("onlineInstructions: ", onlineInstructions) - .append("offlineInstructions: ", offlineInstructions) - .append("usernameVisible: ", usernameVisible) - .append("showOtherAnswers: ", showOtherAnswers) - .append("synchInMonitor: ", synchInMonitor) - .append("questionsSequenced: ", questionsSequenced) - .append("lockWhenFinished: ", lockWhenFinished) - .append("editActivityEditMode: ", editActivityEditMode) - .append("reflectionSubject: ", reflectionSubject) - .append("requestedModule: ", requestedModule) - .append("isDefineLater: ", isDefineLater) - .append("monitoredContentInUse: ", monitoredContentInUse) - .append("mapQuestionContent: ", mapQuestionContent) - .append("attachmentList: ", attachmentList) - .append("deletedAttachmentList: ", deletedAttachmentList) - .append("sbmtSuccess: ", sbmtSuccess) - .append("userExceptionQuestionsDuplicate: ", userExceptionQuestionsDuplicate) - .toString(); + public String toString() { + return new ToStringBuilder(this).append("toolContentID: ", toolContentID).append("contentFolderID: ", + contentFolderID).append("httpSessionID: ", httpSessionID).append("currentTab: ", currentTab).append( + "activeModule: ", activeModule).append("defineLaterInEditMode: ", defineLaterInEditMode).append( + "showAuthoringTabs: ", showAuthoringTabs).append("monitoringOriginatedDefineLater: ", + monitoringOriginatedDefineLater).append("targetMode: ", targetMode).append("defaultQuestionContent: ", + defaultQuestionContent).append("defaultContentIdStr: ", defaultContentIdStr).append("activityTitle: ", + activityTitle).append("activityInstructions: ", activityInstructions).append("reflect: ", reflect) + .append("onlineInstructions: ", onlineInstructions) + .append("offlineInstructions: ", offlineInstructions).append("usernameVisible: ", usernameVisible) + .append("showOtherAnswers: ", showOtherAnswers).append("synchInMonitor: ", synchInMonitor).append( + "questionsSequenced: ", questionsSequenced).append("lockWhenFinished: ", lockWhenFinished) + .append("editActivityEditMode: ", editActivityEditMode) + .append("reflectionSubject: ", reflectionSubject).append("requestedModule: ", requestedModule).append( + "isDefineLater: ", isDefineLater).append("monitoredContentInUse: ", monitoredContentInUse) + .append("mapQuestionContent: ", mapQuestionContent).append("attachmentList: ", attachmentList).append( + "deletedAttachmentList: ", deletedAttachmentList).append("sbmtSuccess: ", sbmtSuccess).append( + "userExceptionQuestionsDuplicate: ", userExceptionQuestionsDuplicate).toString(); } - - - + /** * @return Returns the userExceptionQuestionsDuplicate. */ public String getUserExceptionQuestionsDuplicate() { - return userExceptionQuestionsDuplicate; + return userExceptionQuestionsDuplicate; } + /** - * @param userExceptionQuestionsDuplicate The userExceptionQuestionsDuplicate to set. + * @param userExceptionQuestionsDuplicate + * The userExceptionQuestionsDuplicate to set. */ - public void setUserExceptionQuestionsDuplicate( - String userExceptionQuestionsDuplicate) { - this.userExceptionQuestionsDuplicate = userExceptionQuestionsDuplicate; + public void setUserExceptionQuestionsDuplicate(String userExceptionQuestionsDuplicate) { + this.userExceptionQuestionsDuplicate = userExceptionQuestionsDuplicate; } + /** * @return Returns the httpSessionID. */ public String getHttpSessionID() { - return httpSessionID; + return httpSessionID; } + /** - * @param httpSessionID The httpSessionID to set. + * @param httpSessionID + * The httpSessionID to set. */ public void setHttpSessionID(String httpSessionID) { - this.httpSessionID = httpSessionID; + this.httpSessionID = httpSessionID; } + /** * @return Returns the monitoredContentInUse. */ public String getMonitoredContentInUse() { - return monitoredContentInUse; + return monitoredContentInUse; } + /** - * @param monitoredContentInUse The monitoredContentInUse to set. + * @param monitoredContentInUse + * The monitoredContentInUse to set. */ public void setMonitoredContentInUse(String monitoredContentInUse) { - this.monitoredContentInUse = monitoredContentInUse; + this.monitoredContentInUse = monitoredContentInUse; } + /** * @return Returns the editActivityEditMode. */ public String getEditActivityEditMode() { - return editActivityEditMode; + return editActivityEditMode; } + /** - * @param editActivityEditMode The editActivityEditMode to set. + * @param editActivityEditMode + * The editActivityEditMode to set. */ public void setEditActivityEditMode(String editActivityEditMode) { - this.editActivityEditMode = editActivityEditMode; + this.editActivityEditMode = editActivityEditMode; } + /** * @return Returns the deletedAttachmentList. */ public List getDeletedAttachmentList() { - return deletedAttachmentList; + return deletedAttachmentList; } + /** - * @param deletedAttachmentList The deletedAttachmentList to set. + * @param deletedAttachmentList + * The deletedAttachmentList to set. */ public void setDeletedAttachmentList(List deletedAttachmentList) { - this.deletedAttachmentList = deletedAttachmentList; + this.deletedAttachmentList = deletedAttachmentList; } + /** * @return Returns the mapQuestionContent. */ public Map getMapQuestionContent() { - return mapQuestionContent; + return mapQuestionContent; } + /** - * @param mapQuestionContent The mapQuestionContent to set. + * @param mapQuestionContent + * The mapQuestionContent to set. */ public void setMapQuestionContent(Map mapQuestionContent) { - this.mapQuestionContent = mapQuestionContent; + this.mapQuestionContent = mapQuestionContent; } + /** * @return Returns the isDefineLater. */ public String getIsDefineLater() { - return isDefineLater; + return isDefineLater; } + /** - * @param isDefineLater The isDefineLater to set. + * @param isDefineLater + * The isDefineLater to set. */ public void setIsDefineLater(String isDefineLater) { - this.isDefineLater = isDefineLater; + this.isDefineLater = isDefineLater; } - - + /** * @return Returns the attachmentList. */ public List getAttachmentList() { - return attachmentList; + return attachmentList; } + /** - * @param attachmentList The attachmentList to set. + * @param attachmentList + * The attachmentList to set. */ public void setAttachmentList(List attachmentList) { - this.attachmentList = attachmentList; + this.attachmentList = attachmentList; } + /** * @return Returns the toolContentID. */ public String getToolContentID() { - return toolContentID; + return toolContentID; } + /** - * @param toolContentID The toolContentID to set. + * @param toolContentID + * The toolContentID to set. */ public void setToolContentID(String toolContentID) { - this.toolContentID = toolContentID; + this.toolContentID = toolContentID; } - /** * @return Returns the targetMode. */ public String getTargetMode() { - return targetMode; + return targetMode; } + /** - * @param targetMode The targetMode to set. + * @param targetMode + * The targetMode to set. */ public void setTargetMode(String targetMode) { - this.targetMode = targetMode; + this.targetMode = targetMode; } - + /** * @return Returns the monitoringOriginatedDefineLater. */ public String getMonitoringOriginatedDefineLater() { - return monitoringOriginatedDefineLater; + return monitoringOriginatedDefineLater; } + /** - * @param monitoringOriginatedDefineLater The monitoringOriginatedDefineLater to set. + * @param monitoringOriginatedDefineLater + * The monitoringOriginatedDefineLater to set. */ - public void setMonitoringOriginatedDefineLater( - String monitoringOriginatedDefineLater) { - this.monitoringOriginatedDefineLater = monitoringOriginatedDefineLater; + public void setMonitoringOriginatedDefineLater(String monitoringOriginatedDefineLater) { + this.monitoringOriginatedDefineLater = monitoringOriginatedDefineLater; } - /** * @return Returns the activeModule. */ public String getActiveModule() { - return activeModule; + return activeModule; } + /** - * @param activeModule The activeModule to set. + * @param activeModule + * The activeModule to set. */ public void setActiveModule(String activeModule) { - this.activeModule = activeModule; + this.activeModule = activeModule; } + /** * @return Returns the defineLaterInEditMode. */ public String getDefineLaterInEditMode() { - return defineLaterInEditMode; + return defineLaterInEditMode; } + /** - * @param defineLaterInEditMode The defineLaterInEditMode to set. + * @param defineLaterInEditMode + * The defineLaterInEditMode to set. */ public void setDefineLaterInEditMode(String defineLaterInEditMode) { - this.defineLaterInEditMode = defineLaterInEditMode; + this.defineLaterInEditMode = defineLaterInEditMode; } + /** * @return Returns the showAuthoringTabs. */ public String getShowAuthoringTabs() { - return showAuthoringTabs; + return showAuthoringTabs; } + /** - * @param showAuthoringTabs The showAuthoringTabs to set. + * @param showAuthoringTabs + * The showAuthoringTabs to set. */ public void setShowAuthoringTabs(String showAuthoringTabs) { - this.showAuthoringTabs = showAuthoringTabs; + this.showAuthoringTabs = showAuthoringTabs; } - - public int compareTo(Object o) - { - QaGeneralAuthoringDTO qaGeneralAuthoringDTO = (QaGeneralAuthoringDTO) o; - - if (qaGeneralAuthoringDTO == null) - return 1; - else - return 0; + + public int compareTo(Object o) { + QaGeneralAuthoringDTO qaGeneralAuthoringDTO = (QaGeneralAuthoringDTO) o; + + if (qaGeneralAuthoringDTO == null) + return 1; + else + return 0; } /** * @return Returns the defaultContentIdStr. */ public String getDefaultContentIdStr() { - return defaultContentIdStr; + return defaultContentIdStr; } + /** - * @param defaultContentIdStr The defaultContentIdStr to set. + * @param defaultContentIdStr + * The defaultContentIdStr to set. */ public void setDefaultContentIdStr(String defaultContentIdStr) { - this.defaultContentIdStr = defaultContentIdStr; + this.defaultContentIdStr = defaultContentIdStr; } + /** * @return Returns the defaultQuestionContent. */ public String getDefaultQuestionContent() { - return defaultQuestionContent; + return defaultQuestionContent; } + /** - * @param defaultQuestionContent The defaultQuestionContent to set. + * @param defaultQuestionContent + * The defaultQuestionContent to set. */ public void setDefaultQuestionContent(String defaultQuestionContent) { - this.defaultQuestionContent = defaultQuestionContent; + this.defaultQuestionContent = defaultQuestionContent; } + /** * @return Returns the requestedModule. */ public String getRequestedModule() { - return requestedModule; + return requestedModule; } + /** - * @param requestedModule The requestedModule to set. + * @param requestedModule + * The requestedModule to set. */ public void setRequestedModule(String requestedModule) { - this.requestedModule = requestedModule; + this.requestedModule = requestedModule; } + /** * @return Returns the activityInstructions. */ public String getActivityInstructions() { - return activityInstructions; + return activityInstructions; } + /** - * @param activityInstructions The activityInstructions to set. + * @param activityInstructions + * The activityInstructions to set. */ public void setActivityInstructions(String activityInstructions) { - this.activityInstructions = activityInstructions; + this.activityInstructions = activityInstructions; } + /** * @return Returns the activityTitle. */ public String getActivityTitle() { - return activityTitle; + return activityTitle; } + /** - * @param activityTitle The activityTitle to set. + * @param activityTitle + * The activityTitle to set. */ public void setActivityTitle(String activityTitle) { - this.activityTitle = activityTitle; + this.activityTitle = activityTitle; } + /** * @return Returns the offlineInstructions. */ public String getOfflineInstructions() { - return offlineInstructions; + return offlineInstructions; } + /** - * @param offlineInstructions The offlineInstructions to set. + * @param offlineInstructions + * The offlineInstructions to set. */ public void setOfflineInstructions(String offlineInstructions) { - this.offlineInstructions = offlineInstructions; + this.offlineInstructions = offlineInstructions; } + /** * @return Returns the onlineInstructions. */ public String getOnlineInstructions() { - return onlineInstructions; + return onlineInstructions; } + /** - * @param onlineInstructions The onlineInstructions to set. + * @param onlineInstructions + * The onlineInstructions to set. */ public void setOnlineInstructions(String onlineInstructions) { - this.onlineInstructions = onlineInstructions; + this.onlineInstructions = onlineInstructions; } + /** * @return Returns the questionsSequenced. */ public String getQuestionsSequenced() { - return questionsSequenced; + return questionsSequenced; } + /** - * @param questionsSequenced The questionsSequenced to set. + * @param questionsSequenced + * The questionsSequenced to set. */ public void setQuestionsSequenced(String questionsSequenced) { - this.questionsSequenced = questionsSequenced; + this.questionsSequenced = questionsSequenced; } - + /** * @return Returns the synchInMonitor. */ public String getSynchInMonitor() { - return synchInMonitor; + return synchInMonitor; } + /** - * @param synchInMonitor The synchInMonitor to set. + * @param synchInMonitor + * The synchInMonitor to set. */ public void setSynchInMonitor(String synchInMonitor) { - this.synchInMonitor = synchInMonitor; + this.synchInMonitor = synchInMonitor; } + /** * @return Returns the usernameVisible. */ public String getUsernameVisible() { - return usernameVisible; + return usernameVisible; } + /** - * @param usernameVisible The usernameVisible to set. + * @param usernameVisible + * The usernameVisible to set. */ public void setUsernameVisible(String usernameVisible) { - this.usernameVisible = usernameVisible; + this.usernameVisible = usernameVisible; } + /** * @return Returns the currentTab. */ public String getCurrentTab() { - return currentTab; + return currentTab; } + /** - * @param currentTab The currentTab to set. + * @param currentTab + * The currentTab to set. */ public void setCurrentTab(String currentTab) { - this.currentTab = currentTab; + this.currentTab = currentTab; } - + /** * @return Returns the sbmtSuccess. */ public String getSbmtSuccess() { - return sbmtSuccess; + return sbmtSuccess; } + /** - * @param sbmtSuccess The sbmtSuccess to set. + * @param sbmtSuccess + * The sbmtSuccess to set. */ public void setSbmtSuccess(String sbmtSuccess) { - this.sbmtSuccess = sbmtSuccess; + this.sbmtSuccess = sbmtSuccess; } - + /** * @return Returns the contentFolderID. */ public String getContentFolderID() { - return contentFolderID; + return contentFolderID; } + /** - * @param contentFolderID The contentFolderID to set. + * @param contentFolderID + * The contentFolderID to set. */ public void setContentFolderID(String contentFolderID) { - this.contentFolderID = contentFolderID; + this.contentFolderID = contentFolderID; } /** * @return Returns the editableQuestionText. */ public String getEditableQuestionText() { - return editableQuestionText; + return editableQuestionText; } + /** - * @param editableQuestionText The editableQuestionText to set. + * @param editableQuestionText + * The editableQuestionText to set. */ public void setEditableQuestionText(String editableQuestionText) { - this.editableQuestionText = editableQuestionText; + this.editableQuestionText = editableQuestionText; } - + /** * @return Returns the editableQuestionFeedback. */ public String getEditableQuestionFeedback() { - return editableQuestionFeedback; + return editableQuestionFeedback; } + /** - * @param editableQuestionFeedback The editableQuestionFeedback to set. + * @param editableQuestionFeedback + * The editableQuestionFeedback to set. */ public void setEditableQuestionFeedback(String editableQuestionFeedback) { - this.editableQuestionFeedback = editableQuestionFeedback; + this.editableQuestionFeedback = editableQuestionFeedback; } - + /** * @return Returns the reflect. */ public String getReflect() { - return reflect; + return reflect; } + /** - * @param reflect The reflect to set. + * @param reflect + * The reflect to set. */ public void setReflect(String reflect) { - this.reflect = reflect; + this.reflect = reflect; } + /** * @return Returns the reflectionSubject. */ public String getReflectionSubject() { - return reflectionSubject; + return reflectionSubject; } + /** - * @param reflectionSubject The reflectionSubject to set. + * @param reflectionSubject + * The reflectionSubject to set. */ public void setReflectionSubject(String reflectionSubject) { - this.reflectionSubject = reflectionSubject; + this.reflectionSubject = reflectionSubject; } + /** * @return Returns the lockWhenFinished. */ public String getLockWhenFinished() { - return lockWhenFinished; + return lockWhenFinished; } + /** - * @param lockWhenFinished The lockWhenFinished to set. + * @param lockWhenFinished + * The lockWhenFinished to set. */ public void setLockWhenFinished(String lockWhenFinished) { - this.lockWhenFinished = lockWhenFinished; + this.lockWhenFinished = lockWhenFinished; } + /** * @return Returns the showOtherAnswers. */ public String getShowOtherAnswers() { - return showOtherAnswers; + return showOtherAnswers; } + /** - * @param showOtherAnswers The showOtherAnswers to set. + * @param showOtherAnswers + * The showOtherAnswers to set. */ public void setShowOtherAnswers(String showOtherAnswers) { - this.showOtherAnswers = showOtherAnswers; + this.showOtherAnswers = showOtherAnswers; } } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaMonitoredAnswersDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/Attic/QaMonitoredAnswersDTO.java,v diff -u -r1.5 -r1.6 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaMonitoredAnswersDTO.java 23 Sep 2006 15:11:03 -0000 1.5 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaMonitoredAnswersDTO.java 19 Feb 2009 04:25:01 -0000 1.6 @@ -28,108 +28,114 @@ import org.apache.commons.lang.builder.ToStringBuilder; - /** - *DTO that holds question and user attempts data for jsp purposes + *
+ * DTO that holds question and user attempts data for jsp purposes *
* * @author Ozgur Demirtas */ -public class QaMonitoredAnswersDTO implements Comparable -{ +public class QaMonitoredAnswersDTO implements Comparable { private String sessionId; - + private String sessionName; - - private String questionUid; - - private String question; - - private Map questionAttempts; - - - /** - - /** - * @return Returns the question. - */ - public String getQuestion() { - return question; - } - /** - * @param question The question to set. - */ - public void setQuestion(String question) { - this.question = question; - } - /** - * @return Returns the questionUid. - */ - public String getQuestionUid() { - return questionUid; - } - /** - * @param questionUid The questionUid to set. - */ - public void setQuestionUid(String questionUid) { - this.questionUid = questionUid; - } - - /** - * @return Returns the questionAttempts. - */ - public Map getQuestionAttempts() { - return questionAttempts; - } - /** - * @param questionAttempts The questionAttempts to set. - */ - public void setQuestionAttempts(Map questionAttempts) { - this.questionAttempts = questionAttempts; - } - - public String toString() { - return new ToStringBuilder(this) - .append("sessionName:", sessionName) - .append("sessionId:", sessionId) - .append("questionUid:", questionUid) - .append("question:", question) - .append("questionAttempts:", questionAttempts) - .toString(); + + private String questionUid; + + private String question; + + private Map questionAttempts; + + /** + * + * /** + * + * @return Returns the question. + */ + public String getQuestion() { + return question; } - - public int compareTo(Object o) - { - QaMonitoredAnswersDTO qaMonitoredAnswersDTO = (QaMonitoredAnswersDTO) o; - - if (qaMonitoredAnswersDTO == null) - return 1; - else - return (int) (new Long(questionUid).longValue() - new Long(qaMonitoredAnswersDTO.questionUid).longValue()); + + /** + * @param question + * The question to set. + */ + public void setQuestion(String question) { + this.question = question; } - + /** + * @return Returns the questionUid. + */ + public String getQuestionUid() { + return questionUid; + } + + /** + * @param questionUid + * The questionUid to set. + */ + public void setQuestionUid(String questionUid) { + this.questionUid = questionUid; + } + + /** + * @return Returns the questionAttempts. + */ + public Map getQuestionAttempts() { + return questionAttempts; + } + + /** + * @param questionAttempts + * The questionAttempts to set. + */ + public void setQuestionAttempts(Map questionAttempts) { + this.questionAttempts = questionAttempts; + } + + public String toString() { + return new ToStringBuilder(this).append("sessionName:", sessionName).append("sessionId:", sessionId).append( + "questionUid:", questionUid).append("question:", question) + .append("questionAttempts:", questionAttempts).toString(); + } + + public int compareTo(Object o) { + QaMonitoredAnswersDTO qaMonitoredAnswersDTO = (QaMonitoredAnswersDTO) o; + + if (qaMonitoredAnswersDTO == null) + return 1; + else + return (int) (new Long(questionUid).longValue() - new Long(qaMonitoredAnswersDTO.questionUid).longValue()); + } + + /** * @return Returns the sessionId. */ public String getSessionId() { - return sessionId; + return sessionId; } + /** - * @param sessionId The sessionId to set. + * @param sessionId + * The sessionId to set. */ public void setSessionId(String sessionId) { - this.sessionId = sessionId; + this.sessionId = sessionId; } + /** * @return Returns the sessionName. */ public String getSessionName() { - return sessionName; + return sessionName; } + /** - * @param sessionName The sessionName to set. + * @param sessionName + * The sessionName to set. */ public void setSessionName(String sessionName) { - this.sessionName = sessionName; + this.sessionName = sessionName; } } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaMonitoredUserDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/Attic/QaMonitoredUserDTO.java,v diff -u -r1.8 -r1.9 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaMonitoredUserDTO.java 23 Sep 2006 15:11:03 -0000 1.8 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaMonitoredUserDTO.java 19 Feb 2009 04:25:01 -0000 1.9 @@ -28,206 +28,232 @@ import org.apache.commons.lang.builder.ToStringBuilder; - /** - *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 QaMonitoredUserDTO implements Comparable -{ - private String queUsrId; +public class QaMonitoredUserDTO implements Comparable { + private String queUsrId; private String uid; - - //private String attemptTime; - + + //private String attemptTime; + private Date attemptTime; - - private String timeZone; - - private String userName; - - private String isCorrect; - - private String response; - - private String responsePresentable; - - private String sessionId; - - private String questionUid; - - private String visible; - + + private String timeZone; + + private String userName; + + private String isCorrect; + + private String response; + + private String responsePresentable; + + private String sessionId; + + private String questionUid; + + private String visible; + private Map usersAttempts; - - /** - * @return Returns the queUsrId. - */ - public String getQueUsrId() { - return queUsrId; - } - /** - * @param queUsrId The queUsrId to set. - */ - public void setQueUsrId(String queUsrId) { - this.queUsrId = queUsrId; - } - - public String toString() { - return new ToStringBuilder(this) - .append("sessionId:", sessionId) - .append("userName:", userName) - .append("queUsrId:", queUsrId) - .append("questionUid:", questionUid) - .append("response:", response) - .append("visible:", visible) - .append("usersAttempts:", usersAttempts) - .toString(); + + /** + * @return Returns the queUsrId. + */ + public String getQueUsrId() { + return queUsrId; } - /** - * @return Returns the usersAttempts. - */ - public Map getUsersAttempts() { - return usersAttempts; - } - /** - * @param usersAttempts The usersAttempts to set. - */ - public void setUsersAttempts(Map usersAttempts) { - this.usersAttempts = usersAttempts; - } - - public int compareTo(Object o) - { - QaMonitoredUserDTO qaMonitoredUserDTO = (QaMonitoredUserDTO) o; - - if (qaMonitoredUserDTO == null) - return 1; - else - return (int) (new Long(queUsrId).longValue() - new Long(qaMonitoredUserDTO.queUsrId).longValue()); + + /** + * @param queUsrId + * The queUsrId to set. + */ + public void setQueUsrId(String queUsrId) { + this.queUsrId = queUsrId; } - - /** - * @return Returns the isCorrect. - */ - public String getIsCorrect() { - return isCorrect; - } - /** - * @param isCorrect The isCorrect to set. - */ - public void setIsCorrect(String isCorrect) { - this.isCorrect = isCorrect; - } - /** - * @return Returns the response. - */ - public String getResponse() { - return response; - } - /** - * @param response The response to set. - */ - public void setResponse(String response) { - this.response = response; - } - /** - * @return Returns the timeZone. - */ - public String getTimeZone() { - return timeZone; - } - /** - * @param timeZone The timeZone to set. - */ - public void setTimeZone(String timeZone) { - this.timeZone = timeZone; - } - /** - * @return Returns the uid. - */ - public String getUid() { - return uid; - } - /** - * @param uid The uid to set. - */ - public void setUid(String uid) { - this.uid = uid; - } - /** - * @return Returns the userName. - */ - public String getUserName() { - return userName; - } - /** - * @param userName The userName to set. - */ - public void setUserName(String userName) { - this.userName = userName; - } - /** - * @return Returns the sessionId. - */ - public String getSessionId() { - return sessionId; - } - /** - * @param sessionId The sessionId to set. - */ - public void setSessionId(String sessionId) { - this.sessionId = sessionId; - } - /** - * @return Returns the questionUid. - */ - public String getQuestionUid() { - return questionUid; - } - /** - * @param questionUid The questionUid to set. - */ - public void setQuestionUid(String questionUid) { - this.questionUid = questionUid; - } + + public String toString() { + return new ToStringBuilder(this).append("sessionId:", sessionId).append("userName:", userName).append( + "queUsrId:", queUsrId).append("questionUid:", questionUid).append("response:", response).append( + "visible:", visible).append("usersAttempts:", usersAttempts).toString(); + } + /** + * @return Returns the usersAttempts. + */ + public Map getUsersAttempts() { + return usersAttempts; + } + + /** + * @param usersAttempts + * The usersAttempts to set. + */ + public void setUsersAttempts(Map usersAttempts) { + this.usersAttempts = usersAttempts; + } + + public int compareTo(Object o) { + QaMonitoredUserDTO qaMonitoredUserDTO = (QaMonitoredUserDTO) o; + + if (qaMonitoredUserDTO == null) + return 1; + else + return (int) (new Long(queUsrId).longValue() - new Long(qaMonitoredUserDTO.queUsrId).longValue()); + } + + /** + * @return Returns the isCorrect. + */ + public String getIsCorrect() { + return isCorrect; + } + + /** + * @param isCorrect + * The isCorrect to set. + */ + public void setIsCorrect(String isCorrect) { + this.isCorrect = isCorrect; + } + + /** + * @return Returns the response. + */ + public String getResponse() { + return response; + } + + /** + * @param response + * The response to set. + */ + public void setResponse(String response) { + this.response = response; + } + + /** + * @return Returns the timeZone. + */ + public String getTimeZone() { + return timeZone; + } + + /** + * @param timeZone + * The timeZone to set. + */ + public void setTimeZone(String timeZone) { + this.timeZone = timeZone; + } + + /** + * @return Returns the uid. + */ + public String getUid() { + return uid; + } + + /** + * @param uid + * The uid to set. + */ + public void setUid(String uid) { + this.uid = uid; + } + + /** + * @return Returns the userName. + */ + public String getUserName() { + return userName; + } + + /** + * @param userName + * The userName to set. + */ + public void setUserName(String userName) { + this.userName = userName; + } + + /** + * @return Returns the sessionId. + */ + public String getSessionId() { + return sessionId; + } + + /** + * @param sessionId + * The sessionId to set. + */ + public void setSessionId(String sessionId) { + this.sessionId = sessionId; + } + + /** + * @return Returns the questionUid. + */ + public String getQuestionUid() { + return questionUid; + } + + /** + * @param questionUid + * The questionUid to set. + */ + public void setQuestionUid(String questionUid) { + this.questionUid = questionUid; + } + + /** * @return Returns the visible. */ public String getVisible() { - return visible; + return visible; } + /** - * @param visible The visible to set. + * @param visible + * The visible to set. */ public void setVisible(String visible) { - this.visible = visible; + this.visible = visible; } + /** * @return Returns the attemptTime. */ public Date getAttemptTime() { - return attemptTime; + return attemptTime; } + /** - * @param attemptTime The attemptTime to set. + * @param attemptTime + * The attemptTime to set. */ public void setAttemptTime(Date attemptTime) { - this.attemptTime = attemptTime; + this.attemptTime = attemptTime; } + /** * @return Returns the responsePresentable. */ public String getResponsePresentable() { - return responsePresentable; + return responsePresentable; } + /** - * @param responsePresentable The responsePresentable to set. + * @param responsePresentable + * The responsePresentable to set. */ public void setResponsePresentable(String responsePresentable) { - this.responsePresentable = responsePresentable; + this.responsePresentable = responsePresentable; } } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaQueContent.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaQueContent.java,v diff -u -r1.12 -r1.13 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaQueContent.java 4 Oct 2008 02:45:44 -0000 1.12 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaQueContent.java 19 Feb 2009 04:25:01 -0000 1.13 @@ -37,13 +37,14 @@ * * @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 */ /** - * QaQueContent Value Object The value object that maps to our model database table: tl_laqa11_que_content The relevant - * hibernate mapping resides in: QaQueContent.hbm.xml + * QaQueContent Value Object The value object that maps to our model database + * table: tl_laqa11_que_content The relevant hibernate mapping resides in: + * QaQueContent.hbm.xml * * Holds question content within a particular content */ @@ -276,8 +277,8 @@ } /** - * Validate whether there is a response available for current question. This method only validate struts convient - * field at the moment. + * Validate whether there is a response available for current question. This + * method only validate struts convient field at the moment. * * @return whether the resonse is available or not. */ @@ -302,7 +303,8 @@ /** * Convenient method to check out the response for other field. * - * @return true if other response field is not null and is not equals to empty String + * @return true if other response field is not null and is not equals to + * empty String */ public boolean isOtherResponseAvailable() { if (otherResponse != null && !otherResponse.equals("")) { Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaQueUsr.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaQueUsr.java,v diff -u -r1.11 -r1.12 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaQueUsr.java 20 Sep 2006 15:15:44 -0000 1.11 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaQueUsr.java 19 Feb 2009 04:25:01 -0000 1.12 @@ -20,7 +20,7 @@ * http://www.gnu.org/licenses/gpl.txt * **************************************************************** */ -/* $$Id$$ */ +/* $$Id$$ */ package org.lamsfoundation.lams.tool.qa; import java.io.Serializable; @@ -35,464 +35,436 @@ import org.apache.commons.lang.builder.HashCodeBuilder; import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.log4j.Logger; + /** * * @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 */ /** * - * QaQueUsr Value Object - * The value object that maps to our model database table: tl_laqa11_que_usr - * The relevant hibernate mapping resides in: QaQueUsr.hbm.xml + * QaQueUsr Value Object The value object that maps to our model database table: + * tl_laqa11_que_usr The relevant hibernate mapping resides in: QaQueUsr.hbm.xml * - * Represents tool users. + * Represents tool users. */ -public class QaQueUsr implements Serializable, Comparable, Nullable -{ - static Logger logger = Logger.getLogger(QaQueUsr.class.getName()); - +public class QaQueUsr implements Serializable, Comparable, Nullable { + static Logger logger = Logger.getLogger(QaQueUsr.class.getName()); + /** identifier field */ private Long uid; - /** persistent field */ + /** persistent field */ private Long queUsrId; - + /** nullable persistent field */ private String username; - + /** nullable persistent field */ private String fullname; - + private boolean responseFinalized; - + private boolean learnerFinished; - + /** persistent field */ private QaSession qaSession; - + /** persistent field */ private Long qaSessionId; - + /** persistent field */ private QaQueContent qaQueContent; - + /** persistent field */ - private Set qaUsrResps; + private Set qaUsrResps; - public QaQueUsr(){}; - + public QaQueUsr() { + }; + /** full constructor */ - public QaQueUsr(Long queUsrId, - String username, - String fullname, - QaQueContent qaQueContent, - QaSession qaSession, - Set qaUsrResps) - + public QaQueUsr(Long queUsrId, String username, String fullname, QaQueContent qaQueContent, QaSession qaSession, + Set qaUsrResps) + { - this.queUsrId = queUsrId; - this.username = username; - this.fullname = fullname; - this.qaQueContent = qaQueContent; - this.qaSession = qaSession; - this.qaUsrResps =qaUsrResps; + this.queUsrId = queUsrId; + this.username = username; + this.fullname = fullname; + this.qaQueContent = qaQueContent; + this.qaSession = qaSession; + this.qaUsrResps = qaUsrResps; } /** minimal constructor */ - public QaQueUsr(QaQueContent qaQueContent, - QaSession qaSession, - Set qaUsrResps) - + public QaQueUsr(QaQueContent qaQueContent, QaSession qaSession, Set qaUsrResps) + { - this.qaQueContent = qaQueContent; - this.qaSession = qaSession; - this.qaUsrResps =qaUsrResps; + this.qaQueContent = qaQueContent; + this.qaSession = qaSession; + this.qaUsrResps = qaUsrResps; } - - - public QaQueUsr(Long queUsrId, - String username, - String fullname, - QaQueContent qaQueContent, - QaSession qaSession) - { - this.queUsrId = queUsrId; - this.username = username; - this.fullname = fullname; - this.qaQueContent = qaQueContent; - this.qaSession = qaSession; - } - - - public QaQueUsr(String username, - String fullname, - QaQueContent qaQueContent, - QaSession qaSession, - Set qaUsrResps) - + + public QaQueUsr(Long queUsrId, String username, String fullname, QaQueContent qaQueContent, QaSession qaSession) { + this.queUsrId = queUsrId; + this.username = username; + this.fullname = fullname; + this.qaQueContent = qaQueContent; + this.qaSession = qaSession; + } + + public QaQueUsr(String username, String fullname, QaQueContent qaQueContent, QaSession qaSession, Set qaUsrResps) + { - this.username = username; - this.fullname = fullname; - this.qaQueContent = qaQueContent; - this.qaSession = qaSession; - this.qaUsrResps =qaUsrResps; + this.username = username; + this.fullname = fullname; + this.qaQueContent = qaQueContent; + this.qaSession = qaSession; + this.qaUsrResps = qaUsrResps; } - /** * Copy construtor; We copy all data except the hibernate id field. - * @param queUsr the original survey question user object. + * + * @param queUsr + * the original survey question user object. * @return the survey question user object. */ - public QaQueUsr newInstance(QaQueUsr queUsr) - { - return new QaQueUsr(queUsr.getQueUsrId(), - queUsr.getUsername(), - queUsr.getFullname(), - queUsr.getQaQueContent(), - queUsr.getQaSession(), - queUsr.getQaUsrResps()); + public QaQueUsr newInstance(QaQueUsr queUsr) { + return new QaQueUsr(queUsr.getQueUsrId(), queUsr.getUsername(), queUsr.getFullname(), queUsr.getQaQueContent(), + queUsr.getQaSession(), queUsr.getQaUsrResps()); } - - - /** - * @return Returns the fullname. - */ - public String getFullname() { - return fullname; - } - /** - * @param fullName The fullName to set. - */ - public void setFullname(String fullname) { - this.fullname = fullname; - } - /** - * @return Returns the qaQueContent. - */ - public QaQueContent getQaQueContent() { - return qaQueContent; - } - /** - * @param qaQueContent The qaQueContent to set. - */ - public void setQaQueContent(QaQueContent qaQueContent) { - this.qaQueContent = qaQueContent; - } - /** - * @return Returns the qaSession. - */ - public QaSession getQaSession() { - return qaSession; - } - /** - * @param qaSession The qaSession to set. - */ - public void setQaSession(QaSession qaSession) { - this.qaSession = qaSession; - } - /** - * @return Returns the qaUsrResps. - */ - public Set getQaUsrResps() - { - if (this.qaUsrResps == null) - setQaUsrResps(new TreeSet()); - return this.qaUsrResps; - } - /** - * @param qaUsrResps The qaUsrResps to set. - */ - public void setQaUsrResps(Set qaUsrResps) { - this.qaUsrResps = qaUsrResps; - } - /** - * @return Returns the queUsrId. - */ - public Long getQueUsrId() { - return queUsrId; - } - /** - * @param queUsrId The queUsrId to set. - */ - public void setQueUsrId(Long queUsrId) { - this.queUsrId = queUsrId; - } - /** - * @return Returns the username. - */ - public String getUsername() { - return username; - } - /** - * @param username The username to set. - */ - public void setUsername(String username) { - this.username = username; - } - - - public String toString() - { - return new ToStringBuilder(this).append("queUsrId", getQueUsrId()) - .append("username",getUsername()) - .append("full name",getFullname()) - .toString(); + + /** + * @return Returns the fullname. + */ + public String getFullname() { + return fullname; } - - - public boolean equals(Object other) - { - if (!(other instanceof QaQueUsr)) - return false; - QaQueUsr castOther = (QaQueUsr) other; - return new EqualsBuilder().append(this.getQueUsrId(),castOther.getQueUsrId()) - //.append(this.getUserId(),castOther.getUserId()) - //.append(this.getQaQueContent(),castOther.getQaQueContent()) - .isEquals(); + + /** + * @param fullName + * The fullName to set. + */ + public void setFullname(String fullname) { + this.fullname = fullname; } - public int hashCode() - { - return new HashCodeBuilder().append(getQueUsrId()) - //.append(getUserId()) - .toHashCode(); + /** + * @return Returns the qaQueContent. + */ + public QaQueContent getQaQueContent() { + return qaQueContent; } - + /** + * @param qaQueContent + * The qaQueContent to set. + */ + public void setQaQueContent(QaQueContent qaQueContent) { + this.qaQueContent = qaQueContent; + } + /** + * @return Returns the qaSession. + */ + public QaSession getQaSession() { + return qaSession; + } + + /** + * @param qaSession + * The qaSession to set. + */ + public void setQaSession(QaSession qaSession) { + this.qaSession = qaSession; + } + + /** + * @return Returns the qaUsrResps. + */ + public Set getQaUsrResps() { + if (this.qaUsrResps == null) + setQaUsrResps(new TreeSet()); + return this.qaUsrResps; + } + + /** + * @param qaUsrResps + * The qaUsrResps to set. + */ + public void setQaUsrResps(Set qaUsrResps) { + this.qaUsrResps = qaUsrResps; + } + + /** + * @return Returns the queUsrId. + */ + public Long getQueUsrId() { + return queUsrId; + } + + /** + * @param queUsrId + * The queUsrId to set. + */ + public void setQueUsrId(Long queUsrId) { + this.queUsrId = queUsrId; + } + + /** + * @return Returns the username. + */ + public String getUsername() { + return username; + } + + /** + * @param username + * The username to set. + */ + public void setUsername(String username) { + this.username = username; + } + + public String toString() { + return new ToStringBuilder(this).append("queUsrId", getQueUsrId()).append("username", getUsername()).append( + "full name", getFullname()).toString(); + } + + public boolean equals(Object other) { + if (!(other instanceof QaQueUsr)) + return false; + QaQueUsr castOther = (QaQueUsr) other; + return new EqualsBuilder().append(this.getQueUsrId(), castOther.getQueUsrId()) + //.append(this.getUserId(),castOther.getUserId()) + //.append(this.getQaQueContent(),castOther.getQaQueContent()) + .isEquals(); + } + + public int hashCode() { + return new HashCodeBuilder().append(getQueUsrId()) + //.append(getUserId()) + .toHashCode(); + } + //--------------------------------------------------------------------- // Convenient Service Methods //--------------------------------------------------------------------- /** - * Check up question responsed by current user against a list user responses. - * Returntrue
if
+ * Check up question responsed by current user against a list user
+ * responses. Return true
if
+ *
* @param responses
* @return the validation result
*/
- public boolean checkUpQueUsrHas(List responses)
- {
- if (responses == null)
- throw new IllegalArgumentException("Invalid responses from "
- + this.getFullname() + ": Can't validate null responses"
- + "against current survey questions");
+ public boolean checkUpQueUsrHas(List responses) {
+ if (responses == null)
+ throw new IllegalArgumentException("Invalid responses from " + this.getFullname()
+ + ": Can't validate null responses" + "against current survey questions");
- //make defensive copy to avoid list mutation outside this class.
- ArrayList resps = new ArrayList(responses);
+ //make defensive copy to avoid list mutation outside this class.
+ ArrayList resps = new ArrayList(responses);
- for (Iterator i = resps.iterator(); i.hasNext();)
- {
- QaUsrResp resp = (QaUsrResp) i.next();
- if (doesQueUserHas(resp))
- return true;
- }
- return false;
+ for (Iterator i = resps.iterator(); i.hasNext();) {
+ QaUsrResp resp = (QaUsrResp) i.next();
+ if (doesQueUserHas(resp))
+ return true;
+ }
+ return false;
}
-
-
/**
* The helper function to validate the availability of a user response for
- * this question user.
- * The condition to return true is:DTO that holds stats data + *
+ * DTO that holds stats data *
* * @author Ozgur Demirtas */ -public class QaStatsDTO implements Comparable -{ - private String countAllUsers; - - private String countSessionComplete; - - public String toString() { - return new ToStringBuilder(this) - .append("question", countAllUsers) - .append("countSessionComplete", countSessionComplete) - .toString(); +public class QaStatsDTO implements Comparable { + private String countAllUsers; + + private String countSessionComplete; + + public String toString() { + return new ToStringBuilder(this).append("question", countAllUsers).append("countSessionComplete", + countSessionComplete).toString(); } - - public int compareTo(Object o) - { - QaStatsDTO qaStatsDTO = (QaStatsDTO) o; - - if (qaStatsDTO == null) - return 1; - else - return 0; + + public int compareTo(Object o) { + QaStatsDTO qaStatsDTO = (QaStatsDTO) o; + + if (qaStatsDTO == null) + return 1; + else + return 0; } - - + /** * @return Returns the countAllUsers. */ public String getCountAllUsers() { - return countAllUsers; + return countAllUsers; } + /** - * @param countAllUsers The countAllUsers to set. + * @param countAllUsers + * The countAllUsers to set. */ public void setCountAllUsers(String countAllUsers) { - this.countAllUsers = countAllUsers; + this.countAllUsers = countAllUsers; } + /** * @return Returns the countSessionComplete. */ public String getCountSessionComplete() { - return countSessionComplete; + return countSessionComplete; } + /** - * @param countSessionComplete The countSessionComplete to set. + * @param countSessionComplete + * The countSessionComplete to set. */ public void setCountSessionComplete(String countSessionComplete) { - this.countSessionComplete = countSessionComplete; + this.countSessionComplete = countSessionComplete; } } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaStringComparator.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/Attic/QaStringComparator.java,v diff -u -r1.6 -r1.7 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaStringComparator.java 20 Sep 2006 15:15:44 -0000 1.6 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaStringComparator.java 19 Feb 2009 04:25:01 -0000 1.7 @@ -20,7 +20,7 @@ * http://www.gnu.org/licenses/gpl.txt * **************************************************************** */ -/* $$Id$$ */ +/* $$Id$$ */ package org.lamsfoundation.lams.tool.qa; import java.io.Serializable; @@ -30,28 +30,28 @@ /** * @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 comparator implementation that can be used as a constructor to collections. - * The TreeMap in the web layer makes use of it. + * A comparator implementation that can be used as a constructor to collections. + * The TreeMap in the web layer makes use of it. * */ public class QaStringComparator implements Comparator, Serializable { - static Logger logger = Logger.getLogger(QaStringComparator.class.getName()); - - public int compare(Object o1, Object o2) { - String s1 = (String)o1; - String s2 = (String)o2; + static Logger logger = Logger.getLogger(QaStringComparator.class.getName()); - return s1.compareTo(s2); - } + public int compare(Object o1, Object o2) { + String s1 = (String) o1; + String s2 = (String) o2; - public boolean equals(Object o) { - String s = (String)o; - return compare(this, o)==0; - } + return s1.compareTo(s2); + } + + public boolean equals(Object o) { + String s = (String) o; + return compare(this, o) == 0; + } } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUploadedFile.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/Attic/QaUploadedFile.java,v diff -u -r1.14 -r1.15 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUploadedFile.java 11 Oct 2006 07:19:26 -0000 1.14 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUploadedFile.java 19 Feb 2009 04:25:01 -0000 1.15 @@ -20,7 +20,7 @@ * http://www.gnu.org/licenses/gpl.txt * **************************************************************** */ -/* $$Id$$ */ +/* $$Id$$ */ package org.lamsfoundation.lams.tool.qa; import java.io.Serializable; @@ -38,190 +38,178 @@ /** * * @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 */ /** - * QaQueContent Value Object - * The value object that maps to our model database table: tl_laqa11_que_content - * The relevant hibernate mapping resides in: QaQueContent.hbm.xml - * - * Holds question content within a particular content + * QaQueContent Value Object The value object that maps to our model database + * table: tl_laqa11_que_content The relevant hibernate mapping resides in: + * QaQueContent.hbm.xml + * + * Holds question content within a particular content */ -public class QaUploadedFile implements Serializable, Comparable -{ - static Logger logger = Logger.getLogger(QaUploadedFile.class.getName()); - /** identifier field */ +public class QaUploadedFile implements Serializable, Comparable { + static Logger logger = Logger.getLogger(QaUploadedFile.class.getName()); + /** identifier field */ private Long submissionId; - + /** persistent field */ private String uuid; /** persistent field */ private boolean fileOnline; - + /** persistent field */ private String fileName; - + /** persistent field */ private QaContent qaContent; - - public QaUploadedFile(){}; + public QaUploadedFile() { + }; + /** full constructor */ - public QaUploadedFile(Long submissionId, - String uuid, - boolean fileOnline, - String fileName, - QaContent qaContent) - { - this.submissionId=submissionId; - this.uuid = uuid; - this.fileOnline = fileOnline; - this.fileName = fileName; - this.qaContent=qaContent; + public QaUploadedFile(Long submissionId, String uuid, boolean fileOnline, String fileName, QaContent qaContent) { + this.submissionId = submissionId; + this.uuid = uuid; + this.fileOnline = fileOnline; + this.fileName = fileName; + this.qaContent = qaContent; } - - + public static QaUploadedFile newInstance(IToolContentHandler toolContentHandler, QaUploadedFile qaUploadedFile, - QaContent newMcContent) throws ItemNotFoundException, RepositoryCheckedException - - { - QaUploadedFile newMcUploadedFile=null; + QaContent newMcContent) throws ItemNotFoundException, RepositoryCheckedException - newMcUploadedFile = new QaUploadedFile(qaUploadedFile.getUuid(), - qaUploadedFile.isFileOnline(), - qaUploadedFile.getFileName(), - newMcContent); - - return newMcUploadedFile; - } - - - - public QaUploadedFile(String uuid, - boolean fileOnline, - String fileName, - QaContent qaContent) { - logger.debug("constructor gets called."); - this.uuid = uuid; - this.fileOnline = fileOnline; - this.fileName = fileName; - this.qaContent=qaContent; + QaUploadedFile newMcUploadedFile = null; + + newMcUploadedFile = new QaUploadedFile(qaUploadedFile.getUuid(), qaUploadedFile.isFileOnline(), qaUploadedFile + .getFileName(), newMcContent); + + return newMcUploadedFile; } - - + + public QaUploadedFile(String uuid, boolean fileOnline, String fileName, QaContent qaContent) { + logger.debug("constructor gets called."); + this.uuid = uuid; + this.fileOnline = fileOnline; + this.fileName = fileName; + this.qaContent = qaContent; + } + public String toString() { - return new ToStringBuilder(this) - .append("uuid: ", getUuid()) - .append("fileName: ", getFileName()) - .toString(); + return new ToStringBuilder(this).append("uuid: ", getUuid()).append("fileName: ", getFileName()).toString(); } public boolean equals(Object other) { - if ( !(other instanceof QaUploadedFile) ) return false; - QaUploadedFile castOther = (QaUploadedFile) other; - return new EqualsBuilder() - .append(this.getUuid(), castOther.getUuid()) - .isEquals(); + if (!(other instanceof QaUploadedFile)) + return false; + QaUploadedFile castOther = (QaUploadedFile) other; + return new EqualsBuilder().append(this.getUuid(), castOther.getUuid()).isEquals(); } public int hashCode() { - return new HashCodeBuilder() - .append(getUuid()) - .toHashCode(); + return new HashCodeBuilder().append(getUuid()).toHashCode(); } - - - /** - * @return Returns the fileName. - */ - public String getFileName() { - return fileName; - } - /** - * @param fileName The fileName to set. - */ - public void setFileName(String fileName) { - this.fileName = fileName; - } - - /** - * @return Returns the qaContent. - */ - public QaContent getQaContent() { - return qaContent; - } - /** - * @param qaContent The qaContent to set. - */ - public void setQaContent(QaContent qaContent) { - this.qaContent = qaContent; - } - /** - * @return Returns the submissionId. - */ - public Long getSubmissionId() { - return submissionId; - } - /** - * @param submissionId The submissionId to set. - */ - public void setSubmissionId(Long submissionId) { - this.submissionId = submissionId; - } - /** - * @return Returns the uuid. - */ - public String getUuid() { - return uuid; - } - /** - * @param uuid The uuid to set. - */ - public void setUuid(String uuid) { - this.uuid = uuid; - } - /** - * @return Returns the fileOnline. - */ - public boolean isFileOnline() { - return fileOnline; - } - /** - * @param fileOnline The fileOnline to set. - */ - public void setFileOnline(boolean fileOnline) { - this.fileOnline = fileOnline; - } - - public int compareTo(Object o) - { - QaUploadedFile file = (QaUploadedFile) o; - //if the object does not exist yet, then just return any one of 0, -1, 1. Should not make a difference. - if (submissionId == null) - return 1; - else - return (int) (submissionId.longValue() - file.submissionId.longValue()); + /** + * @return Returns the fileName. + */ + public String getFileName() { + return fileName; } - public String getFileProperty() { - if (isFileOnline()) - { - return IToolContentHandler.TYPE_ONLINE; - } - else - return IToolContentHandler.TYPE_OFFLINE; - } - public void setFileProperty(String fileProperty) { - if(StringUtils.equals(IToolContentHandler.TYPE_ONLINE,fileProperty)) - this.fileOnline = true; - else - this.fileOnline = false; - } + /** + * @param fileName + * The fileName to set. + */ + public void setFileName(String fileName) { + this.fileName = fileName; + } + + /** + * @return Returns the qaContent. + */ + public QaContent getQaContent() { + return qaContent; + } + + /** + * @param qaContent + * The qaContent to set. + */ + public void setQaContent(QaContent qaContent) { + this.qaContent = qaContent; + } + + /** + * @return Returns the submissionId. + */ + public Long getSubmissionId() { + return submissionId; + } + + /** + * @param submissionId + * The submissionId to set. + */ + public void setSubmissionId(Long submissionId) { + this.submissionId = submissionId; + } + + /** + * @return Returns the uuid. + */ + public String getUuid() { + return uuid; + } + + /** + * @param uuid + * The uuid to set. + */ + public void setUuid(String uuid) { + this.uuid = uuid; + } + + /** + * @return Returns the fileOnline. + */ + public boolean isFileOnline() { + return fileOnline; + } + + /** + * @param fileOnline + * The fileOnline to set. + */ + public void setFileOnline(boolean fileOnline) { + this.fileOnline = fileOnline; + } + + public int compareTo(Object o) { + QaUploadedFile file = (QaUploadedFile) o; + //if the object does not exist yet, then just return any one of 0, -1, 1. Should not make a difference. + if (submissionId == null) + return 1; + else + return (int) (submissionId.longValue() - file.submissionId.longValue()); + } + + public String getFileProperty() { + if (isFileOnline()) { + return IToolContentHandler.TYPE_ONLINE; + } else + return IToolContentHandler.TYPE_OFFLINE; + } + + public void setFileProperty(String fileProperty) { + if (StringUtils.equals(IToolContentHandler.TYPE_ONLINE, fileProperty)) + this.fileOnline = true; + else + this.fileOnline = false; + } } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUsrResp.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUsrResp.java,v diff -u -r1.9 -r1.10 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUsrResp.java 20 Sep 2006 15:15:44 -0000 1.9 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUsrResp.java 19 Feb 2009 04:25:01 -0000 1.10 @@ -20,7 +20,7 @@ * http://www.gnu.org/licenses/gpl.txt * **************************************************************** */ -/* $$Id$$ */ +/* $$Id$$ */ package org.lamsfoundation.lams.tool.qa; import java.io.Serializable; @@ -32,16 +32,15 @@ import org.apache.commons.lang.builder.HashCodeBuilder; import org.apache.commons.lang.builder.ToStringBuilder; - /** * * @author Ozgur Demirtas * - * QaUsrResp Value Object - * The value object that maps to our model database table: tl_laqa11_usr_resp - * The relevant hibernate mapping resides in: QaQueResp.hbm.xml + * QaUsrResp Value Object The value object that maps to our model database + * table: tl_laqa11_usr_resp The relevant hibernate mapping resides in: + * QaQueResp.hbm.xml * - * Holds user responses to questions + * Holds user responses to questions */ public class QaUsrResp implements Serializable, Comparable { @@ -51,7 +50,7 @@ /** nullable persistent field */ private String answer; - + /** nullable persistent field */ private boolean hidden; @@ -60,353 +59,330 @@ /** nullable persistent field */ private QaQueContent qaQueContent; - + private boolean visible; - + /** nullable persistent field */ private Long qaQueContentId; //added to enable deletion by the resp dao - + /** nullable persistent field */ - private Long queUsrId; //added to enable deletion by the resp dao + private Long queUsrId; //added to enable deletion by the resp dao /** nullable persistent field */ private QaQueUsr qaQueUser; /** nullable persistent field */ private String timezone; - - + /** full constructor */ - public QaUsrResp(Long responseId, - String answer, - boolean hidden, - Date attemptTime, - String timezone, - QaQueContent qaQueContent, - QaQueUsr qaQueUser) { - this.responseId =responseId; - this.answer = answer; - this.hidden = hidden; - this.attemptTime = attemptTime; - this.timezone = timezone; - this.qaQueContent = qaQueContent; - this.qaQueUser = qaQueUser; + public QaUsrResp(Long responseId, String answer, boolean hidden, Date attemptTime, String timezone, + QaQueContent qaQueContent, QaQueUsr qaQueUser) { + this.responseId = responseId; + this.answer = answer; + this.hidden = hidden; + this.attemptTime = attemptTime; + this.timezone = timezone; + this.qaQueContent = qaQueContent; + this.qaQueUser = qaQueUser; } - - public QaUsrResp(String answer, - boolean hidden, - Date attemptTime, - String timezone, - QaQueContent qaQueContent, - QaQueUsr qaQueUser) { - this.answer = answer; - this.hidden = hidden; - this.attemptTime = attemptTime; - this.timezone = timezone; - this.qaQueContent = qaQueContent; - this.qaQueUser = qaQueUser; - } - + public QaUsrResp(String answer, boolean hidden, Date attemptTime, String timezone, QaQueContent qaQueContent, + QaQueUsr qaQueUser) { + this.answer = answer; + this.hidden = hidden; + this.attemptTime = attemptTime; + this.timezone = timezone; + this.qaQueContent = qaQueContent; + this.qaQueUser = qaQueUser; + } - public QaUsrResp(String answer, - boolean hidden, - Date attemptTime, - String timezone, - QaQueContent qaQueContent, - QaQueUsr qaQueUser, - boolean visible) { + public QaUsrResp(String answer, boolean hidden, Date attemptTime, String timezone, QaQueContent qaQueContent, + QaQueUsr qaQueUser, boolean visible) { this.answer = answer; this.hidden = hidden; this.attemptTime = attemptTime; this.timezone = timezone; this.qaQueContent = qaQueContent; this.qaQueUser = qaQueUser; - this.visible=visible; -} + this.visible = visible; + } - - public QaUsrResp(String answer, - boolean hidden, - Date attemptTime, - String timezone, - QaQueContent qaQueContent, - Long qaQueUsrUid) { - this.answer = answer; - this.hidden = hidden; - this.attemptTime = attemptTime; - this.timezone = timezone; - this.qaQueContent = qaQueContent; - this.queUsrId = qaQueUsrUid; + public QaUsrResp(String answer, boolean hidden, Date attemptTime, String timezone, QaQueContent qaQueContent, + Long qaQueUsrUid) { + this.answer = answer; + this.hidden = hidden; + this.attemptTime = attemptTime; + this.timezone = timezone; + this.qaQueContent = qaQueContent; + this.queUsrId = qaQueUsrUid; } - - - public QaUsrResp(String answer, - Date attemptTime, - QaQueContent question) - { - this.answer = answer; - this.attemptTime = attemptTime; - this.qaQueContent = question; + + public QaUsrResp(String answer, Date attemptTime, QaQueContent question) { + this.answer = answer; + this.attemptTime = attemptTime; + this.qaQueContent = question; } /** default constructor */ - public QaUsrResp(){} - + public QaUsrResp() { + } + /** * Copy construtor. Delegate to full construtor to achieve the object * creation. - * @param response the original survey user response + * + * @param response + * the original survey user response * @return the new qa user response cloned from original object */ - public static QaUsrResp newInstance(QaUsrResp response) - { - return new QaUsrResp(response.getResponseId(), - response.getAnswer(), - response.isHidden(), - response.getAttemptTime(), - response.getTimezone(), - response.getQaQueContent(), - response.qaQueUser); + public static QaUsrResp newInstance(QaUsrResp response) { + return new QaUsrResp(response.getResponseId(), response.getAnswer(), response.isHidden(), response + .getAttemptTime(), response.getTimezone(), response.getQaQueContent(), response.qaQueUser); } - - public String toString() { - return new ToStringBuilder(this) - .append("responseId: ", getResponseId()) - .append("answer:", getAnswer()) - .append("attempt time: ", getAttemptTime()) - .toString(); + return new ToStringBuilder(this).append("responseId: ", getResponseId()).append("answer:", getAnswer()).append( + "attempt time: ", getAttemptTime()).toString(); } public boolean equals(Object other) { - if ( !(other instanceof QaUsrResp) ) return false; - QaUsrResp castOther = (QaUsrResp) other; - return new EqualsBuilder() - .append(this.getResponseId(), castOther.getResponseId()) - .isEquals(); + if (!(other instanceof QaUsrResp)) + return false; + QaUsrResp castOther = (QaUsrResp) other; + return new EqualsBuilder().append(this.getResponseId(), castOther.getResponseId()).isEquals(); } public int hashCode() { - return new HashCodeBuilder() - .append(getResponseId()) - .toHashCode(); + return new HashCodeBuilder().append(getResponseId()).toHashCode(); } - /** - * @return Returns the answer. - */ - public String getAnswer() { - return answer; - } - /** - * @param answer The answer to set. - */ - public void setAnswer(String answer) { - this.answer = answer; - } - /** - * @return Returns the attemptTime. - */ - public Date getAttemptTime() { - return attemptTime; - } - /** - * @param attemptTime The attemptTime to set. - */ - public void setAttemptTime(Date attemptTime) { - this.attemptTime = attemptTime; - } - /** - * @return Returns the qaQueContent. - */ - public QaQueContent getQaQueContent() { - return qaQueContent; - } - /** - * @param qaQueContent The qaQueContent to set. - */ - public void setQaQueContent(QaQueContent qaQueContent) { - this.qaQueContent = qaQueContent; - } - /** - * @return Returns the qaQueUsr. - */ - public QaQueUsr getQaQueUser() { - return qaQueUser; - } - /** - * @param qaQueUsr The qaQueUsr to set. - */ - public void setQaQueUser(QaQueUsr qaQueUser) { - this.qaQueUser = qaQueUser; - } - /** - * @return Returns the responseId. - */ - public Long getResponseId() { - return responseId; - } - /** - * @param responseId The responseId to set. - */ - public void setResponseId(Long responseId) { - this.responseId = responseId; - } - - - /** + /** + * @return Returns the answer. + */ + public String getAnswer() { + return answer; + } + + /** + * @param answer + * The answer to set. + */ + public void setAnswer(String answer) { + this.answer = answer; + } + + /** + * @return Returns the attemptTime. + */ + public Date getAttemptTime() { + return attemptTime; + } + + /** + * @param attemptTime + * The attemptTime to set. + */ + public void setAttemptTime(Date attemptTime) { + this.attemptTime = attemptTime; + } + + /** + * @return Returns the qaQueContent. + */ + public QaQueContent getQaQueContent() { + return qaQueContent; + } + + /** + * @param qaQueContent + * The qaQueContent to set. + */ + public void setQaQueContent(QaQueContent qaQueContent) { + this.qaQueContent = qaQueContent; + } + + /** + * @return Returns the qaQueUsr. + */ + public QaQueUsr getQaQueUser() { + return qaQueUser; + } + + /** + * @param qaQueUsr + * The qaQueUsr to set. + */ + public void setQaQueUser(QaQueUsr qaQueUser) { + this.qaQueUser = qaQueUser; + } + + /** + * @return Returns the responseId. + */ + public Long getResponseId() { + return responseId; + } + + /** + * @param responseId + * The responseId to set. + */ + public void setResponseId(Long responseId) { + this.responseId = responseId; + } + + /** * @param responses * @return */ - public boolean doesRespExistIn(List responses) - { - for(Iterator i = responses.iterator();i.hasNext();) - { - QaUsrResp resp = (QaUsrResp)i.next(); - if((resp.getAnswer().trim()).equals(this.getAnswer().trim()) - &&resp.getQaQueUser().getQueUsrId()==this.getQaQueUser().getQueUsrId()) - return true; - } - return false; + public boolean doesRespExistIn(List responses) { + for (Iterator i = responses.iterator(); i.hasNext();) { + QaUsrResp resp = (QaUsrResp) i.next(); + if ((resp.getAnswer().trim()).equals(this.getAnswer().trim()) + && resp.getQaQueUser().getQueUsrId() == this.getQaQueUser().getQueUsrId()) + return true; + } + return false; } - - + /** * @param responses */ - public void updateResponseBy(List responses) - { - for(Iterator i = responses.iterator();i.hasNext();) - { - QaUsrResp resp = (QaUsrResp)i.next(); - if(resp.getQaQueUser().getQueUsrId()==this.getQaQueUser().getQueUsrId()) -// && resp.getQaAnsContent().getDisplayOrder()==this.getQaAnsContent().getDisplayOrder()) - this.updateResponse(resp); + public void updateResponseBy(List responses) { + for (Iterator i = responses.iterator(); i.hasNext();) { + QaUsrResp resp = (QaUsrResp) i.next(); + if (resp.getQaQueUser().getQueUsrId() == this.getQaQueUser().getQueUsrId()) + // && resp.getQaAnsContent().getDisplayOrder()==this.getQaAnsContent().getDisplayOrder()) + this.updateResponse(resp); - } + } } /** - * The response is not valid if it doesn't have a reference to question + * The response is not valid if it doesn't have a reference to question * object and question user object. - * @param resp the response to be validated + * + * @param resp + * the response to be validated * @return the validation result. */ - public boolean isResponseValid() - { - return this.getQaQueUser()!=null && this.getQaQueContent()!=null; - // &&this.getQaAnsContent()!=null; + public boolean isResponseValid() { + return this.getQaQueUser() != null && this.getQaQueContent() != null; + // &&this.getQaAnsContent()!=null; } - - + /** * Update current object according to the new response object. + * * @param resp */ - public void updateResponse(QaUsrResp resp) - { - if(!resp.isResponseValid()) - throw new IllegalArgumentException("Invalid response for update "); - - this.setAnswer(resp.getAnswer()); - this.setAttemptTime(resp.getAttemptTime()); - this.setQaQueContent(resp.getQaQueContent()); + public void updateResponse(QaUsrResp resp) { + if (!resp.isResponseValid()) + throw new IllegalArgumentException("Invalid response for update "); - this.setQaQueUser(resp.getQaQueUser()); - + this.setAnswer(resp.getAnswer()); + this.setAttemptTime(resp.getAttemptTime()); + this.setQaQueContent(resp.getQaQueContent()); + + this.setQaQueUser(resp.getQaQueUser()); + } - - + /** - * Validate whether the current response is correspondent to an author + * Validate whether the current response is correspondent to an author * defined answer. * * @return boolean value */ - public boolean isPredefinedResponse() - { - //may need to add more logic here - return false; + public boolean isPredefinedResponse() { + //may need to add more logic here + return false; } - - - public int compareTo(Object o) - { - QaUsrResp response = (QaUsrResp) o; - if (responseId == null) - return -1; - if (response.responseId == null) - return 1; + public int compareTo(Object o) { + QaUsrResp response = (QaUsrResp) o; - return (int) (responseId.longValue() - response.responseId.longValue()); + if (responseId == null) + return -1; + if (response.responseId == null) + return 1; + + return (int) (responseId.longValue() - response.responseId.longValue()); } - - - /** - * @return Returns the qaQueContentId. - */ - public Long getQaQueContentId() { - return qaQueContentId; - } - /** - * @param qaQueContentId The qaQueContentId to set. - */ - public void setQaQueContentId(Long qaQueContentId) { - this.qaQueContentId = qaQueContentId; - } - /** - * @return Returns the queUsrId. - */ - public Long getQueUsrId() { - return queUsrId; - } - /** - * @param queUsrId The queUsrId to set. - */ - public void setQueUsrId(Long queUsrId) { - this.queUsrId = queUsrId; - } - /** - * @return Returns the hidden. - */ - public boolean isHidden() { - return hidden; - } - /** - * @param hidden The hidden to set. - */ - public void setHidden(boolean hidden) { - this.hidden = hidden; - } - - /** - * @return Returns the timezone. - */ - public String getTimezone() { - return timezone; - } - /** - * @param timezone The timezone to set. - */ - public void setTimezone(String timezone) { - this.timezone = timezone; - } - /** + * @return Returns the qaQueContentId. + */ + public Long getQaQueContentId() { + return qaQueContentId; + } + + /** + * @param qaQueContentId + * The qaQueContentId to set. + */ + public void setQaQueContentId(Long qaQueContentId) { + this.qaQueContentId = qaQueContentId; + } + + /** + * @return Returns the queUsrId. + */ + public Long getQueUsrId() { + return queUsrId; + } + + /** + * @param queUsrId + * The queUsrId to set. + */ + public void setQueUsrId(Long queUsrId) { + this.queUsrId = queUsrId; + } + + /** + * @return Returns the hidden. + */ + public boolean isHidden() { + return hidden; + } + + /** + * @param hidden + * The hidden to set. + */ + public void setHidden(boolean hidden) { + this.hidden = hidden; + } + + /** + * @return Returns the timezone. + */ + public String getTimezone() { + return timezone; + } + + /** + * @param timezone + * The timezone to set. + */ + public void setTimezone(String timezone) { + this.timezone = timezone; + } + + /** * @return Returns the visible. */ public boolean isVisible() { - return visible; + return visible; } + /** - * @param visible The visible to set. + * @param visible + * The visible to set. */ public void setVisible(boolean visible) { - this.visible = visible; + this.visible = visible; } - + } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/Attic/QaUtils.java,v diff -u -r1.57 -r1.58 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java 26 Nov 2006 22:25:37 -0000 1.57 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java 19 Feb 2009 04:25:01 -0000 1.58 @@ -20,7 +20,7 @@ * http://www.gnu.org/licenses/gpl.txt * **************************************************************** */ -/* $$Id$$ */ +/* $$Id$$ */ package org.lamsfoundation.lams.tool.qa; import java.text.DateFormat; @@ -44,566 +44,526 @@ /** * @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 */ /** - * Common utility functions live here. + * Common utility functions live here. */ public abstract class QaUtils implements QaAppConstants { - static Logger logger = Logger.getLogger(QaUtils.class.getName()); - + static Logger logger = Logger.getLogger(QaUtils.class.getName()); + /** - * setDefaultSessionAttributes(HttpServletRequest request, QaContent defaultQaContent, QaAuthoringForm qaAuthoringForm) + * setDefaultSessionAttributes(HttpServletRequest request, QaContent + * defaultQaContent, QaAuthoringForm qaAuthoringForm) * * @param request * @param defaultQaContent * @param qaAuthoringForm */ - public static void populateAuthoringDTO(HttpServletRequest request, QaContent defaultQaContent, - QaGeneralAuthoringDTO qaGeneralAuthoringDTO) - { - qaGeneralAuthoringDTO.setActivityTitle(defaultQaContent.getTitle()); - qaGeneralAuthoringDTO.setActivityInstructions(defaultQaContent.getInstructions()); - - qaGeneralAuthoringDTO.setOnlineInstructions(defaultQaContent.getOnlineInstructions()); - qaGeneralAuthoringDTO.setOfflineInstructions(defaultQaContent.getOfflineInstructions()); + public static void populateAuthoringDTO(HttpServletRequest request, QaContent defaultQaContent, + QaGeneralAuthoringDTO qaGeneralAuthoringDTO) { + qaGeneralAuthoringDTO.setActivityTitle(defaultQaContent.getTitle()); + qaGeneralAuthoringDTO.setActivityInstructions(defaultQaContent.getInstructions()); + + qaGeneralAuthoringDTO.setOnlineInstructions(defaultQaContent.getOnlineInstructions()); + qaGeneralAuthoringDTO.setOfflineInstructions(defaultQaContent.getOfflineInstructions()); + } + + public static String replaceNewLines(String text) { + logger.debug("using text: " + text); + String newText = ""; + if (text != null) { + newText = text.replaceAll("\n", "DTO that holds reflections from users + *
+ * DTO that holds reflections from users *
* * @author Ozgur Demirtas */ -public class ReflectionDTO implements Comparable -{ +public class ReflectionDTO implements Comparable { protected String userName; - + protected String userId; - + protected String sessionId; - + protected String reflectionUid; - + protected String entry; - - - public int compareTo(Object o) - { - ReflectionDTO reflectionDTO = (ReflectionDTO) o; - - if (reflectionDTO == null) - return 1; - else - return 0; + + public int compareTo(Object o) { + ReflectionDTO reflectionDTO = (ReflectionDTO) o; + + if (reflectionDTO == null) + return 1; + else + return 0; } - - public String toString() { - return new ToStringBuilder(this) - .append("userName: ", userName) - .append("userId: ", userId) - .append("sessionId: ", sessionId) - .append("reflectionUid: ", reflectionUid) - .append("entry: ", entry) - .toString(); + public String toString() { + return new ToStringBuilder(this).append("userName: ", userName).append("userId: ", userId).append( + "sessionId: ", sessionId).append("reflectionUid: ", reflectionUid).append("entry: ", entry).toString(); } - - /** * @return Returns the entry. */ public String getEntry() { - return entry; + return entry; } + /** - * @param entry The entry to set. + * @param entry + * The entry to set. */ public void setEntry(String entry) { - this.entry = entry; + this.entry = entry; } + /** * @return Returns the sessionId. */ public String getSessionId() { - return sessionId; + return sessionId; } + /** - * @param sessionId The sessionId to set. + * @param sessionId + * The sessionId to set. */ public void setSessionId(String sessionId) { - this.sessionId = sessionId; + this.sessionId = sessionId; } + /** * @return Returns the reflectionUid. */ public String getReflectionUid() { - return reflectionUid; + return reflectionUid; } + /** - * @param reflectionUid The reflectionUid to set. + * @param reflectionUid + * The reflectionUid to set. */ public void setReflectionUid(String reflectionUid) { - this.reflectionUid = reflectionUid; + this.reflectionUid = reflectionUid; } + /** * @return Returns the userId. */ public String getUserId() { - return userId; + return userId; } + /** - * @param userId The userId to set. + * @param userId + * The userId to set. */ public void setUserId(String userId) { - this.userId = userId; + this.userId = userId; } + /** * @return Returns the userName. */ public String getUserName() { - return userName; + return userName; } + /** - * @param userName The userName to set. + * @param userName + * The userName to set. */ public void setUserName(String userName) { - this.userName = userName; + this.userName = userName; } } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaQueContentDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/Attic/IQaQueContentDAO.java,v diff -u -r1.17 -r1.18 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaQueContentDAO.java 9 Dec 2008 05:38:15 -0000 1.17 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaQueContentDAO.java 19 Feb 2009 04:19:24 -0000 1.18 @@ -28,35 +28,33 @@ import org.lamsfoundation.lams.tool.qa.QaContent; import org.lamsfoundation.lams.tool.qa.QaQueContent; - /** * * @author Ozgur Demirtas - * + * */ -public interface IQaQueContentDAO -{ +public interface IQaQueContentDAO { public QaQueContent getQaQueById(long qaQueContentId); - + public QaQueContent getToolDefaultQuestionContent(final long qaContentId); - + public List getQuestionIndsForContent(QaContent qa); - + public void createQueContent(QaQueContent queContent); - + public void saveOrUpdateQaQueContent(QaQueContent qaQueContent); - + public void removeQueContent(long qaQueContentId); - + public void removeQaQueContent(QaQueContent qaQueContent); - + public List getQaQueContentsByContentId(long qaContentId); - + public List getAllQuestionEntries(final long qaContentId); - + public QaQueContent getQuestionContentByQuestionText(final String question, Long qaContentId); - - public QaQueContent getQuestionContentByDisplayOrder(Long displayOrder, Long qaContentId); - - public List getAllQuestionEntriesSorted(final long qaContentId); + + public QaQueContent getQuestionContentByDisplayOrder(Long displayOrder, Long qaContentId); + + public List getAllQuestionEntriesSorted(final long qaContentId); } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaSessionDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaSessionDAO.java,v diff -u -r1.13 -r1.14 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaSessionDAO.java 20 Sep 2006 15:15:44 -0000 1.13 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaSessionDAO.java 19 Feb 2009 04:19:24 -0000 1.14 @@ -28,42 +28,35 @@ import org.lamsfoundation.lams.tool.qa.QaContent; import org.lamsfoundation.lams.tool.qa.QaSession; - /** + * * + * @author Ozgur Demirtas * - * * @author Ozgur Demirtas - * */ -public interface IQaSessionDAO -{ - public int countSessionIncomplete(); - - public int countSessionComplete(); - - public int countSessionComplete(QaContent qa); - - public QaSession getQaSessionById(long qaSessionId); - - public List getToolSessionsForContent(QaContent qa); - - public QaSession getQaSessionOrNullById(long qaSessionId); - - public int studentActivityOccurred(QaContent qa); - - public void CreateQaSession(QaSession session); - +public interface IQaSessionDAO { + public int countSessionIncomplete(); + + public int countSessionComplete(); + + public int countSessionComplete(QaContent qa); + + public QaSession getQaSessionById(long qaSessionId); + + public List getToolSessionsForContent(QaContent qa); + + public QaSession getQaSessionOrNullById(long qaSessionId); + + public int studentActivityOccurred(QaContent qa); + + public void CreateQaSession(QaSession session); + public void UpdateQaSession(QaSession session); - + public void deleteQaSession(QaSession session); - + public List getSessionsFromContent(QaContent qaContent); - + public String getSessionNameById(long qaSessionId); - + public List getSessionNamesFromContent(QaContent qaContent); } - - - - - Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaUsrRespDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaUsrRespDAO.java,v diff -u -r1.12 -r1.13 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaUsrRespDAO.java 11 Nov 2006 14:58:39 -0000 1.12 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaUsrRespDAO.java 19 Feb 2009 04:19:24 -0000 1.13 @@ -27,31 +27,27 @@ import org.lamsfoundation.lams.tool.qa.QaUsrResp; - /** * * @author Ozgur Demirtas * */ -public interface IQaUsrRespDAO -{ - public void saveUserResponse(QaUsrResp resp); - - public QaUsrResp getAttemptByUID(Long uid); +public interface IQaUsrRespDAO { + public void saveUserResponse(QaUsrResp resp); - public void updateUserResponse(QaUsrResp resp); - - public void createUserResponse(QaUsrResp resp); - - public void removeUserResponse(QaUsrResp resp); - - public void removeUserResponseByQaQueId(Long qaQueId); - - public QaUsrResp retrieveQaUsrResp(long responseId); - - public List getAttemptsForUserAndQuestionContent(final Long queUsrId, final Long qaQueContentId); - - public void removeAttemptsForUserAndQuestionContent(final Long queUsrId, final Long qaQueContentId); -} + public QaUsrResp getAttemptByUID(Long uid); + public void updateUserResponse(QaUsrResp resp); + public void createUserResponse(QaUsrResp resp); + + public void removeUserResponse(QaUsrResp resp); + + public void removeUserResponseByQaQueId(Long qaQueId); + + public QaUsrResp retrieveQaUsrResp(long responseId); + + public List getAttemptsForUserAndQuestionContent(final Long queUsrId, final Long qaQueContentId); + + public void removeAttemptsForUserAndQuestionContent(final Long queUsrId, final Long qaQueContentId); +} Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaWizardDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaWizardDAO.java,v diff -u -r1.2 -r1.3 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaWizardDAO.java 4 Nov 2008 05:10:34 -0000 1.2 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaWizardDAO.java 19 Feb 2009 04:19:24 -0000 1.3 @@ -18,23 +18,26 @@ * * http://www.gnu.org/licenses/gpl.txt * **************************************************************** - */ - -/* $Id$ */ -package org.lamsfoundation.lams.tool.qa.dao; + */ +/* $Id$ */ +package org.lamsfoundation.lams.tool.qa.dao; + import java.util.SortedSet; import org.lamsfoundation.lams.dao.IBaseDAO; import org.lamsfoundation.lams.tool.qa.QaWizardCategory; -import org.lamsfoundation.lams.tool.qa.QaWizardCognitiveSkill; -import org.lamsfoundation.lams.tool.qa.QaWizardQuestion; -public interface IQaWizardDAO extends IBaseDAO{ + +public interface IQaWizardDAO extends IBaseDAO { void saveOrUpdateCategories(SortedSetTicket
to login and
- * access the Content Repository.
+ * 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.
+ * 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
@@ -1423,8 +1446,8 @@
}
/**
- * This method deletes the content with the given uuid
and versionID
from the content
- * repository
+ * 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
@@ -1768,7 +1791,8 @@
}
/**
- * Set the description, throws away the title value as this is not supported in 2.0
+ * Set the description, throws away the title value as this is not supported
+ * in 2.0
*/
public void setReflectiveData(Long toolContentId, String title, String description) throws ToolException,
DataMissingException {
@@ -1894,7 +1918,8 @@
}
/**
- * Saves the entire set of QaWizardCategories (including the child cognitive skills and questions)
+ * Saves the entire set of QaWizardCategories (including the child cognitive
+ * skills and questions)
*
* @param categories
*/
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServiceProxy.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServiceProxy.java,v
diff -u -r1.10 -r1.11
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServiceProxy.java 20 Sep 2006 15:15:44 -0000 1.10
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServiceProxy.java 19 Feb 2009 04:25:02 -0000 1.11
@@ -29,46 +29,42 @@
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
-
/**
- * This class act as the proxy between web layer and service layer. It is - * designed to decouple the presentation logic and business logic completely. - * In this way, the presentation tier will no longer be aware of the changes in + *
+ * This class act as the proxy between web layer and service layer. It is + * designed to decouple the presentation logic and business logic completely. In + * this way, the presentation tier will no longer be aware of the changes in * service layer. Therefore we can feel free to switch the business logic - * implementation.
+ * implementation. + * * * @author Ozgur Demirtas - * + * */ -public class QaServiceProxy -{ +public class QaServiceProxy { /** * Return the q/a domain service object. It will delegate to the Spring * helper method to retrieve the proper bean from Spring bean factory. - * @param servletContext the servletContext for current application + * + * @param servletContext + * the servletContext for current application * @return qaService object. */ - public static final IQaService getQaService(ServletContext servletContext) - { - return (IQaService)getQaDomainService(servletContext); + public static final IQaService getQaService(ServletContext servletContext) { + return (IQaService) getQaDomainService(servletContext); } - - public static final ToolSessionManager getQaSessionManager(ServletContext servletContext) - { - return (ToolSessionManager)getQaDomainService(servletContext); + + public static final ToolSessionManager getQaSessionManager(ServletContext servletContext) { + return (ToolSessionManager) getQaDomainService(servletContext); } - - public static final ToolContentManager getQaContentManager(ServletContext servletContext) - { - return (ToolContentManager)getQaDomainService(servletContext); + + public static final ToolContentManager getQaContentManager(ServletContext servletContext) { + return (ToolContentManager) getQaDomainService(servletContext); } - - private static Object getQaDomainService(ServletContext servletContext) - { - WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext); - return wac.getBean("qaService"); + private static Object getQaDomainService(ServletContext servletContext) { + WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext); + return wac.getBean("qaService"); } - } \ No newline at end of file Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/util/QaQueContentComparator.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/util/QaQueContentComparator.java,v diff -u -r1.1 -r1.2 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/util/QaQueContentComparator.java 30 Sep 2008 05:54:57 -0000 1.1 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/util/QaQueContentComparator.java 19 Feb 2009 04:25:02 -0000 1.2 @@ -5,7 +5,8 @@ import org.lamsfoundation.lams.tool.qa.QaQueContent; /** - * Comparator forQaQueContent
. Only the display order is compared.
+ * Comparator for QaQueContent
. Only the display order is
+ * compared.
*
* @author Marcin Cieslak
*/
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/util/QaQuestionContentDTOComparator.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/util/QaQuestionContentDTOComparator.java,v
diff -u -r1.1 -r1.2
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/util/QaQuestionContentDTOComparator.java 30 Sep 2008 05:54:57 -0000 1.1
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/util/QaQuestionContentDTOComparator.java 19 Feb 2009 04:25:02 -0000 1.2
@@ -5,7 +5,8 @@
import org.lamsfoundation.lams.tool.qa.QaQuestionContentDTO;
/**
- * Comparator for QaQuestionContentDTO
. Only the display order is compared.
+ * Comparator for QaQuestionContentDTO
. Only the display order
+ * is compared.
*
* @author Marcin Cieslak
*/
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/util/QaToolContentHandler.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/util/QaToolContentHandler.java,v
diff -u -r1.9 -r1.10
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/util/QaToolContentHandler.java 20 Sep 2006 15:15:44 -0000 1.9
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/util/QaToolContentHandler.java 19 Feb 2009 04:25:01 -0000 1.10
@@ -32,34 +32,34 @@
public class QaToolContentHandler extends ToolContentHandler {
public static final String SPRING_BEAN_NAME = "qaToolContentHandler";
-
+
private static String repositoryWorkspaceName = "qaworkspace";
private static String repositoryUser = "qa_user";
- private static char[] repositoryId = {'l','a','m','s','-','q','a'};
+ private static char[] repositoryId = { 'l', 'a', 'm', 's', '-', 'q', 'a' };
private QaToolContentHandler() {
- super();
+ super();
}
/* (non-Javadoc)
* @see org.lamsfoundation.lams.contentrepository.client.ToolContentHandler#getRepositoryWorkspaceName()
*/
public String getRepositoryWorkspaceName() {
- return repositoryWorkspaceName;
+ return repositoryWorkspaceName;
}
/* (non-Javadoc)
* @see org.lamsfoundation.lams.contentrepository.client.ToolContentHandler#getRepositoryUser()
*/
public String getRepositoryUser() {
- return repositoryUser;
+ return repositoryUser;
}
/* (non-Javadoc)
* @see org.lamsfoundation.lams.contentrepository.client.ToolContentHandler#getRepositoryId()
*/
public char[] getRepositoryId() {
- return repositoryId;
+ return repositoryId;
}
}
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/AuthoringUtil.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/AuthoringUtil.java,v
diff -u -r1.47 -r1.48
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/AuthoringUtil.java 9 Dec 2008 05:38:14 -0000 1.47
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/AuthoringUtil.java 19 Feb 2009 04:25:02 -0000 1.48
@@ -371,8 +371,8 @@
}
/**
- * repopulateMap(TreeMap mapQuestionContent, HttpServletRequest request) return void repopulates the user entries
- * into the Map
+ * repopulateMap(TreeMap mapQuestionContent, HttpServletRequest request)
+ * return void repopulates the user entries into the Map
*/
protected void repopulateMap(Map mapQuestionContent, HttpServletRequest request) {
AuthoringUtil.logger.debug("starting repopulateMap");
@@ -561,8 +561,9 @@
}
/**
- * removes unused question entries from db removeRedundantQuestions (Map mapQuestionContent, IQaService qaService,
- * QaAuthoringForm qaAuthoringForm)
+ * removes unused question entries from db removeRedundantQuestions (Map
+ * mapQuestionContent, IQaService qaService, QaAuthoringForm
+ * qaAuthoringForm)
*
* @param mapQuestionContent
* @param qaService
@@ -641,7 +642,8 @@
}
/**
- * createQuestionContent(TreeMap mapQuestionContent, HttpServletRequest request) return void
+ * createQuestionContent(TreeMap mapQuestionContent, HttpServletRequest
+ * request) return void
*
* persist the questions in the Map the user has submitted
*/
@@ -744,8 +746,9 @@
}
/**
- * sorts the questions by the display order reOrganizeDisplayOrder(Map mapQuestionContent, IQaService qaService,
- * QaAuthoringForm qaAuthoringForm, QaContent qaContent)
+ * sorts the questions by the display order reOrganizeDisplayOrder(Map
+ * mapQuestionContent, IQaService qaService, QaAuthoringForm
+ * qaAuthoringForm, QaContent qaContent)
*
* @param mapQuestionContent
* @param qaService
@@ -782,7 +785,8 @@
}
/**
- * checks if any entry is duplicate verifyDuplicatesOptionsMap(Map mapQuestions)
+ * checks if any entry is duplicate verifyDuplicatesOptionsMap(Map
+ * mapQuestions)
*
* @param mapQuestions
* @return
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ClearSessionAction.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ClearSessionAction.java,v
diff -u -r1.5 -r1.6
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ClearSessionAction.java 20 Sep 2006 15:15:41 -0000 1.5
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ClearSessionAction.java 19 Feb 2009 04:25:02 -0000 1.6
@@ -31,22 +31,22 @@
import org.lamsfoundation.lams.web.util.AttributeNames;
/**
- * This class give a chance to clear HttpSession when user save/close authoring page.
- * @author Steve.Ni
- * ----------------XDoclet Tags--------------------
+ * This class give a chance to clear HttpSession when user save/close authoring
+ * page.
*
- * @struts:action path="/clearsession" validate="false"
- *
+ * @author Steve.Ni ----------------XDoclet Tags--------------------
+ *
+ * @struts:action path="/clearsession" validate="false"
+ *
* @version $Revision$
*/
public class ClearSessionAction extends LamsAuthoringFinishAction {
- @Override
- public void clearSession(String customiseSessionID,HttpSession session, ToolAccessMode mode) {
- if(mode.isAuthor()){
- session.removeAttribute(QaAction.SUBMIT_SUCCESS);
- }
+ @Override
+ public void clearSession(String customiseSessionID, HttpSession session, ToolAccessMode mode) {
+ if (mode.isAuthor()) {
+ session.removeAttribute(QaAction.SUBMIT_SUCCESS);
}
+ }
-
}
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java,v
diff -u -r1.16 -r1.17
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java 21 Nov 2007 00:48:14 -0000 1.16
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java 19 Feb 2009 04:25:02 -0000 1.17
@@ -21,7 +21,6 @@
* ****************************************************************
*/
-
package org.lamsfoundation.lams.tool.qa.web;
import javax.servlet.http.Cookie;
@@ -40,165 +39,162 @@
import org.lamsfoundation.lams.tool.qa.service.IQaService;
import org.lamsfoundation.lams.tool.qa.service.QaServiceProxy;
import org.lamsfoundation.lams.web.servlet.AbstractExportPortfolioServlet;
+
/**
- * Enables exporting portfolio for teacher and learner modes.
+ *+ * Enables exporting portfolio for teacher and learner modes. + *
* * @author Ozgur Demirtas */ -public class ExportServlet extends AbstractExportPortfolioServlet implements QaAppConstants{ - static Logger logger = Logger.getLogger(ExportServlet.class.getName()); - private static final long serialVersionUID = -1779093489007108143L; - private final String FILENAME = "qa_main.html"; - - - public String doExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) - { - logger.debug("dispathcing doExport"); - String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath(); - logger.debug("basePath:" + basePath); +public class ExportServlet extends AbstractExportPortfolioServlet implements QaAppConstants { + static Logger logger = Logger.getLogger(ExportServlet.class.getName()); + private static final long serialVersionUID = -1779093489007108143L; + private final String FILENAME = "qa_main.html"; - if (StringUtils.equals(mode,ToolAccessMode.LEARNER.toString())){ - learner(request,response,directoryName,cookies); - }else if (StringUtils.equals(mode,ToolAccessMode.TEACHER.toString())){ - teacher(request,response,directoryName,cookies); - } + public String doExport(HttpServletRequest request, HttpServletResponse response, String directoryName, + Cookie[] cookies) { + logger.debug("dispathcing doExport"); + String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + + request.getContextPath(); + logger.debug("basePath:" + basePath); - writeResponseToFile(basePath+"/export/exportportfolio.jsp",directoryName,FILENAME,cookies); - - return FILENAME; + if (StringUtils.equals(mode, ToolAccessMode.LEARNER.toString())) { + learner(request, response, directoryName, cookies); + } else if (StringUtils.equals(mode, ToolAccessMode.TEACHER.toString())) { + teacher(request, response, directoryName, cookies); } - - protected String doOfflineExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) { - if (toolContentID == null && toolSessionID == null) { - logger.error("Tool content Id or and session Id are null. Unable to activity title"); - } else { - IQaService service = QaServiceProxy.getQaService(getServletContext()); - QaContent content = null; - if ( toolContentID != null ) { - content=service.retrieveQa(toolContentID); - } else { - QaSession session=service.retrieveQaSession(toolSessionID); - if ( session != null ) - content = session.getQaContent(); - } - if ( content != null ) { - activityTitle = content.getTitle(); - } - } - return super.doOfflineExport(request, response, directoryName, cookies); + + writeResponseToFile(basePath + "/export/exportportfolio.jsp", directoryName, FILENAME, cookies); + + return FILENAME; + } + + protected String doOfflineExport(HttpServletRequest request, HttpServletResponse response, String directoryName, + Cookie[] cookies) { + if (toolContentID == null && toolSessionID == null) { + logger.error("Tool content Id or and session Id are null. Unable to activity title"); + } else { + IQaService service = QaServiceProxy.getQaService(getServletContext()); + QaContent content = null; + if (toolContentID != null) { + content = service.retrieveQa(toolContentID); + } else { + QaSession session = service.retrieveQaSession(toolSessionID); + if (session != null) + content = session.getQaContent(); + } + if (content != null) { + activityTitle = content.getTitle(); + } } + return super.doOfflineExport(request, response, directoryName, cookies); + } - public void learner(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) - { - logger.debug("starting learner mode..."); - - IQaService qaService = QaServiceProxy.getQaService(getServletContext()); - - logger.debug("userID:" + userID); - logger.debug("toolSessionID:" + toolSessionID); - - if (userID == null || toolSessionID == null) - { - String error = "Tool session Id or user Id is null. Unable to continue"; - logger.error(error); - throw new QaApplicationException(error); - } - - QaSession qaSession=qaService.retrieveQaSessionOrNullById(toolSessionID.longValue()); - - // If the learner hasn't answered yet, then they won't exist in the session. - // Yet we might be asked for their page, as the activity has been commenced. - // So need to do a "blank" page in that case - QaQueUsr learner = qaService.getQaUserBySession(userID,qaSession.getUid()); - logger.debug("learner: " + learner); - - QaContent content=qaSession.getQaContent(); - logger.debug("content: " + content); - logger.debug("content id: " + content.getQaContentId()); - - if (content == null) - { - String error="The content for this activity has not been defined yet."; - logger.error(error); - throw new QaApplicationException(error); - } + public void learner(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) { + logger.debug("starting learner mode..."); - logger.debug("calling learning mode toolSessionID:" + toolSessionID + " userID: " + userID ); - QaMonitoringAction qaMonitoringAction= new QaMonitoringAction(); - logger.debug("start refreshSummaryData for learner mode."); + IQaService qaService = QaServiceProxy.getQaService(getServletContext()); - GeneralLearnerFlowDTO generalLearnerFlowDTO= LearningUtil.buildGeneralLearnerFlowDTO(content); - generalLearnerFlowDTO.setUserUid(learner != null?learner.getUid().toString():null); - logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); + logger.debug("userID:" + userID); + logger.debug("toolSessionID:" + toolSessionID); - // if learner is null, don't want to show other people's answers - if ( learner != null ) { - qaMonitoringAction.refreshSummaryData(request, content, qaService, content.isUsernameVisible(), true, toolSessionID.toString(), - userID.toString(), generalLearnerFlowDTO, false, toolSessionID.toString()); - logger.debug("end refreshSummaryData for learner mode."); - qaMonitoringAction.prepareReflectionData(request, content, qaService, userID.toString(), true, toolSessionID.toString()); - } - - generalLearnerFlowDTO =(GeneralLearnerFlowDTO)request.getAttribute(GENERAL_LEARNER_FLOW_DTO); - logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO); + if (userID == null || toolSessionID == null) { + String error = "Tool session Id or user Id is null. Unable to continue"; + logger.error(error); + throw new QaApplicationException(error); + } - logger.debug("for the special case of export portfolio we place generalLearnerFlowDTO into session scope"); - request.getSession().setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); + QaSession qaSession = qaService.retrieveQaSessionOrNullById(toolSessionID.longValue()); - request.getSession().setAttribute(PORTFOLIO_EXPORT_MODE, "learner"); - logger.debug("ending learner mode: "); + // If the learner hasn't answered yet, then they won't exist in the session. + // Yet we might be asked for their page, as the activity has been commenced. + // So need to do a "blank" page in that case + QaQueUsr learner = qaService.getQaUserBySession(userID, qaSession.getUid()); + logger.debug("learner: " + learner); + + QaContent content = qaSession.getQaContent(); + logger.debug("content: " + content); + logger.debug("content id: " + content.getQaContentId()); + + if (content == null) { + String error = "The content for this activity has not been defined yet."; + logger.error(error); + throw new QaApplicationException(error); + } + + logger.debug("calling learning mode toolSessionID:" + toolSessionID + " userID: " + userID); + QaMonitoringAction qaMonitoringAction = new QaMonitoringAction(); + logger.debug("start refreshSummaryData for learner mode."); + + GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(content); + generalLearnerFlowDTO.setUserUid(learner != null ? learner.getUid().toString() : null); + logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); + + // if learner is null, don't want to show other people's answers + if (learner != null) { + qaMonitoringAction + .refreshSummaryData(request, content, qaService, content.isUsernameVisible(), true, toolSessionID + .toString(), userID.toString(), generalLearnerFlowDTO, false, toolSessionID.toString()); + logger.debug("end refreshSummaryData for learner mode."); + qaMonitoringAction.prepareReflectionData(request, content, qaService, userID.toString(), true, + toolSessionID.toString()); + } + + generalLearnerFlowDTO = (GeneralLearnerFlowDTO) request.getAttribute(GENERAL_LEARNER_FLOW_DTO); + logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO); + + logger.debug("for the special case of export portfolio we place generalLearnerFlowDTO into session scope"); + request.getSession().setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); + + request.getSession().setAttribute(PORTFOLIO_EXPORT_MODE, "learner"); + logger.debug("ending learner mode: "); } - - public void teacher(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) - { - logger.debug("starting teacher mode..."); - - IQaService qaService = QaServiceProxy.getQaService(getServletContext()); - - if (toolContentID==null) - { - String error="Tool Content Id is missing. Unable to continue"; - logger.error(error); - throw new QaApplicationException(error); - } - QaContent content=qaService.loadQa(toolContentID.longValue()); - logger.debug("content: " + content); - - if (content == null) - { - String error="Data is missing from the database. Unable to Continue"; - logger.error(error); - throw new QaApplicationException(error); - } - - QaMonitoringAction qaMonitoringAction= new QaMonitoringAction(); - logger.debug("start refreshSummaryData for teacher mode."); + public void teacher(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) { + logger.debug("starting teacher mode..."); - GeneralLearnerFlowDTO generalLearnerFlowDTO= LearningUtil.buildGeneralLearnerFlowDTO(content); - logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); - qaMonitoringAction.refreshSummaryData(request, content, qaService, true, false, - null, null, generalLearnerFlowDTO, false, "All"); - logger.debug("end refreshSummaryData for teacher mode."); - logger.debug("teacher uses content id: " + content.getQaContentId()); - - generalLearnerFlowDTO =(GeneralLearnerFlowDTO)request.getAttribute(GENERAL_LEARNER_FLOW_DTO); - logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO); - - logger.debug("for the special case of export portfolio we place generalLearnerFlowDTO into session scope"); - request.getSession().setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); + IQaService qaService = QaServiceProxy.getQaService(getServletContext()); - request.getSession().setAttribute(PORTFOLIO_EXPORT_MODE, "teacher"); - - qaMonitoringAction.prepareReflectionData(request, content, qaService, null, true, "All"); - - - request.setAttribute("currentMonitoredToolSession", "All"); - MonitoringUtil.generateGroupsSessionData(request, qaService, content, true); - - - - logger.debug("ending teacher mode: "); + if (toolContentID == null) { + String error = "Tool Content Id is missing. Unable to continue"; + logger.error(error); + throw new QaApplicationException(error); + } + + QaContent content = qaService.loadQa(toolContentID.longValue()); + logger.debug("content: " + content); + + if (content == null) { + String error = "Data is missing from the database. Unable to Continue"; + logger.error(error); + throw new QaApplicationException(error); + } + + QaMonitoringAction qaMonitoringAction = new QaMonitoringAction(); + logger.debug("start refreshSummaryData for teacher mode."); + + GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(content); + logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO); + qaMonitoringAction.refreshSummaryData(request, content, qaService, true, false, null, null, + generalLearnerFlowDTO, false, "All"); + logger.debug("end refreshSummaryData for teacher mode."); + logger.debug("teacher uses content id: " + content.getQaContentId()); + + generalLearnerFlowDTO = (GeneralLearnerFlowDTO) request.getAttribute(GENERAL_LEARNER_FLOW_DTO); + logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO); + + logger.debug("for the special case of export portfolio we place generalLearnerFlowDTO into session scope"); + request.getSession().setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO); + + request.getSession().setAttribute(PORTFOLIO_EXPORT_MODE, "teacher"); + + qaMonitoringAction.prepareReflectionData(request, content, qaService, null, true, "All"); + + request.setAttribute("currentMonitoredToolSession", "All"); + MonitoringUtil.generateGroupsSessionData(request, qaService, content, true); + + logger.debug("ending teacher mode: "); } } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/LearningUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/LearningUtil.java,v diff -u -r1.39 -r1.40 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/LearningUtil.java 13 Nov 2006 19:38:46 -0000 1.39 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/LearningUtil.java 19 Feb 2009 04:25:02 -0000 1.40 @@ -50,333 +50,288 @@ /** * - * Keeps all operations needed for Learning mode. + * Keeps all operations needed for Learning mode. + * * @author Ozgur Demirtas - * + * */ -public class LearningUtil implements QaAppConstants{ - static Logger logger = Logger.getLogger(LearningUtil.class.getName()); - - public static void saveFormRequestData(HttpServletRequest request, QaLearningForm qaLearningForm) - { - logger.debug("saving form request data..."); - String toolSessionID=request.getParameter("toolSessionID"); - logger.debug("toolSessionID: " + toolSessionID); - qaLearningForm.setToolSessionID(toolSessionID); +public class LearningUtil implements QaAppConstants { + static Logger logger = Logger.getLogger(LearningUtil.class.getName()); - String userID=request.getParameter("userID"); - logger.debug("userID: " + userID); - qaLearningForm.setUserID(userID); - - String httpSessionID=request.getParameter("httpSessionID"); - logger.debug("httpSessionID: " + httpSessionID); - qaLearningForm.setHttpSessionID(httpSessionID); - - String totalQuestionCount=request.getParameter("totalQuestionCount"); - logger.debug("totalQuestionCount: " + totalQuestionCount); - qaLearningForm.setTotalQuestionCount(totalQuestionCount); - - logger.debug("done saving form request data."); + public static void saveFormRequestData(HttpServletRequest request, QaLearningForm qaLearningForm) { + logger.debug("saving form request data..."); + String toolSessionID = request.getParameter("toolSessionID"); + logger.debug("toolSessionID: " + toolSessionID); + qaLearningForm.setToolSessionID(toolSessionID); + + String userID = request.getParameter("userID"); + logger.debug("userID: " + userID); + qaLearningForm.setUserID(userID); + + String httpSessionID = request.getParameter("httpSessionID"); + logger.debug("httpSessionID: " + httpSessionID); + qaLearningForm.setHttpSessionID(httpSessionID); + + String totalQuestionCount = request.getParameter("totalQuestionCount"); + logger.debug("totalQuestionCount: " + totalQuestionCount); + qaLearningForm.setTotalQuestionCount(totalQuestionCount); + + logger.debug("done saving form request data."); + } + + public static GeneralLearnerFlowDTO buildGeneralLearnerFlowDTO(QaContent qaContent) { + logger.debug("starting buildMcGeneralLearnerFlowDTO: " + qaContent); + GeneralLearnerFlowDTO generalLearnerFlowDTO = new GeneralLearnerFlowDTO(); + generalLearnerFlowDTO.setActivityTitle(qaContent.getTitle()); + generalLearnerFlowDTO.setActivityInstructions(qaContent.getInstructions()); + generalLearnerFlowDTO.setReportTitleLearner(qaContent.getReportTitle()); + + if (qaContent.isQuestionsSequenced()) + generalLearnerFlowDTO.setQuestionListingMode(QUESTION_LISTING_MODE_SEQUENTIAL); + else + generalLearnerFlowDTO.setQuestionListingMode(QUESTION_LISTING_MODE_COMBINED); + + generalLearnerFlowDTO.setUserNameVisible(new Boolean(qaContent.isUsernameVisible()).toString()); + generalLearnerFlowDTO.setShowOtherAnswers(new Boolean(qaContent.isShowOtherAnswers()).toString()); + generalLearnerFlowDTO.setActivityOffline(new Boolean(qaContent.isRunOffline()).toString()); + + logger.debug("continue buildGeneralLearnerFlowDTO: " + qaContent); + generalLearnerFlowDTO.setTotalQuestionCount(new Integer(qaContent.getQaQueContents().size())); + logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO); + + Map mapQuestions = new TreeMap(new QaComparator()); + Map mapFeedback = new TreeMap(new QaComparator()); + + Iterator contentIterator = qaContent.getQaQueContents().iterator(); + while (contentIterator.hasNext()) { + QaQueContent qaQueContent = (QaQueContent) contentIterator.next(); + if (qaQueContent != null) { + int displayOrder = qaQueContent.getDisplayOrder(); + if (displayOrder != 0) { + /* + * add the question to the questions Map in the displayOrder + */ + mapQuestions.put(new Integer(displayOrder).toString(), qaQueContent.getQuestion()); + + String feedback = qaQueContent.getFeedback(); + logger.debug("feedback: " + feedback); + if (feedback == null) + feedback = ""; + + mapFeedback.put(new Integer(displayOrder).toString(), feedback.trim()); + } + } } - - public static GeneralLearnerFlowDTO buildGeneralLearnerFlowDTO(QaContent qaContent) - { - logger.debug("starting buildMcGeneralLearnerFlowDTO: " + qaContent); - GeneralLearnerFlowDTO generalLearnerFlowDTO =new GeneralLearnerFlowDTO(); - generalLearnerFlowDTO.setActivityTitle(qaContent.getTitle()); - generalLearnerFlowDTO.setActivityInstructions(qaContent.getInstructions()); - generalLearnerFlowDTO.setReportTitleLearner(qaContent.getReportTitle()); - - if (qaContent.isQuestionsSequenced()) - generalLearnerFlowDTO.setQuestionListingMode(QUESTION_LISTING_MODE_SEQUENTIAL); - else - generalLearnerFlowDTO.setQuestionListingMode(QUESTION_LISTING_MODE_COMBINED); - - - generalLearnerFlowDTO.setUserNameVisible(new Boolean(qaContent.isUsernameVisible()).toString()); - generalLearnerFlowDTO.setShowOtherAnswers(new Boolean(qaContent.isShowOtherAnswers()).toString()); - generalLearnerFlowDTO.setActivityOffline(new Boolean(qaContent.isRunOffline()).toString()); - - logger.debug("continue buildGeneralLearnerFlowDTO: " + qaContent); - generalLearnerFlowDTO.setTotalQuestionCount(new Integer(qaContent.getQaQueContents().size())); - logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO); - - Map mapQuestions= new TreeMap(new QaComparator()); - Map mapFeedback= new TreeMap(new QaComparator()); - - Iterator contentIterator=qaContent.getQaQueContents().iterator(); - while (contentIterator.hasNext()) - { - QaQueContent qaQueContent=(QaQueContent)contentIterator.next(); - if (qaQueContent != null) - { - int displayOrder=qaQueContent.getDisplayOrder(); - if (displayOrder != 0) - { - /* - * add the question to the questions Map in the displayOrder - */ - mapQuestions.put(new Integer(displayOrder).toString(),qaQueContent.getQuestion()); - - String feedback=qaQueContent.getFeedback(); - logger.debug("feedback: " + feedback); - if (feedback == null) feedback=""; - - mapFeedback.put(new Integer(displayOrder).toString(), feedback.trim()); - } - } - } - - logger.debug("mapFeedback: " + mapFeedback); - - generalLearnerFlowDTO.setMapFeedback(mapFeedback); - generalLearnerFlowDTO.setMapQuestionContentLearner(mapQuestions); - return generalLearnerFlowDTO; + logger.debug("mapFeedback: " + mapFeedback); + + generalLearnerFlowDTO.setMapFeedback(mapFeedback); + generalLearnerFlowDTO.setMapQuestionContentLearner(mapQuestions); + return generalLearnerFlowDTO; } /** * createUsersAndResponses(Map mapAnswers, HttpServletRequest request) * create users of the responses - * @param mapAnswers, request - * return void - * + * + * @param mapAnswers, + * request return void + * */ - protected void createUsersAndResponses(Map mapAnswers, HttpServletRequest request, IQaService qaService, - Long toolContentID, Long toolSessionID) - { - logger.debug("createUsers-retrieving qaService: " + qaService); - logger.debug("mapAnswers: " + mapAnswers); - logger.debug("toolContentID: " + toolContentID); - logger.debug("toolSessionID: " + toolSessionID); - - HttpSession ss = SessionManager.getSession(); - /* get back login user DTO */ - UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER); - logger.debug("retrieving toolUser: " + toolUser); - logger.debug("retrieving toolUser userId: " + toolUser.getUserID()); - logger.debug("retrieving toolUser username: " + toolUser.getLogin()); + protected void createUsersAndResponses(Map mapAnswers, HttpServletRequest request, IQaService qaService, + Long toolContentID, Long toolSessionID) { + logger.debug("createUsers-retrieving qaService: " + qaService); + logger.debug("mapAnswers: " + mapAnswers); + logger.debug("toolContentID: " + toolContentID); + logger.debug("toolSessionID: " + toolSessionID); - String userName=toolUser.getLogin(); - String fullName= toolUser.getFirstName() + " " + toolUser.getLastName(); - logger.debug("retrieving toolUser fullname: " + fullName); - - Long userId=new Long(toolUser.getUserID().longValue()); - - /* - * obtain QaContent to be used in creating QaQueUsr - */ - QaContent qaContent=qaService.retrieveQa(toolContentID.longValue()); - logger.debug("createUsers-retrieving qaContent: " + qaContent); + HttpSession ss = SessionManager.getSession(); + /* get back login user DTO */ + UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER); + logger.debug("retrieving toolUser: " + toolUser); + logger.debug("retrieving toolUser userId: " + toolUser.getUserID()); + logger.debug("retrieving toolUser username: " + toolUser.getLogin()); - QaSession qaSession = qaService.retrieveQaSessionOrNullById(toolSessionID.longValue()); - logger.debug("createUsers-retrieving qaSession: " + qaSession); - - Iterator contentIterator=qaContent.getQaQueContents().iterator(); - logger.debug("createUsers-attempt iteration questions"); - - QaQueUsr qaQueUsr= new QaQueUsr(userId, - userName, - fullName, - null, - qaSession, - new TreeSet()); - - logger.debug("createQaQueUsr - qaQueUsr: " + qaQueUsr); - - logger.debug("session uid: " + qaSession.getUid()); - /*note that it is possible for a user to already exist from another tool session. In this case don't add any more user record*/ - QaQueUsr qaQueUsrLocal=qaService.getQaUserBySession(userId, qaSession.getUid()); - logger.debug("qaQueUsrLocal: " + qaQueUsrLocal); - - if ((qaQueUsr != null) && (qaQueUsrLocal == null)) - { - qaQueUsr=createUser(request, toolSessionID, qaService); - logger.debug("created qaQueUsr: " + qaQueUsr); - } - else - { - logger.debug("assign user"); - qaQueUsr=qaQueUsrLocal; - } - - logger.debug("qaQueUsr uid:" + qaQueUsr.getUid()); - - - boolean isResponseFinalized=qaQueUsr.isResponseFinalized(); - logger.debug("isResponseFinalized: " + isResponseFinalized); - - boolean lockWhenFinished=qaContent.isLockWhenFinished(); - logger.debug("lockWhenFinished: " + lockWhenFinished); - - boolean enableAttemptEntry=false; - boolean userAttemptExist=false; - - if (!isResponseFinalized) - { - logger.debug("type 1 attempt entry"); - enableAttemptEntry=true; - } - - if (isResponseFinalized && (!lockWhenFinished)) - { - logger.debug("type 2 attempt entry"); - logger.debug("second visit and lockWhenFinished is false, enable attempt entry"); - userAttemptExist=true; - enableAttemptEntry=true; - } - logger.debug("final enableAttemptEntry: " + enableAttemptEntry); - logger.debug("final userAttemptExist: " + userAttemptExist); - - if (enableAttemptEntry) - { - logger.debug("enableAttemptEntry is true, so creating the responses: "); - while (contentIterator.hasNext()) - { - QaQueContent qaQueContent=(QaQueContent)contentIterator.next(); - if (qaQueContent != null) - { - logger.debug("qaQueContent uid:" + qaQueContent.getUid()); - - String question=qaQueContent.getQuestion(); - logger.debug("question:" + question); - String displayOrder=new Long(qaQueContent.getDisplayOrder()).toString(); - logger.debug("displayOrder:" + displayOrder); - String answer=(String)mapAnswers.get(displayOrder); - - logger.debug("iterationg question-answers: displayOrder: " + displayOrder + - " question: " + question + " answer: " + answer); - - String timezoneId=""; - - List attempts=qaService.getAttemptsForUserAndQuestionContent(qaQueUsr.getUid(), qaQueContent.getUid()); - logger.debug("attempts:" + attempts); - - - if (userAttemptExist) - { - logger.debug("since userAttemptExist is true remove them:"); - qaService.removeAttemptsForUserAndQuestionContent(qaQueUsr.getUid(), qaQueContent.getUid()); - - logger.debug("creating response."); - QaUsrResp qaUsrResp= new QaUsrResp(answer,false, - new Date(System.currentTimeMillis()), - timezoneId, - qaQueContent, - qaQueUsr, - true); + String userName = toolUser.getLogin(); + String fullName = toolUser.getFirstName() + " " + toolUser.getLastName(); + logger.debug("retrieving toolUser fullname: " + fullName); - logger.debug("iterationg qaUsrResp: " + qaUsrResp); - if (qaUsrResp != null) - { - qaService.createQaUsrResp(qaUsrResp); - logger.debug("created qaUsrResp in the db"); - } + Long userId = new Long(toolUser.getUserID().longValue()); - logger.debug("recreated user attempts since the content is not locked when finished"); - } - else - { - logger.debug("first time attempt entry or content is locked"); - if ((attempts != null) && (attempts.size() > 0)) - { - logger.debug("this user already responsed to q/a in this session:"); - } - else - { - logger.debug("creating response."); - QaUsrResp qaUsrResp= new QaUsrResp(answer,false, - new Date(System.currentTimeMillis()), - timezoneId, - qaQueContent, - qaQueUsr, - true); + /* + * obtain QaContent to be used in creating QaQueUsr + */ + QaContent qaContent = qaService.retrieveQa(toolContentID.longValue()); + logger.debug("createUsers-retrieving qaContent: " + qaContent); - logger.debug("iterationg qaUsrResp: " + qaUsrResp); - if (qaUsrResp != null) - { - qaService.createQaUsrResp(qaUsrResp); - logger.debug("created qaUsrResp in the db"); - } - } - } - } - } + QaSession qaSession = qaService.retrieveQaSessionOrNullById(toolSessionID.longValue()); + logger.debug("createUsers-retrieving qaSession: " + qaSession); - } - - logger.debug("current user is: " + qaQueUsr); - if (qaQueUsr != null) - { - qaQueUsr.setResponseFinalized(true); - logger.debug("finalized user input"); - qaService.updateQaQueUsr(qaQueUsr); + Iterator contentIterator = qaContent.getQaQueContents().iterator(); + logger.debug("createUsers-attempt iteration questions"); + + QaQueUsr qaQueUsr = new QaQueUsr(userId, userName, fullName, null, qaSession, new TreeSet()); + + logger.debug("createQaQueUsr - qaQueUsr: " + qaQueUsr); + + logger.debug("session uid: " + qaSession.getUid()); + /*note that it is possible for a user to already exist from another tool session. In this case don't add any more user record*/ + QaQueUsr qaQueUsrLocal = qaService.getQaUserBySession(userId, qaSession.getUid()); + logger.debug("qaQueUsrLocal: " + qaQueUsrLocal); + + if ((qaQueUsr != null) && (qaQueUsrLocal == null)) { + qaQueUsr = createUser(request, toolSessionID, qaService); + logger.debug("created qaQueUsr: " + qaQueUsr); + } else { + logger.debug("assign user"); + qaQueUsr = qaQueUsrLocal; + } + + logger.debug("qaQueUsr uid:" + qaQueUsr.getUid()); + + boolean isResponseFinalized = qaQueUsr.isResponseFinalized(); + logger.debug("isResponseFinalized: " + isResponseFinalized); + + boolean lockWhenFinished = qaContent.isLockWhenFinished(); + logger.debug("lockWhenFinished: " + lockWhenFinished); + + boolean enableAttemptEntry = false; + boolean userAttemptExist = false; + + if (!isResponseFinalized) { + logger.debug("type 1 attempt entry"); + enableAttemptEntry = true; + } + + if (isResponseFinalized && (!lockWhenFinished)) { + logger.debug("type 2 attempt entry"); + logger.debug("second visit and lockWhenFinished is false, enable attempt entry"); + userAttemptExist = true; + enableAttemptEntry = true; + } + logger.debug("final enableAttemptEntry: " + enableAttemptEntry); + logger.debug("final userAttemptExist: " + userAttemptExist); + + if (enableAttemptEntry) { + logger.debug("enableAttemptEntry is true, so creating the responses: "); + while (contentIterator.hasNext()) { + QaQueContent qaQueContent = (QaQueContent) contentIterator.next(); + if (qaQueContent != null) { + logger.debug("qaQueContent uid:" + qaQueContent.getUid()); + + String question = qaQueContent.getQuestion(); + logger.debug("question:" + question); + String displayOrder = new Long(qaQueContent.getDisplayOrder()).toString(); + logger.debug("displayOrder:" + displayOrder); + String answer = (String) mapAnswers.get(displayOrder); + + logger.debug("iterationg question-answers: displayOrder: " + displayOrder + " question: " + + question + " answer: " + answer); + + String timezoneId = ""; + + List attempts = qaService.getAttemptsForUserAndQuestionContent(qaQueUsr.getUid(), qaQueContent + .getUid()); + logger.debug("attempts:" + attempts); + + if (userAttemptExist) { + logger.debug("since userAttemptExist is true remove them:"); + qaService.removeAttemptsForUserAndQuestionContent(qaQueUsr.getUid(), qaQueContent.getUid()); + + logger.debug("creating response."); + QaUsrResp qaUsrResp = new QaUsrResp(answer, false, new Date(System.currentTimeMillis()), + timezoneId, qaQueContent, qaQueUsr, true); + + logger.debug("iterationg qaUsrResp: " + qaUsrResp); + if (qaUsrResp != null) { + qaService.createQaUsrResp(qaUsrResp); + logger.debug("created qaUsrResp in the db"); + } + + logger.debug("recreated user attempts since the content is not locked when finished"); + } else { + logger.debug("first time attempt entry or content is locked"); + if ((attempts != null) && (attempts.size() > 0)) { + logger.debug("this user already responsed to q/a in this session:"); + } else { + logger.debug("creating response."); + QaUsrResp qaUsrResp = new QaUsrResp(answer, false, new Date(System.currentTimeMillis()), + timezoneId, qaQueContent, qaQueUsr, true); + + logger.debug("iterationg qaUsrResp: " + qaUsrResp); + if (qaUsrResp != null) { + qaService.createQaUsrResp(qaUsrResp); + logger.debug("created qaUsrResp in the db"); + } + } + } } - } + } - - public static QaQueUsr createUser(HttpServletRequest request, Long toolSessionID, IQaService qaService) - { - logger.debug("creating a new user in the tool db, toolSessionID: " + toolSessionID); - logger.debug("qaService: " + qaService); - - Long queUsrId=QaUtils.getUserId(); - String username=QaUtils.getUserName(); - String fullname=QaUtils.getUserFullName(); - - QaSession qaSession=qaService.retrieveQaSessionOrNullById(toolSessionID.longValue()); - logger.debug("qaSession: " + qaSession); - - QaQueUsr qaQueUsr= new QaQueUsr(queUsrId, - username, - fullname, - null, - qaSession, - new TreeSet()); + } - qaService.createQaQueUsr(qaQueUsr); - logger.debug("created qaQueUsr in the db: " + qaQueUsr); - return qaQueUsr; + logger.debug("current user is: " + qaQueUsr); + if (qaQueUsr != null) { + qaQueUsr.setResponseFinalized(true); + logger.debug("finalized user input"); + qaService.updateQaQueUsr(qaQueUsr); } + } - protected String getRemainingQuestionCount(int currentQuestionIndex, String totalQuestionCount) - { - logger.debug("totalQuestionCount: " + totalQuestionCount); - int remainingQuestionCount=new Long(totalQuestionCount).intValue() - currentQuestionIndex +1; - logger.debug("remainingQuestionCount: " + remainingQuestionCount); + public static QaQueUsr createUser(HttpServletRequest request, Long toolSessionID, IQaService qaService) { + logger.debug("creating a new user in the tool db, toolSessionID: " + toolSessionID); + logger.debug("qaService: " + qaService); - return new Integer(remainingQuestionCount).toString(); + Long queUsrId = QaUtils.getUserId(); + String username = QaUtils.getUserName(); + String fullname = QaUtils.getUserFullName(); + + QaSession qaSession = qaService.retrieveQaSessionOrNullById(toolSessionID.longValue()); + logger.debug("qaSession: " + qaSession); + + QaQueUsr qaQueUsr = new QaQueUsr(queUsrId, username, fullname, null, qaSession, new TreeSet()); + + qaService.createQaQueUsr(qaQueUsr); + logger.debug("created qaQueUsr in the db: " + qaQueUsr); + return qaQueUsr; } - + protected String getRemainingQuestionCount(int currentQuestionIndex, String totalQuestionCount) { + logger.debug("totalQuestionCount: " + totalQuestionCount); + int remainingQuestionCount = new Long(totalQuestionCount).intValue() - currentQuestionIndex + 1; + logger.debug("remainingQuestionCount: " + remainingQuestionCount); + + return new Integer(remainingQuestionCount).toString(); + } + /** - * feedBackAnswersProgress(HttpServletRequest request, int currentQuestionIndex) - * give user feedback on the remaining questions - * @param qaLearningForm - * return void - */ - protected String feedBackAnswersProgress(HttpServletRequest request, int currentQuestionIndex, String totalQuestionCount) - { - logger.debug("totalQuestionCount: " + totalQuestionCount); - int remainingQuestionCount=new Long(totalQuestionCount).intValue() - currentQuestionIndex +1; - logger.debug("remainingQuestionCount: " + remainingQuestionCount); - String userFeedback=""; - if (remainingQuestionCount != 0) - userFeedback= "Remaining question count: " + remainingQuestionCount; - else - userFeedback= "End of the questions."; - - return userFeedback; + * feedBackAnswersProgress(HttpServletRequest request, int + * currentQuestionIndex) give user feedback on the remaining questions + * + * @param qaLearningForm + * return void + */ + protected String feedBackAnswersProgress(HttpServletRequest request, int currentQuestionIndex, + String totalQuestionCount) { + logger.debug("totalQuestionCount: " + totalQuestionCount); + int remainingQuestionCount = new Long(totalQuestionCount).intValue() - currentQuestionIndex + 1; + logger.debug("remainingQuestionCount: " + remainingQuestionCount); + String userFeedback = ""; + if (remainingQuestionCount != 0) + userFeedback = "Remaining question count: " + remainingQuestionCount; + else + userFeedback = "End of the questions."; + + return userFeedback; } - - public void setContentInUse(long toolContentID, IQaService qaService) - { - QaContent qaContent=qaService.loadQa(toolContentID); - logger.debug("retrieve qaContent: " + qaContent); - - qaContent.setContentLocked(true); - logger.debug("content with id : " + toolContentID + "has been marked LOCKED"); - qaService.updateQa(qaContent); - logger.debug("content with id : " + toolContentID + "has been marked LOCKED and updated in the db"); + + public void setContentInUse(long toolContentID, IQaService qaService) { + QaContent qaContent = qaService.loadQa(toolContentID); + logger.debug("retrieve qaContent: " + qaContent); + + qaContent.setContentLocked(true); + logger.debug("content with id : " + toolContentID + "has been marked LOCKED"); + qaService.updateQa(qaContent); + logger.debug("content with id : " + toolContentID + "has been marked LOCKED and updated in the db"); } } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/MonitoringUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/Attic/MonitoringUtil.java,v diff -u -r1.40 -r1.41 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/MonitoringUtil.java 8 Feb 2007 02:23:27 -0000 1.40 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/MonitoringUtil.java 19 Feb 2009 04:25:02 -0000 1.41 @@ -51,630 +51,574 @@ /** * - * Keeps all operations needed for Monitoring mode. + * Keeps all operations needed for Monitoring mode. + * * @author Ozgur Demirtas - * + * */ -public class MonitoringUtil implements QaAppConstants{ - static Logger logger = Logger.getLogger(MonitoringUtil.class.getName()); +public class MonitoringUtil implements QaAppConstants { + static Logger logger = Logger.getLogger(MonitoringUtil.class.getName()); - /** - * determine whether all the tool sessions for a particular content has been COMPLETED - * boolean isSessionsSync(HttpServletRequest request, long toolContentId) - * @param toolContentId - * @return boolean + /** + * determine whether all the tool sessions for a particular content has been + * COMPLETED boolean isSessionsSync(HttpServletRequest request, long + * toolContentId) + * + * @param toolContentId + * @return boolean + */ + public boolean isSessionsSync(QaContent qaContent) { + /* + * iterate all the tool sessions, if even one session is INCOMPLETE, the function returns false */ - public boolean isSessionsSync(QaContent qaContent) - { - /* - * iterate all the tool sessions, if even one session is INCOMPLETE, the function returns false - */ - if (qaContent != null) - { - Iterator sessionIterator=qaContent.getQaSessions().iterator(); - while (sessionIterator.hasNext()) - { - QaSession qaSession=(QaSession)sessionIterator.next(); - logger.debug("iterated qaSession : " + qaSession); - if (qaSession.getSession_status().equalsIgnoreCase(QaSession.INCOMPLETE)) - return false; - } - } - + if (qaContent != null) { + Iterator sessionIterator = qaContent.getQaSessions().iterator(); + while (sessionIterator.hasNext()) { + QaSession qaSession = (QaSession) sessionIterator.next(); + logger.debug("iterated qaSession : " + qaSession); + if (qaSession.getSession_status().equalsIgnoreCase(QaSession.INCOMPLETE)) + return false; + } + } + return true; + } + + /** + * updateResponse(HttpServletRequest request, String responseId, String + * updatedResponse) + * + * @param qaService + * @param responseId + * @param updatedResponse + */ + public void updateResponse(IQaService qaService, String responseId, String updatedResponse) { + logger.debug("load response with responseId: " + new Long(responseId).longValue()); + QaUsrResp qaUsrResp = qaService.retrieveQaUsrResp(new Long(responseId).longValue()); + logger.debug("loaded user response: " + qaUsrResp); + qaUsrResp.setAnswer(updatedResponse); + qaService.updateQaUsrResp(qaUsrResp); + logger.debug("updated user response in the db: " + qaUsrResp); + } + + /** + * hideResponse(HttpServletRequest request, String responseId) + * + * @param qaService + * @param responseId + */ + public void hideResponse(IQaService qaService, String responseId) { + logger.debug("load response with responseId for hiding: " + new Long(responseId).longValue()); + QaUsrResp qaUsrResp = qaService.retrieveQaUsrResp(new Long(responseId).longValue()); + logger.debug("loaded user response: " + qaUsrResp); + qaUsrResp.setHidden(true); + qaService.updateQaUsrResp(qaUsrResp); + logger.debug("updated user response in the db: " + qaUsrResp); + } + + /** + * unHideResponse(HttpServletRequest request, String responseId) + * + * @param request + * @param responseId + */ + public void unHideResponse(IQaService qaService, String responseId) { + logger.debug("load response with responseId for un-hiding: " + new Long(responseId).longValue()); + QaUsrResp qaUsrResp = qaService.retrieveQaUsrResp(new Long(responseId).longValue()); + logger.debug("loaded user response: " + qaUsrResp); + qaUsrResp.setHidden(false); + qaService.updateQaUsrResp(qaUsrResp); + logger.debug("updated user response in the db: " + qaUsrResp); + } + + /** + * populates all the tool sessions in a map + * populateToolSessions(HttpServletRequest request, McContent mcContent) + * + * @param request + * @param mcContent + * @return Map + */ + public static Map populateToolSessions(HttpServletRequest request, QaContent qaContent, IQaService qaService) { + List sessionsList = qaService.getSessionNamesFromContent(qaContent); + logger.debug("sessionsList size is:..." + sessionsList.size()); + + Map sessionsMap = QaUtils.convertToStringMap(sessionsList, "String"); + logger.debug("generated sessionsMap:..." + sessionsMap); + logger.debug("sessionsMap size:..." + sessionsMap.size()); + + if (sessionsMap.isEmpty()) { + logger.debug("sessionsMap size is 0:"); + sessionsMap.put(new Long(1).toString(), "None"); + } else { + logger.debug("sessionsMap has some entries: " + sessionsMap.size()); + sessionsMap.put(new Long(sessionsMap.size() + 1).toString(), "All"); } - - /** - * updateResponse(HttpServletRequest request, String responseId, String updatedResponse) - * @param qaService - * @param responseId - * @param updatedResponse - */ - public void updateResponse(IQaService qaService, String responseId, String updatedResponse) - { - logger.debug("load response with responseId: " + new Long(responseId).longValue()); - QaUsrResp qaUsrResp=qaService.retrieveQaUsrResp(new Long(responseId).longValue()); - logger.debug("loaded user response: " + qaUsrResp); - qaUsrResp.setAnswer(updatedResponse); - qaService.updateQaUsrResp(qaUsrResp); - logger.debug("updated user response in the db: " + qaUsrResp); + logger.debug("final sessionsMap:" + sessionsMap); + return sessionsMap; + } + + /** + * populates all the tool sessions in a map + * populateToolSessions(HttpServletRequest request, McContent mcContent) + * + * @param request + * @param mcContent + * @return Map + */ + public static Map populateToolSessionsId(HttpServletRequest request, QaContent qaContent, IQaService qaService) { + List sessionsList = qaService.getSessionsFromContent(qaContent); + logger.debug("sessionsList size is:..." + sessionsList.size()); + + Map sessionsMap = QaUtils.convertToStringMap(sessionsList, "Long"); + logger.debug("generated sessionsMap:..." + sessionsMap); + logger.debug("sessionsMap size:..." + sessionsMap.size()); + + if (sessionsMap.isEmpty()) { + logger.debug("sessionsMap size is 0:"); + sessionsMap.put(new Long(1).toString(), "None"); + } else { + logger.debug("sessionsMap has some entries: " + sessionsMap.size()); + sessionsMap.put(new Long(sessionsMap.size() + 1).toString(), "All"); } - - - /** - * hideResponse(HttpServletRequest request, String responseId) - * @param qaService - * @param responseId - */ - public void hideResponse(IQaService qaService, String responseId) - { - logger.debug("load response with responseId for hiding: " + new Long(responseId).longValue()); - QaUsrResp qaUsrResp=qaService.retrieveQaUsrResp(new Long(responseId).longValue()); - logger.debug("loaded user response: " + qaUsrResp); - qaUsrResp.setHidden(true); - qaService.updateQaUsrResp(qaUsrResp); - logger.debug("updated user response in the db: " + qaUsrResp); + + logger.debug("final sessionsMap:" + sessionsMap); + return sessionsMap; + } + + /** + * ends up populating the attempt history for all the users of all the tool + * sessions for a content buildGroupsQuestionData(HttpServletRequest + * request, McContent mcContent) + * + * User id is needed if isUserNamesVisible is false && is learnerRequest = + * true, as it is required to work out if the data being analysed is the + * current user. + * + * @param request + * @param mcContent + * @return List + */ + public static List buildGroupsQuestionData(HttpServletRequest request, QaContent qaContent, IQaService qaService, + boolean isUserNamesVisible, boolean isLearnerRequest, String currentSessionId, String userId) { + logger.debug("buildGroupsQuestionData: " + currentSessionId); + + logger.debug("isUserNamesVisible: " + isUserNamesVisible); + logger.debug("isLearnerRequest: " + isLearnerRequest); + logger.debug("userId: " + userId); + logger.debug("qaService: " + qaService); + + logger.debug("will be building groups question data for content:..." + qaContent); + List listQuestions = qaService.getAllQuestionEntries(qaContent.getUid()); + logger.debug("listQuestions:..." + listQuestions); + + String sessionName = ""; + if ((currentSessionId != null) && (!currentSessionId.equals("All"))) { + QaSession qaSession = qaService.retrieveQaSessionOrNullById(new Long(currentSessionId).longValue()); + logger.debug("qaSession: " + qaSession); + + sessionName = qaSession.getSession_name(); } - - - /** - * unHideResponse(HttpServletRequest request, String responseId) - * @param request - * @param responseId - */ - public void unHideResponse(IQaService qaService, String responseId) - { - logger.debug("load response with responseId for un-hiding: " + new Long(responseId).longValue()); - QaUsrResp qaUsrResp=qaService.retrieveQaUsrResp(new Long(responseId).longValue()); - logger.debug("loaded user response: " + qaUsrResp); - qaUsrResp.setHidden(false); - qaService.updateQaUsrResp(qaUsrResp); - logger.debug("updated user response in the db: " + qaUsrResp); + logger.debug("sessionName: " + sessionName); + request.setAttribute(CURRENT_SESSION_NAME, sessionName); + + List listMonitoredAnswersContainerDTO = new LinkedList(); + + Iterator itListQuestions = listQuestions.iterator(); + while (itListQuestions.hasNext()) { + QaQueContent qaQueContent = (QaQueContent) itListQuestions.next(); + logger.debug("mcQueContent:..." + qaQueContent); + + if (qaQueContent != null) { + QaMonitoredAnswersDTO qaMonitoredAnswersDTO = new QaMonitoredAnswersDTO(); + qaMonitoredAnswersDTO.setQuestionUid(qaQueContent.getUid().toString()); + qaMonitoredAnswersDTO.setQuestion(qaQueContent.getQuestion()); + qaMonitoredAnswersDTO.setSessionName(sessionName); + + logger.debug("using allUsersData to retrieve users data: " + isUserNamesVisible); + Map questionAttemptData = buildGroupsAttemptData(request, qaContent, qaService, qaQueContent, + qaQueContent.getUid().toString(), isUserNamesVisible, isLearnerRequest, currentSessionId, + userId); + logger.debug("questionAttemptData:..." + questionAttemptData); + qaMonitoredAnswersDTO.setQuestionAttempts(questionAttemptData); + listMonitoredAnswersContainerDTO.add(qaMonitoredAnswersDTO); + + } } - - - /** - * populates all the tool sessions in a map - * populateToolSessions(HttpServletRequest request, McContent mcContent) - * - * @param request - * @param mcContent - * @return Map - */ - public static Map populateToolSessions(HttpServletRequest request, QaContent qaContent, IQaService qaService) - { - List sessionsList=qaService.getSessionNamesFromContent(qaContent); - logger.debug("sessionsList size is:..." + sessionsList.size()); - - Map sessionsMap=QaUtils.convertToStringMap(sessionsList, "String"); - logger.debug("generated sessionsMap:..." + sessionsMap); - logger.debug("sessionsMap size:..." + sessionsMap.size()); - - if (sessionsMap.isEmpty()) - { - logger.debug("sessionsMap size is 0:"); - sessionsMap.put(new Long(1).toString() , "None"); + logger.debug("final listMonitoredAnswersContainerDTO:..." + listMonitoredAnswersContainerDTO); + return listMonitoredAnswersContainerDTO; + } + + /** + * User id is needed if learnerRequest = true, as it is required to work out + * if the data being analysed is the current user (for not show other names) + * or to work out which is the user's answers (for not show all answers). + */ + public static Map buildGroupsAttemptData(HttpServletRequest request, QaContent qaContent, IQaService qaService, + QaQueContent qaQueContent, String questionUid, boolean isUserNamesVisible, boolean isLearnerRequest, + String currentSessionId, String userId) { + logger.debug("doing buildGroupsAttemptData..."); + logger.debug("isUserNamesVisible: " + isUserNamesVisible); + logger.debug("isLearnerRequest: " + isLearnerRequest); + logger.debug("currentSessionId: " + currentSessionId); + logger.debug("userId: " + userId); + + logger.debug("qaService: " + qaService); + + Map mapMonitoredAttemptsContainerDTO = new TreeMap(new QaStringComparator()); + List listMonitoredAttemptsContainerDTO = new LinkedList(); + + Map summaryToolSessions = populateToolSessionsId(request, qaContent, qaService); + logger.debug("summaryToolSessions: " + summaryToolSessions); + + Iterator itMap = summaryToolSessions.entrySet().iterator(); + + /*request is for monitoring summary */ + if (!isLearnerRequest) { + + if (currentSessionId != null) { + if (currentSessionId.equals("All")) { + logger.debug("**summary request is for All**:"); + while (itMap.hasNext()) { + Map.Entry pairs = (Map.Entry) itMap.next(); + logger.debug("using the summary tool sessions pair: " + pairs.getKey() + " = " + + pairs.getValue()); + + if (!(pairs.getValue().toString().equals("None")) + && !(pairs.getValue().toString().equals("All"))) { + logger + .debug("using the numerical summary tool sessions pair: " + " = " + + pairs.getValue()); + QaSession qaSession = qaService.retrieveQaSession(new Long(pairs.getValue().toString()) + .longValue()); + logger.debug("qaSession: " + " = " + qaSession); + if (qaSession != null) { + List listUsers = qaService.getUserBySessionOnly(qaSession); + logger.debug("listMcUsers for session id:" + qaSession.getQaSessionId() + " = " + + listUsers); + Map sessionUsersAttempts = populateSessionUsersAttempts(request, qaService, qaSession + .getQaSessionId(), listUsers, questionUid, isUserNamesVisible, + isLearnerRequest, userId); + listMonitoredAttemptsContainerDTO.add(sessionUsersAttempts); + } + } + } + } else if (!currentSessionId.equals("All")) { + logger.debug("**summary request is for currentSessionId**:" + currentSessionId); + QaSession qaSession = qaService + .retrieveQaSession(new Long(currentSessionId.toString()).longValue()); + logger.debug("qaSession: " + " = " + qaSession); + + List listUsers = qaService.getUserBySessionOnly(qaSession); + logger.debug("listUsers: " + " = " + listUsers); + + Map sessionUsersAttempts = populateSessionUsersAttempts(request, qaService, new Long( + currentSessionId), listUsers, questionUid, isUserNamesVisible, isLearnerRequest, userId); + listMonitoredAttemptsContainerDTO.add(sessionUsersAttempts); } - else - { - logger.debug("sessionsMap has some entries: " + sessionsMap.size()); - sessionsMap.put(new Long(sessionsMap.size()+ 1).toString() , "All"); - } - - logger.debug("final sessionsMap:" + sessionsMap); - return sessionsMap; - } - - /** - * populates all the tool sessions in a map - * populateToolSessions(HttpServletRequest request, McContent mcContent) - * - * @param request - * @param mcContent - * @return Map - */ - public static Map populateToolSessionsId(HttpServletRequest request, QaContent qaContent, IQaService qaService) - { - List sessionsList=qaService.getSessionsFromContent(qaContent); - logger.debug("sessionsList size is:..." + sessionsList.size()); - - Map sessionsMap=QaUtils.convertToStringMap(sessionsList, "Long"); - logger.debug("generated sessionsMap:..." + sessionsMap); - logger.debug("sessionsMap size:..." + sessionsMap.size()); - - if (sessionsMap.isEmpty()) - { - logger.debug("sessionsMap size is 0:"); - sessionsMap.put(new Long(1).toString() , "None"); + } + } else { + /*request is for learner report, use only the passed tool session in the report. */ + logger.debug("using currentSessionId for the learner report:" + currentSessionId); + QaSession qaSession = qaService.retrieveQaSession(new Long(currentSessionId).longValue()); + logger.debug("qaSession: " + " = " + qaSession); + if (qaSession != null) { + List listUsers = null; + if (qaContent.isShowOtherAnswers()) { + listUsers = qaService.getUserBySessionOnly(qaSession); + } else { + listUsers = new ArrayList- * 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
@@ -161,22 +163,24 @@
*
*
*
- * 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.
+ * 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.
+ * 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.
+ * @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
@@ -190,8 +194,10 @@
}
/**
- * 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
@@ -833,7 +839,8 @@
}
/**
- * 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
@@ -922,13 +929,14 @@
request.setAttribute(QaAppConstants.ATTR_WIZARD_ENABLED, true);
request.setAttribute(QaAppConstants.ATTR_WIZARD_CATEGORIES, qaService.getWizardCategories());
}
-
+
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
@@ -1042,8 +1050,10 @@
}
/**
- * 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
@@ -1487,8 +1497,10 @@
}
/**
- * 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
@@ -1613,8 +1625,10 @@
}
/**
- * 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
@@ -1756,7 +1770,8 @@
}
/**
- * addFileToContentRepository(HttpServletRequest request, QaAuthoringForm qaAuthoringForm)
+ * addFileToContentRepository(HttpServletRequest request, QaAuthoringForm
+ * qaAuthoringForm)
*
* @param request
* @param qaAuthoringForm
@@ -1872,8 +1887,9 @@
/**
*
- * 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
+ * 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
@@ -1941,8 +1957,10 @@
}
/**
- * 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
@@ -1960,8 +1978,10 @@
}
/**
- * 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
@@ -1981,8 +2001,9 @@
/**
* 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
@@ -2002,8 +2023,10 @@
}
/**
- * 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
@@ -2148,7 +2171,8 @@
}
/**
- * Get the deleted condition list, which could be persisted or non-persisted items.
+ * Get the deleted condition list, which could be persisted or non-persisted
+ * items.
*
* @param request
* @return
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAdminAction.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAdminAction.java,v
diff -u -r1.2 -r1.3
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAdminAction.java 4 Nov 2008 05:10:34 -0000 1.2
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAdminAction.java 19 Feb 2009 04:25:02 -0000 1.3
@@ -349,13 +349,13 @@
*/
@SuppressWarnings("unchecked")
public ActionForward importWizard(ActionMapping mapping, ActionForm form, HttpServletRequest request,
- HttpServletResponse response){
+ HttpServletResponse response) {
QaAdminForm adminForm = (QaAdminForm) form;
if (qaService == null) {
qaService = QaServiceProxy.getQaService(this.getServlet().getServletContext());
}
-
+
// First save the config items
QaConfigItem enableQaWizard = qaService.getConfigItem(QaConfigItem.KEY_ENABLE_QAWIZARD);
@@ -374,24 +374,23 @@
enableQaWizard.setConfigValue(QaAdminForm.FALSE);
}
qaService.saveOrUpdateConfigItem(enableQaWizard);
-
// Now perform the import
try {
String xml = new String(adminForm.getImportFile().getFileData());
XStream conversionXml = new XStream();
- SortedSet exportCategories = (SortedSet)conversionXml.fromXML(xml);
+ SortedSet exportCategories = (SortedSet) conversionXml.fromXML(xml);
qaService.deleteAllWizardCategories();
qaService.saveOrUpdateQaWizardCategories(exportCategories);
} catch (Exception e) {
logger.error("Failed to import wizard model", e);
request.setAttribute("error", true);
- request.setAttribute("errorKey", "wizard.import.error");
+ request.setAttribute("errorKey", "wizard.import.error");
request.setAttribute(ATTR_CATEGORIES, getQaWizardCategories());
return mapping.findForward("config");
- }
-
+ }
+
request.setAttribute(ATTR_CATEGORIES, getQaWizardCategories());
request.setAttribute("savedSuccess", true);
return mapping.findForward("config");
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAdminForm.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/Attic/QaAdminForm.java,v
diff -u -r1.2 -r1.3
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAdminForm.java 4 Nov 2008 05:10:34 -0000 1.2
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAdminForm.java 19 Feb 2009 04:25:02 -0000 1.3
@@ -29,68 +29,69 @@
public class QaAdminForm extends ActionForm {
public static final long serialVersionUID = 978235712395273523L;
-
- public static final String TRUE= "true";
- public static final String FALSE= "false";
-
+
+ public static final String TRUE = "true";
+ public static final String FALSE = "false";
+
private Boolean qaWizardEnabled;
private String serialiseXML;
private String deleteCategoriesCSV;
private String deleteSkillsCSV;
private String deleteQuestionsCSV;
private FormFile importFile;
-
- public QaAdminForm() {}
+ public QaAdminForm() {
+ }
+
public Boolean getQaWizardEnabled() {
- return qaWizardEnabled;
+ return qaWizardEnabled;
}
public void setQaWizardEnabled(Boolean qaWizardEnabled) {
- this.qaWizardEnabled = qaWizardEnabled;
+ this.qaWizardEnabled = qaWizardEnabled;
}
public void setQaWizardEnabled(String qaWizardEnabled) {
this.qaWizardEnabled = qaWizardEnabled.equals(TRUE);
}
public String getSerialiseXML() {
- return serialiseXML;
+ return serialiseXML;
}
public void setSerialiseXML(String serialiseXML) {
- this.serialiseXML = serialiseXML;
+ this.serialiseXML = serialiseXML;
}
public String getDeleteCategoriesCSV() {
- return deleteCategoriesCSV;
+ return deleteCategoriesCSV;
}
public void setDeleteCategoriesCSV(String deleteCategoriesCSV) {
- this.deleteCategoriesCSV = deleteCategoriesCSV;
+ this.deleteCategoriesCSV = deleteCategoriesCSV;
}
public String getDeleteSkillsCSV() {
- return deleteSkillsCSV;
+ return deleteSkillsCSV;
}
public void setDeleteSkillsCSV(String deleteSkillsCSV) {
- this.deleteSkillsCSV = deleteSkillsCSV;
+ this.deleteSkillsCSV = deleteSkillsCSV;
}
public String getDeleteQuestionsCSV() {
- return deleteQuestionsCSV;
+ return deleteQuestionsCSV;
}
public void setDeleteQuestionsCSV(String deleteQuestionsCSV) {
- this.deleteQuestionsCSV = deleteQuestionsCSV;
+ this.deleteQuestionsCSV = deleteQuestionsCSV;
}
public FormFile getImportFile() {
- return importFile;
+ return importFile;
}
public void setImportFile(FormFile importFile) {
- this.importFile = importFile;
+ this.importFile = importFile;
}
}
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAuthoringConditionAction.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAuthoringConditionAction.java,v
diff -u -r1.5 -r1.6
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAuthoringConditionAction.java 9 Dec 2008 05:38:14 -0000 1.5
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAuthoringConditionAction.java 19 Feb 2009 04:25:02 -0000 1.6
@@ -55,8 +55,8 @@
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.
+ * 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
@@ -139,9 +139,11 @@
}
/**
- * 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.
+ * 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
@@ -180,8 +182,9 @@
}
/**
- * 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.
+ * 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
@@ -319,7 +322,8 @@
}
/**
- * Get the deleted condition list, which could be persisted or non-persisted items.
+ * Get the deleted condition list, which could be persisted or non-persisted
+ * items.
*
* @param request
* @return
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAuthoringForm.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/Attic/QaAuthoringForm.java,v
diff -u -r1.24 -r1.25
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAuthoringForm.java 13 Nov 2006 19:38:46 -0000 1.24
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAuthoringForm.java 19 Feb 2009 04:25:02 -0000 1.25
@@ -33,745 +33,849 @@
/**
* @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
*/
public class QaAuthoringForm extends QaLearningForm implements QaAppConstants {
- protected String addContent;
- protected String removeContent;
- protected String removeAllContent;
- protected String submitAllContent;
- protected String submitTabDone;
- protected String submitOfflineFile;
- protected String submitOnlineFile;
- protected String dispatch;
- protected String currentTab;
-
- protected String choice;
- protected String choiceBasic;
- protected String choiceAdvanced;
- protected String choiceInstructions;
+ protected String addContent;
+ protected String removeContent;
+ protected String removeAllContent;
+ protected String submitAllContent;
+ protected String submitTabDone;
+ protected String submitOfflineFile;
+ protected String submitOnlineFile;
+ protected String dispatch;
+ protected String currentTab;
- protected String activeModule;
-
- /* basic content */
- protected String title;
- protected String instructions;
- protected String questionIndex;
- protected String isRemoveContent;
+ protected String choice;
+ protected String choiceBasic;
+ protected String choiceAdvanced;
+ protected String choiceInstructions;
- /* instructions content */
- protected String onlineInstructions;
- protected String offlineInstructions;
- protected FormFile theOfflineFile;
- protected FormFile theOnlineFile;
-
- protected String toolContentID;
- /* advanced content */
- protected String synchInMonitor;
- protected String reportTitle;
- protected String monitoringReportTitle;
- protected String endLearningMessage;
- protected String usernameVisible;
- protected String showOtherAnswers;
- protected String questionsSequenced;
- protected String lockWhenFinished;
- protected String reflect;
- protected String reflectionSubject;
-
- /* proxy controllers for Monitoring tabs */
- protected String summaryMonitoring;
- protected String instructionsMonitoring;
- protected String editActivityMonitoring;
- protected String statsMonitoring;
+ protected String activeModule;
- protected String edit;
- private String contentFolderID;
- private String addSingleQuestion;
- private String editableQuestionIndex;
- private String feedback;
- private String editQuestionBoxRequest;
-
- protected String defineLaterInEditMode;
- protected String defaultContentIdStr;
- protected Map mapQuestionContent;
- protected IQaService qaService;
-
-
- public void resetUserAction()
- {
- this.addContent=null;
- this.removeContent=null;
- this.removeAllContent=null;
- this.submitAllContent=null;
- this.submitTabDone=null;
- this.submitOfflineFile=null;
- this.submitOnlineFile=null;
-
- this.summaryMonitoring=null;
- this.instructionsMonitoring=null;
- this.editActivityMonitoring=null;
- this.statsMonitoring=null;
- this.edit=null;
+ /* basic content */
+ protected String title;
+ protected String instructions;
+ protected String questionIndex;
+ protected String isRemoveContent;
+
+ /* instructions content */
+ protected String onlineInstructions;
+ protected String offlineInstructions;
+ protected FormFile theOfflineFile;
+ protected FormFile theOnlineFile;
+
+ protected String toolContentID;
+ /* advanced content */
+ protected String synchInMonitor;
+ protected String reportTitle;
+ protected String monitoringReportTitle;
+ protected String endLearningMessage;
+ protected String usernameVisible;
+ protected String showOtherAnswers;
+ protected String questionsSequenced;
+ protected String lockWhenFinished;
+ protected String reflect;
+ protected String reflectionSubject;
+
+ /* proxy controllers for Monitoring tabs */
+ protected String summaryMonitoring;
+ protected String instructionsMonitoring;
+ protected String editActivityMonitoring;
+ protected String statsMonitoring;
+
+ protected String edit;
+ private String contentFolderID;
+ private String addSingleQuestion;
+ private String editableQuestionIndex;
+ private String feedback;
+ private String editQuestionBoxRequest;
+
+ protected String defineLaterInEditMode;
+ protected String defaultContentIdStr;
+ protected Map mapQuestionContent;
+ protected IQaService qaService;
+
+ public void resetUserAction() {
+ this.addContent = null;
+ this.removeContent = null;
+ this.removeAllContent = null;
+ this.submitAllContent = null;
+ this.submitTabDone = null;
+ this.submitOfflineFile = null;
+ this.submitOnlineFile = null;
+
+ this.summaryMonitoring = null;
+ this.instructionsMonitoring = null;
+ this.editActivityMonitoring = null;
+ this.statsMonitoring = null;
+ this.edit = null;
}
-
- public void reset()
- {
- this.addContent=null;
- this.removeContent=null;
- this.removeAllContent=null;
- this.submitAllContent=null;
- this.submitTabDone=null;
- this.submitOfflineFile=null;
- this.submitOnlineFile=null;
- this.choice=null;
- this.choiceBasic=null;
- this.choiceAdvanced=null;
- this.choiceInstructions=null;
-
- this.title=null;
- this.instructions=null;
- this.questionIndex=null;
- this.isRemoveContent=null;
+ public void reset() {
+ this.addContent = null;
+ this.removeContent = null;
+ this.removeAllContent = null;
+ this.submitAllContent = null;
+ this.submitTabDone = null;
+ this.submitOfflineFile = null;
+ this.submitOnlineFile = null;
- this.onlineInstructions=null;
- this.offlineInstructions=null;
-
- this.endLearningMessage=null;
- this.synchInMonitor=null;
- this.reportTitle=null;
- this.monitoringReportTitle=null;
- this.questionsSequenced=null;
- this.lockWhenFinished=null;
- this.reflect=null;
-
-
- this.summaryMonitoring=null;
- this.instructionsMonitoring=null;
- this.editActivityMonitoring=null;
- this.statsMonitoring=null;
- this.edit=null;
- this.toolContentID=null;
- this.currentTab=null;
- }
-
- public void resetRadioBoxes()
- {
- this.synchInMonitor =OPTION_OFF;
- this.usernameVisible =OPTION_OFF;
- this.questionsSequenced =OPTION_OFF;
- this.lockWhenFinished =OPTION_OFF;
- this.reflect =OPTION_OFF;
- }
+ this.choice = null;
+ this.choiceBasic = null;
+ this.choiceAdvanced = null;
+ this.choiceInstructions = null;
- public String toString() {
- return new ToStringBuilder(this)
- .append("Listing current QaAuthoringForm properties: ")
- .append("toolContentID: ", toolContentID)
- .append("currentTab: ", currentTab)
- .append("activeModule: ", activeModule)
- .append("defaultContentIdStr: ", defaultContentIdStr)
- .append("title: ", title)
- .append("instructions: ", instructions)
- .append("reportTitle: ", reportTitle)
- .append("monitoringReportTitle: ", monitoringReportTitle)
- .append("endLearningMessage: ", endLearningMessage)
- .append("onlineInstructions: ", onlineInstructions)
- .append("offlineInstructions: ", offlineInstructions)
- .append("usernameVisible: ", usernameVisible)
- .append("showOtherAnswers: ", showOtherAnswers)
- .append("synchInMonitor: ", synchInMonitor)
- .append("questionsSequenced: ", questionsSequenced)
- .append("lockWhenFinished: ", lockWhenFinished)
- .append("reflect: ", reflect)
- .append("defineLaterInEditMode: ", defineLaterInEditMode)
- .toString();
+ this.title = null;
+ this.instructions = null;
+ this.questionIndex = null;
+ this.isRemoveContent = null;
+
+ this.onlineInstructions = null;
+ this.offlineInstructions = null;
+
+ this.endLearningMessage = null;
+ this.synchInMonitor = null;
+ this.reportTitle = null;
+ this.monitoringReportTitle = null;
+ this.questionsSequenced = null;
+ this.lockWhenFinished = null;
+ this.reflect = null;
+
+ this.summaryMonitoring = null;
+ this.instructionsMonitoring = null;
+ this.editActivityMonitoring = null;
+ this.statsMonitoring = null;
+ this.edit = null;
+ this.toolContentID = null;
+ this.currentTab = null;
}
-
- /**
- * @return Returns the isRemoveContent.
- */
- public String getIsRemoveContent() {
- return isRemoveContent;
- }
- /**
- * @param isRemoveContent The isRemoveContent to set.
- */
- public void setIsRemoveContent(String isRemoveContent) {
- this.isRemoveContent = isRemoveContent;
- }
- /**
- * @return Returns the questionIndex.
- */
- public String getQuestionIndex() {
- return questionIndex;
- }
- /**
- * @param questionIndex The questionIndex to set.
- */
- public void setQuestionIndex(String questionIndex) {
- this.questionIndex = questionIndex;
- }
-
- /**
- * @return Returns the addContent.
- */
- public String getAddContent() {
- return addContent;
- }
- /**
- * @param addContent The addContent to set.
- */
- public void setAddContent(String addContent) {
- this.addContent = addContent;
- }
- /**
- * @return Returns the removeContent.
- */
- public String getRemoveContent() {
- return removeContent;
- }
- /**
- * @param removeContent The removeContent to set.
- */
- public void setRemoveContent(String removeContent) {
- this.removeContent = removeContent;
- }
- /**
- * @return Returns the removeAllContent.
- */
- public String getRemoveAllContent() {
- return removeAllContent;
- }
- /**
- * @param removeAllContent The removeAllContent to set.
- */
- public void setRemoveAllContent(String removeAllContent) {
- this.removeAllContent = removeAllContent;
- }
- /**
- * @return Returns the submitAllContent.
- */
- public String getSubmitAllContent() {
- return submitAllContent;
- }
- /**
- * @param submitAllContent The submitAllContent to set.
- */
- public void setSubmitAllContent(String submitAllContent) {
- this.submitAllContent = submitAllContent;
- }
- /**
- * @return Returns the instructions.
- */
- public String getInstructions() {
- return instructions;
- }
- /**
- * @param instructions The instructions to set.
- */
- public void setInstructions(String instructions) {
- this.instructions = instructions;
- }
- /**
- * @return Returns the title.
- */
- public String getTitle() {
- return title;
- }
- /**
- * @param title The title to set.
- */
- public void setTitle(String title) {
- this.title = title;
- }
+ public void resetRadioBoxes() {
+ this.synchInMonitor = OPTION_OFF;
+ this.usernameVisible = OPTION_OFF;
+ this.questionsSequenced = OPTION_OFF;
+ this.lockWhenFinished = OPTION_OFF;
+ this.reflect = OPTION_OFF;
+ }
- /**
- * @return Returns the offlineInstructions.
- */
- public String getOfflineInstructions() {
- return offlineInstructions;
- }
- /**
- * @param offlineInstructions The offlineInstructions to set.
- */
- public void setOfflineInstructions(String offlineInstructions) {
- this.offlineInstructions = offlineInstructions;
- }
- /**
- * @return Returns the onlineInstructions.
- */
- public String getOnlineInstructions() {
- return onlineInstructions;
- }
- /**
- * @param onlineInstructions The onlineInstructions to set.
- */
- public void setOnlineInstructions(String onlineInstructions) {
- this.onlineInstructions = onlineInstructions;
- }
-
- /**
- * @return Returns the syncInMonitor.
- */
- public String getSynchInMonitor() {
- return synchInMonitor;
- }
- /**
- * @param syncInMonitor The syncInMonitor to set.
- */
- public void setSynchInMonitor(String synchInMonitor) {
- this.synchInMonitor = synchInMonitor;
- }
-
- /**
- * @return Returns the choiceAdvanced.
- */
- public String getChoiceAdvanced() {
- return choiceAdvanced;
- }
- /**
- * @param choiceAdvanced The choiceAdvanced to set.
- */
- public void setChoiceAdvanced(String choiceAdvanced) {
- this.choiceAdvanced = choiceAdvanced;
- }
- /**
- * @return Returns the choiceBasic.
- */
- public String getChoiceBasic() {
- return choiceBasic;
- }
- /**
- * @param choiceBasic The choiceBasic to set.
- */
- public void setChoiceBasic(String choiceBasic) {
- this.choiceBasic = choiceBasic;
- }
- /**
- * @return Returns the choiceInstructions.
- */
- public String getChoiceInstructions() {
- return choiceInstructions;
- }
- /**
- * @param choiceInstructions The choiceInstructions to set.
- */
- public void setChoiceInstructions(String choiceInstructions) {
- this.choiceInstructions = choiceInstructions;
- }
- /**
- * @return Returns the choice.
- */
- public String getChoice() {
- return choice;
- }
- /**
- * @param choice The choice to set.
- */
- public void setChoice(String choice) {
- this.choice = choice;
- }
- /**
- * @return Returns the reportTitle.
- */
- public String getReportTitle() {
- return reportTitle;
- }
- /**
- * @param reportTitle The reportTitle to set.
- */
- public void setReportTitle(String reportTitle) {
- this.reportTitle = reportTitle;
- }
- /**
- * @return Returns the usernameVisible.
- */
- public String getUsernameVisible() {
- return usernameVisible;
- }
- /**
- * @param usernameVisible The usernameVisible to set.
- */
- public void setUsernameVisible(String usernameVisible) {
- this.usernameVisible = usernameVisible;
- }
- /**
- * @return Returns the submitTabDone.
- */
- public String getSubmitTabDone() {
- return submitTabDone;
- }
- /**
- * @param submitTabDone The submitTabDone to set.
- */
- public void setSubmitTabDone(String submitTabDone) {
- this.submitTabDone = submitTabDone;
- }
-
- /**
- * @return Returns the questionsSequenced.
- */
- public String getQuestionsSequenced() {
- return questionsSequenced;
- }
- /**
- * @param questionsSequenced The questionsSequenced to set.
- */
- public void setQuestionsSequenced(String questionsSequenced) {
- this.questionsSequenced = questionsSequenced;
- }
- /**
- * @return Returns the endLearningMessage.
- */
- public String getEndLearningMessage() {
- return endLearningMessage;
- }
- /**
- * @param endLearningMessage The endLearningMessage to set.
- */
- public void setEndLearningMessage(String endLearningMessage) {
- this.endLearningMessage = endLearningMessage;
- }
- /**
- * @return Returns the monitoringReportTitle.
- */
- public String getMonitoringReportTitle() {
- return monitoringReportTitle;
- }
- /**
- * @param monitoringReportTitle The monitoringReportTitle to set.
- */
- public void setMonitoringReportTitle(String monitoringReportTitle) {
- this.monitoringReportTitle = monitoringReportTitle;
- }
- /**
- * @return Returns the editActivityMonitoring.
- */
- public String getEditActivityMonitoring() {
- return editActivityMonitoring;
- }
- /**
- * @param editActivityMonitoring The editActivityMonitoring to set.
- */
- public void setEditActivityMonitoring(String editActivityMonitoring) {
- this.editActivityMonitoring = editActivityMonitoring;
- }
- /**
- * @return Returns the instructionsMonitoring.
- */
- public String getInstructionsMonitoring() {
- return instructionsMonitoring;
- }
- /**
- * @param instructionsMonitoring The instructionsMonitoring to set.
- */
- public void setInstructionsMonitoring(String instructionsMonitoring) {
- this.instructionsMonitoring = instructionsMonitoring;
- }
- /**
- * @return Returns the statsMonitoring.
- */
- public String getStatsMonitoring() {
- return statsMonitoring;
- }
- /**
- * @param statsMonitoring The statsMonitoring to set.
- */
- public void setStatsMonitoring(String statsMonitoring) {
- this.statsMonitoring = statsMonitoring;
- }
- /**
- * @return Returns the summaryMonitoring.
- */
- public String getSummaryMonitoring() {
- return summaryMonitoring;
- }
- /**
- * @param summaryMonitoring The summaryMonitoring to set.
- */
- public void setSummaryMonitoring(String summaryMonitoring) {
- this.summaryMonitoring = summaryMonitoring;
- }
- /**
- * @return Returns the edit.
- */
- public String getEdit() {
- return edit;
- }
- /**
- * @param edit The edit to set.
- */
- public void setEdit(String edit) {
- this.edit = edit;
- }
-
- /**
- * @return Returns the submitOfflineFile.
- */
- public String getSubmitOfflineFile() {
- return submitOfflineFile;
- }
- /**
- * @param submitOfflineFile The submitOfflineFile to set.
- */
- public void setSubmitOfflineFile(String submitOfflineFile) {
- this.submitOfflineFile = submitOfflineFile;
- }
- /**
- * @param theOfflineFile The theOfflineFile to set.
- */
- public void setTheOfflineFile(FormFile theOfflineFile) {
- this.theOfflineFile = theOfflineFile;
- }
- /**
- * @param theOnlineFile The theOnlineFile to set.
- */
- public void setTheOnlineFile(FormFile theOnlineFile) {
- this.theOnlineFile = theOnlineFile;
- }
- /**
- * @return Returns the theOfflineFile.
- */
- public FormFile getTheOfflineFile() {
- return theOfflineFile;
- }
- /**
- * @return Returns the theOnlineFile.
- */
- public FormFile getTheOnlineFile() {
- return theOnlineFile;
- }
- /**
- * @return Returns the submitOnlineFile.
- */
- public String getSubmitOnlineFile() {
- return submitOnlineFile;
- }
- /**
- * @param submitOnlineFile The submitOnlineFile to set.
- */
- public void setSubmitOnlineFile(String submitOnlineFile) {
- this.submitOnlineFile = submitOnlineFile;
- }
-
- /**
- * @return Returns the dispatch.
- */
- public String getDispatch() {
- return dispatch;
- }
- /**
- * @param dispatch The dispatch to set.
- */
- public void setDispatch(String dispatch) {
- this.dispatch = dispatch;
- }
-
- /**
- * @return Returns the toolContentID.
- */
- public String getToolContentID() {
- return toolContentID;
- }
- /**
- * @param toolContentID The toolContentID to set.
- */
- public void setToolContentID(String toolContentID) {
- this.toolContentID = toolContentID;
- }
-
-
- /**
- * @return Returns the currentTab.
- */
- public String getCurrentTab() {
- return currentTab;
- }
- /**
- * @param currentTab The currentTab to set.
- */
- public void setCurrentTab(String currentTab) {
- this.currentTab = currentTab;
- }
-
- /**
+ public String toString() {
+ return new ToStringBuilder(this).append("Listing current QaAuthoringForm properties: ").append(
+ "toolContentID: ", toolContentID).append("currentTab: ", currentTab).append("activeModule: ",
+ activeModule).append("defaultContentIdStr: ", defaultContentIdStr).append("title: ", title).append(
+ "instructions: ", instructions).append("reportTitle: ", reportTitle).append("monitoringReportTitle: ",
+ monitoringReportTitle).append("endLearningMessage: ", endLearningMessage).append(
+ "onlineInstructions: ", onlineInstructions).append("offlineInstructions: ", offlineInstructions)
+ .append("usernameVisible: ", usernameVisible).append("showOtherAnswers: ", showOtherAnswers).append(
+ "synchInMonitor: ", synchInMonitor).append("questionsSequenced: ", questionsSequenced).append(
+ "lockWhenFinished: ", lockWhenFinished).append("reflect: ", reflect).append(
+ "defineLaterInEditMode: ", defineLaterInEditMode).toString();
+ }
+
+ /**
+ * @return Returns the isRemoveContent.
+ */
+ public String getIsRemoveContent() {
+ return isRemoveContent;
+ }
+
+ /**
+ * @param isRemoveContent
+ * The isRemoveContent to set.
+ */
+ public void setIsRemoveContent(String isRemoveContent) {
+ this.isRemoveContent = isRemoveContent;
+ }
+
+ /**
+ * @return Returns the questionIndex.
+ */
+ public String getQuestionIndex() {
+ return questionIndex;
+ }
+
+ /**
+ * @param questionIndex
+ * The questionIndex to set.
+ */
+ public void setQuestionIndex(String questionIndex) {
+ this.questionIndex = questionIndex;
+ }
+
+ /**
+ * @return Returns the addContent.
+ */
+ public String getAddContent() {
+ return addContent;
+ }
+
+ /**
+ * @param addContent
+ * The addContent to set.
+ */
+ public void setAddContent(String addContent) {
+ this.addContent = addContent;
+ }
+
+ /**
+ * @return Returns the removeContent.
+ */
+ public String getRemoveContent() {
+ return removeContent;
+ }
+
+ /**
+ * @param removeContent
+ * The removeContent to set.
+ */
+ public void setRemoveContent(String removeContent) {
+ this.removeContent = removeContent;
+ }
+
+ /**
+ * @return Returns the removeAllContent.
+ */
+ public String getRemoveAllContent() {
+ return removeAllContent;
+ }
+
+ /**
+ * @param removeAllContent
+ * The removeAllContent to set.
+ */
+ public void setRemoveAllContent(String removeAllContent) {
+ this.removeAllContent = removeAllContent;
+ }
+
+ /**
+ * @return Returns the submitAllContent.
+ */
+ public String getSubmitAllContent() {
+ return submitAllContent;
+ }
+
+ /**
+ * @param submitAllContent
+ * The submitAllContent to set.
+ */
+ public void setSubmitAllContent(String submitAllContent) {
+ this.submitAllContent = submitAllContent;
+ }
+
+ /**
+ * @return Returns the instructions.
+ */
+ public String getInstructions() {
+ return instructions;
+ }
+
+ /**
+ * @param instructions
+ * The instructions to set.
+ */
+ public void setInstructions(String instructions) {
+ this.instructions = instructions;
+ }
+
+ /**
+ * @return Returns the title.
+ */
+ public String getTitle() {
+ return title;
+ }
+
+ /**
+ * @param title
+ * The title to set.
+ */
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ /**
+ * @return Returns the offlineInstructions.
+ */
+ public String getOfflineInstructions() {
+ return offlineInstructions;
+ }
+
+ /**
+ * @param offlineInstructions
+ * The offlineInstructions to set.
+ */
+ public void setOfflineInstructions(String offlineInstructions) {
+ this.offlineInstructions = offlineInstructions;
+ }
+
+ /**
+ * @return Returns the onlineInstructions.
+ */
+ public String getOnlineInstructions() {
+ return onlineInstructions;
+ }
+
+ /**
+ * @param onlineInstructions
+ * The onlineInstructions to set.
+ */
+ public void setOnlineInstructions(String onlineInstructions) {
+ this.onlineInstructions = onlineInstructions;
+ }
+
+ /**
+ * @return Returns the syncInMonitor.
+ */
+ public String getSynchInMonitor() {
+ return synchInMonitor;
+ }
+
+ /**
+ * @param syncInMonitor
+ * The syncInMonitor to set.
+ */
+ public void setSynchInMonitor(String synchInMonitor) {
+ this.synchInMonitor = synchInMonitor;
+ }
+
+ /**
+ * @return Returns the choiceAdvanced.
+ */
+ public String getChoiceAdvanced() {
+ return choiceAdvanced;
+ }
+
+ /**
+ * @param choiceAdvanced
+ * The choiceAdvanced to set.
+ */
+ public void setChoiceAdvanced(String choiceAdvanced) {
+ this.choiceAdvanced = choiceAdvanced;
+ }
+
+ /**
+ * @return Returns the choiceBasic.
+ */
+ public String getChoiceBasic() {
+ return choiceBasic;
+ }
+
+ /**
+ * @param choiceBasic
+ * The choiceBasic to set.
+ */
+ public void setChoiceBasic(String choiceBasic) {
+ this.choiceBasic = choiceBasic;
+ }
+
+ /**
+ * @return Returns the choiceInstructions.
+ */
+ public String getChoiceInstructions() {
+ return choiceInstructions;
+ }
+
+ /**
+ * @param choiceInstructions
+ * The choiceInstructions to set.
+ */
+ public void setChoiceInstructions(String choiceInstructions) {
+ this.choiceInstructions = choiceInstructions;
+ }
+
+ /**
+ * @return Returns the choice.
+ */
+ public String getChoice() {
+ return choice;
+ }
+
+ /**
+ * @param choice
+ * The choice to set.
+ */
+ public void setChoice(String choice) {
+ this.choice = choice;
+ }
+
+ /**
+ * @return Returns the reportTitle.
+ */
+ public String getReportTitle() {
+ return reportTitle;
+ }
+
+ /**
+ * @param reportTitle
+ * The reportTitle to set.
+ */
+ public void setReportTitle(String reportTitle) {
+ this.reportTitle = reportTitle;
+ }
+
+ /**
+ * @return Returns the usernameVisible.
+ */
+ public String getUsernameVisible() {
+ return usernameVisible;
+ }
+
+ /**
+ * @param usernameVisible
+ * The usernameVisible to set.
+ */
+ public void setUsernameVisible(String usernameVisible) {
+ this.usernameVisible = usernameVisible;
+ }
+
+ /**
+ * @return Returns the submitTabDone.
+ */
+ public String getSubmitTabDone() {
+ return submitTabDone;
+ }
+
+ /**
+ * @param submitTabDone
+ * The submitTabDone to set.
+ */
+ public void setSubmitTabDone(String submitTabDone) {
+ this.submitTabDone = submitTabDone;
+ }
+
+ /**
+ * @return Returns the questionsSequenced.
+ */
+ public String getQuestionsSequenced() {
+ return questionsSequenced;
+ }
+
+ /**
+ * @param questionsSequenced
+ * The questionsSequenced to set.
+ */
+ public void setQuestionsSequenced(String questionsSequenced) {
+ this.questionsSequenced = questionsSequenced;
+ }
+
+ /**
+ * @return Returns the endLearningMessage.
+ */
+ public String getEndLearningMessage() {
+ return endLearningMessage;
+ }
+
+ /**
+ * @param endLearningMessage
+ * The endLearningMessage to set.
+ */
+ public void setEndLearningMessage(String endLearningMessage) {
+ this.endLearningMessage = endLearningMessage;
+ }
+
+ /**
+ * @return Returns the monitoringReportTitle.
+ */
+ public String getMonitoringReportTitle() {
+ return monitoringReportTitle;
+ }
+
+ /**
+ * @param monitoringReportTitle
+ * The monitoringReportTitle to set.
+ */
+ public void setMonitoringReportTitle(String monitoringReportTitle) {
+ this.monitoringReportTitle = monitoringReportTitle;
+ }
+
+ /**
+ * @return Returns the editActivityMonitoring.
+ */
+ public String getEditActivityMonitoring() {
+ return editActivityMonitoring;
+ }
+
+ /**
+ * @param editActivityMonitoring
+ * The editActivityMonitoring to set.
+ */
+ public void setEditActivityMonitoring(String editActivityMonitoring) {
+ this.editActivityMonitoring = editActivityMonitoring;
+ }
+
+ /**
+ * @return Returns the instructionsMonitoring.
+ */
+ public String getInstructionsMonitoring() {
+ return instructionsMonitoring;
+ }
+
+ /**
+ * @param instructionsMonitoring
+ * The instructionsMonitoring to set.
+ */
+ public void setInstructionsMonitoring(String instructionsMonitoring) {
+ this.instructionsMonitoring = instructionsMonitoring;
+ }
+
+ /**
+ * @return Returns the statsMonitoring.
+ */
+ public String getStatsMonitoring() {
+ return statsMonitoring;
+ }
+
+ /**
+ * @param statsMonitoring
+ * The statsMonitoring to set.
+ */
+ public void setStatsMonitoring(String statsMonitoring) {
+ this.statsMonitoring = statsMonitoring;
+ }
+
+ /**
+ * @return Returns the summaryMonitoring.
+ */
+ public String getSummaryMonitoring() {
+ return summaryMonitoring;
+ }
+
+ /**
+ * @param summaryMonitoring
+ * The summaryMonitoring to set.
+ */
+ public void setSummaryMonitoring(String summaryMonitoring) {
+ this.summaryMonitoring = summaryMonitoring;
+ }
+
+ /**
+ * @return Returns the edit.
+ */
+ public String getEdit() {
+ return edit;
+ }
+
+ /**
+ * @param edit
+ * The edit to set.
+ */
+ public void setEdit(String edit) {
+ this.edit = edit;
+ }
+
+ /**
+ * @return Returns the submitOfflineFile.
+ */
+ public String getSubmitOfflineFile() {
+ return submitOfflineFile;
+ }
+
+ /**
+ * @param submitOfflineFile
+ * The submitOfflineFile to set.
+ */
+ public void setSubmitOfflineFile(String submitOfflineFile) {
+ this.submitOfflineFile = submitOfflineFile;
+ }
+
+ /**
+ * @param theOfflineFile
+ * The theOfflineFile to set.
+ */
+ public void setTheOfflineFile(FormFile theOfflineFile) {
+ this.theOfflineFile = theOfflineFile;
+ }
+
+ /**
+ * @param theOnlineFile
+ * The theOnlineFile to set.
+ */
+ public void setTheOnlineFile(FormFile theOnlineFile) {
+ this.theOnlineFile = theOnlineFile;
+ }
+
+ /**
+ * @return Returns the theOfflineFile.
+ */
+ public FormFile getTheOfflineFile() {
+ return theOfflineFile;
+ }
+
+ /**
+ * @return Returns the theOnlineFile.
+ */
+ public FormFile getTheOnlineFile() {
+ return theOnlineFile;
+ }
+
+ /**
+ * @return Returns the submitOnlineFile.
+ */
+ public String getSubmitOnlineFile() {
+ return submitOnlineFile;
+ }
+
+ /**
+ * @param submitOnlineFile
+ * The submitOnlineFile to set.
+ */
+ public void setSubmitOnlineFile(String submitOnlineFile) {
+ this.submitOnlineFile = submitOnlineFile;
+ }
+
+ /**
+ * @return Returns the dispatch.
+ */
+ public String getDispatch() {
+ return dispatch;
+ }
+
+ /**
+ * @param dispatch
+ * The dispatch to set.
+ */
+ public void setDispatch(String dispatch) {
+ this.dispatch = dispatch;
+ }
+
+ /**
+ * @return Returns the toolContentID.
+ */
+ public String getToolContentID() {
+ return toolContentID;
+ }
+
+ /**
+ * @param toolContentID
+ * The toolContentID to set.
+ */
+ public void setToolContentID(String toolContentID) {
+ this.toolContentID = toolContentID;
+ }
+
+ /**
+ * @return Returns the currentTab.
+ */
+ public String getCurrentTab() {
+ return currentTab;
+ }
+
+ /**
+ * @param currentTab
+ * The currentTab to set.
+ */
+ public void setCurrentTab(String currentTab) {
+ this.currentTab = currentTab;
+ }
+
+ /**
* @return Returns the activeModule.
*/
public String getActiveModule() {
- return activeModule;
+ return activeModule;
}
+
/**
- * @param activeModule The activeModule to set.
+ * @param activeModule
+ * The activeModule to set.
*/
public void setActiveModule(String activeModule) {
- this.activeModule = activeModule;
+ this.activeModule = activeModule;
}
-
+
/**
* @return Returns the defaultContentIdStr.
*/
public String getDefaultContentIdStr() {
- return defaultContentIdStr;
+ return defaultContentIdStr;
}
+
/**
- * @param defaultContentIdStr The defaultContentIdStr to set.
+ * @param defaultContentIdStr
+ * The defaultContentIdStr to set.
*/
public void setDefaultContentIdStr(String defaultContentIdStr) {
- this.defaultContentIdStr = defaultContentIdStr;
+ this.defaultContentIdStr = defaultContentIdStr;
}
/**
* @return Returns the qaService.
*/
public IQaService getQaService() {
- return qaService;
+ return qaService;
}
+
/**
- * @param qaService The qaService to set.
+ * @param qaService
+ * The qaService to set.
*/
public void setQaService(IQaService qaService) {
- this.qaService = qaService;
+ this.qaService = qaService;
}
-
+
/**
* @return Returns the mapQuestionContent.
*/
public Map getMapQuestionContent() {
- return mapQuestionContent;
+ return mapQuestionContent;
}
+
/**
- * @param mapQuestionContent The mapQuestionContent to set.
+ * @param mapQuestionContent
+ * The mapQuestionContent to set.
*/
public void setMapQuestionContent(Map mapQuestionContent) {
- this.mapQuestionContent = mapQuestionContent;
+ this.mapQuestionContent = mapQuestionContent;
}
-
-
+
/**
* @return Returns the defineLaterInEditMode.
*/
public String getDefineLaterInEditMode() {
- return defineLaterInEditMode;
+ return defineLaterInEditMode;
}
+
/**
- * @param defineLaterInEditMode The defineLaterInEditMode to set.
+ * @param defineLaterInEditMode
+ * The defineLaterInEditMode to set.
*/
public void setDefineLaterInEditMode(String defineLaterInEditMode) {
- this.defineLaterInEditMode = defineLaterInEditMode;
+ this.defineLaterInEditMode = defineLaterInEditMode;
}
+
/**
* @return Returns the reflect.
*/
public String getReflect() {
- return reflect;
+ return reflect;
}
+
/**
- * @param reflect The reflect to set.
+ * @param reflect
+ * The reflect to set.
*/
public void setReflect(String reflect) {
- this.reflect = reflect;
+ this.reflect = reflect;
}
+
/**
* @return Returns the reflectionSubject.
*/
public String getReflectionSubject() {
- return reflectionSubject;
+ return reflectionSubject;
}
+
/**
- * @param reflectionSubject The reflectionSubject to set.
+ * @param reflectionSubject
+ * The reflectionSubject to set.
*/
public void setReflectionSubject(String reflectionSubject) {
- this.reflectionSubject = reflectionSubject;
+ this.reflectionSubject = reflectionSubject;
}
-
+
/**
* @return Returns the contentFolderID.
*/
public String getContentFolderID() {
- return contentFolderID;
+ return contentFolderID;
}
+
/**
- * @param contentFolderID The contentFolderID to set.
+ * @param contentFolderID
+ * The contentFolderID to set.
*/
public void setContentFolderID(String contentFolderID) {
- this.contentFolderID = contentFolderID;
+ this.contentFolderID = contentFolderID;
}
+
/**
* @return Returns the addSingleQuestion.
*/
public String getAddSingleQuestion() {
- return addSingleQuestion;
+ return addSingleQuestion;
}
+
/**
- * @param addSingleQuestion The addSingleQuestion to set.
+ * @param addSingleQuestion
+ * The addSingleQuestion to set.
*/
public void setAddSingleQuestion(String addSingleQuestion) {
- this.addSingleQuestion = addSingleQuestion;
+ this.addSingleQuestion = addSingleQuestion;
}
+
/**
* @return Returns the editableQuestionIndex.
*/
public String getEditableQuestionIndex() {
- return editableQuestionIndex;
+ return editableQuestionIndex;
}
+
/**
- * @param editableQuestionIndex The editableQuestionIndex to set.
+ * @param editableQuestionIndex
+ * The editableQuestionIndex to set.
*/
public void setEditableQuestionIndex(String editableQuestionIndex) {
- this.editableQuestionIndex = editableQuestionIndex;
+ this.editableQuestionIndex = editableQuestionIndex;
}
-
+
/**
* @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 editQuestionBoxRequest.
*/
public String getEditQuestionBoxRequest() {
- return editQuestionBoxRequest;
+ return editQuestionBoxRequest;
}
+
/**
- * @param editQuestionBoxRequest The editQuestionBoxRequest to set.
+ * @param editQuestionBoxRequest
+ * The editQuestionBoxRequest to set.
*/
public void setEditQuestionBoxRequest(String editQuestionBoxRequest) {
- this.editQuestionBoxRequest = editQuestionBoxRequest;
+ this.editQuestionBoxRequest = editQuestionBoxRequest;
}
+
/**
* @return Returns the lockWhenFinished.
*/
public String getLockWhenFinished() {
- return lockWhenFinished;
+ return lockWhenFinished;
}
+
/**
- * @param lockWhenFinished The lockWhenFinished to set.
+ * @param lockWhenFinished
+ * The lockWhenFinished to set.
*/
public void setLockWhenFinished(String lockWhenFinished) {
- this.lockWhenFinished = lockWhenFinished;
+ this.lockWhenFinished = lockWhenFinished;
}
+
/**
* @return Returns the showOtherAnswers.
*/
public String getShowOtherAnswers() {
- return showOtherAnswers;
+ return showOtherAnswers;
}
+
/**
- * @param showOtherAnswers The showOtherAnswers to set.
+ * @param showOtherAnswers
+ * The showOtherAnswers to set.
*/
public void setShowOtherAnswers(String showOtherAnswers) {
- this.showOtherAnswers = showOtherAnswers;
+ this.showOtherAnswers = showOtherAnswers;
}
}
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaDLStarterAction.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/Attic/QaDLStarterAction.java,v
diff -u -r1.8 -r1.9
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaDLStarterAction.java 23 Sep 2006 15:11:02 -0000 1.8
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaDLStarterAction.java 19 Feb 2009 04:25:02 -0000 1.9
@@ -17,44 +17,45 @@
USA
http://www.gnu.org/licenses/gpl.txt
-* ***********************************************************************/
+ * ***********************************************************************/
/**
* @author Ozgur Demirtas
*
* QaDLStarterAction activates the Define Later module.
* It reuses majority of the functionality from existing authoring module.
*
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
* */
/* $$Id$$ */
package org.lamsfoundation.lams.tool.qa.web;
+
import java.io.IOException;
import javax.servlet.ServletException;
@@ -72,23 +73,21 @@
import org.lamsfoundation.lams.tool.qa.service.IQaService;
import org.lamsfoundation.lams.tool.qa.service.QaServiceProxy;
-
public class QaDLStarterAction extends Action implements QaAppConstants {
- static Logger logger = Logger.getLogger(QaDLStarterAction.class.getName());
+ static Logger logger = Logger.getLogger(QaDLStarterAction.class.getName());
- public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException, QaApplicationException {
- QaUtils.cleanUpSessionAbsolute(request);
- logger.debug("init defineLater mode. removed attributes...");
-
- QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
- logger.debug("qaAuthoringForm: " + qaAuthoringForm);
-
- IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
- qaAuthoringForm.setQaService(qaService);
-
-
- QaStarterAction qaStarterAction= new QaStarterAction();
- return qaStarterAction.executeDefineLater(mapping, qaAuthoringForm, request, response, qaService);
- }
+ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException, QaApplicationException {
+ QaUtils.cleanUpSessionAbsolute(request);
+ logger.debug("init defineLater mode. removed attributes...");
+
+ QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
+ logger.debug("qaAuthoringForm: " + qaAuthoringForm);
+
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ qaAuthoringForm.setQaService(qaService);
+
+ QaStarterAction qaStarterAction = new QaStarterAction();
+ return qaStarterAction.executeDefineLater(mapping, qaAuthoringForm, request, response, qaService);
+ }
}
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaEmptyForm.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/Attic/QaEmptyForm.java,v
diff -u -r1.10 -r1.11
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaEmptyForm.java 20 Sep 2006 15:15:42 -0000 1.10
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaEmptyForm.java 19 Feb 2009 04:25:02 -0000 1.11
@@ -28,9 +28,9 @@
/**
* @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
*/
public class QaEmptyForm extends ActionForm {
}
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java,v
diff -u -r1.35 -r1.36
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java 19 Feb 2009 04:04:31 -0000 1.35
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java 19 Feb 2009 04:25:02 -0000 1.36
@@ -22,74 +22,74 @@
/**
* @author Ozgur Demirtas
*
-
+
-
-
-
-
-
-
-
-
-
+
-
-
+
-
+
+
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
*
*/
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningForm.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/Attic/QaLearningForm.java,v
diff -u -r1.22 -r1.23
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningForm.java 26 Nov 2006 22:25:37 -0000 1.22
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningForm.java 19 Feb 2009 04:25:02 -0000 1.23
@@ -32,440 +32,514 @@
* @author Ozgur Demirtas
*/
public class QaLearningForm extends ActionForm implements QaAppConstants {
-
- //controls which method is called by the Lookup map */
- protected String method;
- protected String answer;
- protected String currentQuestionIndex;
- protected String submitAnswersContent;
- protected String getNextQuestion;
- protected String getPreviousQuestion;
- protected String endLearning;
- protected String refreshAnswers;
- protected String submitReflection;
- protected String updateReflection;
- protected String forwardtoReflection;
-
- protected String totalQuestionCount;
- protected String httpSessionID;
+ //controls which method is called by the Lookup map */
+ protected String method;
+
+ protected String answer;
+ protected String currentQuestionIndex;
+ protected String submitAnswersContent;
+ protected String getNextQuestion;
+ protected String getPreviousQuestion;
+ protected String endLearning;
+ protected String refreshAnswers;
+ protected String submitReflection;
+ protected String updateReflection;
+ protected String forwardtoReflection;
+
+ protected String totalQuestionCount;
+ protected String httpSessionID;
protected String toolSessionID;
- protected String questionIndex;
- protected String userID;
- protected String entryText;
- protected String viewAllResults;
- protected String viewAll;
- protected String redoQuestions;
- protected String responseId;
-
- protected String btnCombined;
- protected String btnGetPrevious;
- protected String btnDone;
- protected String btnGetNext;
-
- protected String requestLearningReport;
- protected String requestLearningReportProgress;
- protected String requestLearningReportViewOnly;
-
-
+ protected String questionIndex;
+ protected String userID;
+ protected String entryText;
+ protected String viewAllResults;
+ protected String viewAll;
+ protected String redoQuestions;
+ protected String responseId;
+
+ protected String btnCombined;
+ protected String btnGetPrevious;
+ protected String btnDone;
+ protected String btnGetNext;
+
+ protected String requestLearningReport;
+ protected String requestLearningReportProgress;
+ protected String requestLearningReportViewOnly;
+
/**
* @return Returns the btnCombined.
*/
public String getBtnCombined() {
- return btnCombined;
+ return btnCombined;
}
+
/**
- * @param btnCombined The btnCombined to set.
+ * @param btnCombined
+ * The btnCombined to set.
*/
public void setBtnCombined(String btnCombined) {
- this.btnCombined = btnCombined;
+ this.btnCombined = btnCombined;
}
+
/**
* @return Returns the btnDone.
*/
public String getBtnDone() {
- return btnDone;
+ return btnDone;
}
+
/**
- * @param btnDone The btnDone to set.
+ * @param btnDone
+ * The btnDone to set.
*/
public void setBtnDone(String btnDone) {
- this.btnDone = btnDone;
+ this.btnDone = btnDone;
}
+
/**
* @return Returns the btnGetNext.
*/
public String getBtnGetNext() {
- return btnGetNext;
+ return btnGetNext;
}
+
/**
- * @param btnGetNext The btnGetNext to set.
+ * @param btnGetNext
+ * The btnGetNext to set.
*/
public void setBtnGetNext(String btnGetNext) {
- this.btnGetNext = btnGetNext;
+ this.btnGetNext = btnGetNext;
}
+
/**
* @return Returns the btnGetPrevious.
*/
public String getBtnGetPrevious() {
- return btnGetPrevious;
+ return btnGetPrevious;
}
+
/**
- * @param btnGetPrevious The btnGetPrevious to set.
+ * @param btnGetPrevious
+ * The btnGetPrevious to set.
*/
public void setBtnGetPrevious(String btnGetPrevious) {
- this.btnGetPrevious = btnGetPrevious;
+ this.btnGetPrevious = btnGetPrevious;
}
- /**
+
+ /**
* reset user actions in learning mode
+ *
* @param qaAuthoringForm
- * return void
+ * return void
*/
-
- protected void resetUserActions()
- {
- this.getNextQuestion=null;
- this.getPreviousQuestion=null;
- this.endLearning=null;
- this.submitReflection=null;
- this.forwardtoReflection=null;
+
+ protected void resetUserActions() {
+ this.getNextQuestion = null;
+ this.getPreviousQuestion = null;
+ this.endLearning = null;
+ this.submitReflection = null;
+ this.forwardtoReflection = null;
}
-
- protected void resetAll()
- {
- this.submitAnswersContent=null;
- this.getNextQuestion =null;
- this.getPreviousQuestion =null;
- this.endLearning =null;
- this.refreshAnswers =null;
- this.submitReflection =null;
- this.forwardtoReflection =null;
- this.viewAllResults =null;
- this.viewAll =null;
- this.redoQuestions =null;
+ protected void resetAll() {
+ this.submitAnswersContent = null;
+ this.getNextQuestion = null;
+ this.getPreviousQuestion = null;
+ this.endLearning = null;
+ this.refreshAnswers = null;
+ this.submitReflection = null;
+ this.forwardtoReflection = null;
- this.btnCombined=null;
- this.btnGetPrevious=null;
- this.btnDone=null;
- this.btnGetNext=null;
-
- this.requestLearningReport =null;
- this.requestLearningReportProgress =null;
- this.requestLearningReportViewOnly =null;
+ this.viewAllResults = null;
+ this.viewAll = null;
+ this.redoQuestions = null;
+
+ this.btnCombined = null;
+ this.btnGetPrevious = null;
+ this.btnDone = null;
+ this.btnGetNext = null;
+
+ this.requestLearningReport = null;
+ this.requestLearningReportProgress = null;
+ this.requestLearningReportViewOnly = null;
}
-
-
-
- /**
- * @return Returns the currentQuestionIndex.
- */
- public String getCurrentQuestionIndex() {
- return currentQuestionIndex;
- }
- /**
- * @param currentQuestionIndex The currentQuestionIndex to set.
- */
- public void setCurrentQuestionIndex(String currentQuestionIndex) {
- this.currentQuestionIndex = currentQuestionIndex;
- }
- /**
- * @return Returns the answer.
- */
- public String getAnswer() {
- return answer;
- }
- /**
- * @param answer The answer to set.
- */
- public void setAnswer(String answer) {
- this.answer = answer;
- }
- /**
- * @return Returns the getNextQuestion.
- */
- public String getGetNextQuestion() {
- return getNextQuestion;
- }
- /**
- * @param getNextQuestion The getNextQuestion to set.
- */
- public void setGetNextQuestion(String getNextQuestion) {
- this.getNextQuestion = getNextQuestion;
- }
- /**
- * @return Returns the getPreviousQuestion.
- */
- public String getGetPreviousQuestion() {
- return getPreviousQuestion;
- }
- /**
- * @param getPreviousQuestion The getPreviousQuestion to set.
- */
- public void setGetPreviousQuestion(String getPreviousQuestion) {
- this.getPreviousQuestion = getPreviousQuestion;
- }
- /**
- * @return Returns the submitAnswersContent.
- */
- public String getSubmitAnswersContent() {
- return submitAnswersContent;
- }
- /**
- * @param submitAnswersContent The submitAnswersContent to set.
- */
- public void setSubmitAnswersContent(String submitAnswersContent) {
- this.submitAnswersContent = submitAnswersContent;
- }
- /**
- * @return Returns the endLearning.
- */
- public String getEndLearning() {
- return endLearning;
- }
- /**
- * @param endLearning The endLearning to set.
- */
- public void setEndLearning(String endLearning) {
- this.endLearning = endLearning;
- }
- /**
- * @return Returns the responseId.
- */
- public String getResponseId() {
- return responseId;
- }
- /**
- * @param responseId The responseId to set.
- */
- public void setResponseId(String responseId) {
- this.responseId = responseId;
- }
- /**
- * @return Returns the method.
- */
- public String getMethod() {
- return method;
- }
- /**
- * @param method The method to set.
- */
- public void setMethod(String method) {
- this.method = method;
- }
-
+
/**
+ * @return Returns the currentQuestionIndex.
+ */
+ public String getCurrentQuestionIndex() {
+ return currentQuestionIndex;
+ }
+
+ /**
+ * @param currentQuestionIndex
+ * The currentQuestionIndex to set.
+ */
+ public void setCurrentQuestionIndex(String currentQuestionIndex) {
+ this.currentQuestionIndex = currentQuestionIndex;
+ }
+
+ /**
+ * @return Returns the answer.
+ */
+ public String getAnswer() {
+ return answer;
+ }
+
+ /**
+ * @param answer
+ * The answer to set.
+ */
+ public void setAnswer(String answer) {
+ this.answer = answer;
+ }
+
+ /**
+ * @return Returns the getNextQuestion.
+ */
+ public String getGetNextQuestion() {
+ return getNextQuestion;
+ }
+
+ /**
+ * @param getNextQuestion
+ * The getNextQuestion to set.
+ */
+ public void setGetNextQuestion(String getNextQuestion) {
+ this.getNextQuestion = getNextQuestion;
+ }
+
+ /**
+ * @return Returns the getPreviousQuestion.
+ */
+ public String getGetPreviousQuestion() {
+ return getPreviousQuestion;
+ }
+
+ /**
+ * @param getPreviousQuestion
+ * The getPreviousQuestion to set.
+ */
+ public void setGetPreviousQuestion(String getPreviousQuestion) {
+ this.getPreviousQuestion = getPreviousQuestion;
+ }
+
+ /**
+ * @return Returns the submitAnswersContent.
+ */
+ public String getSubmitAnswersContent() {
+ return submitAnswersContent;
+ }
+
+ /**
+ * @param submitAnswersContent
+ * The submitAnswersContent to set.
+ */
+ public void setSubmitAnswersContent(String submitAnswersContent) {
+ this.submitAnswersContent = submitAnswersContent;
+ }
+
+ /**
+ * @return Returns the endLearning.
+ */
+ public String getEndLearning() {
+ return endLearning;
+ }
+
+ /**
+ * @param endLearning
+ * The endLearning to set.
+ */
+ public void setEndLearning(String endLearning) {
+ this.endLearning = endLearning;
+ }
+
+ /**
+ * @return Returns the responseId.
+ */
+ public String getResponseId() {
+ return responseId;
+ }
+
+ /**
+ * @param responseId
+ * The responseId to set.
+ */
+ public void setResponseId(String responseId) {
+ this.responseId = responseId;
+ }
+
+ /**
+ * @return Returns the method.
+ */
+ public String getMethod() {
+ return method;
+ }
+
+ /**
+ * @param method
+ * The method to set.
+ */
+ public void setMethod(String method) {
+ this.method = method;
+ }
+
+ /**
* @return Returns the viewAllResults.
*/
public String getViewAllResults() {
- return viewAllResults;
+ return viewAllResults;
}
+
/**
- * @param viewAllResults The viewAllResults to set.
+ * @param viewAllResults
+ * The viewAllResults to set.
*/
public void setViewAllResults(String viewAllResults) {
- this.viewAllResults = viewAllResults;
+ this.viewAllResults = viewAllResults;
}
-
+
/**
* @return Returns the toolSessionID.
*/
public String getToolSessionID() {
- return toolSessionID;
+ return toolSessionID;
}
+
/**
- * @param toolSessionID The toolSessionID to set.
+ * @param toolSessionID
+ * The toolSessionID to set.
*/
public void setToolSessionID(String toolSessionID) {
- this.toolSessionID = toolSessionID;
+ this.toolSessionID = toolSessionID;
}
-
+
/**
* @return Returns the httpSessionID.
*/
public String getHttpSessionID() {
- return httpSessionID;
+ return httpSessionID;
}
+
/**
- * @param httpSessionID The httpSessionID to set.
+ * @param httpSessionID
+ * The httpSessionID to set.
*/
public void setHttpSessionID(String httpSessionID) {
- this.httpSessionID = httpSessionID;
+ this.httpSessionID = httpSessionID;
}
- /**
+
+ /**
* @return Returns the userID.
*/
public String getUserID() {
- return userID;
+ return userID;
}
+
/**
- * @param userID The userID to set.
+ * @param userID
+ * The userID to set.
*/
public void setUserID(String userID) {
- this.userID = userID;
+ this.userID = userID;
}
- protected String mode;
-
+
+ protected String mode;
+
/**
* @return Returns the mode.
*/
public String getMode() {
- return mode;
+ return mode;
}
+
/**
- * @param mode The mode to set.
+ * @param mode
+ * The mode to set.
*/
public void setMode(String mode) {
- this.mode = mode;
- }
+ this.mode = mode;
+ }
+
/**
* @return Returns the questionIndex.
*/
public String getQuestionIndex() {
- return questionIndex;
+ return questionIndex;
}
+
/**
- * @param questionIndex The questionIndex to set.
+ * @param questionIndex
+ * The questionIndex to set.
*/
public void setQuestionIndex(String questionIndex) {
- this.questionIndex = questionIndex;
+ this.questionIndex = questionIndex;
}
+
/**
* @return Returns the totalQuestionCount.
*/
public String getTotalQuestionCount() {
- return totalQuestionCount;
+ return totalQuestionCount;
}
+
/**
- * @param totalQuestionCount The totalQuestionCount to set.
+ * @param totalQuestionCount
+ * The totalQuestionCount to set.
*/
public void setTotalQuestionCount(String totalQuestionCount) {
- this.totalQuestionCount = totalQuestionCount;
+ this.totalQuestionCount = totalQuestionCount;
}
-
+
/**
* @return Returns the requestLearningReport.
*/
public String getRequestLearningReport() {
- return requestLearningReport;
+ return requestLearningReport;
}
+
/**
- * @param requestLearningReport The requestLearningReport to set.
+ * @param requestLearningReport
+ * The requestLearningReport to set.
*/
public void setRequestLearningReport(String requestLearningReport) {
- this.requestLearningReport = requestLearningReport;
+ this.requestLearningReport = requestLearningReport;
}
+
/**
* @return Returns the requestLearningReportProgress.
*/
public String getRequestLearningReportProgress() {
- return requestLearningReportProgress;
+ return requestLearningReportProgress;
}
+
/**
- * @param requestLearningReportProgress The requestLearningReportProgress to set.
+ * @param requestLearningReportProgress
+ * The requestLearningReportProgress to set.
*/
- public void setRequestLearningReportProgress(
- String requestLearningReportProgress) {
- this.requestLearningReportProgress = requestLearningReportProgress;
+ public void setRequestLearningReportProgress(String requestLearningReportProgress) {
+ this.requestLearningReportProgress = requestLearningReportProgress;
}
-
+
/**
* @return Returns the requestLearningReportViewOnly.
*/
public String getRequestLearningReportViewOnly() {
- return requestLearningReportViewOnly;
+ return requestLearningReportViewOnly;
}
+
/**
- * @param requestLearningReportViewOnly The requestLearningReportViewOnly to set.
+ * @param requestLearningReportViewOnly
+ * The requestLearningReportViewOnly to set.
*/
- public void setRequestLearningReportViewOnly(
- String requestLearningReportViewOnly) {
- this.requestLearningReportViewOnly = requestLearningReportViewOnly;
+ public void setRequestLearningReportViewOnly(String requestLearningReportViewOnly) {
+ this.requestLearningReportViewOnly = requestLearningReportViewOnly;
}
-
+
/**
* @return Returns the redoQuestions.
*/
public String getRedoQuestions() {
- return redoQuestions;
+ return redoQuestions;
}
+
/**
- * @param redoQuestions The redoQuestions to set.
+ * @param redoQuestions
+ * The redoQuestions to set.
*/
public void setRedoQuestions(String redoQuestions) {
- this.redoQuestions = redoQuestions;
+ this.redoQuestions = redoQuestions;
}
+
/**
* @return Returns the refreshAnswers.
*/
public String getRefreshAnswers() {
- return refreshAnswers;
+ return refreshAnswers;
}
+
/**
- * @param refreshAnswers The refreshAnswers to set.
+ * @param refreshAnswers
+ * The refreshAnswers to set.
*/
public void setRefreshAnswers(String refreshAnswers) {
- this.refreshAnswers = refreshAnswers;
+ this.refreshAnswers = refreshAnswers;
}
+
/**
* @return Returns the entryText.
*/
public String getEntryText() {
- return entryText;
+ return entryText;
}
+
/**
- * @param entryText The entryText to set.
+ * @param entryText
+ * The entryText to set.
*/
public void setEntryText(String entryText) {
- this.entryText = entryText;
+ this.entryText = entryText;
}
+
/**
* @return Returns the forwardtoReflection.
*/
public String getForwardtoReflection() {
- return forwardtoReflection;
+ return forwardtoReflection;
}
+
/**
- * @param forwardtoReflection The forwardtoReflection to set.
+ * @param forwardtoReflection
+ * The forwardtoReflection to set.
*/
public void setForwardtoReflection(String forwardtoReflection) {
- this.forwardtoReflection = forwardtoReflection;
+ this.forwardtoReflection = forwardtoReflection;
}
+
/**
* @return Returns the submitReflection.
*/
public String getSubmitReflection() {
- return submitReflection;
+ return submitReflection;
}
+
/**
- * @param submitReflection The submitReflection to set.
+ * @param submitReflection
+ * The submitReflection to set.
*/
public void setSubmitReflection(String submitReflection) {
- this.submitReflection = submitReflection;
+ this.submitReflection = submitReflection;
}
+
/**
* @return Returns the viewAll.
*/
public String getViewAll() {
- return viewAll;
+ return viewAll;
}
+
/**
- * @param viewAll The viewAll to set.
+ * @param viewAll
+ * The viewAll to set.
*/
public void setViewAll(String viewAll) {
- this.viewAll = viewAll;
+ this.viewAll = viewAll;
}
+
/**
* @return Returns the updateReflection.
*/
public String getUpdateReflection() {
- return updateReflection;
+ return updateReflection;
}
+
/**
- * @param updateReflection The updateReflection to set.
+ * @param updateReflection
+ * The updateReflection to set.
*/
public void setUpdateReflection(String updateReflection) {
- this.updateReflection = updateReflection;
+ this.updateReflection = updateReflection;
}
-
+
}
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java,v
diff -u -r1.68 -r1.69
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java 8 Feb 2007 02:23:27 -0000 1.68
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java 19 Feb 2009 04:25:02 -0000 1.69
@@ -23,6 +23,7 @@
/* $$Id$$ */
package org.lamsfoundation.lams.tool.qa.web;
+
import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
@@ -64,681 +65,595 @@
/**
*
* @author Ozgur Demirtas
- *
- * /&userId=&toolSessionId=123&mode=teacher
*
- * Since the toolSessionId is passed, we will derive toolContentId from the toolSessionId
- *
- * This class is used to load the default content and initialize the presentation Map for Learner mode
+ * /&userId=&toolSessionId=123&mode=teacher
*
+ * Since the toolSessionId is passed, we will derive toolContentId from the
+ * toolSessionId
+ *
+ * This class is used to load the default content and initialize the
+ * presentation Map for Learner mode
+ *
* createToolSession will not be called once the tool is deployed.
*
- * It is important that ALL the session attributes created in this action gets removed by: QaUtils.cleanupSession(request)
+ * It is important that ALL the session attributes created in this action gets
+ * removed by: QaUtils.cleanupSession(request)
*
*/
/**
* Tool Session:
- *
- * A tool session is the concept by which which the tool and the LAMS core manage a set of learners interacting with the tool.
- * The tool session id (toolSessionId) is generated by the LAMS core and given to the tool.
- * A tool session represents the use of a tool for a particulate activity for a group of learners.
- * So if an activity is ungrouped, then one tool session exist for for a tool activity in a learning design.
- *
- * More details on the tool session id are covered under monitoring.
- * When thinking about the tool content id and the tool session id, it might be helpful to think about the tool content id
- * relating to the definition of an activity, whereas the tool session id relates to the runtime participation in the activity.
*
+ * A tool session is the concept by which which the tool and the LAMS core
+ * manage a set of learners interacting with the tool. The tool session id
+ * (toolSessionId) is generated by the LAMS core and given to the tool. A tool
+ * session represents the use of a tool for a particulate activity for a group
+ * of learners. So if an activity is ungrouped, then one tool session exist for
+ * for a tool activity in a learning design.
+ *
+ * More details on the tool session id are covered under monitoring. When
+ * thinking about the tool content id and the tool session id, it might be
+ * helpful to think about the tool content id relating to the definition of an
+ * activity, whereas the tool session id relates to the runtime participation in
+ * the activity.
+ *
*/
/**
*
- * Learner URL:
- * The learner url display the screen(s) that the learner uses to participate in the activity.
- * When the learner accessed this user, it will have a tool access mode ToolAccessMode.LEARNER.
- *
- * It is the responsibility of the tool to record the progress of the user.
- * If the tool is a multistage tool, for example asking a series of questions, the tool must keep track of what the learner has already done.
- * If the user logs out and comes back to the tool later, then the tool should resume from where the learner stopped.
- * When the user is completed with tool, then the tool notifies the progress engine by calling
- * org.lamsfoundation.lams.learning.service.completeToolSession(Long toolSessionId, User learner).
- *
- * If the tool's content DefineLater flag is set to true, then the learner should see a "Please wait for the teacher to define this part...."
- * style message.
- * If the tool's content RunOffline flag is set to true, then the learner should see a "This activity is not being done on the computer.
- * Please see your instructor for details."
- *
- * ?? Would it be better to define a run offline message in the tool? We have instructions for the teacher but not the learner. ??
- * If the tool has a LockOnFinish flag, then the tool should lock learner's entries once they have completed the activity.
- * If they return to the activity (e.g. via the progress bar) then the entries should be read only.
- *
+ * Learner URL: The learner url display the screen(s) that the learner uses to
+ * participate in the activity. When the learner accessed this user, it will
+ * have a tool access mode ToolAccessMode.LEARNER.
+ *
+ * It is the responsibility of the tool to record the progress of the user. If
+ * the tool is a multistage tool, for example asking a series of questions, the
+ * tool must keep track of what the learner has already done. If the user logs
+ * out and comes back to the tool later, then the tool should resume from where
+ * the learner stopped. When the user is completed with tool, then the tool
+ * notifies the progress engine by calling
+ * org.lamsfoundation.lams.learning.service.completeToolSession(Long
+ * toolSessionId, User learner).
+ *
+ * If the tool's content DefineLater flag is set to true, then the learner
+ * should see a "Please wait for the teacher to define this part...." style
+ * message. If the tool's content RunOffline flag is set to true, then the
+ * learner should see a "This activity is not being done on the computer. Please
+ * see your instructor for details."
+ * ?? Would it be better to define a run offline message in the tool? We have
+ * instructions for the teacher but not the learner. ?? If the tool has a
+ * LockOnFinish flag, then the tool should lock learner's entries once they have
+ * completed the activity. If they return to the activity (e.g. via the progress
+ * bar) then the entries should be read only.
+ *
*/
/**
-
-
-
-
-
-
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ */
-
+public class QaLearningStarterAction extends Action implements QaAppConstants {
+ static Logger logger = Logger.getLogger(QaLearningStarterAction.class.getName());
-
+ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException, QaApplicationException {
-
-
-
-
-
-
-
-
+ QaUtils.cleanUpSessionAbsolute(request);
-
-
-
- * */
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ logger.debug("retrieving qaService: " + qaService);
-public class QaLearningStarterAction extends Action implements QaAppConstants {
- static Logger logger = Logger.getLogger(QaLearningStarterAction.class.getName());
+ /* holds the question contents for a given tool session and relevant content */
+ Map mapQuestions = new TreeMap(new QaComparator());
- public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException, QaApplicationException {
-
- QaUtils.cleanUpSessionAbsolute(request);
+ /*holds the answers */
+ Map mapAnswers = new TreeMap(new QaComparator());
- IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("retrieving qaService: " + qaService);
+ QaLearningForm qaLearningForm = (QaLearningForm) form;
- /* holds the question contents for a given tool session and relevant content */
- Map mapQuestions= new TreeMap(new QaComparator());
-
- /*holds the answers */
- Map mapAnswers= new TreeMap(new QaComparator());
-
- QaLearningForm qaLearningForm = (QaLearningForm) form;
-
- GeneralLearnerFlowDTO generalLearnerFlowDTO= new GeneralLearnerFlowDTO();
- generalLearnerFlowDTO.setCurrentQuestionIndex(new Integer(1));
- generalLearnerFlowDTO.setCurrentAnswer("");
-
+ GeneralLearnerFlowDTO generalLearnerFlowDTO = new GeneralLearnerFlowDTO();
+ generalLearnerFlowDTO.setCurrentQuestionIndex(new Integer(1));
+ generalLearnerFlowDTO.setCurrentAnswer("");
- logger.debug("reading httpSessionID");
-
- String httpSessionID=qaLearningForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
+ logger.debug("reading httpSessionID");
- SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
+ String httpSessionID = qaLearningForm.getHttpSessionID();
+ logger.debug("httpSessionID: " + httpSessionID);
- if (sessionMap == null)
- {
- sessionMap = new SessionMap();
- Map mapSequentialAnswers= new HashMap();
- sessionMap.put(MAP_SEQUENTIAL_ANSWERS_KEY, mapSequentialAnswers);
- request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap);
- }
-
- qaLearningForm.setHttpSessionID(sessionMap.getSessionID());
- generalLearnerFlowDTO.setHttpSessionID(sessionMap.getSessionID());
-
- /*validate learning mode parameters*/
- boolean validateParameters=validateParameters(request, mapping, qaLearningForm);
- logger.debug("validateParamaters: " + validateParameters);
- if (!validateParameters)
- {
- logger.debug("error during validation");
- }
-
- // this is the user id of the current user, set up in validateParameters
- String userID=qaLearningForm.getUserID();
- logger.debug("userID: " + userID);
-
- /*
- * use the incoming tool session id and later derive toolContentId from it.
- */
- String toolSessionID=qaLearningForm.getToolSessionID();
- logger.debug("toolSessionID: " + toolSessionID);
- generalLearnerFlowDTO.setToolSessionID(toolSessionID);
- qaLearningForm.setToolSessionID(toolSessionID);
-
- /*
- * By now, the passed tool session id MUST exist in the db by calling:
- * public void createToolSession(Long toolSessionId, Long toolContentId) by the core.
- *
- * make sure this session exists in tool's session table by now.
- */
-
- if (!QaUtils.existsSession(new Long(toolSessionID).longValue(), qaService))
- {
- QaUtils.cleanUpSessionAbsolute(request);
- logger.debug("error: The tool expects mcSession.");
- return (mapping.findForward(ERROR_LIST_LEARNER));
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
+ logger.debug("sessionMap: " + sessionMap);
+
+ if (sessionMap == null) {
+ sessionMap = new SessionMap();
+ Map mapSequentialAnswers = new HashMap();
+ sessionMap.put(MAP_SEQUENTIAL_ANSWERS_KEY, mapSequentialAnswers);
+ request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap);
+ }
+
+ qaLearningForm.setHttpSessionID(sessionMap.getSessionID());
+ generalLearnerFlowDTO.setHttpSessionID(sessionMap.getSessionID());
+
+ /*validate learning mode parameters*/
+ boolean validateParameters = validateParameters(request, mapping, qaLearningForm);
+ logger.debug("validateParamaters: " + validateParameters);
+ if (!validateParameters) {
+ logger.debug("error during validation");
+ }
+
+ // this is the user id of the current user, set up in validateParameters
+ String userID = qaLearningForm.getUserID();
+ logger.debug("userID: " + userID);
+
+ /*
+ * use the incoming tool session id and later derive toolContentId from it.
+ */
+ String toolSessionID = qaLearningForm.getToolSessionID();
+ logger.debug("toolSessionID: " + toolSessionID);
+ generalLearnerFlowDTO.setToolSessionID(toolSessionID);
+ qaLearningForm.setToolSessionID(toolSessionID);
+
+ /*
+ * By now, the passed tool session id MUST exist in the db by calling:
+ * public void createToolSession(Long toolSessionId, Long toolContentId) by the core.
+ *
+ * make sure this session exists in tool's session table by now.
+ */
+
+ if (!QaUtils.existsSession(new Long(toolSessionID).longValue(), qaService)) {
+ QaUtils.cleanUpSessionAbsolute(request);
+ logger.debug("error: The tool expects mcSession.");
+ return (mapping.findForward(ERROR_LIST_LEARNER));
+ }
+
+ /*
+ * by now, we made sure that the passed tool session id exists in the db as a new record
+ * Make sure we can retrieve it and relavent content
+ */
+
+ QaSession qaSession = qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue());
+ logger.debug("retrieving qaSession: " + qaSession);
+ /*
+ * find out what content this tool session is referring to
+ * get the content for this tool session (many to one mapping)
+ */
+
+ /*
+ * Each passed tool session id points to a particular content. Many to one mapping.
+ */
+ QaContent qaContent = qaSession.getQaContent();
+ logger.debug("using qaContent: " + qaContent);
+ if (qaContent == null) {
+ QaUtils.cleanUpSessionAbsolute(request);
+ logger.debug("error: The tool expects qaContent.");
+ return (mapping.findForward(ERROR_LIST_LEARNER));
+ }
+
+ generalLearnerFlowDTO.setActivityTitle(qaContent.getTitle());
+ generalLearnerFlowDTO.setActivityInstructions(qaContent.getInstructions());
+
+ logger.debug("is tool reflective: " + qaContent.isReflect());
+ generalLearnerFlowDTO.setReflection(new Boolean(qaContent.isReflect()).toString());
+ logger.debug("reflection subject: " + qaContent.getReflectionSubject());
+ generalLearnerFlowDTO.setReflectionSubject(qaContent.getReflectionSubject());
+
+ logger.debug("attempt getting notebookEntry: ");
+ NotebookEntry notebookEntry = qaService.getEntry(new Long(toolSessionID), CoreNotebookConstants.NOTEBOOK_TOOL,
+ MY_SIGNATURE, new Integer(userID));
+
+ logger.debug("notebookEntry: " + notebookEntry);
+
+ if (notebookEntry != null) {
+ String notebookEntryPresentable = QaUtils.replaceNewLines(notebookEntry.getEntry());
+ //String notebookEntryPresentable=notebookEntry.getEntry();
+ logger.debug("notebookEntryPresentable: " + notebookEntryPresentable);
+ generalLearnerFlowDTO.setNotebookEntry(notebookEntryPresentable);
+ }
+
+ logger.debug("using TOOL_CONTENT_ID: " + qaContent.getQaContentId());
+ generalLearnerFlowDTO.setToolContentID(qaContent.getQaContentId().toString());
+
+ /*
+ * The content we retrieved above must have been created before in Authoring time.
+ * And the passed tool session id refers to it.
+ */
+
+ logger.debug("REPORT_TITLE_LEARNER: " + qaContent.getReportTitle());
+ generalLearnerFlowDTO.setReportTitleLearner(qaContent.getReportTitle());
+
+ /*
+ * Is the tool activity been checked as Run Offline in the property inspector?
+ */
+ logger.debug("IS_TOOL_ACTIVITY_OFFLINE: " + qaContent.isRunOffline());
+ generalLearnerFlowDTO.setActivityOffline(new Boolean(qaContent.isRunOffline()).toString());
+
+ logger.debug("IS_USERNAME_VISIBLE: " + qaContent.isUsernameVisible());
+ generalLearnerFlowDTO.setUserNameVisible(new Boolean(qaContent.isUsernameVisible()).toString());
+ generalLearnerFlowDTO.setShowOtherAnswers(new Boolean(qaContent.isShowOtherAnswers()).toString());
+
+ /*
+ * Is the tool activity been checked as Define Later in the property inspector?
+ */
+ logger.debug("IS_DEFINE_LATER: " + qaContent.isDefineLater());
+ if (qaContent.isDefineLater()) {
+ QaUtils.cleanUpSessionAbsolute(request);
+ return (mapping.findForward(DEFINE_LATER));
+ }
+
+ /*
+ * Learning mode requires this setting for jsp to generate the user's report
+ */
+ logger.debug("IS_QUESTIONS_SEQUENCED: " + qaContent.isQuestionsSequenced());
+ String feedBackType = "";
+ if (qaContent.isQuestionsSequenced()) {
+ generalLearnerFlowDTO.setQuestionListingMode(QUESTION_LISTING_MODE_SEQUENTIAL);
+ feedBackType = FEEDBACK_TYPE_SEQUENTIAL;
+ } else {
+ generalLearnerFlowDTO.setQuestionListingMode(QUESTION_LISTING_MODE_COMBINED);
+ feedBackType = FEEDBACK_TYPE_COMBINED;
+ }
+ logger.debug("QUESTION_LISTING_MODE: " + generalLearnerFlowDTO.getQuestionListingMode());
+
+ /*
+ * fetch question content from content
+ */
+ Iterator contentIterator = qaContent.getQaQueContents().iterator();
+ while (contentIterator.hasNext()) {
+ QaQueContent qaQueContent = (QaQueContent) contentIterator.next();
+ logger.debug("qaQueContent: " + qaQueContent);
+ logger.debug("question: " + qaQueContent.getQuestion());
+ if (qaQueContent != null) {
+ int displayOrder = qaQueContent.getDisplayOrder();
+ logger.debug("displayOrder: " + displayOrder);
+
+ if (displayOrder != 0) {
+ /*
+ * add the question to the questions Map in the displayOrder
+ */
+ mapQuestions.put(new Integer(displayOrder).toString(), qaQueContent.getQuestion());
}
-
-
- /*
- * by now, we made sure that the passed tool session id exists in the db as a new record
- * Make sure we can retrieve it and relavent content
- */
-
-
- QaSession qaSession=qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue());
- logger.debug("retrieving qaSession: " + qaSession);
- /*
- * find out what content this tool session is referring to
- * get the content for this tool session (many to one mapping)
- */
-
- /*
- * Each passed tool session id points to a particular content. Many to one mapping.
- */
- QaContent qaContent=qaSession.getQaContent();
- logger.debug("using qaContent: " + qaContent);
- if (qaContent == null)
- {
- QaUtils.cleanUpSessionAbsolute(request);
- logger.debug("error: The tool expects qaContent.");
- return (mapping.findForward(ERROR_LIST_LEARNER));
}
-
- generalLearnerFlowDTO.setActivityTitle(qaContent.getTitle());
- generalLearnerFlowDTO.setActivityInstructions(qaContent.getInstructions());
-
- logger.debug("is tool reflective: " + qaContent.isReflect());
- generalLearnerFlowDTO.setReflection(new Boolean(qaContent.isReflect()).toString());
- logger.debug("reflection subject: " + qaContent.getReflectionSubject());
- generalLearnerFlowDTO.setReflectionSubject(qaContent.getReflectionSubject());
-
-
- logger.debug("attempt getting notebookEntry: ");
- NotebookEntry notebookEntry = qaService.getEntry(new Long(toolSessionID),
- CoreNotebookConstants.NOTEBOOK_TOOL,
- MY_SIGNATURE, new Integer(userID));
-
- logger.debug("notebookEntry: " + notebookEntry);
-
- if (notebookEntry != null) {
- String notebookEntryPresentable=QaUtils.replaceNewLines(notebookEntry.getEntry());
- //String notebookEntryPresentable=notebookEntry.getEntry();
- logger.debug("notebookEntryPresentable: " + notebookEntryPresentable);
- generalLearnerFlowDTO.setNotebookEntry(notebookEntryPresentable);
- }
-
-
+ }
+ logger.debug("mapQuestions: " + mapQuestions);
+ generalLearnerFlowDTO.setMapQuestions(mapQuestions);
+ generalLearnerFlowDTO.setMapQuestionContentLearner(mapQuestions);
- logger.debug("using TOOL_CONTENT_ID: " + qaContent.getQaContentId());
- generalLearnerFlowDTO.setToolContentID(qaContent.getQaContentId().toString());
-
-
- /*
- * The content we retrieved above must have been created before in Authoring time.
- * And the passed tool session id refers to it.
- */
-
-
- logger.debug("REPORT_TITLE_LEARNER: " + qaContent.getReportTitle());
- generalLearnerFlowDTO.setReportTitleLearner(qaContent.getReportTitle());
-
- /*
- * Is the tool activity been checked as Run Offline in the property inspector?
- */
- logger.debug("IS_TOOL_ACTIVITY_OFFLINE: " + qaContent.isRunOffline());
- generalLearnerFlowDTO.setActivityOffline(new Boolean(qaContent.isRunOffline()).toString());
-
- logger.debug("IS_USERNAME_VISIBLE: " + qaContent.isUsernameVisible());
- generalLearnerFlowDTO.setUserNameVisible(new Boolean(qaContent.isUsernameVisible()).toString());
- generalLearnerFlowDTO.setShowOtherAnswers(new Boolean(qaContent.isShowOtherAnswers()).toString());
-
- /*
- * Is the tool activity been checked as Define Later in the property inspector?
- */
- logger.debug("IS_DEFINE_LATER: " + qaContent.isDefineLater());
- if ( qaContent.isDefineLater() ) {
- QaUtils.cleanUpSessionAbsolute(request);
- return (mapping.findForward(DEFINE_LATER));
- }
-
- /*
- * Learning mode requires this setting for jsp to generate the user's report
- */
- logger.debug("IS_QUESTIONS_SEQUENCED: " + qaContent.isQuestionsSequenced());
- String feedBackType="";
- if (qaContent.isQuestionsSequenced())
- {
- generalLearnerFlowDTO.setQuestionListingMode(QUESTION_LISTING_MODE_SEQUENTIAL);
- feedBackType=FEEDBACK_TYPE_SEQUENTIAL;
- }
- else
- {
- generalLearnerFlowDTO.setQuestionListingMode(QUESTION_LISTING_MODE_COMBINED);
- feedBackType=FEEDBACK_TYPE_COMBINED;
- }
- logger.debug("QUESTION_LISTING_MODE: " + generalLearnerFlowDTO.getQuestionListingMode());
-
- /*
- * fetch question content from content
- */
- Iterator contentIterator=qaContent.getQaQueContents().iterator();
- while (contentIterator.hasNext())
- {
- QaQueContent qaQueContent=(QaQueContent)contentIterator.next();
- logger.debug("qaQueContent: " + qaQueContent);
- logger.debug("question: " + qaQueContent.getQuestion());
- if (qaQueContent != null)
- {
- int displayOrder=qaQueContent.getDisplayOrder();
- logger.debug("displayOrder: " + displayOrder);
-
- if (displayOrder != 0)
- {
- /*
- * add the question to the questions Map in the displayOrder
- */
- mapQuestions.put(new Integer(displayOrder).toString(),qaQueContent.getQuestion());
- }
- }
- }
- logger.debug("mapQuestions: " + mapQuestions);
- generalLearnerFlowDTO.setMapQuestions(mapQuestions);
- generalLearnerFlowDTO.setMapQuestionContentLearner(mapQuestions);
-
- Iterator itMapQuestions = mapQuestions.entrySet().iterator();
-
- while (itMapQuestions.hasNext())
- {
- Map.Entry pairs = (Map.Entry)itMapQuestions.next();
- mapAnswers.put(pairs.getKey(), "");
+ Iterator itMapQuestions = mapQuestions.entrySet().iterator();
- }
- logger.debug("mapAnswers : " + mapAnswers);
- generalLearnerFlowDTO.setMapAnswers(mapAnswers);
- logger.debug("mapQuestions: " + mapQuestions);
+ while (itMapQuestions.hasNext()) {
+ Map.Entry pairs = (Map.Entry) itMapQuestions.next();
+ mapAnswers.put(pairs.getKey(), "");
- logger.debug("mapQuestions has : " + mapQuestions.size() + " entries.");
-
- generalLearnerFlowDTO.setTotalQuestionCount(new Integer(mapQuestions.size()));
- qaLearningForm.setTotalQuestionCount(new Integer(mapQuestions.size()).toString());
-
- String userFeedback= feedBackType + generalLearnerFlowDTO.getTotalQuestionCount() + QUESTIONS;
-
- generalLearnerFlowDTO.setUserFeedback(userFeedback);
-
- logger.debug("remaining question count: " + generalLearnerFlowDTO.getTotalQuestionCount().toString());
- generalLearnerFlowDTO.setRemainingQuestionCount(generalLearnerFlowDTO.getTotalQuestionCount().toString());
- generalLearnerFlowDTO.setInitialScreen(new Boolean(true).toString());
-
-
- request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO);
- /* Is the request for a preview by the author?
- 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
- 3 modes are:
- author
- teacher
- learner
- */
- /*handling PREVIEW mode*/
- String mode=qaLearningForm.getMode();
- logger.debug("mode: " + mode);
- if ((mode != null) && (mode.equals("author")))
- {
- logger.debug("Author requests for a preview of the content.");
- }
-
-
- int sessionUserCount=0;
- if (qaSession.getQaQueUsers() != null)
- {
- sessionUserCount=qaSession.getQaQueUsers().size();
- }
-
- if (sessionUserCount > 1)
- {
- logger.debug("there are multiple user responses");
- generalLearnerFlowDTO.setExistMultipleUserResponses(new Boolean(true).toString());
- }
+ }
+ logger.debug("mapAnswers : " + mapAnswers);
+ generalLearnerFlowDTO.setMapAnswers(mapAnswers);
+ logger.debug("mapQuestions: " + mapQuestions);
-
-
-
- /* by now, we know that the mode is either teacher or learner
- * check if the mode is teacher and request is for Learner Progress
- */
- logger.debug("current userID: " + userID);
- String learnerProgressUserIdString = WebUtil.readStrParam(request, AttributeNames.PARAM_USER_ID, true);
- logger.debug("learnerProgressUserId: " + learnerProgressUserIdString);
-
- if ((learnerProgressUserIdString != null) && (mode.equals("teacher")))
- {
- logger.debug("start generating learner progress report for toolSessionID: " + toolSessionID);
-
- /* the report should have the all entries for the users in this tool session,
- * and display under the "my answers" section the answers for the user id in the url */
- qaLearningForm.setUserID(learnerProgressUserIdString);
- Long learnerProgressUserId = WebUtil.readLongParam(request, AttributeNames.PARAM_USER_ID, false);
- QaMonitoringAction qaMonitoringAction= new QaMonitoringAction();
- logger.debug("using generalLearnerFlowDTO: " + generalLearnerFlowDTO);
- generalLearnerFlowDTO.setRequestLearningReport(new Boolean(true).toString());
- generalLearnerFlowDTO.setRequestLearningReportProgress(new Boolean(true).toString());
- generalLearnerFlowDTO.setTeacherViewOnly(new Boolean(true).toString());
-
- qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, qaContent.isUsernameVisible(), true,
- toolSessionID, learnerProgressUserIdString,
- generalLearnerFlowDTO, false, toolSessionID);
-
- logger.debug("presenting teacher's report");
-
- QaQueUsr qaQueUsrLocal=qaService.getQaUserBySession(learnerProgressUserId, qaSession.getUid());
-
- if ( qaQueUsrLocal != null ) {
- logger.debug("qaQueUsrLocal uid : " + qaQueUsrLocal.getUid());
- generalLearnerFlowDTO.setUserUid(qaQueUsrLocal.getUid().toString());
- } else {
- generalLearnerFlowDTO.setUserUid(null);
- }
-
- logger.debug("fwd'ing to for learner progress" + INDIVIDUAL_LEARNER_REPORT);
-
- return (mapping.findForward(INDIVIDUAL_LEARNER_REPORT));
- }
-
- /* by now, we know that the mode is learner*/
- /* find out if the content is set to run offline or online. If it is set to run offline , the learners are informed about that. */
- boolean isRunOffline=QaUtils.isRunOffline(qaContent);
- logger.debug("isRunOffline: " + isRunOffline);
- if (isRunOffline == true)
- {
- QaUtils.cleanUpSessionAbsolute(request);
- logger.debug("warning to learner: the activity is offline.");
- logger.debug("fwding to :" + RUN_OFFLINE);
- return (mapping.findForward(RUN_OFFLINE));
- }
+ logger.debug("mapQuestions has : " + mapQuestions.size() + " entries.");
-
-
- /*
- * Verify that userId does not already exist in the db.
- * If it does exist and the passed tool session id exists in the db, that means the user already responded to the content and
- * his answers must be displayed read-only
- *
- * if the user's tool session id AND user id exists in the tool tables go to learner's report.
- */
- /* if the 'All Responses' has been clicked no more user entry is accepted, and isResponseFinalized() returns true*/
- logger.debug("userID:" + userID);
- Long currentToolSessionID=new Long(qaLearningForm.getToolSessionID());
- logger.debug("currentToolSessionID: " + currentToolSessionID);
- logger.debug("current session uid: " + qaSession.getUid());
-
- boolean lockWhenFinished=qaContent.isLockWhenFinished();
- logger.debug("lockWhenFinished: " + lockWhenFinished);
-
- String sessionStatus=qaSession.getSession_status();
- logger.debug("sessionStatus: " + sessionStatus);
-
-
- if (userID != null)
- {
- QaQueUsr qaQueUsr=qaService.getQaUserBySession(new Long(userID), qaSession.getUid());
- logger.debug("QaQueUsr:" + qaQueUsr);
-
- if ((qaQueUsr != null) && (qaQueUsr.isResponseFinalized()))
- {
- logger.debug("is current user's response finalised: " + qaQueUsr.isResponseFinalized());
- QaSession checkSession=qaQueUsr.getQaSession();
- logger.debug("checkSession:" + checkSession);
-
- if (checkSession != null)
- {
- Long checkQaSessionId=checkSession.getQaSessionId();
- logger.debug("checkQaSessionId:" + checkQaSessionId);
-
- if (checkQaSessionId.toString().equals(currentToolSessionID.toString()))
- {
-
- logger.debug("the learner is in the same session and has already responsed to this content");
- logger.debug("lockWhenFinished: " + lockWhenFinished);
+ generalLearnerFlowDTO.setTotalQuestionCount(new Integer(mapQuestions.size()));
+ qaLearningForm.setTotalQuestionCount(new Integer(mapQuestions.size()).toString());
- boolean isLearnerFinished=qaQueUsr.isLearnerFinished();
- logger.debug("isLearnerFinished: " + isLearnerFinished);
+ String userFeedback = feedBackType + generalLearnerFlowDTO.getTotalQuestionCount() + QUESTIONS;
- generalLearnerFlowDTO.setLockWhenFinished(new Boolean(lockWhenFinished).toString());
+ generalLearnerFlowDTO.setUserFeedback(userFeedback);
- logger.debug("isUserNamesVisible: " + qaContent.isUsernameVisible());
- Boolean isUserNamesVisibleBoolean=new Boolean(qaContent.isUsernameVisible());
- boolean isUserNamesVisible=isUserNamesVisibleBoolean.booleanValue();
-
- QaMonitoringAction qaMonitoringAction= new QaMonitoringAction();
- /*the report should have all the users' entries OR
- * the report should have only the current session's entries*/
-
- generalLearnerFlowDTO.setRequestLearningReport(new Boolean(true).toString());
+ logger.debug("remaining question count: " + generalLearnerFlowDTO.getTotalQuestionCount().toString());
+ generalLearnerFlowDTO.setRemainingQuestionCount(generalLearnerFlowDTO.getTotalQuestionCount().toString());
+ generalLearnerFlowDTO.setInitialScreen(new Boolean(true).toString());
- logger.debug("using generalLearnerFlowDTO: " + generalLearnerFlowDTO);
- qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, isUserNamesVisible, true,
- currentToolSessionID.toString(), userID, generalLearnerFlowDTO, false, toolSessionID);
- logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO);
+ request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO);
+ /* Is the request for a preview by the author?
+ 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
+ 3 modes are:
+ author
+ teacher
+ learner
+ */
+ /*handling PREVIEW mode*/
+ String mode = qaLearningForm.getMode();
+ logger.debug("mode: " + mode);
+ if ((mode != null) && (mode.equals("author"))) {
+ logger.debug("Author requests for a preview of the content.");
+ }
- logger.debug("current sessionMap: " + sessionMap);
-
- mapAnswers=(Map)sessionMap.get(MAP_ALL_RESULTS_KEY);
- logger.debug("mapAnswers: " + mapAnswers);
-
- HttpSession ss = SessionManager.getSession();
- /* get back login user DTO */
- UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER);
- Long userId=new Long(toolUser.getUserID().longValue());
-
- QaQueUsr qaQueUsrLocal=qaService.getQaUserBySession(userId, qaSession.getUid());
- logger.debug("qaQueUsrLocal: " + qaQueUsrLocal);
- logger.debug("qaQueUsrLocal uid : " + qaQueUsrLocal.getUid());
-
- generalLearnerFlowDTO.setUserUid(qaQueUsrLocal.getUid().toString());
- String noteBookEntry=generalLearnerFlowDTO.getNotebookEntry();
- logger.debug("noteBookEntry : " + noteBookEntry);
- qaLearningForm.setEntryText(noteBookEntry);
+ int sessionUserCount = 0;
+ if (qaSession.getQaQueUsers() != null) {
+ sessionUserCount = qaSession.getQaQueUsers().size();
+ }
-
- logger.debug("attempt getting notebookEntry: ");
- NotebookEntry notebookEntryLocal = qaService.getEntry(new Long(toolSessionID),
- CoreNotebookConstants.NOTEBOOK_TOOL,
- MY_SIGNATURE, new Integer(userID));
-
- logger.debug("notebookEntryLocal: " + notebookEntryLocal);
-
- if (notebookEntryLocal != null) {
- String notebookEntryPresentable=QaUtils.replaceNewLines(notebookEntryLocal.getEntry());
- logger.debug("notebookEntryPresentable: " + notebookEntryPresentable);
- generalLearnerFlowDTO.setNotebookEntry(notebookEntryPresentable);
- qaLearningForm.setEntryText(notebookEntryPresentable);
- }
-
-
-
- if (isLearnerFinished)
- {
- logger.debug("isLearnerFinished is true");
- generalLearnerFlowDTO.setRequestLearningReportViewOnly(new Boolean(true).toString());
-
- request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO);
- logger.debug("before fwd, GENERAL_LEARNER_FLOW_DTO: " + request.getAttribute(GENERAL_LEARNER_FLOW_DTO));
-
- logger.debug("fwd'ing to." + REVISITED_LEARNER_REP);
- return (mapping.findForward(REVISITED_LEARNER_REP));
- }
- else
- {
- logger.debug("NOT true both isLearnerFinished and lockWhenFinished");
- generalLearnerFlowDTO.setRequestLearningReportViewOnly(new Boolean(false).toString());
-
- request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO);
- logger.debug("before fwd, GENERAL_LEARNER_FLOW_DTO: " + request.getAttribute(GENERAL_LEARNER_FLOW_DTO));
- }
+ if (sessionUserCount > 1) {
+ logger.debug("there are multiple user responses");
+ generalLearnerFlowDTO.setExistMultipleUserResponses(new Boolean(true).toString());
+ }
+ /* by now, we know that the mode is either teacher or learner
+ * check if the mode is teacher and request is for Learner Progress
+ */
+ logger.debug("current userID: " + userID);
+ String learnerProgressUserIdString = WebUtil.readStrParam(request, AttributeNames.PARAM_USER_ID, true);
+ logger.debug("learnerProgressUserId: " + learnerProgressUserIdString);
-
- logger.debug("fwd'ing to." + INDIVIDUAL_LEARNER_REPORT);
- return (mapping.findForward(INDIVIDUAL_LEARNER_REPORT));
- }
- }
- }
+ if ((learnerProgressUserIdString != null) && (mode.equals("teacher"))) {
+ logger.debug("start generating learner progress report for toolSessionID: " + toolSessionID);
+
+ /* the report should have the all entries for the users in this tool session,
+ * and display under the "my answers" section the answers for the user id in the url */
+ qaLearningForm.setUserID(learnerProgressUserIdString);
+ Long learnerProgressUserId = WebUtil.readLongParam(request, AttributeNames.PARAM_USER_ID, false);
+ QaMonitoringAction qaMonitoringAction = new QaMonitoringAction();
+ logger.debug("using generalLearnerFlowDTO: " + generalLearnerFlowDTO);
+ generalLearnerFlowDTO.setRequestLearningReport(new Boolean(true).toString());
+ generalLearnerFlowDTO.setRequestLearningReportProgress(new Boolean(true).toString());
+ generalLearnerFlowDTO.setTeacherViewOnly(new Boolean(true).toString());
+
+ qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, qaContent.isUsernameVisible(), true,
+ toolSessionID, learnerProgressUserIdString, generalLearnerFlowDTO, false, toolSessionID);
+
+ logger.debug("presenting teacher's report");
+
+ QaQueUsr qaQueUsrLocal = qaService.getQaUserBySession(learnerProgressUserId, qaSession.getUid());
+
+ if (qaQueUsrLocal != null) {
+ logger.debug("qaQueUsrLocal uid : " + qaQueUsrLocal.getUid());
+ generalLearnerFlowDTO.setUserUid(qaQueUsrLocal.getUid().toString());
+ } else {
+ generalLearnerFlowDTO.setUserUid(null);
}
- else
- {
- logger.debug("userId is null, it should not be, report this.");
- }
-
- /*
- * present user with the questions.
- */
- request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO);
- logger.debug("GENERAL_LEARNER_FLOW_DTO: " + request.getAttribute(GENERAL_LEARNER_FLOW_DTO));
- logger.debug("forwarding to: " + LOAD_LEARNER);
- return (mapping.findForward(LOAD_LEARNER));
+
+ logger.debug("fwd'ing to for learner progress" + INDIVIDUAL_LEARNER_REPORT);
+
+ return (mapping.findForward(INDIVIDUAL_LEARNER_REPORT));
}
-
- /**
- * validates the learning mode parameters
- * @param request
- * @param mapping
- * @return ActionForward
+ /* by now, we know that the mode is learner*/
+ /* find out if the content is set to run offline or online. If it is set to run offline , the learners are informed about that. */
+ boolean isRunOffline = QaUtils.isRunOffline(qaContent);
+ logger.debug("isRunOffline: " + isRunOffline);
+ if (isRunOffline == true) {
+ QaUtils.cleanUpSessionAbsolute(request);
+ logger.debug("warning to learner: the activity is offline.");
+ logger.debug("fwding to :" + RUN_OFFLINE);
+ return (mapping.findForward(RUN_OFFLINE));
+ }
+
+ /*
+ * Verify that userId does not already exist in the db.
+ * If it does exist and the passed tool session id exists in the db, that means the user already responded to the content and
+ * his answers must be displayed read-only
+ *
+ * if the user's tool session id AND user id exists in the tool tables go to learner's report.
*/
- protected boolean validateParameters(HttpServletRequest request, ActionMapping mapping, QaLearningForm qaLearningForm)
- {
- /*
- * obtain and setup the current user's data
- */
- String userID = "";
- HttpSession ss = SessionManager.getSession();
- logger.debug("ss: " + ss);
-
- if (ss != null)
- {
- UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
- if ((user != null) && (user.getUserID() != null))
- {
- userID = user.getUserID().toString();
- logger.debug("retrieved userId: " + userID);
- qaLearningForm.setUserID(userID);
- }
- }
-
-
- /*
- * process incoming tool session id and later derive toolContentId from it.
- */
- String strToolSessionId=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID);
- long toolSessionId=0;
- if ((strToolSessionId == null) || (strToolSessionId.length() == 0))
- {
- persistError(request, "error.toolSessionId.required");
- return false;
- }
- else
- {
- try
- {
- toolSessionId=new Long(strToolSessionId).longValue();
- logger.debug("passed TOOL_SESSION_ID : " + new Long(toolSessionId));
- qaLearningForm.setToolSessionID(new Long(toolSessionId).toString());
+ /* if the 'All Responses' has been clicked no more user entry is accepted, and isResponseFinalized() returns true*/
+ logger.debug("userID:" + userID);
+ Long currentToolSessionID = new Long(qaLearningForm.getToolSessionID());
+ logger.debug("currentToolSessionID: " + currentToolSessionID);
+ logger.debug("current session uid: " + qaSession.getUid());
+
+ boolean lockWhenFinished = qaContent.isLockWhenFinished();
+ logger.debug("lockWhenFinished: " + lockWhenFinished);
+
+ String sessionStatus = qaSession.getSession_status();
+ logger.debug("sessionStatus: " + sessionStatus);
+
+ if (userID != null) {
+ QaQueUsr qaQueUsr = qaService.getQaUserBySession(new Long(userID), qaSession.getUid());
+ logger.debug("QaQueUsr:" + qaQueUsr);
+
+ if ((qaQueUsr != null) && (qaQueUsr.isResponseFinalized())) {
+ logger.debug("is current user's response finalised: " + qaQueUsr.isResponseFinalized());
+ QaSession checkSession = qaQueUsr.getQaSession();
+ logger.debug("checkSession:" + checkSession);
+
+ if (checkSession != null) {
+ Long checkQaSessionId = checkSession.getQaSessionId();
+ logger.debug("checkQaSessionId:" + checkQaSessionId);
+
+ if (checkQaSessionId.toString().equals(currentToolSessionID.toString())) {
+
+ logger.debug("the learner is in the same session and has already responsed to this content");
+ logger.debug("lockWhenFinished: " + lockWhenFinished);
+
+ boolean isLearnerFinished = qaQueUsr.isLearnerFinished();
+ logger.debug("isLearnerFinished: " + isLearnerFinished);
+
+ generalLearnerFlowDTO.setLockWhenFinished(new Boolean(lockWhenFinished).toString());
+
+ logger.debug("isUserNamesVisible: " + qaContent.isUsernameVisible());
+ Boolean isUserNamesVisibleBoolean = new Boolean(qaContent.isUsernameVisible());
+ boolean isUserNamesVisible = isUserNamesVisibleBoolean.booleanValue();
+
+ QaMonitoringAction qaMonitoringAction = new QaMonitoringAction();
+ /*the report should have all the users' entries OR
+ * the report should have only the current session's entries*/
+
+ generalLearnerFlowDTO.setRequestLearningReport(new Boolean(true).toString());
+
+ logger.debug("using generalLearnerFlowDTO: " + generalLearnerFlowDTO);
+ qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, isUserNamesVisible, true,
+ currentToolSessionID.toString(), userID, generalLearnerFlowDTO, false, toolSessionID);
+ logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO);
+
+ logger.debug("current sessionMap: " + sessionMap);
+
+ mapAnswers = (Map) sessionMap.get(MAP_ALL_RESULTS_KEY);
+ logger.debug("mapAnswers: " + mapAnswers);
+
+ HttpSession ss = SessionManager.getSession();
+ /* get back login user DTO */
+ UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER);
+ Long userId = new Long(toolUser.getUserID().longValue());
+
+ QaQueUsr qaQueUsrLocal = qaService.getQaUserBySession(userId, qaSession.getUid());
+ logger.debug("qaQueUsrLocal: " + qaQueUsrLocal);
+ logger.debug("qaQueUsrLocal uid : " + qaQueUsrLocal.getUid());
+
+ generalLearnerFlowDTO.setUserUid(qaQueUsrLocal.getUid().toString());
+ String noteBookEntry = generalLearnerFlowDTO.getNotebookEntry();
+ logger.debug("noteBookEntry : " + noteBookEntry);
+ qaLearningForm.setEntryText(noteBookEntry);
+
+ logger.debug("attempt getting notebookEntry: ");
+ NotebookEntry notebookEntryLocal = qaService.getEntry(new Long(toolSessionID),
+ CoreNotebookConstants.NOTEBOOK_TOOL, MY_SIGNATURE, new Integer(userID));
+
+ logger.debug("notebookEntryLocal: " + notebookEntryLocal);
+
+ if (notebookEntryLocal != null) {
+ String notebookEntryPresentable = QaUtils.replaceNewLines(notebookEntryLocal.getEntry());
+ logger.debug("notebookEntryPresentable: " + notebookEntryPresentable);
+ generalLearnerFlowDTO.setNotebookEntry(notebookEntryPresentable);
+ qaLearningForm.setEntryText(notebookEntryPresentable);
}
- catch(NumberFormatException e)
- {
- logger.debug("add error.sessionId.numberFormatException to ActionMessages.");
- return false;
+
+ if (isLearnerFinished) {
+ logger.debug("isLearnerFinished is true");
+ generalLearnerFlowDTO.setRequestLearningReportViewOnly(new Boolean(true).toString());
+
+ request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO);
+ logger.debug("before fwd, GENERAL_LEARNER_FLOW_DTO: "
+ + request.getAttribute(GENERAL_LEARNER_FLOW_DTO));
+
+ logger.debug("fwd'ing to." + REVISITED_LEARNER_REP);
+ return (mapping.findForward(REVISITED_LEARNER_REP));
+ } else {
+ logger.debug("NOT true both isLearnerFinished and lockWhenFinished");
+ generalLearnerFlowDTO.setRequestLearningReportViewOnly(new Boolean(false).toString());
+
+ request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO);
+ logger.debug("before fwd, GENERAL_LEARNER_FLOW_DTO: "
+ + request.getAttribute(GENERAL_LEARNER_FLOW_DTO));
}
+
+ logger.debug("fwd'ing to." + INDIVIDUAL_LEARNER_REPORT);
+ return (mapping.findForward(INDIVIDUAL_LEARNER_REPORT));
+ }
+ }
}
-
- /*mode can be learner, teacher or author */
- String mode=request.getParameter(MODE);
- logger.debug("mode: " + mode);
-
- if ((mode == null) || (mode.length() == 0))
- {
- return false;
+ } else {
+ logger.debug("userId is null, it should not be, report this.");
+ }
+
+ /*
+ * present user with the questions.
+ */
+ request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO);
+ logger.debug("GENERAL_LEARNER_FLOW_DTO: " + request.getAttribute(GENERAL_LEARNER_FLOW_DTO));
+ logger.debug("forwarding to: " + LOAD_LEARNER);
+ return (mapping.findForward(LOAD_LEARNER));
+ }
+
+ /**
+ * validates the learning mode parameters
+ *
+ * @param request
+ * @param mapping
+ * @return ActionForward
+ */
+ protected boolean validateParameters(HttpServletRequest request, ActionMapping mapping,
+ QaLearningForm qaLearningForm) {
+ /*
+ * obtain and setup the current user's data
+ */
+ String userID = "";
+ HttpSession ss = SessionManager.getSession();
+ logger.debug("ss: " + ss);
+
+ if (ss != null) {
+ UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
+ if ((user != null) && (user.getUserID() != null)) {
+ userID = user.getUserID().toString();
+ logger.debug("retrieved userId: " + userID);
+ qaLearningForm.setUserID(userID);
}
-
- if ((!mode.equals("learner")) && (!mode.equals("teacher")) && (!mode.equals("author")))
- {
- return false;
+ }
+
+ /*
+ * process incoming tool session id and later derive toolContentId from it.
+ */
+ String strToolSessionId = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID);
+ long toolSessionId = 0;
+ if ((strToolSessionId == null) || (strToolSessionId.length() == 0)) {
+ persistError(request, "error.toolSessionId.required");
+ return false;
+ } else {
+ try {
+ toolSessionId = new Long(strToolSessionId).longValue();
+ logger.debug("passed TOOL_SESSION_ID : " + new Long(toolSessionId));
+ qaLearningForm.setToolSessionID(new Long(toolSessionId).toString());
+ } catch (NumberFormatException e) {
+ logger.debug("add error.sessionId.numberFormatException to ActionMessages.");
+ return false;
}
+ }
- logger.debug("session LEARNING_MODE set to:" + mode);
- qaLearningForm.setMode(mode);
- return true;
+ /*mode can be learner, teacher or author */
+ String mode = request.getParameter(MODE);
+ logger.debug("mode: " + mode);
+
+ if ((mode == null) || (mode.length() == 0)) {
+ return false;
}
-
-
- boolean isSessionCompleted(String userSessionId, IQaService qaService)
- {
- logger.debug("userSessionId:" + userSessionId);
- QaSession qaSession=qaService.retrieveQaSessionOrNullById(new Long(userSessionId).longValue());
- logger.debug("retrieving qaSession: " + qaSession);
- logger.debug("voteSession status : " + qaSession.getSession_status());
- if ((qaSession.getSession_status() != null) && (qaSession.getSession_status().equals(COMPLETED)))
- {
- logger.debug("this session is COMPLETED voteSession status : " + userSessionId);
- return true;
- }
+
+ if ((!mode.equals("learner")) && (!mode.equals("teacher")) && (!mode.equals("author"))) {
return false;
}
-
- /**
+ logger.debug("session LEARNING_MODE set to:" + mode);
+ qaLearningForm.setMode(mode);
+ return true;
+ }
+
+ boolean isSessionCompleted(String userSessionId, IQaService qaService) {
+ logger.debug("userSessionId:" + userSessionId);
+ QaSession qaSession = qaService.retrieveQaSessionOrNullById(new Long(userSessionId).longValue());
+ logger.debug("retrieving qaSession: " + qaSession);
+ logger.debug("voteSession status : " + qaSession.getSession_status());
+ if ((qaSession.getSession_status() != null) && (qaSession.getSession_status().equals(COMPLETED))) {
+ logger.debug("this session is COMPLETED voteSession status : " + userSessionId);
+ return true;
+ }
+ return false;
+ }
+
+ /**
* 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));
+ logger.debug("add " + message + " to ActionMessages:");
+ saveErrors(request, errors);
+ }
+}
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringForm.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/Attic/QaMonitoringForm.java,v
diff -u -r1.20 -r1.21
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringForm.java 23 Sep 2006 15:11:01 -0000 1.20
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringForm.java 19 Feb 2009 04:25:02 -0000 1.21
@@ -32,145 +32,163 @@
/**
* @author Ozgur Demirtas
- *
+ *
*/
public class QaMonitoringForm extends QaAuthoringForm implements QaAppConstants {
- //controls which method is called by the Lookup map */
- protected String method;
- protected String selectedToolSessionId;
- protected String isToolSessionChanged;
-
- protected String editResponse;
- protected String hideResponse;
- protected String showResponse;
- protected String currentUid;
-
- protected String sessionId;
-
- protected IQaService qaService;
-
-
- public String toString() {
- super.toString();
- return new ToStringBuilder(this)
- .append("Listing current QaMonitoringForm properties: ")
- .append("method: ", method)
- .append("selectedToolSessionId: ", selectedToolSessionId)
- .append("isToolSessionChanged: ", isToolSessionChanged)
- .append("editResponse: ", editResponse)
- .append("hideResponse: ", hideResponse)
- .append("showResponse: ", showResponse)
- .append("currentUid: ", currentUid)
- .toString();
+ //controls which method is called by the Lookup map */
+ protected String method;
+ protected String selectedToolSessionId;
+ protected String isToolSessionChanged;
+
+ protected String editResponse;
+ protected String hideResponse;
+ protected String showResponse;
+ protected String currentUid;
+
+ protected String sessionId;
+
+ protected IQaService qaService;
+
+ public String toString() {
+ super.toString();
+ return new ToStringBuilder(this).append("Listing current QaMonitoringForm properties: ").append("method: ",
+ method).append("selectedToolSessionId: ", selectedToolSessionId).append("isToolSessionChanged: ",
+ isToolSessionChanged).append("editResponse: ", editResponse).append("hideResponse: ", hideResponse)
+ .append("showResponse: ", showResponse).append("currentUid: ", currentUid).toString();
}
-
+
/**
* @return Returns the editResponse.
*/
public String getEditResponse() {
- return editResponse;
+ return editResponse;
}
+
/**
- * @param editResponse The editResponse to set.
+ * @param editResponse
+ * The editResponse to set.
*/
public void setEditResponse(String editResponse) {
- this.editResponse = editResponse;
+ this.editResponse = editResponse;
}
+
/**
* @return Returns the qaService.
*/
public IQaService getQaService() {
- return qaService;
+ return qaService;
}
+
/**
- * @param qaService The qaService to set.
+ * @param qaService
+ * The qaService to set.
*/
public void setQaService(IQaService qaService) {
- this.qaService = qaService;
+ this.qaService = qaService;
}
+
/**
* @return Returns the currentUid.
*/
public String getCurrentUid() {
- return currentUid;
+ return currentUid;
}
+
/**
- * @param currentUid The currentUid to set.
+ * @param currentUid
+ * The currentUid to set.
*/
public void setCurrentUid(String currentUid) {
- this.currentUid = currentUid;
+ this.currentUid = currentUid;
}
+
/**
* @return Returns the hideResponse.
*/
public String getHideResponse() {
- return hideResponse;
+ return hideResponse;
}
+
/**
- * @param hideResponse The hideResponse to set.
+ * @param hideResponse
+ * The hideResponse to set.
*/
public void setHideResponse(String hideResponse) {
- this.hideResponse = hideResponse;
+ this.hideResponse = hideResponse;
}
+
/**
* @return Returns the showResponse.
*/
public String getShowResponse() {
- return showResponse;
+ return showResponse;
}
+
/**
- * @param showResponse The showResponse to set.
+ * @param showResponse
+ * The showResponse to set.
*/
public void setShowResponse(String showResponse) {
- this.showResponse = showResponse;
+ this.showResponse = showResponse;
}
- /**
- * @return Returns the isToolSessionChanged.
- */
- public String getIsToolSessionChanged() {
- return isToolSessionChanged;
- }
- /**
- * @param isToolSessionChanged The isToolSessionChanged to set.
- */
- public void setIsToolSessionChanged(String isToolSessionChanged) {
- this.isToolSessionChanged = isToolSessionChanged;
- }
- /**
- * @return Returns the selectedToolSessionId.
- */
- public String getSelectedToolSessionId() {
- return selectedToolSessionId;
- }
- /**
- * @param selectedToolSessionId The selectedToolSessionId to set.
- */
- public void setSelectedToolSessionId(String selectedToolSessionId) {
- this.selectedToolSessionId = selectedToolSessionId;
- }
-
- /**
- * @return Returns the method.
- */
- public String getMethod() {
- return method;
- }
- /**
- * @param method The method to set.
- */
- public void setMethod(String method) {
- this.method = method;
- }
+
/**
+ * @return Returns the isToolSessionChanged.
+ */
+ public String getIsToolSessionChanged() {
+ return isToolSessionChanged;
+ }
+
+ /**
+ * @param isToolSessionChanged
+ * The isToolSessionChanged to set.
+ */
+ public void setIsToolSessionChanged(String isToolSessionChanged) {
+ this.isToolSessionChanged = isToolSessionChanged;
+ }
+
+ /**
+ * @return Returns the selectedToolSessionId.
+ */
+ public String getSelectedToolSessionId() {
+ return selectedToolSessionId;
+ }
+
+ /**
+ * @param selectedToolSessionId
+ * The selectedToolSessionId to set.
+ */
+ public void setSelectedToolSessionId(String selectedToolSessionId) {
+ this.selectedToolSessionId = selectedToolSessionId;
+ }
+
+ /**
+ * @return Returns the method.
+ */
+ public String getMethod() {
+ return method;
+ }
+
+ /**
+ * @param method
+ * The method to set.
+ */
+ public void setMethod(String method) {
+ this.method = method;
+ }
+
+ /**
* @return Returns the sessionId.
*/
public String getSessionId() {
- return sessionId;
+ return sessionId;
}
+
/**
- * @param sessionId The sessionId to set.
+ * @param sessionId
+ * The sessionId to set.
*/
public void setSessionId(String sessionId) {
- this.sessionId = sessionId;
+ this.sessionId = sessionId;
}
}
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java,v
diff -u -r1.51 -r1.52
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java 3 Dec 2006 14:58:02 -0000 1.51
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java 19 Feb 2009 04:25:02 -0000 1.52
@@ -59,305 +59,260 @@
/**
*
- * @author Ozgur Demirtas
- * starts up the monitoring module
+ * @author Ozgur Demirtas starts up the monitoring module
*
- *
-
-
-
-
-
-
- *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
*/
public class QaMonitoringStarterAction extends Action implements QaAppConstants {
- static Logger logger = Logger.getLogger(QaMonitoringStarterAction.class.getName());
+ static Logger logger = Logger.getLogger(QaMonitoringStarterAction.class.getName());
- public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException, QaApplicationException
- {
- logger.debug("init QaMonitoringStarterAction...");
- QaUtils.cleanUpSessionAbsolute(request);
-
- QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
- logger.debug("qaMonitoringForm: " + qaMonitoringForm);
+ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException, QaApplicationException {
+ logger.debug("init QaMonitoringStarterAction...");
+ QaUtils.cleanUpSessionAbsolute(request);
- IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug("qaService: " + qaService);
- qaMonitoringForm.setQaService(qaService);
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
- qaMonitoringForm.setContentFolderID(contentFolderID);
+ QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
+ logger.debug("qaMonitoringForm: " + qaMonitoringForm);
-
-
- ActionForward validateParameters=validateParameters(request, mapping, qaMonitoringForm);
- logger.debug("validateParamaters: " + validateParameters);
- if (validateParameters != null)
- {
- return validateParameters;
- }
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ logger.debug("qaService: " + qaService);
+ qaMonitoringForm.setQaService(qaService);
-
- GeneralMonitoringDTO generalMonitoringDTO= new GeneralMonitoringDTO();
- boolean initData=initialiseMonitoringData(mapping, qaMonitoringForm, request, response, qaService, generalMonitoringDTO);
- logger.debug("initData: " + initData);
- if (initData == false)
- return (mapping.findForward(ERROR_LIST));
-
- qaMonitoringForm.setCurrentTab("1");
- logger.debug("setting current tab to 1: ");
-
- generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
- generalMonitoringDTO.setContentFolderID(contentFolderID);
-
-
- QaMonitoringAction qaMonitoringAction= new QaMonitoringAction();
- logger.debug("calling initSummaryContent.");
- qaMonitoringAction.initSummaryContent(mapping, form, request, response);
- logger.debug("calling initInstructionsContent.");
- qaMonitoringAction.initInstructionsContent(mapping, form, request, response);
- logger.debug("calling initStatsContent.");
- qaMonitoringAction.initStatsContent(mapping, form, request, response, generalMonitoringDTO);
- logger.debug("post initStatsContent." + generalMonitoringDTO);
-
- String toolContentID=qaMonitoringForm.getToolContentID();
- logger.debug("toolContentID: " + toolContentID);
-
- QaContent qaContent=qaService.loadQa(new Long(toolContentID).longValue());
- logger.debug("existing qaContent:" + qaContent);
-
- /*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());
- }
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ logger.debug("contentFolderID: " + contentFolderID);
+ qaMonitoringForm.setContentFolderID(contentFolderID);
- request.setAttribute(SELECTION_CASE, new Long(2));
- qaMonitoringForm.setActiveModule(MONITORING);
- qaMonitoringForm.setEditResponse(new Boolean(false).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 **/
+ ActionForward validateParameters = validateParameters(request, mapping, qaMonitoringForm);
+ logger.debug("validateParamaters: " + validateParameters);
+ if (validateParameters != null) {
+ return validateParameters;
+ }
-
- 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);
+ GeneralMonitoringDTO generalMonitoringDTO = new GeneralMonitoringDTO();
+ boolean initData = initialiseMonitoringData(mapping, qaMonitoringForm, request, response, qaService,
+ generalMonitoringDTO);
+ logger.debug("initData: " + initData);
+ if (initData == false)
+ return (mapping.findForward(ERROR_LIST));
-
- qaMonitoringAction.prepareReflectionData(request, qaContent, qaService, null, false, "All");
-
- logger.debug("final qaMonitoringForm: " + qaMonitoringForm);
- logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO );
- request.setAttribute(QA_GENERAL_MONITORING_DTO, generalMonitoringDTO);
-
-
- /*for Edit Activity screen, BasicTab-ViewOnly*/
- qaMonitoringAction.prepareEditActivityScreenData(request, qaContent);
-
-
-
- SessionMap sessionMap = new SessionMap();
- sessionMap.put(ACTIVITY_TITLE_KEY, qaContent.getTitle());
- sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, qaContent.getInstructions());
-
- qaMonitoringForm.setHttpSessionID(sessionMap.getSessionID());
- request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap);
+ qaMonitoringForm.setCurrentTab("1");
+ logger.debug("setting current tab to 1: ");
-
- List listQuestionContentDTO= new LinkedList();
+ generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
+ generalMonitoringDTO.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()));
-
- 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());
- }
+ QaMonitoringAction qaMonitoringAction = new QaMonitoringAction();
+ logger.debug("calling initSummaryContent.");
+ qaMonitoringAction.initSummaryContent(mapping, form, request, response);
+ logger.debug("calling initInstructionsContent.");
+ qaMonitoringAction.initInstructionsContent(mapping, form, request, response);
+ logger.debug("calling initStatsContent.");
+ qaMonitoringAction.initStatsContent(mapping, form, request, response, generalMonitoringDTO);
+ logger.debug("post initStatsContent." + generalMonitoringDTO);
- }
- else
- {
- request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
- }
-
- MonitoringUtil.buildQaStatsDTO(request,qaService, qaContent);
-
- request.setAttribute("currentMonitoredToolSession", "All");
- MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent,false);
-
- logger.debug("fwding to : " + LOAD_MONITORING);
- return (mapping.findForward(LOAD_MONITORING));
+ String toolContentID = qaMonitoringForm.getToolContentID();
+ logger.debug("toolContentID: " + toolContentID);
+
+ QaContent qaContent = qaService.loadQa(new Long(toolContentID).longValue());
+ logger.debug("existing qaContent:" + qaContent);
+
+ /*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());
}
-
- /**
- * initialises monitoring data mainly for jsp purposes
- * initialiseMonitoringData(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- *
- * @param mapping
- * @param form
- * @param request
- * @param response
- * @return boolean
- */
- public boolean initialiseMonitoringData(ActionMapping mapping, QaMonitoringForm qaMonitoringForm, HttpServletRequest request,
- HttpServletResponse response, IQaService qaService, GeneralMonitoringDTO generalMonitoringDTO)
- {
- logger.debug("start initializing monitoring data...: " + qaService);
- generalMonitoringDTO.setEditResponse(new Boolean(false).toString());
- generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
-
- String toolContentID=qaMonitoringForm.getToolContentID();
- logger.debug("toolContentID:" + toolContentID);
-
- QaContent qaContent=qaService.loadQa(new Long(toolContentID).longValue());
- logger.debug("existing qaContent:" + qaContent);
-
- if (qaContent == null)
- {
- QaUtils.cleanUpSessionAbsolute(request);
- return false;
- }
-
- QaMonitoringAction qaMonitoringAction= new QaMonitoringAction();
- logger.debug("refreshing summary data...");
-
- GeneralLearnerFlowDTO generalLearnerFlowDTO= LearningUtil.buildGeneralLearnerFlowDTO(qaContent);
- logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO);
-
- qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, true, false, null, null,
- generalLearnerFlowDTO, false , "All");
-
- logger.debug("refreshing stats data...");
- qaMonitoringAction.refreshStatsData(request, qaMonitoringForm, qaService, generalMonitoringDTO);
-
+ request.setAttribute(SELECTION_CASE, new Long(2));
+ qaMonitoringForm.setActiveModule(MONITORING);
+ qaMonitoringForm.setEditResponse(new Boolean(false).toString());
- logger.debug("end initialising monitoring data...");
- return true;
+ /** 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);
+ logger.debug("isContentInUse:" + isContentInUse);
+ if (isContentInUse == true) {
+ editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
}
+ request.setAttribute(EDIT_ACTIVITY_DTO, editActivityDTO);
-
- /**
- * validates request paramaters based on tool contract
- * validateParameters(HttpServletRequest request, ActionMapping mapping)
- *
- * @param request
- * @param mapping
- * @return ActionForward
- */
- protected ActionForward validateParameters(HttpServletRequest request, ActionMapping mapping, QaMonitoringForm qaMonitoringForm)
- {
- logger.debug("start validating monitoring parameters...");
-
- String strToolContentId=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentId: " + strToolContentId);
-
- if ((strToolContentId == null) || (strToolContentId.length() == 0))
- {
- QaUtils.cleanUpSessionAbsolute(request);
- return (mapping.findForward(ERROR_LIST));
+ qaMonitoringAction.prepareReflectionData(request, qaContent, qaService, null, false, "All");
+
+ logger.debug("final qaMonitoringForm: " + qaMonitoringForm);
+ logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO);
+ request.setAttribute(QA_GENERAL_MONITORING_DTO, generalMonitoringDTO);
+
+ /*for Edit Activity screen, BasicTab-ViewOnly*/
+ qaMonitoringAction.prepareEditActivityScreenData(request, qaContent);
+
+ SessionMap sessionMap = new SessionMap();
+ sessionMap.put(ACTIVITY_TITLE_KEY, qaContent.getTitle());
+ sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, qaContent.getInstructions());
+
+ qaMonitoringForm.setHttpSessionID(sessionMap.getSessionID());
+ request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap);
+
+ List listQuestionContentDTO = new LinkedList();
+
+ 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);
}
- else
- {
- try
- {
- long toolContentId=new Long(strToolContentId).longValue();
- logger.debug("passed TOOL_CONTENT_ID : " + new Long(toolContentId));
+ }
+ logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
+ request.setAttribute(LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
+ sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
- qaMonitoringForm.setToolContentID(new Long(toolContentId).toString());
- }
- catch(NumberFormatException e)
- {
- logger.debug("add error.contentId.numberFormatException to ActionMessages.");
- QaUtils.cleanUpSessionAbsolute(request);
- return (mapping.findForward(ERROR_LIST));
- }
+ request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
+
+ 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());
}
- return null;
+
+ } else {
+ request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString());
}
-
- /**
+ MonitoringUtil.buildQaStatsDTO(request, qaService, qaContent);
+
+ request.setAttribute("currentMonitoredToolSession", "All");
+ MonitoringUtil.generateGroupsSessionData(request, qaService, qaContent, false);
+
+ logger.debug("fwding to : " + LOAD_MONITORING);
+ return (mapping.findForward(LOAD_MONITORING));
+ }
+
+ /**
+ * initialises monitoring data mainly for jsp purposes
+ * initialiseMonitoringData(ActionMapping mapping, ActionForm form,
+ * HttpServletRequest request, HttpServletResponse response)
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return boolean
+ */
+ public boolean initialiseMonitoringData(ActionMapping mapping, QaMonitoringForm qaMonitoringForm,
+ HttpServletRequest request, HttpServletResponse response, IQaService qaService,
+ GeneralMonitoringDTO generalMonitoringDTO) {
+ logger.debug("start initializing monitoring data...: " + qaService);
+ generalMonitoringDTO.setEditResponse(new Boolean(false).toString());
+ generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
+
+ String toolContentID = qaMonitoringForm.getToolContentID();
+ logger.debug("toolContentID:" + toolContentID);
+
+ QaContent qaContent = qaService.loadQa(new Long(toolContentID).longValue());
+ logger.debug("existing qaContent:" + qaContent);
+
+ if (qaContent == null) {
+ QaUtils.cleanUpSessionAbsolute(request);
+ return false;
+ }
+
+ QaMonitoringAction qaMonitoringAction = new QaMonitoringAction();
+ logger.debug("refreshing summary data...");
+
+ GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent);
+ logger.debug("generalLearnerFlowDTO: " + generalLearnerFlowDTO);
+
+ qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, true, false, null, null,
+ generalLearnerFlowDTO, false, "All");
+
+ logger.debug("refreshing stats data...");
+ qaMonitoringAction.refreshStatsData(request, qaMonitoringForm, qaService, generalMonitoringDTO);
+
+ logger.debug("end initialising monitoring data...");
+ return true;
+ }
+
+ /**
+ * validates request paramaters based on tool contract
+ * validateParameters(HttpServletRequest request, ActionMapping mapping)
+ *
+ * @param request
+ * @param mapping
+ * @return ActionForward
+ */
+ protected ActionForward validateParameters(HttpServletRequest request, ActionMapping mapping,
+ QaMonitoringForm qaMonitoringForm) {
+ logger.debug("start validating monitoring parameters...");
+
+ String strToolContentId = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ logger.debug("strToolContentId: " + strToolContentId);
+
+ if ((strToolContentId == null) || (strToolContentId.length() == 0)) {
+ QaUtils.cleanUpSessionAbsolute(request);
+ return (mapping.findForward(ERROR_LIST));
+ } else {
+ try {
+ long toolContentId = new Long(strToolContentId).longValue();
+ logger.debug("passed TOOL_CONTENT_ID : " + new Long(toolContentId));
+
+ qaMonitoringForm.setToolContentID(new Long(toolContentId).toString());
+ } catch (NumberFormatException e) {
+ logger.debug("add error.contentId.numberFormatException to ActionMessages.");
+ QaUtils.cleanUpSessionAbsolute(request);
+ return (mapping.findForward(ERROR_LIST));
+ }
+ }
+ return null;
+ }
+
+ /**
* 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));
+ logger.debug("add " + message + " to ActionMessages:");
+ saveErrors(request, errors);
+ }
+}
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java,v
diff -u -r1.69 -r1.70
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java 4 Nov 2008 00:41:19 -0000 1.69
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java 19 Feb 2009 04:25:02 -0000 1.70
@@ -524,7 +524,7 @@
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();