Download the PHP package zulkarnen/moodleapi without Composer
On this page you can find all versions of the php package zulkarnen/moodleapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download zulkarnen/moodleapi
More information about zulkarnen/moodleapi
Files in zulkarnen/moodleapi
Package moodleapi
Short Description A library for interacting with Moodle via REST API.
License
Informations about the package moodleapi
Moodle API PHP Library
Requirement
Overview
The Moodle API PHP Library is a simple PHP library built to interact with the Moodle REST API, providing functions to fetch user details, manage user accounts, retrieve course grades, and more. It is designed to easily integrate into PHP applications like CodeIgniter, Laravel, or any plain PHP project.
This library relies on the llagerlof/moodlerest package to communicate with Moodle's Web Services API.
Installation
Via Composer
First, make sure Composer is installed. Then, add the library to your project:
Usage
Initializing the Library
To use this library, you need to instantiate the MoodleApi
class with your Moodle API token and server address.
Example Usage
Get Grade Report
Create Grade Category
Assign Student with Selfenrol in a Course
Function createStudentSelfEnrollToCourse
is used to assign student with selfenrol in a course.
Get Selfenrol in a Course
Available Methods
getToken($username, $password, $serviceName)
- Get token using username, password and service name.getUser($key, $value)
- Get user by criteria.getUserByUsername($username)
- Get user by username.getCourseGradeCategories($courseId)
- Get course grade categories.getGradeReportCourse($courseId)
- Get grade report in course.getGradeReportSelfEnrol($courseId, $enrolmentKey)
- Get grade report with selfenrol in course.getSelfEnrolCourse($courseId, $enrolmentKey)
- Get users with selfenrol in course.createStudentSelfEnrollToCourse($userId, $courseId, $enrolmentKey)
- Create student selfenroll to course.
License
This project is licensed under the MIT License. See the LICENSE file for more information.
Contributing
Feel free to contribute to this project by submitting issues or pull requests.