Questions tagged [moodle-api]

Moodle has a number of core APIs that provide tools for Moodle scripts.API's are already having functionality that can be reuse,and allow you to interact with Moodle system. They are essential when writing Moodle plugin, or Moodle customization.

Moodle Questions, those are about programming or development in Moodle should use this tag.

there are many core-apis those provide interaction with Moodle core system.

List of API's is

1 Most-used General APIs
    1.1 Access API (access)
    1.2 Data manipulation API (dml)
    1.3 File API (files)
    1.4 Form API (form)
    1.5 Logging API (log)
    1.6 Navigation API (navigation)
    1.7 Page API (page)
    1.8 Output API (output)
    1.9 String API (string)
    1.10 Upgrade API (upgrade)
    1.11 Moodlelib API (core)
2 Other General APIs
    2.1 Admin settings (admin)
    2.2 Availability (availability)
    2.3 Backup API (backup)
    2.4 Cache API (cache)
    2.5 Calendar API (calendar)
    2.6 Comment API (comment)
    2.7 Data definition API (ddl)
    2.8 Enrolment API (enrol)
    2.9 Events API (event)
    2.10 External functions API (external)
    2.11 Lock API (lock)
    2.12 Message API (message)
    2.13 Media API (media)
    2.14 My profile API
    2.15 Preference API (preference)
    2.16 Portfolio API (portfolio)
    2.17 Rating API (rating)
    2.18 RSS API (rss)
    2.19 Tag API (tag)
    2.20 Task API (task)
    2.21 Time API (time)
    2.22 Testing API (test)
    2.23 User-related APIs (user)
    2.24 Web services API (webservice)
3 Activity module APIs
    3.1 Activity completion API (completion)
    3.2 Advanced grading API (grading)
    3.3 Conditional activities API (condition) - deprecated in 2.7
    3.4 Groups API (group)
    3.5 Gradebook API (grade)
    3.6 Plagiarism API (plagiarism)
    3.7 Question API (question)

more about Moodle Api's https://docs.moodle.org/dev/Core_APIs

Most generally used api's are

Form API, File API, Events Api, Logging API, Data manipulation API, Navigation API (navigation) etc.

328 questions
0
votes
0 answers

I need all the couse id and rest of the information as api gives in moodles

I have given the form-data following value in Postman api call, wstoken: moodlewsrestformat: wsfunction: courseid: and getting all the info like : But i need all couse id related to userid such as 3823 that have all course and their grade i am using…
0
votes
0 answers

Duplicating courses with Moodle webservice with included role enrolments

I'm duplicating moodle courses via webservice core_course_duplicate_course. While including role enrolments in the duplicate is easy through UI (see screenshot attached). How can I pass the option for role enrolment in webservice? I want to include…
Madamadam
  • 842
  • 2
  • 12
  • 24
0
votes
1 answer

PHP Get Assign ID in Moodle

I have editing /mod/assign/view.php in moodle. in that file I'm printing $assign and showing result in browser like this. assign Object ( [instance:assign:private] => stdClass Object ( [id] => 2 [course] => 2 [name] =>…
Arif Nur Rohman
  • 175
  • 1
  • 4
  • 15
0
votes
1 answer

Moodle - Subquery returns more than 1 row

I am facing the following error in moodle version 4.2.1 while creating Quiz questions. Not sure why it suddenly started happening. Has anyone faced something similar ? A screenshot of error trace has been attached. Please check. Error reading from…
Ajji
  • 3,068
  • 2
  • 30
  • 31
0
votes
0 answers

How to update a Quiz grade using core_grades_update_grades function with api and python

I like do update the usergrades of a quiz in moodle using the core_grades_update_grades function. Unfortunately, I am not able to get the right parameters for the array at the end. My code: moodle = XXXXXX', token='XXXXXX') courses =…
user22179001
0
votes
0 answers

API to Retrieve created questions without any attempt from Moodle

Retrieve all questions just created by user (that are not replied = without any attempt) is what I'm looking for. It's possible to retrieve the different attempts of a question (already replied = with attempts) through mod_quiz_get_user_attempts,…
Smiley
  • 1
0
votes
1 answer

Is it possible to have a participants' course reports plugin with all their courses, the status of learning, time spent on moodle lms?

I have a client that want all the reports of all participants to be shown in with all their courses, their level of completion of those courses and the time spent. And the report for every participant should appear on a single row.
0
votes
0 answers

Adding an attribute to select option in moodle form

As described in Set the select option as blank as default in HTML select element, I would like to render a moodle select dropdown in a way that the initially displayed option isn't a valid option, instead it's just a notice to the user to select one…
Madamadam
  • 842
  • 2
  • 12
  • 24
0
votes
1 answer

Duplicating courses in Moodle by using REST webservice with Python

I'm really struggling to get my code for duplicating moodle courses via REST to work, just couldn't figure out the reason: import requests import json token = 'mytoken123' domainname = 'https://example.com' functionname =…
Madamadam
  • 842
  • 2
  • 12
  • 24
0
votes
1 answer

Email to students after completing course

Iam new to moodle, We are using "single activity format" type courses where we add a scorm package into the course. I need to send the "congratulations" mail to students after completing the course, is it possible?
0
votes
0 answers

Reporting dashboard error- moodle development

can someone please review this :https://github.com/cseprs/moodle_reports_development/tree/master/template As it shows the error in the admin user drop down does not expand. Best,
Parul S
  • 13
  • 4
0
votes
0 answers

What is the best practice for calling Moodle Web service endpoints in Flutter?

I created a moodle application using Moodle's web service. I wrote the repository code like this, what needs to be improved so that it is easier to maintain later on Future> getEnrolledUsers(String token, int courseId) async { …
0
votes
1 answer

Moodle and .NET application

Does anyone know how to connect .NET app with Moodle? Is it even possible for a .NET application to integrate with Moodle? Is there any API for Moodle? I've looked everywhere, but I can't find any clarification anywhere?
Alex
  • 5
  • 2
0
votes
0 answers

How to fetch a file metadata on server-side

I am writing a block where I am collecting the metadata of a videofile and sending it to my block table but problem is  I want to validate the data on server side by checking the metadata. for e.g the video has a time duration = 300 seconds, now I…
Rohit -
  • 29
  • 4
0
votes
0 answers

How can I display Category tiles in "My Courses" page (ie. courses.php) instead of list of courses?

I am using Moodle 4.0.4 and boost theme, I want Categories to be displayed as tiles in "My Courses" page (i.e., courses.php page), where the users click the category first then see all the courses in that category. I found a block plugin named…
egp_s2s
  • 11
  • 6