Evaluation of the Enrollment Date

Last modified by Carina Enke on 15.01.2024

Expert rules let you evaluate the enrollment date and thus control the visibility and the access to course sections. To do this, use the expert rules getInitialEnrollmentDate, getRecentEnrollmentDate and getInitialCourseLaunchDate.

All of the following example rules can be created for both the visibility and access of a course element. To simplify matters, only one scenario is described in each of the following examples. To learn more about the difference between visibility and access, see the page Publishing within couses (visibilty and access).

 

In all of the following examples, specific course elements are used. Before using these rules, note down the course element IDs of the relevant course elements for your scenario and adjust them accordingly in the expert rules.

Some of the following example rules check for a course element enrollment. For this purpose you can use getInitialEnrollmentDate, as long as only the first enrollment is to be considered, independently of a later deregistration from the course element. Alternatively, you can also use getRecentEnrollmentDate if each enrollment is to be re-evaluated. To simplify matters, only one scenario is described in each of the following examples.

Syntax in General

Example of an expert rule

Result of this rule

getInitialEnrollmentDate("[integer]")

getInitialEnrollmentDate("70323786958847") <= date("26.5.2020 18:00")

The access to a course element is possible depending on a specific enrollment date.

Course participants who got enrolled by means of a course element enrollment (course element ID "70323786958847") before May 26, 2020, 6 pm can use the course element.

getInitialEnrollmentDate("70323786958847") + 2h < now

Each course participant can see the course element from a relative point in time, e. g. only 2 hours after the enrollment (course element ID "70323786958847").

getInitialEnrollmentDate("70323786958847") + 2h > now

Each course participant can only see the course element up to a relative point in time, e.g. only for the first 2 hours after the enrollment (course element ID "70323786958847").

 

When using this rule, make sure that the visibility of the learning group is already limited by a higher level course element. Otherwise, if you only use this rule, non-enrolled users and guests will always have access to this course element.

(getInitialEnrollmentDate("101524102434663") + 2h < now and getInitialEnrollmentDate("101524102434663") + 5h > now ) or isCourseCoach() or isCourseAdministrator()

Each course participant can only see the course element within a relative time period, e. g. starting 2 hours prior to the enrollment (course element ID "70323786958847") until 5 hours after the enrollment. Course tutors are exempt from this restriction.

getInitialCourseLaunchDate()

(getInitialCourseLaunchDate() >= never) or (getInitialCourseLaunchDate() + 2h > now)

Each course participant can only see the course element for a certain period of time (during the first two hours of the first course visit).

getInitialRecentCourseLaunchDate()

(getRecentCourseLaunchDate() + 10min) > now

The course element becomes only visible if the user has been active in the course for more than 10 minutes.

Create additional rules by using expert syntax. A tabular overview is provided on the page Expert Syntax.