The Moodle APIs Setup screen is used to set up integrations between Focus and Moodle. The Moodle integration allows for a seamless transfer of student and teacher enrollments to the corresponding courses and sections within the LMS, as well as teacher changes, student re-enrollments, enrollment activation, and inactivation using enrollment date, expiration date, extension date, and completion date.
After the initial Moodle integration set up established here, ensure the following scheduled job is set up for a successful integration via Setup > Scheduled Jobs: Transfer Moodle API Data.
The appropriate profile permissions are required to set up a Moodle integration, which can be enabled via Users > Profiles > Setup tab > Moodle API Setup view and edit permission.
1. In the Setup menu, click Moodle API Setup.
![Moodle API Setup](https://media.screensteps.com/image_assets/assets/006/756/373/original/b9b81df5-395a-4b03-a443-c34ba1e83600.png)
Any existing Moodle integrations that have been set up in Focus are displayed in the table.
2. Enter the Title in the provided text box, such as Moodle.
![Moodle API Setup](https://media.screensteps.com/image_assets/assets/007/104/086/original/36314ebd-9b6e-45ec-8294-b53455c2353c.png)
3. Select the applicable Moodle version from the Version from the pull-down.
![Moodle API Setup](https://media.screensteps.com/image_assets/assets/007/104/088/original/5ecc1de8-ce80-4e53-b753-89fee6f9643d.png)
4. Select the data that should be transfered from Moodle to Focus from the Transfer From Moodle pull-down.
![Moodle API Setup](https://media.screensteps.com/image_assets/assets/007/104/090/original/a0d9d7c0-7eae-4e42-9301-747550f3cccd.png)
5. Select the data that should be transfered from Focus to Moodle from the Transfer To Moodle pull-down.
![Moodle API Setup](https://media.screensteps.com/image_assets/assets/007/104/092/original/e34c0a42-b316-485f-8f15-a509dc70922c.png)
6. Select the applicable Schools from the pull-down to determine the schools that have access to Moodle vis-a-vis the integration. Leave the pull-down blank to ensure all schools have access.
7. Enter the External API URL in the provided text box.
8. Enter the Service Name in the provided text box.
9. Enter the Authentication Token in the provided text box.
10. Select the User Auth Method from the pull-down to determine the authentication that Moodle will be using in order to login the users that are created.
Select OAuth 2 if your district already has another service setting up accounts to ensure that Moodle uses those oauth credentials instead of having its own password setup. The email should match the data used with that service.
Select Create Password if the API should create the user and email the user to setup a password.
11. Select the check box to Use Grade Posting End Date on Courses and Enrollments.
12. Enter the number of Days before school year's start date to allow teacher access in the provided text box.
13. Enter the number of Days before making period's start date to allow teacher access in the provided text box.
14. Select the Use Test Email check box for testing purposes. Instead of using an actual email address, you can use a test email address such as [email protected]. Otherwise, the system will send emails to the user's actual email address, which may be confusing when testing the API.
15. Press the Enter key to save the Moodle data.
16. Click Log in to Retrieve Token to test the integration.
a. In the pop-up window, enter your Username and Password in the provided text boxes to sign in.
b. Click Retrieve Token.
![Moodle API Setup](https://media.screensteps.com/image_assets/assets/006/771/392/original/01a2fdc4-4964-4b14-9df8-7a2fb1d821ec.png)
Focus will attempt to receive a token from the external API. A confirmation pop-up window is displayed indicating the results of the test. If the test was not successful, please communicate with Moodle that Focus is unable to receive a token with the external credentials provided.
![sandbox.focusschoolsoftware.com says](https://media.screensteps.com/image_assets/assets/006/756/425/original/27abb86c-a117-47d7-9306-e3fb2ed33de6.png)
17. Click the delete button (red minus sign) to delete the Moodle integration set up.
![Moodle API Setup](https://media.screensteps.com/image_assets/assets/007/104/108/original/c461e9bb-3cc5-45b1-b3c2-e1fcb9e70ac7.png)
Data listed can be sorted by clicking on any of the headers. Click once for ascending results; click twice for descending results.
Click the Filters feature to further breakdown data.
a. To add more than one filter to a column, click on the green plus sign.
b. To delete an added filter, click on the red minus sign.
c. Select the gray arrow for more filtering options.
For more information, see Filters.
Click the Excel icon in the Export section to export the table of data to an Excel spreadsheet, which can then be saved to your computer.
Click the Printer icon to print the table of data.
The Page Size displays the total number of records displayed per page; the default is 25 records. To change the number of records displayed per page, enter the Page Size in the provided text box.
![Moodle API Setup](https://media.screensteps.com/image_assets/assets/007/104/116/original/60b8705c-fcf3-4812-8a9e-a2f6c4c48fc2.png)