#### Examples of using expert syntax

Some examples are listed below in order to show you how to use expert syntax.

Examples of expert rules in the tabs «Visibility», «Access» and «Score» (structure elements)
isGuest(0) or isGuest(0)=1 or isGuest(0)=TRUE Only guests have access to this course element.
inLearningGroup("Amateur") = 0 With the exception of the group «Amateur» the course element is visible for all participants.
(now >= date("22.03.2004 12:00")) & (now <= date("23.08.2004 18:00")) | inLearningGroup("Tutor") The course element is visible for all participants between 22-3-2004 and 23-8-2004. For members of the learning group «Tutor» it is visible any time.
(now >= date("03.09.2004 00:00")) & (now <= date("13.10.2004 00:00")) & inRightGroup("Assessors")| isUser("Author") The course element is visible for all participants of the right group «Assessors» between 3-9-2004 and 13-10-2004. For the person with the user name «Author» it is visible any time.
hasAttribute("swissEduPersonStudyBranch3","6200") Only students of human medicine have access to this course element. Also see: Description of AAI attributes Specification of the AAI attributes (pdf file)
hasAttribute("swissEduPersonHomeOrganization","unizh.ch") Only students of the University of Zurich have access to this course element. Also see: Description of AAI attributes Specification of the AAI attributes (pdf file)
isInAttribute("surname","Mue") Generates TRUE for all persons whose attribute surname contains the letter sequence "Mue". E.g. gives TRUE for the value "Mueller" or "Muehlebacher" Also see: Description of AAI attributes Specification of the AAI attributes (pdf file)
isInAttribute("eduPersonEntitlement","http://vam.unizh.ch") Generates TRUE for all persons whose attribute eduPersonEntitlement contains the value "http://vam.unizh.ch". E.g. gives TRUE for the value "http://vam.unizh.ch/surgery" Also see: Description of AAI attributes Specification of the AAI attributes (pdf file)
(getPassed("69742969114730") | getPassed("69742969115733") | getPassed("69742969118009")) * 10 This rule is set in the tab «Score» -> «Processing score» of the course element Structure . The course element Structure shows 10 points if one of the tests (course element IDs "69742969114730", "69742969115733" or "69742969118009") was passed. Otherwise 0 points.
(getScore("69742969114730") + getScore("69742969115733") + getScore("69742969118009")) >= 140 | getPassed("69978845384688") This rule is set in the tab «Score» -> «Passed if» of the course element Structure . The course element Structure shows «Passed», if a minimum of 140 points in all tests is achieved or if «Passed» is entered manually. (Element Assessment with ID "69978845384688").
getAttempts("70323786958847") > 0 Generates TRUE, as soon as the relevant course participant has completed the test with specified ID for the first time.
getAttempts("70323524635734") <= 3 Generates FALSE, as soon as the relevant course participant has put more than 3 files into the storage folder of the course element Task .
getInitialEnrollmentDate("70323786958847") <= date("26.5.2005 18:00") Generates TRUE for those participants who enrolled in an available group before 6 p.m. on May 26th, 2005, by means of the course element Enrolment with specified ID.
getInitialEnrollmentDate("70323786958847") + 2h > now Generates TRUE during two hours as of enrollment schedule for those participants who have enrolled in an available group by means of the course element Enrolment with specified ID. This way it is clear that every participant can only work on e.g. a script within a particular time frame.

Attention: Please note that the IDs of the course elements mentioned above are only examples. To create your course, you have to make reference to the relevant numbers available on the first tab «Description» of the desired course element.

Back | Close window