Expert rules examples
Expert rules in example images
In these examples, you can see how to configure expert rules and how they affect the course view.
Expert rules for checking user properties
Checking for a user role
Only guests but no registered users can see the course element. | Enter the following on the Visibility tab: isGuest() Alternatively enter: isGuest()=true or isGuest()=1 |
Guests do not have access to this course element. | Enter the following on the Access tab: isGuest()=false Alternatively enter: !isGuest() |
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
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") |
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
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"). | 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() >= never) or (getInitialCourseLaunchDate() + 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() + 10min) > now |
Expert rules with specific course elements
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 |
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 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
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") |