Skip to main content

Moodle 3.x/4.x Data Integration and Webservice Setup Instructions

Course Evaluations & Surveys offers a Data Integration Webservice that connects to your instance of Moodle to automate the import of course, student and instructor enrollment information into your Course Evaluations & Surveys Project(s). Additionally, once the courses and enrollments are imported into a project, enrollment refreshes of the data can be scheduled to automatically update enrollment add/drops in the selected courses.


Course Evaluations & Surveys uses Moodle Webservices for data integration. No Moodle block is installed in Moodle for the data integration. Moodle Webservices need to be activated and configured, as well as a user created in Moodle with enough privileges to execute actions in order to retrieve course and user information.

For Moodle Webservice activation, Course Evaluations & Surveys follows Moodle’s standard Webservice activation steps.

Steps to setup Moodle web services

  1. In Moodle, go to Home > Site administration > Plugins > Web services > Overview > Users as clients with token.
    1. Enable web services by changing status to Yes
    2. Enable protocol by selecting rest
  2. Go to Home > Site administration > Users to create a user for these integration purposes. We suggest the username should have EvalKIT in the name to easily distinguish it from other users, e.g. EvalKITAPIUser.
  3. Add the user to Site Administrators list under Home > Site administration > Users > Permissions > Site administrators.
  4. Go to Home > Site administration > Plugins > Web services > External Services, create an External Service and name it EvalKit Web Services .
    1. Check the option Enabled .
    2. Check the option Authorized users only .
    3. Click Add Service .
    4. After adding the new External Service, you will be returned to the External services page. Click the Functions link.
    5. The following functions must be added to the External Service created in Step 4:

  5. After adding the Functions, you will be returned to the External services page. Click the Authorized users link. Add the user created in step 3 as an Authorized User of the External Service.
  6. Go to Home > Site administration > Plugins > Web services > Manage Tokens to create token for the authorized user created in Step 3.
This completes the Moodle web services configuration, now the user token and Moodle site address must be entered in Course Evaluations & Surveys in order to establish communication and retrieve data. This is covered in the next section.

CONFIGURATION SETUP IN Course Evaluations & Surveys

To configure your Course Evaluations & Surveys Account to use the Data Integration Webservice, perform the following:

  1. Within the Account section, click on Moodle under the Integrations section.
  2. Add a name for your Moodle Site.
  3. Add your version of Moodle.
  4. Add the URL for YOUR instance of Moodle (If your instance of Moodle is behind HTTPS, make sure to insert HTTPS in your URL).
  5. Add your Moodle Web Service Token (This is the token that was generated in the previous section).
  6. Click Save.

To configure Moodle Role Settings for your Course Evaluations & Surveys Account, perform the following:

As part of the Moodle integration, Course Evaluations & Surveys follows and adheres to the standard default settings of Moodle's role short names. The standard role mappings in Course Evaluations & Surveys will appear here as follows and cannot be edited:

Name Short Name
Student student
Teacher teacher
Editing Teacher editingteacher
Instructor instructor

Additional Moodle Roles can be created to align to custom Moodle roles to import users for any of the Course Evaluations & Surveys roles.

  1. Select + Add Moodle Role.
  2. Enter the Moodle role Name and Moodle Short Name.
  3. Click Save.
The custom Moodle roles can then be selected to import users under any of the Course Evaluations & Surveys roles. Refer to the Select Users to Import section.

Preparing for Data Imports

The Moodle Data Import allows you to search for and import courses directly from your instance of Moodle. All necessary course, student enrollment, and instructor enrollment information needed in Course Evaluations & Surveys is transferred into your Course Evaluations & Surveys Project by pressing Import Data.

Once the data integration has been completed, you are ready to test the data import feature within Course Evaluations & Surveys. To do so, you will need to have the following:

  1. A visible course in Moodle you can use as a test course for import.
  2. A student test user enrolled in the above course that will be imported into your Course Evaluations & Surveys Project.
