Course modules

Connect Moodle and match courses and students

Connect your Moodle site with a web services token, match Moodle courses to Cohort course codes, test the link and pull grades in.

Advanced15 minFor: Owner / Admin· Last checked 2026-11-13
Video tutorial coming soon

The written steps below are complete. Producing the video? Use the video script tab — it follows these steps one for one.

Once Moodle is connected, Cohort pulls each student's course grades into their transcript. Students are matched by email address, and Moodle courses are matched to Cohort courses by course code: set each Moodle course's ID number to the matching Cohort course code. After setup, grades come in every night for current students; this lesson covers the connection and the matching.

By the end you can

  • Create a Moodle web services token
  • Connect Moodle and test the connection
  • Match Moodle courses and students to Cohort
  • Pull every student's grades in on demand

Before you start

  • An Owner or Admin login in Cohort
  • A Moodle site administrator login
  • Your Cohort course codes (Courses in the sidebar)

Step by step

  1. 1

    Turn on web services in Moodle

    In Moodle, go to Site administration → Advanced features and enable web services. Then go to Server → Web services → Manage protocols and enable REST.

    You should see: Web services and the REST protocol are enabled in Moodle.

  2. 2

    Create a token in Moodle

    In Moodle, go to Site administration → Server → Web services → Manage tokens and create a token for a service that includes the grade functions.

    You should see: Moodle shows a long token. Copy it.

    The service needs core_webservice_get_site_info, core_user_get_users, core_enrol_get_users_courses and gradereport_user_get_grade_items.

  3. 3

    Match course codes

    In each Moodle course's settings, set Course ID number to the Cohort course code, for example PSW-01.

    You should see: Each Moodle course carries the same code as its Cohort course.

    Small differences such as PSW001 and PSW-01 still match.

  4. 4

    Open Moodle settings in Cohort

    /settings

    In Settings, click Connect Moodle in the Moodle integration card.

    You should see: A page titled Moodle integration with a Connection card and a Sync all grades card.

  5. 5

    Enter the URL and token

    /settings/moodle

    Type your Moodle site URL (for example https://moodle.lakeshorecollege.ca), paste the Web Services token, and tick Enable Moodle grade sync.

    You should see: The URL and token boxes are filled in and the box is ticked.

  6. 6

    Save

    /settings/moodle

    Click Save.

    You should see: The token box now shows •••••••• (saved — leave blank to keep).

  7. 7

    Test the connection

    /settings/moodle

    Click Test connection.

    You should see: Connected to followed by your Moodle site's name.

  8. 8

    Pull grades in now

    /settings/moodle

    Click Sync all students' grades now.

    You should see: A message such as Synced 120 grades across 30 students. and, if some couldn't be matched, a list under No grades pulled for: with the reason.

Tips

  • Each student's email in Cohort must be the same as their Moodle email. That is how Cohort finds them.
  • Each click covers 250 students. With more than that, a Continue with the next batch button appears — click it until it disappears.
  • The last result stays on the page as Last sync:.
  • To change the token later, paste a new one and Save. Leave the box blank to keep the saved token.

Troubleshooting

It says Enter the Moodle URL and token, then Save first.
Fill in both boxes and click Save before Test connection.
It says Moodle refused the request (HTTP …).
In Moodle check that web services and REST are enabled, the token is valid, its service includes the grade functions, and no firewall is blocking Cohort.
A student is listed as no Moodle account for their email.
Their email in Cohort doesn't match any Moodle user. Correct the email on the student's record or in Moodle, then sync again.
A student is listed as no email on file.
Add the student's email to their Cohort record.
A course's grades never come through.
The Moodle course's ID number doesn't match a Cohort course the student is enrolled in. Set it to the Cohort course code.
The sync button is greyed out with Connect and enable Moodle above first.
Tick Enable Moodle grade sync, click Save, and try again.

Related lessons

Finished this lesson?