SlideShare une entreprise Scribd logo
1  sur  20
Télécharger pour lire hors ligne
Workshop
How to develop a new
plugin for Moodle Mobile
Juan Leyva
Moodlemoot Spain 2013
26, 27 y 28 September
Speakers
Juan Leyva
Moodle Developer (since 2003) working @ CV&A Consulting
Moodle Mobile official app creator and maintainer
Developer of plugins:
● Configurable Reports
● jmail
● LTI Provider
● UMM (Unofficial Moodle Mobile)
● Anonymous posting in forums, Collaborative real-time editor,
ConfigTabs, Forum discuss subscription,
What we are going to do
● Understand how Moodle Mobile talks with a Moodle installation
● Understand the basics about Moodle Mobile Architecture
● Set up your Moodle Mobile development environment
● Set up your Moodle installation
● Package a existing Webservice to be used inside a local plugin
● Configure new “Mobile Services” in your Moodle installation
● Set up your MoodleMobile app
● Develop a MoodleMobile plugin
● Change the name and appearance of your app
● Build your MoodleMobile rebranded app
The new plugin
● Display user grades in activities
How Moodle Mobile talks with Moodle
Moodle Mobile is a REST+JSON based
Web Services client
HTTPS is recommended
User session is emulated using unique
tokens
File upload and downloads are done
using standard HTTP requests
Moodle Mobile Architecture basics
Set up the development environment
● Install Google Chrome
● Create a direct access or script for launching Google Chrome
with these flags: --disable-web-security --allow-file-access-
from-files
● With Google Chrome and the F12 or "Developer tools" you can
emulate mobile devices changing user-agent, orientation,
resolution, geo-location, touch events, etc..
● Just open the Developers tools, click on the wheel bottom-right
corner to see the Override options.
● It's interesting also disabling the Cache (in general options)
Set up your Moodle Installation
● Enable debugging
● Disable all caches
● Enable WebServices in Advanced options
● Enable WebServices protocols (REST)
● Enable Mobile Services (in Plugins -> WebServices
-> Services)
Package an existing WebService
● https://github.com/cvaconsulting/moodle-
local_custommm
Configure the new service
● A service is a set of functions for an specific purpose. Since Moodle
2.1 there is a pre-built service for Moodle M.
● This service cannot be edited for adding new functions so we don't
have a simple way for make available our new Web Service function
to the mobile app.
● The only way for fix this is creating a new Service in Moodle, and
configuring our app for pointing to this new service.
● There are two ways of creating a Service in Moodle:
○ Using a db/services.php in your plugin as mentioned here:
External services description
○ Creating the service in your Moodle installation using the forms in
Admin > Plugins > Web Services > External Services
Configure the new service
● In this case we've created the service using the Moodle forms
because it gives more flexibility in some aspects.
● There is a big impediment, due tohttps://tracker.moodle.
org/browse/MDL-29807 in order to add a shortname for the new
Service, we have to edit manually the Moodle database for adding the
shortname in the dbprefix_external_services table
Set up your MoodleMobile app
● Download the last version of the MoodleMobile source code from
https://github.com/moodlehq/moodlemobile
● Edit the config.json file and change the wsservice parameter in order
to point to the shortname of the Service you created before.
● You have to add also the name of the plugin you are developing at the
final of the plugins parameter:
● "plugins" : ["notifications", "upload", "contents", "participants",
"addcontact", "addnote", "sendmessage", "grades"],
● Notice that, for avoid errors, this last change should be done once the
file plugins/grades/main.js file exists
Develop the MoodleMobile plugin
● https://github.com/cvaconsulting/moodlemobile-grades
● plugin/grades/lang/en.json - Contains the language strings
● plugin/grades/icon.png - The plugin icon
● plugin/grades/activities.html - The template for the activities list
● plugin/grades/activitygrade.html - The template for showing the
grade
● plugin/grades/main.js - The plugin's main code
Develop the MoodleMobile plugin
(main.js)
Develop the MoodleMobile plugin
(main.js)
Develop the MoodleMobile plugin
(main.js)
Develop the MoodleMobile plugin
(main.js)
Change the name an appearance
● Edit the config.xml to change the app name
● Replace all the icons found in the app
● Edit also the config.json file for additional changes
● Load a custom CSS from your plugin:
$('head').append('<link rel="stylesheet" href="plugins/myplugin/mycss.css" type="text/css" />');
MM.registerPlugin(plugin);
Build your MoodleMobile rebranded app
● Use PhoneGap Build https:
//build.phonegap.com/
● Create a free account
pointing to your github
repository or upload a zip file
with your app
● Sign the app using your
Android and iOs certificates
● Publish your app in Google
Play and Apple app Store
Thanks for coming!
You have more information here:
http://docs.moodle.org/dev/Moodle_Mobile

