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

Moodle: web service call to get assignments under course

I have an application where I need to fetch records from Moodle using the core Web Service API. I am receiving courses and categories with the following API calls: core_course_get_courses core_course_get_categories But I am not able to find the…
TechNo
  • 615
  • 2
  • 7
  • 24
1
vote
1 answer

Moodle authentication by external application using java web service

I am trying to connect to Moodle using java web service. What I need to do is, authenticate moodle and save users into it. Can anyone provide me some sample code in java for authentication? It would be a great help.
Neha
  • 143
  • 4
  • 19
1
vote
1 answer

Moodle external services login

I'm looking to list all courses with External Service and use the Moodle's url provided by the web service to show courses. When I tried to access this url I have this message "You are not logged in". I want to log in before showing this page. Is it…
olivierplante
  • 185
  • 2
  • 11
1
vote
1 answer

Moodle : How to insert Real Life data?

I have Moodle 2.9 version up and running. I need the way to insert Real Life data into Moodle? For e.g 100 Courses with 1000 Users. Each user in Random 5-10 Courses. Courses having different resources like audio, video, files. etc. I have tried PHP…
SAIR
  • 479
  • 3
  • 9
1
vote
2 answers

Moodle Resource/File Completion

I need help understanding WHERE the completion state of a resource (file) in Moodle is stored. Please see attached images for more information. The flag next to the file is marked as completed once the user viewed This is setup in the Completion…
1
vote
1 answer

adding hook on course activity added

I need to be notified when a course activity (Assignment, Chat & Quiz) is added to a course. I need to send a message to all enrolled users. How can I add a hook on those events in moodle 2.9? Thanks
Ariyan
  • 14,760
  • 31
  • 112
  • 175
1
vote
0 answers

Activity completion based on minimum grade with overrides

My question is related to Moodle bug MDL-51220 (https://tracker.moodle.org/browse/MDL-51220). This bug was introduced in Moodle 2.8 and I'm using Moodle 2.9. With activity completion turned on and requiring that a student receive a certain minimum…
Sam M
  • 4,136
  • 4
  • 29
  • 42
1
vote
1 answer

Moodle API create user, generate password and email user

I am trying to create a new user in Moodle via the Web service API (version 2.7.1+ (Build: 20140829). I want to auto-generate the password and notify the user via email about his new account. When I create a user via GUI there is a checkbox for…
GEMI
  • 2,239
  • 3
  • 20
  • 28
1
vote
1 answer

How to put scorm packages externally into moodle?

I have a specific requirement. How one can put scorm packages externally but using moodle scorm uploading functionality so that the package content will show up in moodle course. It is like, i am putting all scorm activity details in DB from back…
Jyotirmay
  • 1,533
  • 3
  • 21
  • 41
1
vote
0 answers

How to make database connection into moodle 1.9.19 and retrieve records using get_record()

I am using moodle 1.9.19+. I want to connect my database and retrieve & listing table values using moodle how to do that. I am trying get_record() function. Please anyone help me
Nisanth
  • 323
  • 8
  • 24
1
vote
1 answer

how to use insert record function in moodle

I am trying to insert record into my database using moodle. I am using version 1.9.19. i am trying the following code : display(); …
Nisanth
  • 323
  • 8
  • 24
1
vote
2 answers

Moodle - Invalid course module ID

I am adding a folder module to a Moodle course using the API: folder_add_instance($data, null); I am getting the error below when running the script using CMD: !!! Invalid course module ID !!! I looked into the folder_add_instance() function in…
Johnny Zghaib
  • 518
  • 1
  • 12
  • 30
1
vote
1 answer

How to resolve unexpected end of input in file picker moodle

Hi Iam using moodle cms to develop my e-learning website everything OK except one problem when i trying to search any youtube video the first image error shown in mozila firefox second in google crome. in browse repository enter search keyword…
user3773761
1
vote
1 answer

Glossary in Moodle: show overview of all terms on one page

I am a beginner in moodle-programming and would like to build a custom module which displays all terms and explanations of a given glossary on one page. Can someone point out, how to begin and accomplish this?
Madamadam
  • 842
  • 2
  • 12
  • 24
0
votes
1 answer

Install adaptive theme for Moodle via admin account

The platform used moodle.org. The website runs on actual website. The point how to install theme on local development first? I currently have loaded data on local website e.g localhost/moodle and it shows first page with courses. However to install…
Meru
  • 1
  • 2