Index: lams_common/src/java/org/lamsfoundation/lams/lesson/service/ILessonService.java =================================================================== diff -u -rfd131067cd0d56f83e3f9675277248bca41e259e -r11403ed5085a73344f4cea2b7d3677115c6f2150 --- lams_common/src/java/org/lamsfoundation/lams/lesson/service/ILessonService.java (.../ILessonService.java) (revision fd131067cd0d56f83e3f9675277248bca41e259e) +++ lams_common/src/java/org/lamsfoundation/lams/lesson/service/ILessonService.java (.../ILessonService.java) (revision 11403ed5085a73344f4cea2b7d3677115c6f2150) @@ -23,11 +23,6 @@ package org.lamsfoundation.lams.lesson.service; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.Set; - import org.lamsfoundation.lams.index.IndexLessonBean; import org.lamsfoundation.lams.learningdesign.Activity; import org.lamsfoundation.lams.learningdesign.Group; @@ -39,6 +34,11 @@ import org.lamsfoundation.lams.lesson.dto.LessonDetailsDTO; import org.lamsfoundation.lams.usermanagement.User; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; + /** * Access the general lesson details and access to grouping. * @@ -163,7 +163,7 @@ * @param grouping * the object on which to perform the grouing. (mandatory) */ - void performGrouping(Grouping grouping, Long groupId, List learners) throws LessonServiceException; + void performGrouping(Grouping grouping, Long groupId, List learners, boolean forceChosenGrouping) throws LessonServiceException; /** * Perform grouping for the given learner. Index: lams_common/src/java/org/lamsfoundation/lams/lesson/service/LessonService.java =================================================================== diff -u -rfd131067cd0d56f83e3f9675277248bca41e259e -r11403ed5085a73344f4cea2b7d3677115c6f2150 --- lams_common/src/java/org/lamsfoundation/lams/lesson/service/LessonService.java (.../LessonService.java) (revision fd131067cd0d56f83e3f9675277248bca41e259e) +++ lams_common/src/java/org/lamsfoundation/lams/lesson/service/LessonService.java (.../LessonService.java) (revision 11403ed5085a73344f4cea2b7d3677115c6f2150) @@ -23,19 +23,11 @@ package org.lamsfoundation.lams.lesson.service; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeMap; - import org.apache.log4j.Logger; import org.lamsfoundation.lams.dao.IBaseDAO; import org.lamsfoundation.lams.index.IndexLessonBean; import org.lamsfoundation.lams.learningdesign.Activity; +import org.lamsfoundation.lams.learningdesign.ChosenGrouper; import org.lamsfoundation.lams.learningdesign.Group; import org.lamsfoundation.lams.learningdesign.Grouper; import org.lamsfoundation.lams.learningdesign.Grouping; @@ -61,13 +53,24 @@ import org.lamsfoundation.lams.usermanagement.User; import org.lamsfoundation.lams.util.MessageService; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; + /** * Access the general lesson details. * * A lesson has three different "lists" of learners. *
MonitoringConstants
defining search type
+ * one of 11 constants from MonitoringConstants
defining search type
* @param lessonId
* @param lessonIds
* @param activityId
@@ -163,13 +161,13 @@
* This is also known as the learner progress url.
*
* @param lessonID
- * The lesson_id of the Lesson for which the information has to be fetched.
+ * The lesson_id of the Lesson for which the information has to be fetched.
* @param activityID
- * The activity_id of the activity for which the URL is required
+ * The activity_id of the activity for which the URL is required
* @param learnerID
- * The user_id of the Learner for whom the URL is being fetched
+ * The user_id of the Learner for whom the URL is being fetched
* @param requesterID
- * The user_id of the user who is requesting the url
+ * The user_id of the user who is requesting the url
* @throws IOException
* @throws LamsToolServiceException
*/
@@ -180,17 +178,18 @@
* This method returns the monitor url for the given activity
*
* @param lessonID
- * The lesson_id of the Lesson for which the information has to be fetched.
+ * The lesson_id of the Lesson for which the information has to be fetched.
* @param activityID
- * The activity_id of the Activity whose URL will be returned
+ * The activity_id of the Activity whose URL will be returned
* @param userID
- * The user id of the user requesting the url.
+ * The user id of the user requesting the url.
* @throws IOException
*/
String getActivityMonitorURL(Long lessonID, Long activityID, String contentFolderID, Integer userID)
throws IOException, LamsToolServiceException;
/* Supports the Chosen Groupings and Branching */
+
/**
* Get all the active learners in the lesson who are not in a group or in a branch.
*
@@ -201,7 +200,7 @@
* @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
*/
SortedSet
@@ -2265,6 +2263,9 @@
grouping = activity.getGrouping();
}
+ // get real object and not proxy
+ grouping = groupingDAO.getGroupingById(grouping.getGroupingId());
+
if (grouping == null) {
String error = methodName + ": Grouping activity missing grouping. Activity was " + activity;
MonitoringService.log.error(error);
@@ -2318,7 +2319,7 @@
Activity activity = getActivityById(activityID);
Grouping grouping = getGroupingForActivity(activity, !activity.isChosenBranchingActivity(), "addUsersToGroup");
ArrayList