Contenu connexe

Tendances

Admin Critical Route for Moodle 2.4
 Admin Critical Route for Moodle 2.4 Admin Critical Route for Moodle 2.4
Admin Critical Route for Moodle 2.4
Maria Moodle
 

Tendances (20)

Creating Moodle Mobile remote themes (Moodle Moot US 2016)
Creating Moodle Mobile remote themes (Moodle Moot US 2016)Creating Moodle Mobile remote themes (Moodle Moot US 2016)
Creating Moodle Mobile remote themes (Moodle Moot US 2016)
 
Making your Moodle Mobile
Making your Moodle MobileMaking your Moodle Mobile
Making your Moodle Mobile
 
Moodle Mobile SCORM 1.2 player
Moodle Mobile SCORM 1.2 playerMoodle Mobile SCORM 1.2 player
Moodle Mobile SCORM 1.2 player
 
Tips for creating Moodle Mobile friendly courses sites - MoodleMoot Spain 2014
Tips for creating Moodle Mobile friendly courses sites - MoodleMoot Spain 2014Tips for creating Moodle Mobile friendly courses sites - MoodleMoot Spain 2014
Tips for creating Moodle Mobile friendly courses sites - MoodleMoot Spain 2014
 
Moodle & Moodle Mobile 3.1 Release Party Barcelona
Moodle  & Moodle Mobile 3.1 Release Party BarcelonaMoodle  & Moodle Mobile 3.1 Release Party Barcelona
Moodle & Moodle Mobile 3.1 Release Party Barcelona
 
Customising the moodle mobile experience
Customising the moodle mobile experienceCustomising the moodle mobile experience
Customising the moodle mobile experience
 
Mobile learning with moodle
Mobile learning with moodleMobile learning with moodle
Mobile learning with moodle
 
Ten years and onwards
Ten years and onwardsTen years and onwards
Ten years and onwards
 
How to improve your moodle site performance
How to improve your moodle site performanceHow to improve your moodle site performance
How to improve your moodle site performance
 
The Best Moodle Modules and Plugins
The Best Moodle Modules and PluginsThe Best Moodle Modules and Plugins
The Best Moodle Modules and Plugins
 
Some Essential Moodle 2 plugins
Some Essential Moodle 2 pluginsSome Essential Moodle 2 plugins
Some Essential Moodle 2 plugins
 
Admin Critical Route for Moodle 2.4
 Admin Critical Route for Moodle 2.4 Admin Critical Route for Moodle 2.4
Admin Critical Route for Moodle 2.4
 
Moodle
MoodleMoodle
Moodle
 
Engaging ways to use moodle (1)
Engaging ways to use moodle (1)Engaging ways to use moodle (1)
Engaging ways to use moodle (1)
 
Study of content management systems joomla and drupal
Study of content management systems joomla and drupalStudy of content management systems joomla and drupal
Study of content management systems joomla and drupal
 
Study of content management systems joomla and
Study of content management systems joomla andStudy of content management systems joomla and
Study of content management systems joomla and
 
Mobimooc 1 moodle
Mobimooc 1 moodleMobimooc 1 moodle
Mobimooc 1 moodle
 
Basics of Joomla!
Basics of Joomla! Basics of Joomla!
Basics of Joomla!
 
Best new features in moodle 3.1
Best new features in moodle 3.1Best new features in moodle 3.1
Best new features in moodle 3.1
 
Git for Moodle Administrators
Git for Moodle AdministratorsGit for Moodle Administrators
Git for Moodle Administrators
 

Similaire à Moodlemoot spain 2013. taller, creación de un plugin para moodle mobile

Inthiyaz-4.6Years-SharePoint
Inthiyaz-4.6Years-SharePointInthiyaz-4.6Years-SharePoint
Inthiyaz-4.6Years-SharePoint
Inthiyaz Pathan
 
SharePoint Saturday Belgium 2014 SharePoint Upgrade, real life experience and...
SharePoint Saturday Belgium 2014 SharePoint Upgrade, real life experience and...SharePoint Saturday Belgium 2014 SharePoint Upgrade, real life experience and...
SharePoint Saturday Belgium 2014 SharePoint Upgrade, real life experience and...
BIWUG
 
