* - List of learners in this group
* - Order ID
@@ -722,8 +680,7 @@
// Preview Methods
// ---------------------------------------------------------------------
/**
- * Create the lesson class and the staff class for a preview lesson. The
- * lesson is not attached to any organisation.
+ * Create the lesson class and the staff class for a preview lesson. The lesson is not attached to any organisation.
*
* @param userID
* User ID of the teacher running the preview. Mandatory.
@@ -734,50 +691,43 @@
public abstract Lesson createPreviewClassForLesson(int userID, long lessonID) throws UserAccessDeniedException;
/**
- * Remove all the details for a particular preview lessons. The transaction
- * handling for this method should be REQUIRES_NEW, which allows each lesson
- * to be deleted separately.
+ * Remove all the details for a particular preview lessons. The transaction handling for this method should be
+ * REQUIRES_NEW, which allows each lesson to be deleted separately.
*
* @param lessonID
* ID of the lesson which is the preview session. Mandatory.
*/
public abstract void deletePreviewLesson(long lessonID);
/**
- * Remove all the "old" preview lessons. Removes all preview lessons older
- * than the number of days specified in the configuration file.
+ * Remove all the "old" preview lessons. Removes all preview lessons older than the number of days specified in the
+ * configuration file.
*
- * Calls deletePreviewLesson(long lessonID) to do the actual deletion, so if
- * one lesson throws a database exception when deleting, the other lessons
- * should delete okay (as deletePreviewLesson uses a REQUIRES_NEW
- * transaction)
+ * Calls deletePreviewLesson(long lessonID) to do the actual deletion, so if one lesson throws a database exception
+ * when deleting, the other lessons should delete okay (as deletePreviewLesson uses a REQUIRES_NEW transaction)
*
* @return number of lessons deleted.
*/
public abstract int deleteAllOldPreviewLessons();
/* Supports the Chosen Groupings and Branching */
/**
- * Get all the active learners in the lesson who are not in a group or in a
- * branch.
+ * Get all the active learners in the lesson who are not in a group or in a branch.
*
- * If the activity is a grouping activity, then set useCreatingGrouping =
- * true to base the list on the create grouping. Otherwise leave it false
- * and it will use the grouping applied to the activity - this is used for
+ * If the activity is a grouping activity, then set useCreatingGrouping = true to base the list on the create
+ * grouping. Otherwise leave it false and it will use the grouping applied to the activity - this is used for
* branching activities.
*
* @param activityID
* @param lessonID
* @param useCreateGrouping
- * true/false for GroupingActivities, always false for
- * non-GroupingActivities
+ * true/false for GroupingActivities, always false for non-GroupingActivities
* @return Sorted set of Users, sorted by surname
*/
public SortedSet getClassMembersNotGrouped(Long lessonID, Long activityID, boolean useCreateGrouping);
/**
- * Add a new group to a grouping activity. If name already exists or the
- * name is blank, does not add a new group.
+ * Add a new group to a grouping activity. If name already exists or the name is blank, does not add a new group.
*
* @param activityID
* id of the activity
@@ -789,9 +739,8 @@
throws LessonServiceException, MonitoringServiceException;
/**
- * Remove a group to from a grouping activity. If the group does not exists
- * then nothing happens. If the group is already used (e.g. a tool session
- * exists) then it throws a LessonServiceException.
+ * Remove a group to from a grouping activity. If the group does not exists then nothing happens. If the group is
+ * already used (e.g. a tool session exists) then it throws a LessonServiceException.
*
* @param activityID
* id of the activity
@@ -802,26 +751,23 @@
public abstract void removeGroup(Long activityID, Long groupID) throws LessonServiceException;
/**
- * Add learners to a group. Doesn't necessarily check if the user is already
- * in another group.
+ * Add learners to a group. Doesn't necessarily check if the user is already in another group.
*/
public abstract void addUsersToGroup(Long activityID, Long groupID, String learnerIDs[])
throws LessonServiceException;
/**
- * Remove a user to a group. If the user is not in the group, then nothing
- * is changed.
+ * Remove a user to a group. If the user is not in the group, then nothing is changed.
*
* @throws LessonServiceException
*/
public abstract void removeUsersFromGroup(Long activityID, Long groupID, String learnerIDs[])
throws LessonServiceException;
/**
- * Add learners to a branch. Doesn't necessarily check if the user is
- * already in another branch. Assumes there should only be one group for
- * this branch. Use for Teacher Chosen Branching. Don't use for Group Based
- * Branching as there could be more than one group for the branch.
+ * Add learners to a branch. Doesn't necessarily check if the user is already in another branch. Assumes there
+ * should only be one group for this branch. Use for Teacher Chosen Branching. Don't use for Group Based Branching
+ * as there could be more than one group for the branch.
*
* @param sequenceActivityID
* Activity id of the sequenceActivity representing this branch
@@ -831,9 +777,8 @@
public void addUsersToBranch(Long sequenceActivityID, String learnerIDs[]) throws LessonServiceException;
/**
- * Remove learners from a branch. Assumes there should only be one group for
- * this branch. Use for Teacher Chosen Branching. Don't use for Group Based
- * Branching as there could be more than one group for the branch.
+ * Remove learners from a branch. Assumes there should only be one group for this branch. Use for Teacher Chosen
+ * Branching. Don't use for Group Based Branching as there could be more than one group for the branch.
*
* @param sequenceActivityID
* Activity id of the sequenceActivity representing this branch
@@ -843,15 +788,14 @@
public void removeUsersFromBranch(Long sequenceActivityID, String learnerIDs[]) throws LessonServiceException;
/**
- * Has anyone started this branch / branching activity ? Irrespective of the
- * groups. Used to determine if a branch mapping can be removed.
+ * Has anyone started this branch / branching activity ? Irrespective of the groups. Used to determine if a branch
+ * mapping can be removed.
*/
public boolean isActivityAttempted(Activity activity) throws LessonServiceException;
/**
- * Match group(s) to a branch. Doesn't necessarily check if the group is
- * already assigned to another branch. Use for Group Based Branching and
- * define later.
+ * Match group(s) to a branch. Doesn't necessarily check if the group is already assigned to another branch. Use for
+ * Group Based Branching and define later.
*
* @param sequenceActivityID
* Activity id of the sequenceActivity representing this branch
@@ -861,8 +805,8 @@
public void addGroupToBranch(Long sequenceActivityID, String groupIDs[]) throws LessonServiceException;
/**
- * Remove group / branch mapping. Cannot be done if any users in the group
- * have started the branch. Used for group based branching in define later.
+ * Remove group / branch mapping. Cannot be done if any users in the group have started the branch. Used for group
+ * based branching in define later.
*
* @param sequenceActivityID
* Activity id of the sequenceActivity representing this branch
@@ -872,20 +816,17 @@
public void removeGroupFromBranch(Long sequenceActivityID, String groupIDs[]) throws LessonServiceException;
/**
- * Get all the groups that exist for the related grouping activity that have
- * not been allocated to a branch.
+ * Get all the groups that exist for the related grouping activity that have not been allocated to a branch.
*
* @param branchingActivityID
* Activity id of the branchingActivity
*/
public SortedSet getGroupsNotAssignedToBranch(Long branchingActivityID) throws LessonServiceException;
/**
- * Get the list of users who have attempted an activity. This is based on
- * the progress engine records. This will give the users in all tool
- * sessions for an activity (if it is a tool activity) or it will give all
- * the users who have attempted an activity that doesn't have any tool
- * sessions, i.e. system activities such as branching.
+ * Get the list of users who have attempted an activity. This is based on the progress engine records. This will
+ * give the users in all tool sessions for an activity (if it is a tool activity) or it will give all the users who
+ * have attempted an activity that doesn't have any tool sessions, i.e. system activities such as branching.
*/
public List getLearnersHaveAttemptedActivity(Activity activity) throws LessonServiceException;
@@ -895,17 +836,17 @@
/**
* Set a groups name
*/
- public void setGroupName(Long groupID, String name);
-
- /** Open Time Chart */
- public Boolean openTimeChart(long lessonId, Integer userId) throws UserAccessDeniedException;
+ public void setGroupName(Long groupID, String name);
- /** Get Organisation by organisationId */
- public Organisation getOrganisation(Integer organisationId);
-
- public void initToolSessionIfSuitable(ToolActivity activity, Lesson lesson);
-
- /**
+ /** Open Time Chart */
+ public Boolean openTimeChart(long lessonId, Integer userId) throws UserAccessDeniedException;
+
+ /** Get Organisation by organisationId */
+ public Organisation getOrganisation(Integer organisationId);
+
+ public void initToolSessionIfSuitable(ToolActivity activity, Lesson lesson);
+
+ /**
* Used in admin to clone lessons using the given lesson Ids (from another group) into the given group. Given staff
* and learner ids should already be members of the group.
*
Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java
===================================================================
diff -u -r1b117caf4135f53248542cbc97d71aac448f3de9 -r430f979ac0574e45242bd6e3df353d8592276121
--- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java (.../MonitoringService.java) (revision 1b117caf4135f53248542cbc97d71aac448f3de9)
+++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java (.../MonitoringService.java) (revision 430f979ac0574e45242bd6e3df353d8592276121)
@@ -437,19 +437,16 @@
// Don't use unlimited loop to avoid dead lock. For instance, orgA
// is orgB parent, but orgB parent is orgA as well.
for (int idx = 0; idx < MAX_DEEP_LEVEL_FOLDER; idx++) {
- if (org != null) {
- Workspace workspace = org.getWorkspace();
- if (workspace != null) {
- runSeqFolder = workspace.getDefaultRunSequencesFolder();
- }
- if (runSeqFolder == null) {
- org = org.getParentOrganisation();
- } else {
- break;
- }
- } else {
+ if ((org == null) || (runSeqFolder != null)) {
break;
}
+ Workspace workspace = org.getWorkspace();
+ if (workspace != null) {
+ runSeqFolder = workspace.getDefaultRunSequencesFolder();
+ }
+ if (runSeqFolder == null) {
+ org = org.getParentOrganisation();
+ }
}
}
@@ -485,6 +482,28 @@
learnerPresenceAvailable, learnerImAvailable, liveEditEnabled, null, null, null);
}
+ /**
+ * Intialise lesson without creating Learning Design copy, i.e. the original LD will be used.
+ */
+ public Lesson initializeLessonWithoutLDcopy(String lessonName, String lessonDescription, long learningDesignID,
+ User user, String customCSV, Boolean enableLessonIntro, Boolean displayDesignImage,
+ Boolean learnerExportAvailable, Boolean learnerPresenceAvailable, Boolean learnerImAvailable,
+ Boolean liveEditEnabled, Boolean enableLessonNotifications, Integer scheduledNumberDaysToLessonFinish,
+ Lesson precedingLesson) {
+ LearningDesign learningDesign = authoringService.getLearningDesign(learningDesignID);
+ if (learningDesign == null) {
+ throw new MonitoringServiceException("Learning design for id=" + learningDesignID
+ + " is missing. Unable to initialize lesson.");
+ }
+ Lesson lesson = createNewLesson(lessonName, lessonDescription, user, learningDesign,
+ enableLessonIntro, displayDesignImage, learnerExportAvailable, learnerPresenceAvailable,
+ learnerImAvailable, liveEditEnabled, enableLessonNotifications, scheduledNumberDaysToLessonFinish,
+ precedingLesson);
+ auditAction(MonitoringService.AUDIT_LESSON_CREATED_KEY, new Object[] { lessonName, learningDesign.getTitle(),
+ learnerExportAvailable });
+ return lesson;
+ }
+
public Lesson initializeLesson(String lessonName, String lessonDescription, LearningDesign originalLearningDesign,
User user, WorkspaceFolder workspaceFolder, int copyType, String customCSV, Boolean enableLessonIntro,
Boolean displayDesignImage, Boolean learnerExportAvailable, Boolean learnerPresenceAvailable,
@@ -1353,7 +1372,7 @@
Activity parentActivity = stopActivity.getParentActivity();
// if user is moved into branch, see if he is allowed to do that
- if (parentActivity != null && parentActivity.isSequenceActivity()) {
+ if ((parentActivity != null) && parentActivity.isSequenceActivity()) {
SequenceActivity sequenceActivity = (SequenceActivity) parentActivity;
Group group = sequenceActivity.getSoleGroupForBranch();
if ((group == null) || !group.hasLearner(learner)) {
@@ -1390,13 +1409,13 @@
return stopReason != null ? stopReason : messageService
.getMessage(MonitoringService.FORCE_COMPLETE_STOP_MESSAGE_STOPPED_UNEXPECTEDLY);
}
-
+
/**
* @throws LamsToolServiceException
* @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#forceCompleteLessonByUser(Integer,long,long)
*/
public String forceCompleteLessonByUser(Integer learnerId, Integer requesterId, long lessonId, Long activityId) {
- //TODO: REMOVE THIS METHOD AFTER OLD, FLASH MONITORING IS REMOVED
+ // TODO: REMOVE THIS METHOD AFTER OLD, FLASH MONITORING IS REMOVED
Lesson lesson = lessonDAO.getLesson(new Long(lessonId));
checkOwnerOrStaffMember(requesterId, lesson, "force complete");
@@ -1415,8 +1434,8 @@
Activity currentActivity = learnerProgress.getCurrentActivity();
String stopReason = null;
if (currentActivity != null) {
- stopReason = forceCompleteActivity(learner, lessonId, learnerProgress, currentActivity,
- stopActivity, new ArrayList());
+ stopReason = forceCompleteActivity(learner, lessonId, learnerProgress, currentActivity, stopActivity,
+ new ArrayList());
}
return stopReason != null ? stopReason : messageService
Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/action/AuthoringAction.java
===================================================================
diff -u -rd5b13766f602aa85ed8be456dfab8defa9b2ecc6 -r430f979ac0574e45242bd6e3df353d8592276121
--- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/action/AuthoringAction.java (.../AuthoringAction.java) (revision d5b13766f602aa85ed8be456dfab8defa9b2ecc6)
+++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/action/AuthoringAction.java (.../AuthoringAction.java) (revision 430f979ac0574e45242bd6e3df353d8592276121)
@@ -889,7 +889,9 @@
dacoQuestionList.addAll(questions);
sessionMap.put(DacoConstants.ATTR_DACO_FORM, dacoForm);
-
+ request.getSession().setAttribute(AttributeNames.PARAM_NOTIFY_CLOSE_URL,
+ request.getParameter(AttributeNames.PARAM_NOTIFY_CLOSE_URL));
+
return mapping.findForward(DacoConstants.SUCCESS);
}
Index: lams_tool_daco/web/pages/authoring/authoring.jsp
===================================================================
diff -u -r701ee9220cb7323ae5abe5234baa5a50a56a617b -r430f979ac0574e45242bd6e3df353d8592276121
--- lams_tool_daco/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 701ee9220cb7323ae5abe5234baa5a50a56a617b)
+++ lams_tool_daco/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 430f979ac0574e45242bd6e3df353d8592276121)
@@ -95,7 +95,8 @@
+ contentFolderID="${formBean.contentFolderID}"
+ cancelConfirmMsgKey="message.authoring.cancel.save" />