Wiki source code of Expertenregeln zur Prüfung von Nutzerrolle und Guppenzugehörigkeit
Last modified by Anna Paul-Hasenfuss on 02.11.2026
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | {{section}} | ||
| 2 | {{column width="60%"}} | ||
| 3 | By using expert rules, you can control the visibility and the access to course elements by evaluating the user role or group membership. To do this, use the expert rules **is**[AttrName]() and **in**[AttrName](). | ||
| 4 | |||
| 5 | {{info}} | ||
| 6 | All of the following example rules can be created for both the visibility and access of a course element. For matters of simplicity, the following examples only describe one scenario at a time. To learn more about the difference between visibility and access, see the page [[Publishing within courses (visibility and access)>>doc:LMS.Benutzerhandbuch OPAL.Lehren.Kurs.Freigabe von Kursen und Kursinhalten.Freigabe innerhalb von Kursen Sichtbarkeit und Zugang.WebHome||shape="rect"]]. | ||
| 7 | {{/info}} | ||
| 8 | {{/column}} | ||
| 9 | |||
| 10 | {{column width="30%"}} | ||
| 11 | {{panel title="Content"}} | ||
| 12 | {{toc start="2"/}} | ||
| 13 | {{/panel}} | ||
| 14 | |||
| 15 | {{panel title="Related Topics"}} | ||
| 16 | * Further [[application examples for expert rules>>doc:LMS.Benutzerhandbuch OPAL.Lehren.Kurs.Freigabe von Kursen und Kursinhalten.Expertenmodus zur Freigabe innerhalb von Kursen.Anwendungsbeispiele zu Expertenregeln.WebHome]] | ||
| 17 | * List of the complete [[expert syntax>>doc:LMS.Benutzerhandbuch OPAL.Lehren.Kurs.Freigabe von Kursen und Kursinhalten.Expertenmodus zur Freigabe innerhalb von Kursen.Expertensyntax.WebHome]] | ||
| 18 | {{/panel}} | ||
| 19 | |||
| 20 | |||
| 21 | |||
| 22 | {{/column}} | ||
| 23 | {{/section}} | ||
| 24 | |||
| 25 | |||
| 26 | |||
| 27 | == Checking for user role == | ||
| 28 | |||
| 29 | The following role attributes are available in the learning platform and can be used for expert rules: | ||
| 30 | |||
| 31 | (% class="wrapped" %) | ||
| 32 | |=(% colspan="1" style="width: 171px;" %)(% colspan="1" %) | ||
| 33 | ((( | ||
| 34 | Attribute | ||
| 35 | )))|=(% colspan="1" style="width: 1446px;" %)(% colspan="1" %) | ||
| 36 | ((( | ||
| 37 | User with | ||
| 38 | ))) | ||
| 39 | |=(% colspan="1" style="width: 171px;" %)(% colspan="1" %) | ||
| 40 | ((( | ||
| 41 | GlobalAuthor | ||
| 42 | )))|(% colspan="1" style="width:1446px" %)(% colspan="1" %) | ||
| 43 | ((( | ||
| 44 | Author role | ||
| 45 | ))) | ||
| 46 | |=(% colspan="1" style="width: 171px;" %)(% colspan="1" %) | ||
| 47 | ((( | ||
| 48 | Guest | ||
| 49 | )))|(% colspan="1" style="width:1446px" %)(% colspan="1" %) | ||
| 50 | ((( | ||
| 51 | Guest role | ||
| 52 | ))) | ||
| 53 | |=(% style="width: 171px;" %)((( | ||
| 54 | ExternalUser | ||
| 55 | )))|(% style="width:1446px" %)((( | ||
| 56 | [[External user >>doc:LMS.Benutzerhandbuch OPAL.Administration.Benutzerverwaltung.Rollen und Rechte.Benutzerrolle Externer Nutzer.WebHome]]role | ||
| 57 | ))) | ||
| 58 | |||
| 59 | === Use cases === | ||
| 60 | |||
| 61 | (% class="relative-table wrapped" style="width:100.0%" %) | ||
| 62 | |=(% colspan="1" %)(% colspan="1" %) | ||
| 63 | ((( | ||
| 64 | General syntax | ||
| 65 | )))|=(% colspan="1" %)(% colspan="1" %) | ||
| 66 | ((( | ||
| 67 | Entry | ||
| 68 | )))|=(% colspan="1" %)(% colspan="1" %) | ||
| 69 | ((( | ||
| 70 | Rule result | ||
| 71 | ))) | ||
| 72 | |(% rowspan="3" %)(% rowspan="3" %) | ||
| 73 | ((( | ||
| 74 | //is[AttrName]()// | ||
| 75 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 76 | ((( | ||
| 77 | (% class="auto-cursor-target" %) | ||
| 78 | isGuest()=false | ||
| 79 | |||
| 80 | //Alternative: !isGuest()// | ||
| 81 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 82 | ((( | ||
| 83 | If an entry is made in the Access tab, guests will not have access to this course element. | ||
| 84 | ))) | ||
| 85 | |(% colspan="1" %)(% colspan="1" %) | ||
| 86 | ((( | ||
| 87 | (% class="content-wrapper" %) | ||
| 88 | ((( | ||
| 89 | isGuest() | ||
| 90 | |||
| 91 | //Alternative: isGuest() or isGuest()=1// | ||
| 92 | ))) | ||
| 93 | )))|((( | ||
| 94 | If an entry is made in the Visibility tab, only guests will see this course element, while all the registered users will not. | ||
| 95 | ))) | ||
| 96 | |(% colspan="1" %)(% colspan="1" %) | ||
| 97 | ((( | ||
| 98 | isGuest() or isExternalUser() | ||
| 99 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 100 | ((( | ||
| 101 | If an entry is made in the Visibility tab, only guests and external users will see the course element. | ||
| 102 | ))) | ||
| 103 | |||
| 104 | {{info}} | ||
| 105 | Further details on the guest scenario with sample images of the course view for each user role can be found here: (% class="plugin_pagetree_children_span" %)[[Controlling based on the guest role>>doc:LMS.Benutzerhandbuch OPAL.Lehren.Kurs.Freigabe von Kursen und Kursinhalten.Expertenmodus zur Freigabe innerhalb von Kursen.Anwendungsbeispiele zu Expertenregeln.Expertenregeln zur Prüfung von Nutzerrolle und Guppenzugehörigkeit.Steuerung auf Basis der Gastrolle.WebHome]] | ||
| 106 | {{/info}} | ||
| 107 | |||
| 108 | == Checking for group membership == | ||
| 109 | |||
| 110 | The following memberships of a user in connection with a course can be used for expert rules: | ||
| 111 | |||
| 112 | (% class="auto-cursor-target" %) | ||
| 113 | The following memberships of a user in connection with a course can be used for expert rules: | ||
| 114 | |||
| 115 | (% class="wrapped" %) | ||
| 116 | |=(% colspan="1" %)(% colspan="1" %) | ||
| 117 | ((( | ||
| 118 | Attribute | ||
| 119 | )))|=(% colspan="1" %)(% colspan="1" %) | ||
| 120 | ((( | ||
| 121 | User is a member | ||
| 122 | ))) | ||
| 123 | |=(% colspan="1" %)(% colspan="1" %) | ||
| 124 | ((( | ||
| 125 | LearningGroup | ||
| 126 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 127 | ((( | ||
| 128 | of a learning group | ||
| 129 | ))) | ||
| 130 | |=(% colspan="1" %)(% colspan="1" %) | ||
| 131 | ((( | ||
| 132 | LearningArea | ||
| 133 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 134 | ((( | ||
| 135 | of a learning area | ||
| 136 | ))) | ||
| 137 | |=(% colspan="1" %)(% colspan="1" %) | ||
| 138 | ((( | ||
| 139 | LearningGroupWaitingList | ||
| 140 | |||
| 141 | LearningAreaWaitingList | ||
| 142 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 143 | ((( | ||
| 144 | of the waiting list of a learning group or learning area | ||
| 145 | ))) | ||
| 146 | |=(% colspan="1" %)(% colspan="1" %) | ||
| 147 | ((( | ||
| 148 | CourseAdministrator | ||
| 149 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 150 | ((( | ||
| 151 | of the course owners | ||
| 152 | ))) | ||
| 153 | |=(% colspan="1" %)(% colspan="1" %) | ||
| 154 | ((( | ||
| 155 | CourseCoach | ||
| 156 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 157 | ((( | ||
| 158 | of the learning group tutors | ||
| 159 | ))) | ||
| 160 | |=(% colspan="1" %)(% colspan="1" %) | ||
| 161 | ((( | ||
| 162 | RightGroup | ||
| 163 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 164 | ((( | ||
| 165 | of a rights group | ||
| 166 | ))) | ||
| 167 | |||
| 168 | === Use cases === | ||
| 169 | |||
| 170 | |=(% colspan="1" %)(% colspan="1" %) | ||
| 171 | ((( | ||
| 172 | General syntax | ||
| 173 | )))|=(% colspan="1" %)(% colspan="1" %) | ||
| 174 | ((( | ||
| 175 | Expert rule example | ||
| 176 | )))|=(% colspan="1" %)(% colspan="1" %) | ||
| 177 | ((( | ||
| 178 | Expert rule result | ||
| 179 | ))) | ||
| 180 | |(% rowspan="2" %)(% rowspan="2" %) | ||
| 181 | ((( | ||
| 182 | //inLearningGroup("//[string]//")// | ||
| 183 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 184 | ((( | ||
| 185 | (% class="content-wrapper" %) | ||
| 186 | ((( | ||
| 187 | inLearningGroup("Beginner")= false | ||
| 188 | |||
| 189 | //Alternative: !inLearningGroup("Beginner")// | ||
| 190 | ))) | ||
| 191 | )))|((( | ||
| 192 | If an entry is made in the Visibility tab, all course participants except for the (learning) group with the "Beginner" title will see the course element. | ||
| 193 | ))) | ||
| 194 | |(% colspan="1" %)inLearningGroup("Intern")(% colspan="1" %) | ||
| 195 | ((( | ||
| 196 | (% class="content-wrapper" %) | ||
| 197 | ((( | ||
| 198 | (% class="auto-cursor-target" %) | ||
| 199 | inLearningGroup("Internal") | ||
| 200 | ))) | ||
| 201 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 202 | ((( | ||
| 203 | If an entry is made in the 'Visibility' tab, only members of the "Internal" group will see the course element. Even course owners and group tutors cannot see the course element in the course navigation. | ||
| 204 | ))) | ||
| 205 | | |(% colspan="1" %)!(inLearningArea("[Learning group1]") or inLearningGroup("[Learning area A]"))|(% colspan="1" %)If an entry is made in the ‘Visibility’ tab, the course element will be hidden from members of learning group 1 or learning area A. To put it simply, the structure of this assessment is: !(A or B) | ||
| 206 | |(% colspan="1" %)(% colspan="1" %) | ||
| 207 | ((( | ||
| 208 | //(now >= date("tt.mm.yyy hh:mm")) and (now <= date("tt.mm.yyy hh:mm")) or inLearningGroup("[string]")// | ||
| 209 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 210 | ((( | ||
| 211 | (% class="content-wrapper" %) | ||
| 212 | ((( | ||
| 213 | (now >= date("22.03.2020 12:00")) and (now <= date("23.08.2020 18:00")) or inLearningGroup("Tutor") | ||
| 214 | ))) | ||
| 215 | )))|((( | ||
| 216 | If an entry is made in the 'Visibility' tab, the course element will be visible to all course participants within a certain period of time (22.03.2020 - 23.08.2020), while it will be visible to members of the learning group with the title “tutor" at any time. | ||
| 217 | ))) | ||
| 218 | |(% colspan="1" %)(% colspan="1" %) | ||
| 219 | ((( | ||
| 220 | //(now >= date("tt.mm.yyy hh:mm")) and (now <= date("tt.mm.yyy hh:mm")) or inRightGroup("[string]") or isUser("[string]")// | ||
| 221 | )))|(% colspan="1" %)(now >= date("03.09.2020 00:00")) and (now <= date("13.10.2020 00:00")) and inRightGroup("Assessors")or isUser("natalie")(% colspan="1" %) | ||
| 222 | ((( | ||
| 223 | (% class="content-wrapper" %) | ||
| 224 | ((( | ||
| 225 | (% class="auto-cursor-target" %) | ||
| 226 | (now >= date("03.09.2020 00:00")) and (now <= date("13.10.2020 00:00")) and inRightGroup("Assessors")or isUser("Natalie") | ||
| 227 | ))) | ||
| 228 | )))|((( | ||
| 229 | If an entry is made in the 'Visibility' tab, the course element will be visible to all course participants in the rights group titled "Assessors" within a period of time (03.09.2020 - 13.10.2020), while it will be visible at all times to the person with the user name "Natalie". | ||
| 230 | ))) | ||
| 231 | |(% colspan="1" %)//is[AttrName]()//|(% colspan="1" %)!(isCourseCoach() or isCourseAdministrator()) |If this rule is entered as expert syntax for the ‘Test session visibility’ option in the Visibility tab of a course module test, course coordinators will not see the ‘Start test’ button section in the course view. | ||
| 232 | |||
| 233 | Create additional rules by using expert syntax. A tabular overview is provided on the page [[Expert syntax>>doc:LMS.Benutzerhandbuch OPAL.Lehren.Kurs.Freigabe von Kursen und Kursinhalten.Expertenmodus zur Freigabe innerhalb von Kursen.Expertensyntax.WebHome]]. |