SPS Dubai Best Practice upgrading SharePoint from 2007/2010 to 2013 and 2013 SP1
SPS Dubai Best Practice upgrading SharePoint from 2007/2010 to 2013 and 2013 SP1SPS Dubai Best Practice upgrading SharePoint from 2007/2010 to 2013 and 2013 SP1
SPS Dubai Best Practice upgrading SharePoint from 2007/2010 to 2013 and 2013 SP1
Knut Relbe-Moe [MVP, MCT]
 

Similaire à Moodlemoot spain 2013. taller, creación de un plugin para moodle mobile (20)

Spring '22 SFMC Release Notes
Spring '22 SFMC Release NotesSpring '22 SFMC Release Notes
Spring '22 SFMC Release Notes
 
MAS202 - Customizing IBM Connections - Downloadable
MAS202 - Customizing IBM Connections - DownloadableMAS202 - Customizing IBM Connections - Downloadable
MAS202 - Customizing IBM Connections - Downloadable
 
MAS202 - Customizing IBM Connections
MAS202 - Customizing IBM ConnectionsMAS202 - Customizing IBM Connections
MAS202 - Customizing IBM Connections
 
Inthiyaz-4.6Years-SharePoint
Inthiyaz-4.6Years-SharePointInthiyaz-4.6Years-SharePoint
Inthiyaz-4.6Years-SharePoint
 
Patna MuleSoft Meetup | Exposing WEB GUI for DWL Mapping File
Patna MuleSoft Meetup | Exposing WEB GUI for DWL Mapping FilePatna MuleSoft Meetup | Exposing WEB GUI for DWL Mapping File
Patna MuleSoft Meetup | Exposing WEB GUI for DWL Mapping File
 
MuleSoft_Meetup_Exchange-Nexus-Publish_Asserts.pptx
MuleSoft_Meetup_Exchange-Nexus-Publish_Asserts.pptxMuleSoft_Meetup_Exchange-Nexus-Publish_Asserts.pptx
MuleSoft_Meetup_Exchange-Nexus-Publish_Asserts.pptx
 
Warsaw MuleSoft Meetup #13.pptx
Warsaw MuleSoft Meetup #13.pptxWarsaw MuleSoft Meetup #13.pptx
Warsaw MuleSoft Meetup #13.pptx
 
UX DURING MODULE INSTALLATION AND CONFIGURATION
UX DURING MODULE INSTALLATION AND CONFIGURATIONUX DURING MODULE INSTALLATION AND CONFIGURATION
UX DURING MODULE INSTALLATION AND CONFIGURATION
 
Cracow MuleSoft Meetup #1
Cracow MuleSoft Meetup #1Cracow MuleSoft Meetup #1
Cracow MuleSoft Meetup #1
 
SPSBE14 SPSBE02 SharePoint Upgrade reel life experience, best practices
SPSBE14 SPSBE02 SharePoint Upgrade reel life experience, best practicesSPSBE14 SPSBE02 SharePoint Upgrade reel life experience, best practices
SPSBE14 SPSBE02 SharePoint Upgrade reel life experience, best practices
 
SharePoint Saturday Belgium 2014 SharePoint Upgrade, real life experience and...
SharePoint Saturday Belgium 2014 SharePoint Upgrade, real life experience and...SharePoint Saturday Belgium 2014 SharePoint Upgrade, real life experience and...
SharePoint Saturday Belgium 2014 SharePoint Upgrade, real life experience and...
 
SPS Dubai Best Practice upgrading SharePoint from 2007/2010 to 2013 and 2013 SP1
SPS Dubai Best Practice upgrading SharePoint from 2007/2010 to 2013 and 2013 SP1SPS Dubai Best Practice upgrading SharePoint from 2007/2010 to 2013 and 2013 SP1
SPS Dubai Best Practice upgrading SharePoint from 2007/2010 to 2013 and 2013 SP1
 
Moodle integration with microsoft office 365 by enovation
Moodle integration with microsoft office 365 by enovationMoodle integration with microsoft office 365 by enovation
Moodle integration with microsoft office 365 by enovation
 
Architecture and Analytical Study of Magento
Architecture and Analytical Study of MagentoArchitecture and Analytical Study of Magento
Architecture and Analytical Study of Magento
 
Integrate Shindig with Joomla
Integrate Shindig with JoomlaIntegrate Shindig with Joomla
Integrate Shindig with Joomla
 
MuleSoft meetup__houston #13
MuleSoft meetup__houston #13MuleSoft meetup__houston #13
MuleSoft meetup__houston #13
 
