diff --git a/docs/install-plugin.md b/docs/install-plugin.md index df149489b74bb4e6d6fb7ebad58a15a71d6f85e8..9a9150634f8d9d84fe1f3ffb390cd6c39b32114f 100644 --- a/docs/install-plugin.md +++ b/docs/install-plugin.md @@ -1,6 +1,54 @@ -TODO HR : -- Talk about enabling the webservice and generate the token -- create the bot user, and it's token + give access to the service -- create 2 custom roles (system and course level) -- provide the token to the autograde team -- register the user as an autograde in the course \ No newline at end of file +<div align="center"> + <h1>Plugin Installation</h1> +</div> + +- Install the plugin on Moodle + > The plugin should be stored at ./mod/assign/submission/autograde +- Make sure to have the Moodle web service enable + - Go to Site Administration > Advanced Features : Enable web services should be checked + - Go to Site Administration > Server > Manage Protocols : Make sure that the REST protocol is enabled +- Create our user bot: + - Go to Site Administration > Users > Add a new user : + - Username : *autograde-bot* + - Choose an authentication method : *Web services authentication* + - First name : *AUTOGRADE* + - Surname : *BOT* + - Email address : *autograde-support@groups.epfl.ch* (unless we can have another one) + - Email display : Hide ym email address from non-privileged users +- Define Roles : The *autograde-bot* user needs to have two roles at different contexts : + - AUTOGRADE-SYSTEM : A system level role + - Go to Site Administration > Users > Define roles > Add a new role + - No need to select an archetype + - Short name : *autograde-system-role* + - Custom full name : *AUTOGRADE-SYSTEM* + - Context : Select ***System*** + - Add the following capability : *webservice/rest:use* + - **If a similar role is already define, we don't need to create a new role** + - AUTOGRADE : + - Define a new role called *AUTOGRADE* + - Go to Site Administration > Users > Define roles > Add a new role + - No need to select an archetype + - Short name : *autograde-course-role* + - Custom full name : *AUTOGRADE* + - Context : Select ***Course*** + - Add the following capability : + - *autograde:read_credentials* + - *autograde:read_submission* + - *autograde:update_feedback* + - *autograde:update_gradebook* + - *autograde:use_service* +- Assign the *autograde-system-role* role to the *autograde-bot* user + - Go to Site Administration > Users > Assign system roles + - Select *AUTOGRADE-SYSTEM* and add the *autograde-bot* to the existing users +- Allow the *autograde-bot* to use the *AUTOGRADE* service : + - Go to Site Administration > Server > External services + - Select Authorised Users in the *AUTOGRADE* service and add the *autograde-bot* +- Generate the access token : + - Go to Site Administration > Server > Manage Tokens > Create Token + - Select *autograde-bot* as the user + - Select *AUTOGRADE* as the service + - Add an expiration date of 6 months, we will update the token every 6 months for security reasons + - TODO HR : Add info about IP restrictions +- Add the URL of for autograde + - Go to Site Administration > Plugins > Autograde + - Add the provided "Service URL" \ No newline at end of file