Moodle Mobile 2 (Ionic 1) Remote add-ons: Difference between revisions
Juan Leyva (talk | contribs) (Created page with "Only available for Moodle 3.1 onwards. A Moodle Mobile remote addon is the mobile app version of a Moodle plugin that will be loaded when a user accesses the plugin on the ap...") |
Juan Leyva (talk | contribs) mNo edit summary |
||
Line 1: | Line 1: | ||
Only available for Moodle 3.1 onwards. | Only available for Moodle 3.1 onwards. | ||
A Moodle Mobile remote | A Moodle Mobile remote add-on is the mobile app version of a Moodle plugin that will be loaded when a user accesses the plugin on the app. | ||
Moodle Mobile remote | Moodle Mobile remote add-ons are stored within a Moodle plugin and are downloaded and lazy-loaded by the Mobile app in every site that uses them. | ||
Moodle plugins can include several Mobile | Moodle plugins can include several Mobile add-ons. They can also declare dependencies between plugins. | ||
We can say that a | We can say that a remote add-on is a special version of a Moodle Mobile add-on. The main differences are: | ||
* Mobile remote | * Mobile remote add-ons are placed inside Moodle plugins (outside the Mobile app). | ||
* Mobile remote | * Mobile remote add-ons language files must include the whole component prefix. | ||
* Mobile remote | * Mobile remote add-ons uses special placeholders for paths inside CSS files or Javascript code. | ||
== How to create a remote | == How to create a remote add-on == | ||
Remote | Remote add-ons must be developed first as standard Moodle Mobile add-ons and then packaged as a remote add-on. | ||
These are the main steps | These are the main required steps: | ||
* Develop the required Moodle Web Services | * Develop the required Moodle Web Services | ||
* Develop a standard Moodle Mobile | * Develop a standard Moodle Mobile add-on | ||
* Package the Moodle Mobile | * Package the Moodle Mobile add-on as a remote add-on | ||
* Include the | * Include the remote add-on in your Moodle plugin | ||
=== Web Services === | === Web Services === | ||
Most of Mobile | Most of Mobile add-ons require Web Services to work, but in some cases (like add-ons implementing question types) it won't be necessary. | ||
Please refer to [[Web services]] documentation, you have an example here: https://github.com/markn86/moodle-mod_certificate/blob/MOODLE_31_STABLE/classes/external.php | Please refer to [[Web services]] documentation, you have an example here: https://github.com/markn86/moodle-mod_certificate/blob/MOODLE_31_STABLE/classes/external.php | ||
Once the Web Services | Once the Web Services are developed, you must include them into the Mobile service using the "services" field when declaring external functions, see: https://github.com/markn86/moodle-mod_certificate/blob/MOODLE_31_STABLE/db/services.php | ||
Remember that this is only available Moodle 3.1 onwards. | Remember that this is only available from Moodle 3.1 onwards. | ||
=== Mobile | === Mobile add-on === | ||
Refer to [[Moodle Mobile Plugins Development]] | Refer to [[Moodle Mobile Plugins Development]] | ||
=== Remote | === Remote add-on packaging === | ||
=== Remote | === Remote add-on publishing === | ||
Once you have a zip file containing the remote | Once you have a zip file containing the remote add-on, you must include it into the Moodle plugin. | ||
Please, refer to [[Activity_modules#mobile.php]] for instructions | Please, refer to [[Activity_modules#mobile.php]] for instructions. Basically you will need to create a db/mobile.php and place the zip file into mobile/addonname.zip |
Revision as of 09:25, 20 May 2016
Only available for Moodle 3.1 onwards.
A Moodle Mobile remote add-on is the mobile app version of a Moodle plugin that will be loaded when a user accesses the plugin on the app.
Moodle Mobile remote add-ons are stored within a Moodle plugin and are downloaded and lazy-loaded by the Mobile app in every site that uses them.
Moodle plugins can include several Mobile add-ons. They can also declare dependencies between plugins.
We can say that a remote add-on is a special version of a Moodle Mobile add-on. The main differences are:
- Mobile remote add-ons are placed inside Moodle plugins (outside the Mobile app).
- Mobile remote add-ons language files must include the whole component prefix.
- Mobile remote add-ons uses special placeholders for paths inside CSS files or Javascript code.
How to create a remote add-on
Remote add-ons must be developed first as standard Moodle Mobile add-ons and then packaged as a remote add-on.
These are the main required steps:
- Develop the required Moodle Web Services
- Develop a standard Moodle Mobile add-on
- Package the Moodle Mobile add-on as a remote add-on
- Include the remote add-on in your Moodle plugin
Web Services
Most of Mobile add-ons require Web Services to work, but in some cases (like add-ons implementing question types) it won't be necessary.
Please refer to Web services documentation, you have an example here: https://github.com/markn86/moodle-mod_certificate/blob/MOODLE_31_STABLE/classes/external.php
Once the Web Services are developed, you must include them into the Mobile service using the "services" field when declaring external functions, see: https://github.com/markn86/moodle-mod_certificate/blob/MOODLE_31_STABLE/db/services.php
Remember that this is only available from Moodle 3.1 onwards.
Mobile add-on
Refer to Moodle Mobile Plugins Development
Remote add-on packaging
Remote add-on publishing
Once you have a zip file containing the remote add-on, you must include it into the Moodle plugin.
Please, refer to Activity_modules#mobile.php for instructions. Basically you will need to create a db/mobile.php and place the zip file into mobile/addonname.zip