Techjoomla Infrastructure Extensions - Adding an Enterprise Layer to Joomla!
Techjoomla Infrastructure Extensions - Adding an Enterprise Layer to Joomla!Techjoomla Infrastructure Extensions - Adding an Enterprise Layer to Joomla!
Techjoomla Infrastructure Extensions - Adding an Enterprise Layer to Joomla!
 
Nuxeo Platform LTS 2016 - Roadmap
Nuxeo Platform LTS 2016 - RoadmapNuxeo Platform LTS 2016 - Roadmap
Nuxeo Platform LTS 2016 - Roadmap
 
Angular - Chapter 3 - Components
Angular - Chapter 3 - ComponentsAngular - Chapter 3 - Components
Angular - Chapter 3 - Components
 
Mobilesoft presentation
Mobilesoft presentationMobilesoft presentation
Mobilesoft presentation
 

Plus de Juan Leyva Delgado

Moodlemoot spain 2013. nuevos estándares de tecnologías aplicadas a la educ...
Moodlemoot spain 2013. nuevos estándares de tecnologías aplicadas a la educ...Moodlemoot spain 2013. nuevos estándares de tecnologías aplicadas a la educ...
Moodlemoot spain 2013. nuevos estándares de tecnologías aplicadas a la educ...
Juan Leyva Delgado
 
Moodlemoot spain 2013. actualización a moodle 2 enfoque técnico
Moodlemoot spain 2013. actualización a moodle 2  enfoque técnicoMoodlemoot spain 2013. actualización a moodle 2  enfoque técnico
Moodlemoot spain 2013. actualización a moodle 2 enfoque técnico
Juan Leyva Delgado
 

Plus de Juan Leyva Delgado (10)

Seven tips for mobile course design
Seven tips for mobile course designSeven tips for mobile course design
Seven tips for mobile course design
 
Mastering Moodle Web Services development
Mastering Moodle Web Services developmentMastering Moodle Web Services development
Mastering Moodle Web Services development
 
Moodlemoot spain 2013. nuevos estándares de tecnologías aplicadas a la educ...
Moodlemoot spain 2013. nuevos estándares de tecnologías aplicadas a la educ...Moodlemoot spain 2013. nuevos estándares de tecnologías aplicadas a la educ...
Moodlemoot spain 2013. nuevos estándares de tecnologías aplicadas a la educ...
 
Moodlemoot spain 2013. actualización a moodle 2 enfoque técnico
Moodlemoot spain 2013. actualización a moodle 2  enfoque técnicoMoodlemoot spain 2013. actualización a moodle 2  enfoque técnico
Moodlemoot spain 2013. actualización a moodle 2 enfoque técnico
 
Moodle en dispositivos móviles (MoodleMoot Spain 2011)
Moodle en dispositivos móviles (MoodleMoot Spain 2011)Moodle en dispositivos móviles (MoodleMoot Spain 2011)
Moodle en dispositivos móviles (MoodleMoot Spain 2011)
 
Moodle 2.0 Novedades (MoodleMoot Spain 2010)
Moodle 2.0 Novedades (MoodleMoot Spain 2010)Moodle 2.0 Novedades (MoodleMoot Spain 2010)
Moodle 2.0 Novedades (MoodleMoot Spain 2010)
 
Presentando a Python
Presentando a PythonPresentando a Python
Presentando a Python
 
Taller de mensajería bajo Jabber
Taller de mensajería bajo JabberTaller de mensajería bajo Jabber
Taller de mensajería bajo Jabber
 
Libro de Calificaciones en Moodle 1.9.4 (MoodleMoot Spain 2008)
Libro de Calificaciones en Moodle 1.9.4 (MoodleMoot Spain 2008)Libro de Calificaciones en Moodle 1.9.4 (MoodleMoot Spain 2008)
Libro de Calificaciones en Moodle 1.9.4 (MoodleMoot Spain 2008)
 
Roles en Moodle 1.9 (MoodleMoot Spain 2009)
Roles en Moodle 1.9 (MoodleMoot Spain 2009)Roles en Moodle 1.9 (MoodleMoot Spain 2009)
Roles en Moodle 1.9 (MoodleMoot Spain 2009)
 

Dernier

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

