===== MoodleScript: ASSIGN ROLE ===== ===== MoodleScript Script Engine ===== === Effect === Assigns a role to a user in a given context. === Syntax === ASSIGN ROLE TO IN === Examples === ASSIGN ROLE student TO idnumber:U345654 IN idnumber:2022_C104 ASSIGN ROLE editingteacher TO username:"admin" IN shortname:TESTCOURSE === Specific attributes === * **roleshortname**: A role short name. * **useridentifier**: A user identifier. * **courseidentifier**: A course identifier. === Other defaults === None [[:local:moodlescript:languagespecification|Back to the language index]] - [[:local:moodlescript|Back to the component index]]