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

Users from Microsoft SQL Server to Moodle

I have to sync users from an existing Microsoft SQL Server to Moodle via the API. I have done some batch uploading from a csv file like this: insertMoodleGebruikersBatch(array: csvGebruiker[]) { this.functionName = "core_user_create_users"; …
Milan_w
  • 291
  • 2
  • 4
  • 17
1
vote
2 answers

unable to view own profile in moodle

I am new in moodle administration! I am using moodlem 3.2. logged in with administrator, if i open my own profile it redirects me to this page: http://moodle_site.com/ExamOnline/user/profile.php?id=2 And it show this error message: "Forbidden You…
Rajeet
  • 37
  • 1
  • 8
1
vote
3 answers

Moodle event observer not triggered in local plugin

I have created a plugin at this location moodle/local/redirectafterlogin with the following structure : redirectafterlogin/ ├── db │   ├── classes │   │   └── observer.php │   └── events │   └── events.php └──…
ben.IT
  • 1,490
  • 2
  • 18
  • 37
1
vote
2 answers

Moodle File API : multiple rows?

In a Moodle form I perform a file upload using the filemanager element: $mform->addElement('filemanager', 'attachment',get_string('displayedcontent', 'block_helloworld'), null, $filemanageropts); Once the form is validated, when I record my…
ben.IT
  • 1,490
  • 2
  • 18
  • 37
1
vote
1 answer

Retrieve all questions of a Moodle quiz

I've a Moodle Quiz on 2 different pages (2 questions on the first and 1 on the second) and I'd like to retrieve those 3 questions. I use this code : function getQuiz(IdQuiz){ …
1
vote
0 answers

How to get scorm activity validation and show to enrolled users

I am using api to upload scorm package to moodle. It is uploading the scorm but How can get scorm activity validation and show it to enrolled user. Here is the code,
Kumar
  • 1,187
  • 18
  • 31
1
vote
1 answer

Share Moodle Session with other Web Applications

We are developing a Java based web application which needs to be integrated with Moodle. Moodle is using Active Directory to authenticate the users. For some roles in Moodle (e.g Administrators or Course Creator) there is going to be a redirect link…
1
vote
2 answers

Restricting a resource in Moodle

I am trying to create access restrictions to a folder or resource inside of a section in a Moodle course using a Script. This restriction must be for groups of users and if you don't belong to that group you can not see the existing resources. The…
Joacer
  • 568
  • 13
  • 32
1
vote
1 answer

Get path of uploaded image in Moodle

I have added custom column to store company logo. I have used file api of moodle like : $mform->addElement('filepicker', 'certificatelogo', 'Company Logo', null, array('maxbytes' => $maxbytes, 'accepted_types' =>…
stefun
  • 1,261
  • 3
  • 24
  • 54
1
vote
1 answer

Moodle custom service creation issue

I am trying to create Moodle custom service for my functionality enhancement 1 ) https://docs.moodle.org/dev/External_functions_API 2 ) https://docs.moodle.org/dev/Adding_a_web_service_to_a_plugin updated service module based on these…
Varun Sreedharan
  • 517
  • 8
  • 28
1
vote
2 answers

Moodle user enrollment to a course using Api

I am new to Moodle, but I am setup site in local server. Created new courses, users into it. I want to enroll a patient to a specific course (created using admin side) through Javascript API. Are any options to enroll a user in a course. I couldn't…
Varun Sreedharan
  • 517
  • 8
  • 28
1
vote
0 answers

Moodle ltilibrary grades posting

I posted this question on Moodle forum, as well. I am trying to use LtiLibrary and post grades to all students under LTI item in the gradebook in Moodle. For now, I can post only grade for a student that click on the LTI like so, var result =…
C P
  • 11
  • 5
1
vote
3 answers

How should I edit or delete the default fields in moodle?

I'm using moodle 3.0. While creating user, it displays too many extra fields like SkypeID, AimID etc. So is there any way to edit or delete these fields ? Also I want to add user profile fields in Grader report.Like, If I created 'Roll_No' field…
Kartikesh
  • 11
  • 2
  • 5
1
vote
1 answer

Get specific field from a table with moodle Data manipulation API

I want to select all records from moodle data base where id is equal to a certain variable.Can anybody tell me what will be the moodle Data manipulation API syntax for it. Here is mysql query Select question from mdl_answers where id=$questionid; I…
Usman Qadeer
  • 157
  • 1
  • 12
1
vote
2 answers

Adding new moodle UI elements according to the onchange event of a select element

I'm new in moodle and I always programmed at client-side. I think maybe I'm missing something because of that reason. I need to provide the user with diverse UI elements, according to what he selects in a combo. So I was thinking in writing the…
gal007
  • 6,911
  • 8
  • 47
  • 70