Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Instructor edits details on an item in the Resources tool and is presented with "Only if the following conditions is met" option. The list of available assignments and their conditions is passed from the ConditionService with no direct dependency from the Resources tool and the GradebookService.
  2. Instructor saves the details, and within ResourcesAction a Predicate is created from the condition parameters and is added to a fresh instance of ResourceReleaseRule which in turn is added to a fresh instance of Notification, along with the event type (function) to respond to and the resource filter (the resource's ID). The NotificationService takes care of persisting the Notification.
  3. As events propagate through Sakai, BaseNotificationService examines each one for a matching function in its stored list of Notifications. If a stored Notification matches both the function and resource filter of the inbound event, its embedded NotificationAction is dereferenced and its notify() method is called.
  4. In the case of a ResourceReleaseRule, an argument necessary for evaluating the embedded Predicate will be pulled from the event and the embedded Predicate will be evaluated. In response to the evaluation, the access rules of the underlying content resource will either be modified or left alone.

BooleanExpression

The Predicate within the ResourceReleaseRule is delegated to another class called BooleanExpression. The BooleanExpression is how we programmatically encapsulate such English language questions as "Is the assignment score above 80?" We have a conventional boolean expression here, with a left term, an operator, and a right term. What makes this interesting is that at the time the instructor sets up the condition, a necessary piece of information to answer the question is missing. In our example, the missing piece is the left term, the assignment score in question. This data only materializes later, at the time the instructor submits one or more assignment grades.

...