RollWiseHelp

Create a web service token

Set up a RollWise web service, a RollWise user with only the permissions it needs, and a token. Optional, for group sync, the Engagement tab and group limits.

The short version

Site administration then Server then Web services then Manage tokens then Create token

The tool registration covers launches, the roster and grades. Group sync, the Engagement tab and group limits (which groups a teacher without editing rights may see) go through Moodle's web services, which need a token.

This part is optional. Without it, attendance, the roster and grade push still work. But in a course set to Separate groups, a teacher without editing rights then sees every student in RollWise, because RollWise cannot ask Moodle which groups they may see.

Turn on web services and create the service

  1. Enable web services and REST

    Go to Site administration, Server, Web services, Overview, and follow the list there to enable web services and the REST protocol.

  2. Add the RollWise service

    Go to Site administration, Server, Web services, External services and click Add. Name it RollWise, tick Enabled and Authorised users only, then click Add service.

  3. Add all fourteen functions

    On the new service, click Functions, then Add functions, and add each of these:

    core_webservice_get_site_info
    core_enrol_get_enrolled_users
    core_group_get_course_groups
    core_group_get_group_members
    core_course_get_courses_by_field
    core_course_get_course_module_by_instance
    core_group_get_activity_allowed_groups
    mod_assign_get_assignments
    mod_assign_get_submissions
    mod_quiz_get_quizzes_by_courses
    mod_quiz_get_user_quiz_attempts
    mod_forum_get_forums_by_courses
    mod_forum_get_forum_discussions
    mod_forum_get_discussion_posts
    

    The first two check the connection and read the course's students. The two group functions serve group sync. The two course functions and the allowed groups function serve group limits. The assignment, quiz and forum functions serve the Engagement tab.

Pick the exact names. Moodle lists look alike functions next to these. The most common mistake is core_enrol_get_enrolled_users_with_capability instead of core_enrol_get_enrolled_users. The Engagement tab then shows Your LMS didn't allow this.

Create the RollWise user

  1. Turn on web services authentication

    Go to Site administration, Plugins, Authentication, Manage authentication and enable Web services authentication with its eye icon. An account using it can call web services with its token but cannot sign in to Moodle's web pages.

  2. Add the user

    Go to Site administration, Users, Add a new user:

    • Username: rollwise.
    • Choose an authentication method: Web services authentication.
    • Password: any strong password. Nobody signs in with it.

    Click Create user. The form has no role field; you give the role next.

Give the user only the permissions it needs

RollWise does not need the Manager role or any other standard role. Choose one of two options:

Option A: one roleOption B: two roles
RollWise can readevery course on the siteonly the course categories you choose
Setupsimplera little more work

The sixteen permissions both options use:

Type in FilterAllow this row
webservice/rest:useUse REST protocol
moodle/course:viewView courses without participation
moodle/course:viewparticipantsView participants
moodle/course:managegroupsManage groups
mod/assign:viewView assignment
mod/assign:viewgradesView grades
mod/quiz:viewView quiz information
mod/quiz:viewreportsView quiz reports
mod/forum:viewdiscussionView discussions
mod/forum:viewqandawithoutpostingAlways see Q and A posts
moodle/user:viewdetailsView user profiles
moodle/site:accessallgroupsAccess all groups
moodle/course:viewhiddencoursesView hidden courses
moodle/course:viewhiddenactivitiesView hidden activities
mod/lti:viewLaunch external tool activities
moodle/course:ignoreavailabilityrestrictionsIgnore availability restrictions

Type each code into the Filter box and set Allow only on the row whose grey code line matches exactly. Leave every other row on Not set. Why each one matters is in Moodle troubleshooting.

Option A: one role for the whole site

  1. Go to Site administration, Users, Permissions, Define roles and click Add a new role.
  2. Set Use role or archetype to No role and click Continue.
  3. Short name rollwise_integration, custom full name RollWise integration.
  4. Under Context types where this role may be assigned, tick System only.
  5. Allow all sixteen permissions above, then click Create this role.
  6. Go to Site administration, Users, Permissions, Assign system roles, choose RollWise integration and add the rollwise user.

Option B: two roles, limited to chosen categories

Moodle accepts the web service permission only at site level, so it goes in its own role.

  1. Web service role. Add a new role as in Option A with short name rollwise_ws, custom full name RollWise web service, context System only, and allow only Use REST protocol.
  2. Data role. Add a second role with short name rollwise_integration, custom full name RollWise integration, context Category only, and allow the other fifteen permissions.
  3. Assign the web service role at site level in Assign system roles: choose RollWise web service and add the rollwise user.
  4. Assign the data role on each category. From the site home open Courses and click the category name. In the category's menu (under More if it is not shown), choose Assign roles, then RollWise integration, and add the rollwise user. Repeat for every category RollWise should serve.

Option B limits RollWise on purpose. In courses outside those categories, RollWise still launches and takes attendance, but group sync and the Engagement tab do not work. The actions menu on Manage courses and categories offers Permissions, not Assign roles; that is a different page.

Authorize the user and create the token

  1. Authorize the user on the service

    Go to Site administration, Server, Web services, External services, click Authorised users next to RollWise and add the rollwise user.

  2. Check the Missing capabilities list

    Under the user's entry, Moodle lists any permissions it thinks are missing.

    • Option A: none of the sixteen may be listed. If one is, the role is missing it or is not assigned.
    • Option B: webservice/rest:use must not be listed. The fifteen data permissions may appear; that is expected, because this page checks site level and you assigned them on categories.
    • The list never shows mod/lti:view or moodle/course:ignoreavailabilityrestrictions. Check those two by hand on the role.
    • Moodle may list others, such as moodle/user:update. RollWise does not need them, so do not add them.
  3. Create the token

    Go to Site administration, Server, Web services, Manage tokens and click Create token. Choose user rollwise and service RollWise, set no expiry, then click Save changes.

  4. Copy the token straight away

    Moodle shows it only once. If you miss it, delete the token and create a new one. You paste it into the Control Center in the next guide.