With the above items, follow the steps below:
  1. As an CES Administrator, create a test project within your Course Evaluations & Surveys Account.
  2. Under the Survey tab of the project, select your test survey, and click Save
  3. Make sure your Project Level Start Date is set for today’s date.
  4. Under the Courses tab click on Data Import > Moodle.
  5. On the top of the page you will see two options: Re-Sync Courses and Clear Synced Courses.

    1. Re-Sync Courses:
      1. Re-Sync All Courses: Selecting this option will sync all courses and enrollments.  NOTE: If your Moodle has a large number of courses, Moodle will time out the connection before CES can complete the sync.  If you are seeing failed syncs then this is likely the reason and you will instead need to sync courses using the Course ID.
      2. Re-Sync Courses according to Course ID(s): Selecting this option allows you to sync a range of courses and enrollments, according to Moodle course IDs.  The Moodle course ID can be found in the URL of the course in Moodle

      3. You can check the status of your course re-sync via the Notifications widget on the Home page of Course Evaluations & Surveys and also receive an email.
      4. A timestamp will be populated to alert you of the last time you re-synced courses.

    2. Clear Synced Courses: This option allows you to clear your previously synced courses (I.e. Your data source). Institutions who change courses information in the LMS, such as deleting courses or building new course sections, should utilize this feature if they want to keep the data source aligned with their recent changes. Once you clear your synced courses, you will need to select Course Re-Sync before importing.

      Note: Clearing synced courses has no impact on courses in existing Projects or enrollment refreshes.
    Once your accounts and courses have been re-synced, you are ready to import your courses into the Course Evaluations & Surveys Project. As a note, re-syncing accounts or courses does not make any changes to the data in your LMS. These features only refresh the data source for you to utilize for purposes of the data import.

Using the Data Integration Webservice Functionality

  1. Create a Project within Course Evaluations & Surveys
  2. click on the Courses tab in the sub-navigation to access the Moodle Data Import options.
  3. Click on the Data Import drop down menu and select Moodle.

Searching Courses

The Search Moodle Courses feature allows searching for courses based on Moodle Course Name, Short Name or ID Number.

Select which of these options to search on from the Filter Options dropdown in this section. You can also use operands like Contains, Equals, Starts With or Not Contains based on your desired search logic.

