How to use moodle core and get rid of everything else?

How to use moodle core and get rid of everything else?

by CARLOS ABINADI RAMOS MONJARAS -
Number of replies: 3

(Using Moodle 2.4)

In my company we need to program a web app that uses moodle's inner mechanisms that manage courses, users, database connections, etc., but only that. Nothing else.

We want to get rid of YUI, the GUI, and anything graphical. We don't want $PAGE or anything similar since it doesn't have anything to do with the important data in moodle (users, course content, etc). We just want the core. We'll make a completely new frontend. We have our own framework.

Is there a PHP file(s) that we can include in our scripts, that lets us call some functions or send some commands to the moodle core, to create an user, get user listing, create a course, etc?

If so, which ones are they? Where to start?

I've been looking this for months; in handbooks, in moodle's documentation, etc. But I still don't have a straightforward answer.

I hope you know what I mean. Something like

require_once('moodle_core.php');

$MOODLE_CORE -> create_user('Joe Winston','JW','123Password');

Does such thing exist? Is there a tutorial or a book about that?

Average of ratings: -
In reply to CARLOS ABINADI RAMOS MONJARAS

Re: How to use moodle core and get rid of everything else?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

This does not exist.

Have you looked at LTI, what Moodle calls External tool? That lets your other system be completely separate. The student sees you activity as a link  in their Moodle course. When they click it, some magic happens, so that with a reasonably high degree of securty, your other system gets told that Student X from Course Y is accessing your system, and so your system should let them in to do stuff.

One or other of these videos  or  is probably the best introduction. (Sorry, I don't know which of the two is better.)

In reply to Tim Hunt

Re: How to use moodle core and get rid of everything else?

by Rex Lorenzo -

Following on the LTI idea, you can use this plugin LTI provider tool: https://moodle.org/plugins/view.php?plugin=local_ltiprovider

This will allow you to make Moodle an LTI provider, meaning that suppose you want to just use the Quiz tool for Moodle in your other system.

You can use this plugin and it will handle the single sign-on and grade transfers.

This also should work for any of the other "core" tools that Moodle provides.