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
1
vote
1 answer

Does the MoodleCloud expose APIs that can be used by tools to integrate with it?

I am looking for APIs that will let me sign in from the tool into the MoodleCloud and then access the objects in MoodleCloud for the account to be displayed and interacted with from the tool.
Sunil
  • 11
  • 2
1
vote
1 answer

Don't have enough questions in category to create the question Random

I have 3 categories with several quizzies in it and i can test 2 of them , they work properly, but when i try to test third one i got this error below: There are not enough questions in category XX to create the question Random What should i…
Sagitarius
  • 348
  • 1
  • 11
  • 36
1
vote
2 answers

Moodle change badges image size

when I create a badge in Moodle 3.5, the core automatically creates 3 thumbs for the badge icon (35x35, 100x100, 512x512). I should increase the size of the 100x100 thumb, but that size are hardcoded in the core package: /lib/gdlib.php, function…
btb84
  • 241
  • 1
  • 3
  • 11
1
vote
0 answers

timecreated from mdl_user_enrolments via Moodle's api

I not find a Moodle's api that I get "timecreated" from "mdl_user_enrolments" table via api. Is there a solution? Thanks!
1
vote
1 answer

Moodle API Optional Return Values

I am calling the Moodle API (core_user_get_users) and trying to retrieve the user's first name and last name fields. According to the API's source code, the firstname and lastname fields are VALUE_OPTIONAL. I am not sure whether these fields are…
Flea
  • 1,490
  • 2
  • 19
  • 43
1
vote
1 answer

Display all yet avoid repetition of DB column records in SQL Server [Moodle] [PHP]

I would like to retrieve and display values in the Database (SQL server). The only problem is that multiple records have the same value in the column. I would basically like cycle through the column and to display a list of all unique values and…
D0uble0
  • 175
  • 1
  • 2
  • 12
1
vote
1 answer

Moodle date selector (year only)

I am new to Moodle and need some assistance creating (year only) date selector. In the code below I have a few entry fields. If possible, I would like to customize the bottom 2 date selector fields to display only years for the user selection. My…
D0uble0
  • 175
  • 1
  • 2
  • 12
1
vote
2 answers

How to make user auto login in MOODLE

I have a portal called xyz.com and a Moodle site called yzx.com. I have some users on both sites, which have same usernames and password. What I want is when a user logs in on non-Moodle site called xyz.com, he should auto login to the same user on…
DHRUV GUPTA
  • 2,000
  • 1
  • 15
  • 24
1
vote
1 answer

I want to access multiple domains using one moodle mobile app. is it possible to handle multiple? domains with one app in moodle

I am using moodle 3.2.1 version and i have 3 subdomains. I want to access these domains using one moodle mobile app. is it possible to handle multiple domains with one app in moodle ?
1
vote
1 answer

Upload files to moodle under a selected course

I have created a particular course using the moodle rest api and i would like to add a files into that particular course. The course may take the week/topic form. I need to add the uploaded file under a selected topic/week how can i achieve that? .I…
Madushika Perera
  • 402
  • 2
  • 5
  • 13
1
vote
1 answer

Moodle-progress bar

In moodle,I could see the default course progress for the courses in the moodle on the front end. But when tried to show the progress like 10% completed when chapter1 gets completed, 20% completed when chapter2 gets completed and so on. I could not…
jaya
  • 53
  • 4
1
vote
1 answer

Moodle join tables without raw SQL query

I am new to the Moodle world. I want to make inner join 2 or more tables with PDO. I checked documentation but can't find anything helpful. Maybe I am missing some part of Moodle. Let's say I want to get all users enrolled to the specified…
Bahriddin Abdiev
  • 328
  • 1
  • 14
1
vote
6 answers

Upgrade Moodle 2.5 to Moodle 3.3

I want to upgrade a moodle website currently on version 2.5 to the latest version. I need to clarify that is it possible to upgrade Moodle 2.5 directly to Moodle 3.3. OR As mentioned in the moodle upgradation document "Note: You can only upgrade…
Tanmay Mishra
  • 119
  • 1
  • 3
  • 10
1
vote
1 answer

Downloading a custom plugin from the Moodle server

I am currently using a Moodle on a private server to test plug-ins which will then be put onto the main Moodle for public access. There is a plug-in on the private Moodle which I would like to put onto the main Moodle server. I have administrative…
Evan
  • 288
  • 1
  • 10
  • 19
1
vote
2 answers

"Not available unless: You belong to " : How to hide this message in moodle course

I'm building a Moodle course for my students who are part of different batches. Each batch refers same lesson notes, but the Quiz and Assignment activities vary for each batch. The students are categorized into groups for the course and access to…
code
  • 55
  • 13