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
6
votes
2 answers

Understanding Moodle $context

From Moodle doc: A context is a space in Moodle where roles can be assigned. I understand that a context is a logical space used to manage Moodle objects. I developed a custom block plugin with a file upload where I use file_prepare_draft_area…
ben.IT
  • 1,490
  • 2
  • 18
  • 37
5
votes
3 answers

Accessing a Moodle server's API via Python's request library

I'm trying to access the web services of a Moodle installation I have using Python's requests library. I have the API's documentation and an example project written in php (I haven't looked at php before and is way more difficult than I would…
grhmstl
  • 51
  • 1
  • 2
5
votes
1 answer

Getting information from the Moodle API as a student

I'm currently a student at a University and I'm using Moodle everyday. I would like to access some information that is available to me (For example, information of the classes I'm taking, Which assignments are due and when , etc) I did some research…
RonH
  • 357
  • 2
  • 14
5
votes
1 answer

Create Moodle course dynamically using API

I have been asked to create an engine that will take a course(name, short-name, category) from our local database and add it to moodle. I am thinking of using Moodle API for this. I tried using the webservice with no luck. I need something like…
Johnny Zghaib
  • 518
  • 1
  • 12
  • 30
4
votes
1 answer

Login API via webservice in moodle

I am trying to code login API from an external website to moodle. I don't know how to achieve it. Please guide me through. I want to create via REST webservice. Such that student logs in via that external website.
neha sk
  • 51
  • 1
  • 3
4
votes
2 answers

How to get roleid for enrol user on moodle web service

I want to use the 'enrol_manual_enrol_users' function. One required field to do this 'roleid'. I'd like to pull a list of roles from Moodle and present them to user to select which role the student should be enrolled as. I can't see any function…
Zulyantara
  • 53
  • 1
  • 5
4
votes
1 answer

How to insert a dynamic form as an activity or resource in between the sections on the moodle course?

We have tried to insert form elements via quiz actvity in moodle but when it is much complicated to handle when we display on the front end. Please refer the screenshot below https://i.stack.imgur.com/1b1TI.png Kindly give some input about how to…
jaya
  • 53
  • 4
4
votes
1 answer

I want to retrieve the instance of a course module

tl;dr; trying to get a course module instance via a course module through mysql or the official moodle api. My solution in the end seems rather scrappy though, so i would like some advice. Hi Moodle people I am trying to retrieve the corresponding…
DenLilleMand
  • 3,732
  • 5
  • 25
  • 34
3
votes
2 answers

Moodle session_start returns FALSE

I need some help installing Moodle v3.7.2. I've passed all checks for server configuration during installation, except for the fact that the site is recognized as http instead of https, maybe because of the proxy that sits in front of the nginx…
Jumpa
  • 4,319
  • 11
  • 52
  • 100
3
votes
1 answer

How to POST a request on Moodle using POSTMAN api tool

I want to create an API request in Postman that creates a category in Moodle. The following are the steps which I did in Moodle : Enabled Web service Created an External service and added core_course_create_categories function. Enabled REST…
Sarath
  • 89
  • 2
  • 9
3
votes
1 answer

Moodle API - get all completions per course

I have an external app that needs to know which users have completed a course in Moodle via the API. That is to say, it will want to know who completed course 123, and be given back a list. So far, the only way I've found to do this is…
Chief B
  • 31
  • 2
3
votes
1 answer

Moodle plugin creation

I am a beginner in Moodle and I wrote an algorithm in python to learn users profiles. The aim is to create a plugin that provides adaptive functionalities in the Moodle platform based on users' profiles. However Moodle documentation is too large,…
echtouka
  • 72
  • 4
3
votes
2 answers

get user role by user id in moodle

I want to get user role from user id. I am using loop in my code where i want to show all user except admin. i used below code but its not working. $context = get_context_instance (CONTEXT_SYSTEM); $roles = get_user_roles($context, $USER->id,…
Pritesh Mahajan
  • 4,974
  • 8
  • 39
  • 64
3
votes
1 answer

Is there any moodle API to get quiz data?

I have already check the mod/quiz/db/services.php , but not able to find any api for the same. Note : Quiz data like questions, answers details.
Luv Gupta
  • 51
  • 1
  • 3
3
votes
1 answer

Moodle: using mysql joins in $table = set_sql(); method

I want to know how joins are applied for $table= set_sql(); method. I'm trying to render a table without using the conventional html_table(); method. A basic application for a single database table "mdl_user": $table->set_sql('*', "{user}",…
kcay King
  • 77
  • 7
1
2 3
21 22