Sunday, June 28, 2015

Setting up the development Environment for Moodle Mobile v 2.0


In this blog post I will mainly discuss on how I set up the development environment for Moodle Mobile v 2.0 in my computer. Actually this took approximately week and half . I am a windows user and when I tried setting up it in my windows 7 , it did not work. I tried , tried thinking that I would fly someday but could not actually take off until I shifted my track to Ubuntu. So I have made up computer to dual boot both the Ubuntu and Windows. In this post I will be explaining how to set up your development environment in Ubuntu 14.04 .

When setting up the environment, first we need to set up the Moodle web site instance in our machine. The newest version, 2.9 of moodle should be installed in your machine.

By going through this you will able to install the latest version (2.9) of Moodle in to your Ubuntu environment.

After installing and making Moodle Up and running, then you have to install  "the Moodle Mobile additional features plugin for Moodle 2.9 ". By going through this link , you will be able to successfully install it.

Then fork the repository from https://github.com/moodlehq/moodlemobile2 and clone the forked repository to the computer.

So now we are left with setting up the Moodle Mobile. By following the below described steps, you will be able to successfully set up Moodle Mobile in your Ubuntu environment.

Steps 

  • Installing nodejs to the computer
Open the terminal and type sudo apt-get install nodejs command and then type sudo apt-get install npm to install npm. Then type sudo apt-get install nodejs-legacy as well. After the installation type node --version and it will out put the installed nodejs version as follows.







  • Install ionic and cordova to the computer

Go to the terminal and use this command sudo npm install -g ionic to install ionic and sudo npm install -g cordova to install cordova. This will install ionic and cordova in your computer.

  • Adding platforms
CD in to the moodlemobile2 directory and type ionic platform add ios android. This will add the platforms to the moodlemobile and will create two folders named android and IOS and a json file named platforms.json in the /moodlemobile2/platforms.


  • Adding all the plugins listed in the package.json file
CD in to the moodlemobile2 directory and type ionic plugin add org.apache.cordova.globalization org.apache.cordova.file org.apache.cordova.inappbrowser org.apache.cordova.file-transfer org.apache.cordova.network-information org.apache.cordova.camera org.apache.cordova.media-capture


  • Installing the dependencies
CD in to the moodlemobile2 directory and type npm install. This will install the dependencies which are listed in the package.json


  • Installing 3rd party libraries .
CD in to the moodlemobile2 directory and type sudo npm install -g bower to install bower and then type bower install to add all the 3rd party libraries which are listed in the bower.json


  • Creating JS file bundles
CD in to the moodlemobile2 directory and type sudo npm install -g gulp to install gulp and then type gulp to create JS file bundles.


  • Running moodle mobile v 2.0
In order to work with moodle mobile v 2.0 we need to install google chromium browser. We can install it through terminal by typing sudo apt-get install chromium-browser . This will install chromium browser. We need to run this chromium browser with the flags , in order to access remote sites. This can be done by typing the following command. chromium-browser --allow-file-access-from-files --disable-web-security

Then type ionic serve to start the ionic server in localhost:8100 . Moodle mobile will be run on this.



So now we have finished setting up the development Environment for Moodle Mobile v 2.0. Now the coding begins. In the next post I will be discussing about the first component I started developing. Till then see you guys and Happy Coding. :D

Sunday, June 21, 2015

Finalized Spec for the project - Javascript based SCORM 1.2 Player for the new moodle mobile app

In this blog post I will be mainly discussing about the specifications of the project that I am working on for GSOC 2015. When we look at the project in an overall view, this project ideally has two main components that need to be developed. First one is the additional web services for the Moodle site and the second one is the SCORM player. The web services will be developed by the developers in the moodle HQ . (By the time I publish this bog post they have already developed most of the web services).

Moodle Requirements 

SCORM Module Changes

 In order to make possible to play SCORM packages in online and offline modes, the Mobile app needs to download the complete zip SCORM package and extract to the local sdcard/storage system.

The Mobile app will notify the user if the SCORM package is supported, checking if the package was uploaded or downloaded via URL, if the “Allow to download complete SCORM packages” is enabled, and if there is enough free space in the device.

The Moodle guys have also created some new external web services for the moodle as well which are supposed to use in the SCORM mobile application. Following are the new web services.

mod_scorm_get_scorms_by_courses

Parameters: list of course ids
Returns: A list of SCORM packages module settings in the specified courses, including only the settings the user may see

mod_scorm_get_scorm_attempts

Parameters: scormid and userid
Returns: A list containing information of all the attempts done by the specified user id

This will be used to know the current attempt status for the user (last attempt, etc..)

mod_scorm_get_scorm_scoes

Parameters: scormid
Returns a list of scoes inside the specified scorm

mod_scorm_get_scorm_user_data

Parameters: userid, attempt
Returns all the user tracks for all the scorm scoes (including objectives and interactions)
This will be used for preparing the API runtime data

mod_scorm_insert_scorm_track

Parameters: scoid, userid, attempt, element, value
Inserts track information about a SCO
Returns: true or false (success or not)

Moodle Mobile Requirements


The SCORM player will be an AngularJS module integrated in a Mobile app addon. It will be responsible for:
  1. Parsing the imsmanifest.xml file in order to display the available Organizations and Structures inside the package.
  2. Displaying a basic SCORM player with a basic menu tree.
  3. Implementing a basic runtime support in order to retrieve the SCOs tracking information (including objectives and interactions) and sending tracking information too.

The SCORM player will be an AngularJS player that will communicate with the Mobile app SCORM add-on via the SCORM runtime.


Moodle Mobile SCORM addon

A new addon for the SCORM module that will contain the AngularJS SCORM player and will perform the following tasks:
  • Downloading and synchronizing the SCORM zip package
  • Unzipping the package into the device persistent storage
  • Populating the SCORM SCO’s default tracking information
  • Storing and synchronizing tracking information with Moodle via Web Service

In order to do that, the SCORM player (AngularJS module) will have to communicate with the addon via the API runtime (functions LMSInitialize, LMSGetValue, LMSSetValue)

So the above features are finalized specification of this project. If you like to see some more features in the SCORM mobile player please feel free to leave them as comments.

Till next post -------------- Happy Coding ----------------------------------------