Skip to end of metadata
Go to start of metadata

Expert rules offer a wide range of applications and can have different effects. The examples on this page give a brief insight into possible application scenarios.

Content

Expert rules in example images

In these examples, you can see how to configure expert rules and how they affect the course view.


Do you wish to hide content in a public course from guests?

Enter the following content in the text field next to Expert rule in the Visibility tab of the respective course element.

isGuest(0)=false

This will prevent the course element in a publicly accessible course from being displayed to guest users.

After publishing, users will see the following view:

View as a registered userView as a guest userView as a course owner

Do you wish to display content in a public course exclusively to guests and course owners?

Enter the following content in the text field next to Expert rule in the Visibility tab of the respective course element.

isGuest(0) or isCourseAdministrator(0) 

This will make the course element in a publicly accessible course visible only to guest users and course owners.


After publishing, users will see the following view:

View as a registered userView as a guest userView as a course owner

Do you wish to release content depending on a test? The implementation of this scenario is explained on the help page Learning path control by test result.


Expert rules for checking user properties

All of the following example rules can be created for both the visibility and access of a course element. For simplicity, the following examples only describe one scenario at a time.


Checking for a user role

Only guests but no registered users can see the course element.

Enter the following on the Visibility tab:

isGuest(0)

Alternatively enter: isGuest(0) or isGuest(0)=1

Guests do not have access to this course element.

Enter the following on the Access tab:

isGuest(0)=false

Alternatively enter: !isGuest(0)

Checking for a group membership

Except of the (learning) group with the title "Anfänger", all course participants can see the course element.

Enter the following on the Visibility tab:

inLearningGroup("Anfänger")= false

Alternatively enter: !inLearningGroup("Anfänger")

Only members of the "Intern" group can see the course element. Course owners and group tutors also cannot see the course element in the course navigation.

inLearningGroup("Intern")

The course element is visible to all course participants within a certain time frame (22.03.2020 - 23.08.2020), while being visible to members of the learning group with the title "Betreuer" at any time.

Enter the following on the Visibility tab:

(now >= date("22.03.2020 12:00")) and (now <= date("23.08.2020 18:00")) or inLearningGroup("Betreuer")

The course element is visible to all course participants in the right group with the title “Assessoren" within a certain time frame (03.09.2020 - 13.10.2020), while being always visible to the person with the username "natalie".

Enter the following on the Visibility tab:

(now >= date("03.09.2020 00:00")) and (now <= date("13.10.2020 00:00")) and inRightGroup("Assessoren")or isUser("natalie")

Checking of user attributes

In addition to these institution-independent examples, there are also institution-dependent rules that restrict and transmit data according to the user's institution.
For OPAL users, the help page Overview of OPAL Shibboleth attributes contains all currently usable institution-specific attributes of Saxon institutions.

This course element can be accessed by everyone whose study subject attribute contains the letter sequence "Chemie".

This means that users with the study subject "Chemie BA" or "Chemie MA" can use the course element, but users with the study subject "Chemische Wasseraufbereitung" cannot.

Enter the following on the Access tab:

isInAttribute("studySubject","Chemie")

Different user attributes can be configured depending on the system. Therefore, it is advisable to check beforehand which user attributes are available on your platform.

Examples of user attributes:

  • Username: username
  • Email address: email
  • Term: termsOfStudy
  • Institution: institutionalName
  • Matriculation number: institutionalUserIdentifier
  • Location: standort
  • Study subject: studySubject
  • Study group: studyGroup
  • Organisation unit: orgUnit
  • First name: firstName
  • Last name: lastName

Only users from the "Marketing" organisation unit can see the course element.

Enter the following on the Visibility tab:

(getUserProperty("orgUnit") = "Marketing")


Evaluation of the enrolment date

Some of the following example rules check for an enrolment course element. For example, you can use getInitialEnrollmentDate if only the initial enrolment is to be considered, independent of a later deregistration from the course element. Alternatively, you can also use getRecentEnrollmentDate if each enrolment is to be re-evaluated. For simplicity, the following examples only describe one scenario at a time.

Access to a course element is possible depending on a specific enrolment date.

Course participants who got enrolled via an enrolment course element (course element ID "70323786958847") before May 26, 2020, 6 pm can use the course element.

Enter the following on the Access tab:

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

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

Enter the following on the Visibility tab:

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 enrolment (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.

Enter the following on the Visibility tab:

getInitialEnrollmentDate("70323786958847") + 2h > now

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

Enter the following on the Visibility tab:

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

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).

Enter the following on the Visibility tab:

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

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

Enter the following on the Visibility tab:

(getRecentCourseLaunchDate(0) + 10min) > now


Expert rules with specific course elements

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.


Evaluation of the number of attempts

The course element becomes visible as soon as the respective course participant has performed the test course element (course element ID "70323786958847") for the first time.

Enter the following on the Visibility tab:

getAttempts("70323786958847") > 0

Users should no longer be able to see a course element as soon as they have placed more than 3 files in the drop box of a task course element (course element ID "70323524635734").

Enter the following on the Visibility tab:

getAttempts("70323524635734") <= 3


Evaluation of other course elements' assessment data

The course element is visible as soon as the user has reached at least 10 points in the test (course element ID "84692289655276").

Enter the following on the Visibility tab:

getOnyxTestOutcome("84692289655276","SCORE") >= 10

The course element is visible as soon as the user has passed the test (course element ID "84389429397045").

Enter the following on the Visibility tab:

getOnyxTestOutcomeZK("84389429397045","PASS") ="true"

The course element is visible if the user's grade for the indicated element (course element ID "84692289655276") is better than 4.

Enter the following on the Visibility tab:

getMark("84692289655276") > 4

The course element is visible when the user has completed the indicated course element (course element ID "69742969114730") (course progress).

Enter the following on the Visibility tab:

getProgress("69742969114730")>=100

The implementation of another example of the use of expert rules is explained on the help page Learning path control by test result.


Controlling visibility and access based on test output variables (ONYX)

If global test variables are used in a test course element, they can also be used to control visibility and access.

The available test variables can be viewed in the corresponding test course element in the Test configuration tab via the Output variables of this resource link. In addition to visibility and access rules (expert syntax), they can also be used as placeholders in certificate templates.

The course element is visible if the user has reached a value greater than 10 for the test variable "S1_max" in the indicated test course element (course element ID "69742969114730").

Enter the following on the Visibility tab:

getOnyxTestOutcome("84692289655276","S1_max") > 10

The course element is visible if the user has exactly the value "Wiederholen" for the test variable “feedbackE" in the indicated test course element (course element ID "69742969114730").

Enter the following on the Visibility tab:

getOnyxTestOutcome("84692289655276","feedbackE")="Wiederholen" 


Set scoring or passing status automatically

These rules can be set in a structure course element in the Assessment tab in the respective input field.

Automatic scoring:

10 points should automatically be awarded for a structure course element if one of three test course elements (course element IDs "69742969114730", "69742969115733" or "69742969118009") has been passed. If this is not the case, 0 points should automatically be set for the structure course element.

This rule is set in the Process points section.

getPassed("69742969114730") or getPassed("69742969115733") or getPassed("69742969118009")) * 10

Set passing status automatically:

A structure course element should automatically be displayed as passed if a total of at least 140 points has been reached in all test course elements (course element IDs "69742969114730", "69742969115733" or "69742969118009") together or if a "passed" was manually set for the assessment course element (ID "69978845384688").

This rule is set in the Passed if section.

(getScore("69742969114730") + getScore("69742969115733") + getScore("69742969118009")) >= 140 or getPassed("69978845384688")