Course Completion API

Course Completion API

core_completion_get_activities_completion_status

This function checks the completion status of all activities within a course for a specific user.

Let's review the POST parameters for this function:

  1. Required Parameters:
    • courseid= int (Required: The numeric ID of the course.)
    • userid= int (Required: The numeric ID of the user.)

cURL Command Example (Getting Activity Status):

curl "https://courses.yoursite.com/webservice/rest/server.php?wstoken=XXXXXXXXXXXXXXX" \
-d "wsfunction=core_completion_get_activities_completion_status" \
-d "courseid=789" \
-d "userid=123"



core_completion_get_course_completion_status

This function checks the overall completion status of an entire course for a specific user.

Let's review the POST parameters for this function:

  1. Required Parameters:
    • courseid= int (Required: The numeric ID of the course.)
    • userid= int (Required: The numeric ID of the user.)

cURL Command Example (Getting Course Status):

curl "https://courses.yoursite.com/webservice/rest/server.php?wstoken=XXXXXXXXXXXXXXX" \
-d "wsfunction=core_completion_get_course_completion_status" \
-d "courseid=789" \
-d "userid=123"



core_completion_override_activity_completion_status

This function allows you to manually set or override the completion status of a specific activity for a user.

Let's review the POST parameters for this function:

  1. Required Parameters:
    • userid= int (Required: The numeric ID of the user.)
    • cmid= int (Required: The unique course module ID for the specific activity.)
    • newstate= int (Required: The new completion state. Use 0 for 'Incomplete' or 1 for 'Complete'.)

cURL Command Example (Overriding Activity Status):

curl "https://courses.yoursite.com/webservice/rest/server.php?wstoken=XXXXXXXXXXXXXXX" \
-d "wsfunction=core_completion_override_activity_completion_status" \
-d "userid=123" \
-d "cmid=567" \
-d "newstate=1"
    • Related Articles

    • Creating a Webhook

      With the Pluto LMS API (see functions), you will be able to create webhooks within your custom application. What are Webhooks? A webhook is triggered by events rather than requests. A webhook allows one software application to send data to another as ...
    • Grades API

      gradereport_overview_get_course_grades This function retrieves an overview of all final course grades for a specific user. Let's review the POST parameters for this function: Optional Parameter: userid= int (Optional: The numeric ID of the user. If ...
    • Course API

      core_course_get_courses This function retrieves details about one or more courses. Let's review the POST parameters for this function: Optional Parameter: options[ids][0]= int (Optional: A numeric course ID. You can pass multiple IDs to retrieve ...
    • Course Groups API

      core_group_add_group_members This function adds one or more users to a specific group within a course. Let's review the POST parameters for this function: Required Parameters: members[0][groupid]= int (Required: The numeric ID of the group.) ...
    • Enrollment API

      enrol_manual_enrol_users This function manually enrols one or more users into a specified course with a specific role. Let's review the POST parameters for this function: Required Parameters: enrolments[0][roleid]= int (Required: The numeric ID for ...