Moodlemoot spain 2013. taller, creación de un plugin para moodle mobile

  • 1. Workshop How to develop a new plugin for Moodle Mobile Juan Leyva Moodlemoot Spain 2013 26, 27 y 28 September
  • 2. Speakers Juan Leyva Moodle Developer (since 2003) working @ CV&A Consulting Moodle Mobile official app creator and maintainer Developer of plugins: ● Configurable Reports ● jmail ● LTI Provider ● UMM (Unofficial Moodle Mobile) ● Anonymous posting in forums, Collaborative real-time editor, ConfigTabs, Forum discuss subscription,
  • 3. What we are going to do ● Understand how Moodle Mobile talks with a Moodle installation ● Understand the basics about Moodle Mobile Architecture ● Set up your Moodle Mobile development environment ● Set up your Moodle installation ● Package a existing Webservice to be used inside a local plugin ● Configure new “Mobile Services” in your Moodle installation ● Set up your MoodleMobile app ● Develop a MoodleMobile plugin ● Change the name and appearance of your app ● Build your MoodleMobile rebranded app
  • 4. The new plugin ● Display user grades in activities
  • 5. How Moodle Mobile talks with Moodle Moodle Mobile is a REST+JSON based Web Services client HTTPS is recommended User session is emulated using unique tokens File upload and downloads are done using standard HTTP requests
  • 7. Set up the development environment ● Install Google Chrome ● Create a direct access or script for launching Google Chrome with these flags: --disable-web-security --allow-file-access- from-files ● With Google Chrome and the F12 or "Developer tools" you can emulate mobile devices changing user-agent, orientation, resolution, geo-location, touch events, etc.. ● Just open the Developers tools, click on the wheel bottom-right corner to see the Override options. ● It's interesting also disabling the Cache (in general options)
  • 8. Set up your Moodle Installation ● Enable debugging ● Disable all caches ● Enable WebServices in Advanced options ● Enable WebServices protocols (REST) ● Enable Mobile Services (in Plugins -> WebServices -> Services)
  • 9. Package an existing WebService ● https://github.com/cvaconsulting/moodle- local_custommm
  • 10. Configure the new service ● A service is a set of functions for an specific purpose. Since Moodle 2.1 there is a pre-built service for Moodle M. ● This service cannot be edited for adding new functions so we don't have a simple way for make available our new Web Service function to the mobile app. ● The only way for fix this is creating a new Service in Moodle, and configuring our app for pointing to this new service. ● There are two ways of creating a Service in Moodle: ○ Using a db/services.php in your plugin as mentioned here: External services description ○ Creating the service in your Moodle installation using the forms in Admin > Plugins > Web Services > External Services
  • 11. Configure the new service ● In this case we've created the service using the Moodle forms because it gives more flexibility in some aspects. ● There is a big impediment, due tohttps://tracker.moodle. org/browse/MDL-29807 in order to add a shortname for the new Service, we have to edit manually the Moodle database for adding the shortname in the dbprefix_external_services table
  • 12. Set up your MoodleMobile app ● Download the last version of the MoodleMobile source code from https://github.com/moodlehq/moodlemobile ● Edit the config.json file and change the wsservice parameter in order to point to the shortname of the Service you created before. ● You have to add also the name of the plugin you are developing at the final of the plugins parameter: ● "plugins" : ["notifications", "upload", "contents", "participants", "addcontact", "addnote", "sendmessage", "grades"], ● Notice that, for avoid errors, this last change should be done once the file plugins/grades/main.js file exists
  • 13. Develop the MoodleMobile plugin ● https://github.com/cvaconsulting/moodlemobile-grades ● plugin/grades/lang/en.json - Contains the language strings ● plugin/grades/icon.png - The plugin icon ● plugin/grades/activities.html - The template for the activities list ● plugin/grades/activitygrade.html - The template for showing the grade ● plugin/grades/main.js - The plugin's main code
  • 14. Develop the MoodleMobile plugin (main.js)
  • 15. Develop the MoodleMobile plugin (main.js)
  • 16. Develop the MoodleMobile plugin (main.js)
  • 17. Develop the MoodleMobile plugin (main.js)
  • 18. Change the name an appearance ● Edit the config.xml to change the app name ● Replace all the icons found in the app ● Edit also the config.json file for additional changes ● Load a custom CSS from your plugin: $('head').append('<link rel="stylesheet" href="plugins/myplugin/mycss.css" type="text/css" />'); MM.registerPlugin(plugin);
  • 19. Build your MoodleMobile rebranded app ● Use PhoneGap Build https: //build.phonegap.com/ ● Create a free account pointing to your github repository or upload a zip file with your app ● Sign the app using your Android and iOs certificates ● Publish your app in Google Play and Apple app Store
  • 20. Thanks for coming! You have more information here: http://docs.moodle.org/dev/Moodle_Mobile