The language file to use, here we are using moodle because we are using the main language file, for plugins, you should use the Moodle franken-style plugin name where the lang file is located in your Moodle installation i.e: "local_mycustomplugin"

This means that you need to put your language files in a local plugin (called mycustomplugin) in your Moodle installation, this local plugin should be the same where you are going to add your custom Web Services

Notice that the lang.strings property is needed because until we sync to the remote Moodle installation for downloading the language pack, we are going to need this temporal strings.

You can also can add the strings in a json file and uses the same method that for loading templates (add the lang json file as a dependency and then assign to the lang.strings property the variable returned by the define function, see above)

Routes

For avoid binding DOM elements to functions, we use a Route navigation model, any time an user clicks on a button or link, the hash part of the URL is changed and the function linked to the hash part is triggered.
So, if you want to trigger the function ShowParticipant, you must create a button or link that points to "#participant/courseid/userid", when the user click on the link the function showParticipant(courseid, userid) is triggered
One of the advantages of using roues, is that we preserve the browser history so the "back" button on an Android device will work as expected without any extra code.

Sync, aka cron or periodic tasks

sync:{
handler: MM.plugins.myplugin.functionName,
time:60},

You can hook to the sync/cron/periodic tasks core subsystem, just create a property called Sync with two sub-properties:

handler: The function that is going to be executed

time: The execution interval

The sync subsystem is used for synchronize language strings and also for sending operations performed when offline.

When the Web service returns info, the next step is to render a Template using the app template function and then display the template in the center panel.

Notice that for referencing the template, we use the MM global object: MM.plugins.participants.templates.participants.html (MM . registered plugins . name of the plugin . property . template name . contents of the template

If we are using a tablet, we load in the right panel the first participant calling the showParticipant function

Notice that for referencing the function, we use the MM global object: M.plugins.participants.showParticipant