Finally, you can select More Options and use the large text box to paste in a text string you would like to search by.

  1. Search Moodle Courses: The Course Search feature allows searching for courses based on Moodle Course Name, Short Name, or ID Number. Select which of these fields to search on from the first dropdown in this section. Then, select Contains, Equals, Starts With, or Not Contains based on your desired search logic. And finally, insert the text string you would like to search by. Click Search to run the search. The courses that meet your search criteria will be displayed in the Select Courses section where you can check the checkbox for specific courses in the list, or select the checkbox in the header to select ALL courses in the viewed page of your search results.

    Note: Select All only selects the number of records per page.
  2. Select Users to Import: You can customize your import to only bring in student, instructor or TA enrollments, and omit specific user properties in the import. The default is to import student and instructor enrollments, along with their full name and email address. Importing TA enrollments is optional.
    1. Moodle Student Role: Import users with custom, Instructor or Teaching Assistant roles in Moodle as Students into the Course Evaluations & Surveys Project.
    2. Moodle Instructor Role: Import users with custom, Student or Teaching Assistant roles in Moodle as Instructors into the Course Evaluations & Surveys Project.
    3. Moodle TA Role: Import users with custom, Student or Instructor roles in Moodle as Instructors into the Course Evaluations & Surveys Project.
  3. Create Unique Course Evaluations & Surveys Course Sections for each Instructor (optional): Using this feature will automatically create separate course evaluation sections within Course Evaluations & Surveys for each instructor enrolled within the selected Moodle courses. Important Note: If selected, students within courses with more than one instructor enrolled will be asked to take the whole survey multiple times, for each instructor/course section. This will negate the team-taught courses functionality within Course Evaluations & Surveys.
  4. Add Instructor to Course Title (optional): Add the instructor's name to the course title of the course section.
  5. Remove Meta Enrollments: Remove meta-enrollments from the courses selected to import. Within the text box in this section, paste the Moodle parent and child(ren) course IDs with a double-pipe (||) to separate the values, one per line. Example: "Px||C1||C2”
  6. Generate Course-Level Dates Based on Course Dates (optional): With this feature, you can automatically generate course-level survey dates within the Course Evaluations & Surveys project that control when surveys for specific courses will start and end, based on the Moodle course start/end dates. Options for generating course-level dates upon imprt of course data include:
    1. Generating course-level survey start/end dates based off number of days before/after the course start/end date in Moodle.
    2. Setup course-level report access dates for administrators and instructors based off number of days before/after the course start/end date in Moodle.

      Note: this is an optional step, if you do not setup anything in this step, Course Evaluations & Surveys will use the project-level dates you have in your EK project to drive the survey start and end dates for all courses within the project.
  7. Import Options: I would like to receive confirmation emails for this data import. You can elect to receive an email alert confirming the import by checking this check box.
  8. Import Data: To import the related course, student enrollment, and instructor enrollment information into your Course Evaluations & Surveys Project for the selected courses, just click Import Data.

    Note: You can upload up to 440 characters for a Course Code and Course Unique ID. These values may be truncated throughout your PDF Reporting.
    1. Contained in the notification and email alert is an embedded link, that once clicked on will direct the CES Administrator to the Course Import/Delete Log within Course Evaluations & Surveys.

    2. The log contains additional detail for the course import or deletion and includes, Course Code, Course Title, Course Unique ID, Project Name, Project ID, number of Student Enrollments, number of Instructor Enrollments, Requester, and Request Submit Date/Time.

      Note: Completion time for your data import will be based on the size of your import. It’s recommended that you allow the import to complete before running subsequent batches.

Using the Enrollment Refresh

After importing data for the selected courses from within Moodle, a refresh of the enrollments can be scheduled in order to automate updating enrollment adds and drops for all Moodle courses within the project.


The Enrollment Refresh will update enrollments for courses that have been imported via the Moodle integration only. Courses that are imported or added via other means, i.e. Excel, .csv, or manually created, are not supported with the Enrollment Refresh feature.


Re-syncing courses has no bearing on the enrollment refresh and does not need to be completed to schedule an enrollment refresh. Also, the enrollment refresh will only update your enrollment numbers for the courses within your Course Evaluations & Surveys Project.
  1. Go to Users tab within the project.
  2. Click on Data Import drop down menu and select Moodle.
  3. Add Refresh Schedule
    1. Schedule a date & time for the Enrollment Refresh OR
    2. Setup recurring instances of the Enrollment Refresh to update enrollments within the Course Evaluations & Surveys project every X days within a specified time frame.
  4. Choose to exclude courses from the Enrollment Refresh where the survey has ended for both course-level and project-level end dates prior to the Enrollment Refresh scheduled run date.
  5. Select to refresh students and/or instructors.
  6. Click Save.

Additional Information on Enrollment Refresh

  1. You can schedule multiple refresh instances here.
  2. Enrollment refreshes can occur before, during or after a project has ended.
  3. If a student has already submitted survey responses and is dropped from a course within an Course Evaluations & Surveys project, their results will be removed from the project results as well.
  4. If you schedule a enrollment refresh for a date/time in the past, it will refresh for that project immediately.
  5. Dependent on the amount of courses/enrollments within your project will determine the length of time that the refresh takes to update enrollments within a project.



Was this article helpful?
0 out of 0 found this helpful

Articles in this section

How to Contact Support
There are many ways to reach out! Click here for our support options.
Watermark Academy
Click to access the Watermark Academy for consultation, training, and implementation companion courses.