Index: lams_central/web/gradebook/gradeBookCourseMonitor.jsp
===================================================================
diff -u -r662af4c9490c6c67127cda6c29d7d806a9e9eaca -r8e0af661d84b765d167c4b982f2f1f7d3c34e78f
--- lams_central/web/gradebook/gradeBookCourseMonitor.jsp (.../gradeBookCourseMonitor.jsp) (revision 662af4c9490c6c67127cda6c29d7d806a9e9eaca)
+++ lams_central/web/gradebook/gradeBookCourseMonitor.jsp (.../gradeBookCourseMonitor.jsp) (revision 8e0af661d84b765d167c4b982f2f1f7d3c34e78f)
@@ -12,16 +12,9 @@
{
// ---------------------------------------------------------------------
// Class Level Constants
@@ -81,9 +81,9 @@
public static final int FLOATING_ACTIVITY_TYPE = 15;
/** *************************************************************** */
- /*******************************************************************************************************************
+ /***************************************************************************
* static final variables indicating the the category of activities
- ******************************************************************************************************************/
+ **************************************************************************/
public static final int CATEGORY_SYSTEM = 1;
public static final int CATEGORY_COLLABORATION = 2;
public static final int CATEGORY_ASSESSMENT = 3;
@@ -92,9 +92,9 @@
public static final int CATEGORY_RESPONSE = 6;
/** *************************************************************** */
- /*******************************************************************************************************************
+ /***************************************************************************
* static final variables indicating the grouping_support of activities
- ******************************************************************************************************************/
+ **************************************************************************/
public static final int GROUPING_SUPPORT_NONE = 1;
public static final int GROUPING_SUPPORT_OPTIONAL = 2;
public static final int GROUPING_SUPPORT_REQUIRED = 3;
@@ -111,7 +111,8 @@
// Instance variables
// ---------------------------------------------------------------------
/**
- * WDDX packet specific attribute created to identify the type of object being passed.
+ * WDDX packet specific attribute created to identify the type of object
+ * being passed.
*/
public static final String OBJECT_TYPE = "Activity";
@@ -143,12 +144,14 @@
private Integer ycoord;
/**
- * Indicates the order in which the activities appear inside complex activities. Starts from 0, 1 and so on.
+ * Indicates the order in which the activities appear inside complex
+ * activities. Starts from 0, 1 and so on.
*/
private Integer orderId;
/**
- * Indicates whether the content of this activity would be defined later in the monitoring environment or not.
+ * Indicates whether the content of this activity would be defined later in
+ * the monitoring environment or not.
*/
private Boolean defineLater;
@@ -167,13 +170,15 @@
private LearningLibrary learningLibrary;
/**
- * The activity that acts as a container/parent for this activity. Normally would be one of the complex activities
- * which have child activities defined inside them.
+ * The activity that acts as a container/parent for this activity. Normally
+ * would be one of the complex activities which have child activities
+ * defined inside them.
*/
private Activity parentActivity;
/**
- * Single Library can have one or more activities defined inside it. This field indicates which activity is this.
+ * Single Library can have one or more activities defined inside it. This
+ * field indicates which activity is this.
*/
private Activity libraryActivity;
@@ -208,26 +213,31 @@
private Integer groupingSupportType;
/**
- * Name of the file (including the package) that contains the text strings for this activity. e.g.
+ * Name of the file (including the package) that contains the text strings
+ * for this activity. e.g.
* org.lamsfoundation.lams.tool.sbmt.SbmtResources.properties.
*/
private String languageFile;
/**
- * An activity is readOnly when a learner starts doing the activity. Used in editOnFly.
+ * An activity is readOnly when a learner starts doing the activity. Used in
+ * editOnFly.
*/
private Boolean readOnly;
/**
- * An activity is initialised if it is ready to be used in lesson ie the tool content is set up, schedule gates are
- * scheduled, etc. Used to detect which activities need to be initialised for live edit.
+ * An activity is initialised if it is ready to be used in lesson ie the
+ * tool content is set up, schedule gates are scheduled, etc. Used to detect
+ * which activities need to be initialised for live edit.
*/
private Boolean initialised;
/**
- * If stopAfterActivity is true, then the progress engine should "end" the lesson at this point. Used to arbitrarily
- * stop somewhere in a design, such as at the end of the branch. The normal final activity of a design does not
- * necessarily have this set - the progress engine will just stop when it runs out of transitions to follow.
+ * If stopAfterActivity is true, then the progress engine should "end" the
+ * lesson at this point. Used to arbitrarily stop somewhere in a design,
+ * such as at the end of the branch. The normal final activity of a design
+ * does not necessarily have this set - the progress engine will just stop
+ * when it runs out of transitions to follow.
*/
private Boolean stopAfterActivity;
@@ -237,8 +247,8 @@
private Set inputActivities;
/**
- * The BranchActivityEntries that map conditions to this Activity; bi-directional association required (e.g.
- * LDEV-1910)
+ * The BranchActivityEntries that map conditions to this Activity;
+ * bi-directional association required (e.g. LDEV-1910)
*/
private Set branchActivityEntries;
@@ -369,9 +379,9 @@
activity.setActivityCategoryID(Activity.CATEGORY_SYSTEM);
break;
case FLOATING_ACTIVITY_TYPE:
- activity = new FloatingActivity();
- activity.setActivityCategoryID(Activity.CATEGORY_SYSTEM);
- break;
+ activity = new FloatingActivity();
+ activity.setActivityCategoryID(Activity.CATEGORY_SYSTEM);
+ break;
default:
activity = new GroupingActivity();
activity.setActivityCategoryID(Activity.CATEGORY_SYSTEM);
@@ -385,7 +395,8 @@
// Getters and Setters
// ---------------------------------------------------------------------
/**
- * @hibernate.activityUIID generator-class="native" type="java.lang.Long" column="activity_id"
+ * @hibernate.activityUIID generator-class="native" type="java.lang.Long"
+ * column="activity_id"
*/
public Long getActivityId() {
return activityId;
@@ -698,11 +709,12 @@
}
/**
- * This function returns the Transition that STARTS FROM THIS ACTIVITY. In simpler words the next activity in the
- * transition.
+ * This function returns the Transition that STARTS FROM THIS ACTIVITY. In
+ * simpler words the next activity in the transition.
*
- * For example, if we have a transition as following A --> B --> C. For activity B this function would return C.
- * That is the Transition FROM activity B.
+ * For example, if we have a transition as following A --> B --> C. For
+ * activity B this function would return C. That is the Transition FROM
+ * activity B.
*
* @return Returns the transitionFrom.
*/
@@ -719,11 +731,12 @@
}
/**
- * This function returns the Transition that POINTS TO THIS ACTIVITY and NOT the transition that this activity
- * points to.
+ * This function returns the Transition that POINTS TO THIS ACTIVITY and NOT
+ * the transition that this activity points to.
*
- * For example, if we have a transition as following A --> B --> C. For activity B this function would return A.
- * That is the Transition that points TO activity B.
+ * For example, if we have a transition as following A --> B --> C. For
+ * activity B this function would return A. That is the Transition that
+ * points TO activity B.
*
* @return Returns the transitionTo.
*/
@@ -802,10 +815,13 @@
/**
* This method that get all tool activities belong to the current activity.
*
- * As the activity object structure might be infinite, we recursively loop through the entire structure and added
- * all tool activities into the set that we want to return. This method calls a method getToolActivitiesInActivity()
- * which must be defined in subclasses for tool or a complex activities. This handles the polymorphic aspect of this
- * function. (Note: we can't use instanceOf as we are dealing with Hibernate proxies.)
+ * As the activity object structure might be infinite, we recursively loop
+ * through the entire structure and added all tool activities into the set
+ * that we want to return. This method calls a method
+ * getToolActivitiesInActivity() which must be defined in subclasses for
+ * tool or a complex activities. This handles the polymorphic aspect of this
+ * function. (Note: we can't use instanceOf as we are dealing with Hibernate
+ * proxies.)
*
* @return the set of all tool activities.
*/
@@ -822,8 +838,8 @@
}
/**
- * Return the group information for the requested user when he is running current activity instance, based on the
- * grouping data in the activity.
+ * Return the group information for the requested user when he is running
+ * current activity instance, based on the grouping data in the activity.
*
* @param learner
* the requested user
@@ -834,11 +850,12 @@
}
/**
- * Return the group information for the requested user when he is running current activity instance, based on the
- * given grouping.
+ * Return the group information for the requested user when he is running
+ * current activity instance, based on the given grouping.
*
- * If we are using the grouping set up in the activity, the grouping will be this.getGrouping(). If the activity
- * isn't grouped, then it should use the class grouping.
+ * If we are using the grouping set up in the activity, the grouping will be
+ * this.getGrouping(). If the activity isn't grouped, then it should use the
+ * class grouping.
*
* @param learner
* the requested user
@@ -973,7 +990,8 @@
}
/**
- * Check up whether an activity is branching activity based on the monitor choice or not.
+ * Check up whether an activity is branching activity based on the monitor
+ * choice or not.
*
* @return is this activity a branching activity
*/
@@ -982,7 +1000,8 @@
}
/**
- * Check up whether an activity is branching activity based on an existing group or not.
+ * Check up whether an activity is branching activity based on an existing
+ * group or not.
*
* @return is this activity a branching activity
*/
@@ -991,7 +1010,8 @@
}
/**
- * Check up whether an activity is branching activity based on another activity's output or not.
+ * Check up whether an activity is branching activity based on another
+ * activity's output or not.
*
* @return is this activity a branching activity
*/
@@ -1005,9 +1025,9 @@
* @return is this activity a floating activity
*/
public boolean isFloatingActivity() {
- return getActivityTypeId().intValue() == Activity.FLOATING_ACTIVITY_TYPE;
+ return getActivityTypeId().intValue() == Activity.FLOATING_ACTIVITY_TYPE;
}
-
+
public boolean isActivityReadOnly() {
return readOnly.equals(Boolean.TRUE);
}
@@ -1039,12 +1059,13 @@
}
/**
- * Create a deep copy of the this activity. It should return the same subclass as the activity being copied.
- * Generally doesn't copy the "link" type fields like transitions, learning design, etc.
+ * Create a deep copy of the this activity. It should return the same
+ * subclass as the activity being copied. Generally doesn't copy the "link"
+ * type fields like transitions, learning design, etc.
*
* @param uiidOffset -
- * this should be added to UIID fields in any new objects. Used when importing a design into another
- * design.
+ * this should be added to UIID fields in any new objects.
+ * Used when importing a design into another design.
* @return deep copy of this object
*/
public abstract Activity createCopy(int uiidOffset);
@@ -1099,7 +1120,10 @@
return null;
}
- /** Get the input activity UIIDs in a format suitable for Flash. See also getToolInputActivityID */
+ /**
+ * Get the input activity UIIDs in a format suitable for Flash. See also
+ * getToolInputActivityID
+ */
public ArrayList getInputActivityUIIDs() {
ArrayList list = new ArrayList();
if (getInputActivities() != null && getInputActivities().size() > 0) {
@@ -1113,8 +1137,9 @@
}
/**
- * Get the first input activity's UIID as the tool input activity. The db is set up to allow multiple input
- * activities, but at present we only support one. See also getInputActivityUIIDs.
+ * Get the first input activity's UIID as the tool input activity. The db is
+ * set up to allow multiple input activities, but at present we only support
+ * one. See also getInputActivityUIIDs.
*/
public Integer getToolInputActivityUIID() {
if (getInputActivities() != null) {
@@ -1127,8 +1152,9 @@
}
/**
- * Is this activity inside a branch? If so, return turn branch activity (ie the sequence, not the branching
- * activity. Returns null if not in a branch.
+ * Is this activity inside a branch? If so, return turn branch activity (ie
+ * the sequence, not the branching activity. Returns null if not in a
+ * branch.
*/
public Activity getParentBranch() {
if (isSequenceActivity() && getParentActivity() != null && getParentActivity().isBranchingActivity()) {
@@ -1161,13 +1187,26 @@
return getParentBranch(parent, processedActivityIds);
}
-
+
public boolean isFloating() {
- if(parentActivity == null){
- return false;
- }
-
- return (parentActivity.isFloatingActivity()) ? true : parentActivity.isFloating();
+ if (parentActivity == null) {
+ return false;
+ }
+
+ return (parentActivity.isFloatingActivity()) ? true : parentActivity.isFloating();
}
+ public int compareTo(Activity anotherActivity) {
+
+ Long activityID1 = getActivityId();
+ Long activityID2 = anotherActivity.getActivityId();
+
+ if (activityID1 == null || activityID2 == null) {
+ return 0;
+ }
+
+ Long result = (activityID1 - activityID2) * -1;
+ return result.intValue();
+ }
+
}
\ No newline at end of file