Skip to content

Instantly share code, notes, and snippets.

@abhi9bakshi
Last active June 1, 2022 08:15

Revisions

  1. abhi9bakshi revised this gist Dec 17, 2016. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -485,4 +485,10 @@ Launch URL: http://10.0.3.215/TinCan_Prototypes/GolfExample_TCAPI/index.html //
    Activity ID: https://id.tincanapi.com/activity/tincan-prototypes/golf-example
    ```
    Leave all other settings to default and click on `Save and display`.
    Leave all other settings to default and click on `Save and display`. Now if you visit `Site Home`, you will see a link to Golf Course with Tin Can Logo. Launch that course to record statements to LRS.
    ##Fetching activity streams from Learning Locker to Moodle
    Go to _Site Home_. In the left panel, click on `Add a block` and choose _Tin Can Learner Stream_. If it is configured properly, you will see streams being fetched from the LRS to Moodle.
  2. abhi9bakshi revised this gist Dec 16, 2016. 1 changed file with 7 additions and 4 deletions.
    11 changes: 7 additions & 4 deletions tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -477,9 +477,12 @@ Identify by email: Yes
    4. Now an option becomes visible on the site home, **Add an activity or resource**. Click on that and choose `Tin Can Launch Link`
    5. Configure the launch link settings as follows:
    * Launch link name: Golf Course
    * Description: Golf Course
    * Launch URL: http://10.0.3.215/TinCan_Prototypes/GolfExample_TCAPI/index.html //Replace 10.0.3.215 with your IP
    * Activity ID: https://id.tincanapi.com/activity/tincan-prototypes/golf-example
    ```
    Launch link name: Golf Course
    Description: Golf Course
    Launch URL: http://10.0.3.215/TinCan_Prototypes/GolfExample_TCAPI/index.html //Replace 10.0.3.215 with your IP
    Activity ID: https://id.tincanapi.com/activity/tincan-prototypes/golf-example
    ```
    Leave all other settings to default and click on `Save and display`.
  3. abhi9bakshi revised this gist Dec 16, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -456,7 +456,7 @@ Refer the following \[[video](https://www.youtube.com/watch?v=qJxO4Ene2kM)\] for
    For my setup, the settings are as follows:
    ```
    Endpoint: http://10.0.3.215/learninglocker
    Endpoint: http://10.0.3.215/learninglocker/data/xAPI/ //Replace 10.0.3.215 with your IP
    LRS integration: LearningLocker
    Basic Login: e9ab800b8de14d0f2336bf0c5def40b25c9b2c3f //Copied from LRS earlier
    Basic Password: bd5d4958622ebf68f2ec96887ae9a753ca59960c //Copied from LRS earlier
    @@ -479,7 +479,7 @@ Identify by email: Yes
    5. Configure the launch link settings as follows:
    * Launch link name: Golf Course
    * Description: Golf Course
    * Launch URL: https://localhost/TinCan_Prototypes/GolfExample_TCAPI/index.html
    * Launch URL: http://10.0.3.215/TinCan_Prototypes/GolfExample_TCAPI/index.html //Replace 10.0.3.215 with your IP
    * Activity ID: https://id.tincanapi.com/activity/tincan-prototypes/golf-example
    Leave all other settings to default and click on `Save and display`.
  4. abhi9bakshi revised this gist Dec 16, 2016. 1 changed file with 18 additions and 2 deletions.
    20 changes: 18 additions & 2 deletions tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -412,7 +412,7 @@ After that, create a new LRS by clicking on the `LRS` button in left pane, and t
    You can get readymade TinCan API prototypes at [github](https://github.com/RusticiSoftware/TinCan_Prototypes). Download them inside LMSprototype container and make sure to update submodules.
    ```bash
    cd /var/www
    cd /var/www/html/
    sudo git clone https://github.com/RusticiSoftware/TinCan_Prototypes.git
    cd TinCan_Prototypes
    sudo git submodule update --init --recursive
    @@ -466,4 +466,20 @@ Identify by email: Yes
    ```
    ##Creating a new course in Moodle
    ##Creating a new course in Moodle
    1. In moodle dashboard, go to _Site Administration -> Courses -> Manage Courses and Categories -> Create New Course_
    2. Name the course `Golf` for both full and short name, leave other settings to default and click on `Save and Return`.
    3. Now, click on `Site Home` from the left pane, then click on the cog symbol in the top right corner and choose `Turn editing on`.
    4. Now an option becomes visible on the site home, **Add an activity or resource**. Click on that and choose `Tin Can Launch Link`
    5. Configure the launch link settings as follows:
    * Launch link name: Golf Course
    * Description: Golf Course
    * Launch URL: https://localhost/TinCan_Prototypes/GolfExample_TCAPI/index.html
    * Activity ID: https://id.tincanapi.com/activity/tincan-prototypes/golf-example
    Leave all other settings to default and click on `Save and display`.
  5. abhi9bakshi revised this gist Dec 16, 2016. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -414,6 +414,7 @@ You can get readymade TinCan API prototypes at [github](https://github.com/Rusti
    ```bash
    cd /var/www
    sudo git clone https://github.com/RusticiSoftware/TinCan_Prototypes.git
    cd TinCan_Prototypes
    sudo git submodule update --init --recursive
    ```
    @@ -462,4 +463,7 @@ Basic Password: bd5d4958622ebf68f2ec96887ae9a753ca59960c //Copied from LRS earli
    Duration: 9000
    Custom account homePage :
    Identify by email: Yes
    ```
    ```
    ##Creating a new course in Moodle
  6. abhi9bakshi revised this gist Dec 16, 2016. 1 changed file with 14 additions and 7 deletions.
    21 changes: 14 additions & 7 deletions tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -402,6 +402,8 @@ Test working learninglocker installation by visiting that address e.g.`10.0.3.15
    Upon successful registration, the first thing you need to do is to verify newly created user. On the left menu, go to “Users”. You’ll see a list with just one user, the admin you just created. On the status column, click on the “verified” button to manually verify this user.
    After that, create a new LRS by clicking on the `LRS` button in left pane, and then on `Create an LRS`. Name the LRS `TinCan test`. Once created, go to `Manage clients` and copy the _username_ and _password_ of the first client to be used later.
    #_Part 4: Tin Can API_
    @@ -417,12 +419,6 @@ sudo git submodule update --init --recursive
    ##Installing tincan plugins for moodle
    Download the following tin can plugins as zip from the github repository
    1. Tin Can Launck LInk: [https://github.com/garemoko/moodle-mod_tincanlaunch](https://github.com/garemoko/moodle-mod_tincanlaunch)
    2. Tin Can Learner Stream: [https://github.com/garemoko/moodle-mod_tincanlearnerstream](https://github.com/garemoko/moodle-mod_tincanlearnerstream)
    Now login back to moodle by visiting your address, e.g. `10.0.3.215/moodle`. Click on _Site Administration -> Plugins -> Install Plugins -> Install Plugins from Moodle Plugins directory._
    After successfully logging in, search for the plugin `tincan` in the plugins directory and then install the following two plugins:
    @@ -455,4 +451,15 @@ sudo chown -R root /var/www/moodle
    ##Configuring moodle tincan api to communicate with learninglocker
    Refer the following \[[video](https://www.youtube.com/watch?v=qJxO4Ene2kM)\] for details on configuring **Tin Can Launch Link** and **Tin Can Learner Stream**
    Refer the following \[[video](https://www.youtube.com/watch?v=qJxO4Ene2kM)\] for details on configuring **Tin Can Launch Link** and **Tin Can Learner Stream**
    For my setup, the settings are as follows:
    ```
    Endpoint: http://10.0.3.215/learninglocker
    LRS integration: LearningLocker
    Basic Login: e9ab800b8de14d0f2336bf0c5def40b25c9b2c3f //Copied from LRS earlier
    Basic Password: bd5d4958622ebf68f2ec96887ae9a753ca59960c //Copied from LRS earlier
    Duration: 9000
    Custom account homePage :
    Identify by email: Yes
    ```
  7. abhi9bakshi revised this gist Dec 16, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -455,4 +455,4 @@ sudo chown -R root /var/www/moodle
    ##Configuring moodle tincan api to communicate with learninglocker
    Refer the following \[[video](https://www.youtube.com/watch?v=qJxO4Ene2kM)\] for details on settings for **Tin Can Launch Link** and **Tin Can Learner Stream**
    Refer the following \[[video](https://www.youtube.com/watch?v=qJxO4Ene2kM)\] for details on configuring **Tin Can Launch Link** and **Tin Can Learner Stream**
  8. abhi9bakshi revised this gist Dec 16, 2016. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -453,5 +453,6 @@ sudo chown -R www-data:www-data /var/www/moodle/
    sudo chown -R root /var/www/moodle
    ```
    ##Configuring moodle tincan api to communicate with learninglocker
    ##Configuring moodle tincan api to communicate with learninglocker
    Refer the following \[[video](https://www.youtube.com/watch?v=qJxO4Ene2kM)\] for details on settings for **Tin Can Launch Link** and **Tin Can Learner Stream**
  9. abhi9bakshi revised this gist Dec 16, 2016. 1 changed file with 32 additions and 1 deletion.
    33 changes: 32 additions & 1 deletion tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -423,4 +423,35 @@ Download the following tin can plugins as zip from the github repository
    2. Tin Can Learner Stream: [https://github.com/garemoko/moodle-mod_tincanlearnerstream](https://github.com/garemoko/moodle-mod_tincanlearnerstream)
    Now login back to moodle by visiting your address, e.g. `10.0.3.215/moodle`. Click on _Site Administration -> Plugins -> Install Plugins -> Install Plugins from Moodle Plugins directory._
    Now login back to moodle by visiting your address, e.g. `10.0.3.215/moodle`. Click on _Site Administration -> Plugins -> Install Plugins -> Install Plugins from Moodle Plugins directory._
    After successfully logging in, search for the plugin `tincan` in the plugins directory and then install the following two plugins:
    1. xAPI Launch Link
    * Go to plugin page
    * From the right pane, choose moodle version as 3.1
    * Download the plugin as zip
    2. Tin Can Learner Stream
    * Go to plugin page
    * From the right pane, choose moodle version as 2.5
    * Download the plugin as zip
    Now, go back to your moodle site, click on _Site Administration -> Plugins -> Install Plugins_ and drop the downloaded zip files one by one to install them.
    **Note: If you face '\[Error\]Write access check' problem, change ownership of moodle root by typing**
    ```bash
    sudo chown -R www-data:www-data /var/www/moodle/
    ```
    **Dont forget to set the ownership back to root user by typing**
    ```bash
    sudo chown -R root /var/www/moodle
    ```
    ##Configuring moodle tincan api to communicate with learninglocker
  10. abhi9bakshi revised this gist Dec 16, 2016. 1 changed file with 7 additions and 5 deletions.
    12 changes: 7 additions & 5 deletions tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -415,10 +415,12 @@ sudo git clone https://github.com/RusticiSoftware/TinCan_Prototypes.git
    sudo git submodule update --init --recursive
    ```
    Now login back to moodle by visiting your address, e.g. `10.0.3.215/moodle`. Click on _Site Administration -> Plugins -> Install Plugins -> Install Plugins from Moodle Plugins directory._
    ##Installing tincan plugins for moodle
    Login using your moodle account and then search for `tincan`
    Download the following tin can plugins as zip from the github repository
    From the results returned, install the plugins
    * xAPI Launch Link
    * Tin Can Learner Stream
    1. Tin Can Launck LInk: [https://github.com/garemoko/moodle-mod_tincanlaunch](https://github.com/garemoko/moodle-mod_tincanlaunch)
    2. Tin Can Learner Stream: [https://github.com/garemoko/moodle-mod_tincanlearnerstream](https://github.com/garemoko/moodle-mod_tincanlearnerstream)
    Now login back to moodle by visiting your address, e.g. `10.0.3.215/moodle`. Click on _Site Administration -> Plugins -> Install Plugins -> Install Plugins from Moodle Plugins directory._
  11. abhi9bakshi revised this gist Dec 16, 2016. 1 changed file with 13 additions and 11 deletions.
    24 changes: 13 additions & 11 deletions tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -407,16 +407,18 @@ Upon successful registration, the first thing you need to do is to verify newly
    ##Getting tin can prototypes
    Now that we are done with setting up a container, we can start working on our setup. You can get readymade TinCan API prototypes at [github](https://github.com/RusticiSoftware/TinCan_Prototypes)
    Download(git clone) them inside LMSprototype container and make sure to update submodules.
    You can get readymade TinCan API prototypes at [github](https://github.com/RusticiSoftware/TinCan_Prototypes). Download them inside LMSprototype container and make sure to update submodules.
    ```bash
    cd /home/ubuntu
    mkdir Documents
    cd Documents
    mkdir LMSprototype
    cd LMSprototype
    git clone https://github.com/RusticiSoftware/TinCan_Prototypes.git
    git submodule update --init --recursive
    ```
    cd /var/www
    sudo git clone https://github.com/RusticiSoftware/TinCan_Prototypes.git
    sudo git submodule update --init --recursive
    ```
    Now login back to moodle by visiting your address, e.g. `10.0.3.215/moodle`. Click on _Site Administration -> Plugins -> Install Plugins -> Install Plugins from Moodle Plugins directory._
    Login using your moodle account and then search for `tincan`
    From the results returned, install the plugins
    * xAPI Launch Link
    * Tin Can Learner Stream
  12. abhi9bakshi revised this gist Dec 16, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -400,7 +400,7 @@ ifconfig eth0 | grep "inet addr" | cut -d ':' -f 2 | cut -d ' ' -f 1
    Test working learninglocker installation by visiting that address e.g.`10.0.3.15/learninglocker` in your preferred web browser.
    The first thing to do is to verify this newly created user. On the left menu, go to “Users”. You’ll see a list with just one user, the admin you just created. On the status column, click on the “verified” button to manually verify this user.
    Upon successful registration, the first thing you need to do is to verify newly created user. On the left menu, go to “Users”. You’ll see a list with just one user, the admin you just created. On the status column, click on the “verified” button to manually verify this user.
    #_Part 4: Tin Can API_
  13. abhi9bakshi revised this gist Dec 16, 2016. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -400,6 +400,8 @@ ifconfig eth0 | grep "inet addr" | cut -d ':' -f 2 | cut -d ' ' -f 1
    Test working learninglocker installation by visiting that address e.g.`10.0.3.15/learninglocker` in your preferred web browser.
    The first thing to do is to verify this newly created user. On the left menu, go to “Users”. You’ll see a list with just one user, the admin you just created. On the status column, click on the “verified” button to manually verify this user.
    #_Part 4: Tin Can API_
  14. abhi9bakshi revised this gist Dec 15, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -35,6 +35,7 @@ Note: To
    * Exit the LXC console, you can use command `Ctrl+a` followed by `q`.
    * Stop the LXC container, you can use command `sudo lxc-stop --name LMSprototype`.
    * Destroy it permanently, use `sudo lxc-destroy --name LMSprototype`.
    * Migrate container to another host, refer [this](http://stackoverflow.com/questions/23427129/how-do-i-backup-move-lxc-containers) tutorial.


    #_Part 2: Moodle_
  15. abhi9bakshi revised this gist Dec 15, 2016. 1 changed file with 55 additions and 26 deletions.
    81 changes: 55 additions & 26 deletions tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -235,6 +235,18 @@ Change ownership of moodle path back to root user
    sudo chown -R root /var/www/moodle
    ```

    Add an alias for moodle in apache configuration
    ```bash
    //Open the 000-default.conf file
    sudo nano /etc/apache2/sites-enabled/000-default.conf

    //Add the following line below 'DocumentRoot /var/www/html'
    Alias /moodle "/var/www/moodle/"

    //Restart apache server
    sudo service apache2 restart
    ```

    Get the IP address of your LXC container by typing folowing command inside LXC shell
    ```bash
    ifconfig eth0 | grep "inet addr" | cut -d ':' -f 2 | cut -d ' ' -f 1
    @@ -250,19 +262,6 @@ $CFG->wwwroot = 'http://localhost/moodle';
    $CFG->wwwroot = 'http://10.0.3.15/moodle';
    ```

    Add an alias for moodle in apache configuration
    ```bash
    //Open the 000-default.conf file
    cd /etc/apache2/sites-enabled/
    sudo nano 000-default.conf

    //Add the following line below 'DocumentRoot /var/www/html'
    Alias /moodle "/var/www/moodle/"

    //Restrat apache server
    sudo service apache2 restart
    ```

    Test working moodle installation by visiting that address e.g.`10.0.3.15/moodle` in your preferred web browser.
    Create an account at [moodle.org](moodle.org) for getting full experience of moodle without any restrictions.

    @@ -345,33 +344,63 @@ sudo nano /var/www/learninglocker/app/config/database.php
    'database' => 'learninglocker'
    ```
    Run Install
    Download dependencies and migrate database
    ```bash
    cd /var/www/learninglocker/
    sudo composer install
    sudo php artisan migrate
    ```
    #Errors
    Generate APP_KEY
    ```bash
    //////////////////////////////
    sudo apt-get install curl nano apache2 php7.0 php-mongodb php7.0-mcrypt git nodejs npm mysql-server postfix
    cd /var/www/learninglocker/
    sudo php artisan key:generate
    ```
    sudo apt-get install curl nano apache2 php7.0 php-mongodb php7.0-mcrypt git mysql-server postfix
    Change the ownership of everything within learninglocker
    ```bash
    cd /var/www/learninglocker
    sudo chown -R www-data:www-data *
    ```
    Add an alias for learninglocker in apache configuration \[[ref](https://github.com/LearningLocker/learninglocker/issues/480)\]
    ```bash
    //Open the 000-default.conf file
    sudo nano /etc/apache2/sites-enabled/000-default.conf
    //Add the following lines below 'DocumentRoot /var/www/html'
    Alias /learninglocker "/var/www/learninglocker/public/"
    <Directory "/var/www/learninglocker/public/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>
    ```
    https://groups.google.com/forum/#!msg/learning-locker/TPbdtmfCxhM/3623QRwWDAAJ
    http://askubuntu.com/questions/756181/installing-php-5-6-on-xenial-16-04
    Add corresponding code to .htaccess file
    ```bash
    sudo nano /var/www/learninglocker/public/.htaccess
    //Add the following line below 'RewriteEngine On'
    RewriteBase /learninglocker
    ```
    /////////////////
    sudo apt-get install vim apache2 mysql-client mysql-server php5.6 libapache2-mod-php5.6 graphviz aspell php5.6-pspell php5.6-curl php5.6-gd php5.6-intl php5.6-mysql php5.6-xml php5.6-xmlrpc php5.6-ldap php5.6-zip git git-core nano
    Enable some modules and restart Apache server
    ```bash
    sudo a2enmod rewrite negotiation php5.6
    sudo service apache2 restart
    ```
    //////////////////
    Discussion: https://groups.google.com/forum/#!msg/learning-locker/TPbdtmfCxhM/3623QRwWDAAJ
    Downgrading to php5: http://askubuntu.com/questions/756181/installing-php-5-6-on-xenial-16-04
    //////////////////
    Get the IP address of your LXC container by typing folowing command inside LXC shell
    ```bash
    ifconfig eth0 | grep "inet addr" | cut -d ':' -f 2 | cut -d ' ' -f 1
    ```
    Test working learninglocker installation by visiting that address e.g.`10.0.3.15/learninglocker` in your preferred web browser.
    #_Part 4: Tin Can API_
    ##Getting tin can prototypes
  16. abhi9bakshi revised this gist Dec 15, 2016. 1 changed file with 7 additions and 8 deletions.
    15 changes: 7 additions & 8 deletions tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -287,7 +287,7 @@ sudo service mongod start
    ##Installing Learning Locker

    ```bash
    sudo apt-get install curl php-mongodb php7.0-mcrypt nodejs npm postfix libapache2-mod-php7.0 php-mbstring
    sudo apt-get install curl nano apache2 php5.6 php5.6-mongo php5.6-mcrypt git nodejs npm mysql-server postfix
    ```
    The Postfix configuration will ask you to choose the mail server type. Choose Internet Site, then you can use the default “mail name” that appears

    @@ -312,14 +312,13 @@ sudo npm install -g bower

    Install composer
    ```bash
    cd
    curl -sS https://getcomposer.org/installer | php
    sudo mv composer.phar /usr/local/bin/composer
    sudo apt-get install composer
    export PATH="~/.config/composer/vendor/bin:$PATH"
    ```

    Fetch Learning Locker
    ```bash
    cd /var/www/html/
    cd /var/www/
    sudo git clone https://github.com/LearningLocker/learninglocker.git
    ```

    @@ -334,7 +333,7 @@ sudo service mongod restart
    Put mongoDB credentials in learning locker
    ```bash
    nano /var/www/html/learninglocker/app/config/database.php
    sudo nano /var/www/learninglocker/app/config/database.php
    ```
    ```php
    @@ -348,8 +347,8 @@ nano /var/www/html/learninglocker/app/config/database.php
    Run Install
    ```bash
    cd /var/www/html/learninglocker/
    composer require jenssegers/mongodb --ignore-platform-reqs
    cd /var/www/learninglocker/
    sudo composer install
    ```
    #Errors
  17. abhi9bakshi revised this gist Dec 15, 2016. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -263,12 +263,15 @@ Alias /moodle "/var/www/moodle/"
    sudo service apache2 restart
    ```

    Test working moodle installation by visiting that address e.g.`10.0.3.15/moodle` in your preferred web browser
    Test working moodle installation by visiting that address e.g.`10.0.3.15/moodle` in your preferred web browser.
    Create an account at [moodle.org](moodle.org) for getting full experience of moodle without any restrictions.


    #_Part 3: Learning Locker_

    There is a detailed guide to installing learning locker [here](http://docs.learninglocker.net/installation/) and also a step-by-step guide for installing in Ubuntu [here](http://www.jpablo128.com/how-to-install-learning-locker/). However, both of them are a bit dated and give a fair bit of errors on newer Ubuntu distributions. You can refer them for the documentation as to what we are doing. Brief steps are listed below.


    ##Installing MongoDB

    If you have logged out of the LXC container, login back by typing `sudo lxc-console -n LMSprototype`. Then, enter the following commands to install MongoDB
  18. abhi9bakshi revised this gist Dec 15, 2016. 1 changed file with 14 additions and 1 deletion.
    15 changes: 14 additions & 1 deletion tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -232,7 +232,7 @@ Installation completed successfully.

    Change ownership of moodle path back to root user
    ```bash
    sudo chown -R root /var/www/html/moodle
    sudo chown -R root /var/www/moodle
    ```

    Get the IP address of your LXC container by typing folowing command inside LXC shell
    @@ -250,6 +250,19 @@ $CFG->wwwroot = 'http://localhost/moodle';
    $CFG->wwwroot = 'http://10.0.3.15/moodle';
    ```

    Add an alias for moodle in apache configuration
    ```bash
    //Open the 000-default.conf file
    cd /etc/apache2/sites-enabled/
    sudo nano 000-default.conf

    //Add the following line below 'DocumentRoot /var/www/html'
    Alias /moodle "/var/www/moodle/"

    //Restrat apache server
    sudo service apache2 restart
    ```

    Test working moodle installation by visiting that address e.g.`10.0.3.15/moodle` in your preferred web browser
    Create an account at [moodle.org](moodle.org) for getting full experience of moodle without any restrictions.

  19. abhi9bakshi revised this gist Dec 15, 2016. 1 changed file with 7 additions and 7 deletions.
    14 changes: 7 additions & 7 deletions tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -69,14 +69,14 @@ cd moodle
    //Choose which branch to track (As of writing this tutorial, MOODLE_32 is the most recent stable branch)
    sudo git branch -a
    sudo git branch --track MOODLE_32_STABLE origin/MOODLE_32_STABLE
    sudo git checkout MOODLE_32_STABLE
    sudo git checkout MOODLE_32_STABLE

    //Copy local repository and set proper privileges
    sudo cp -R /opt/moodle /var/www/html/
    sudo cp -R /opt/moodle /var/www/
    sudo mkdir /var/moodledata
    sudo chown -R www-data /var/moodledata
    sudo chmod -R 777 /var/moodledata
    sudo chmod -R 0755 /var/www/html/moodle
    sudo chmod -R 0755 /var/www/moodle
    ```


    @@ -99,7 +99,7 @@ Now we need to create the Moodle database and the Moodle MySQL User with the cor
    ```bash
    mysql -u root -p

    //Inside Moodle shell
    //Inside MySQL shell
    CREATE DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
    create user 'moodleuser'@'localhost' IDENTIFIED BY 'moodlepass';
    GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodle.* TO moodleuser@localhost IDENTIFIED BY 'moodlepass';
    @@ -110,10 +110,10 @@ quit;
    ##Installing Moodle
    ```bash
    //Set ownership of moodle path to web user
    sudo chown www-data /var/www/html/moodle
    sudo chown www-data /var/www/moodle

    //Install moodle
    cd /var/www/html/moodle/admin/cli
    cd /var/www/moodle/admin/cli
    sudo -u www-data /usr/bin/php install.php
    ```

    @@ -242,7 +242,7 @@ ifconfig eth0 | grep "inet addr" | cut -d ':' -f 2 | cut -d ' ' -f 1

    Paste the same address inside your moodle config file
    ```bash
    sudo nano /var/lib/lxc/LMSprototype/rootfs/var/www/html/moodle/config.php
    sudo nano /var/www/moodle/config.php

    //Replace the line
    $CFG->wwwroot = 'http://localhost/moodle';
  20. abhi9bakshi revised this gist Dec 15, 2016. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -52,8 +52,11 @@ If you have logged out of the LXC container, login back by typing `sudo lxc-cons
    sudo apt-get update

    //Install php, mysql and essential packages
    sudo apt-get install vim apache2 mysql-client mysql-server php7.0 libapache2-mod-php7.0 graphviz aspell php7.0-pspell php7.0-curl php7.0-gd php7.0-intl php7.0-mysql php7.0-xml php7.0-xmlrpc php7.0-ldap php7.0-zip git git-core nano
    //Set a root password for mysql
    sudo apt-get install software-properties-common
    sudo add-apt-repository ppa:ondrej/php
    sudo apt-get update
    sudo apt-get install vim apache2 mysql-client mysql-server php5.6 libapache2-mod-php5.6 graphviz aspell php5.6-pspell php5.6-curl php5.6-gd php5.6-intl php5.6-mysql php5.6-xml php5.6-xmlrpc php5.6-ldap php5.6-zip git nano
    //When prompted, set a root password for mysql

    //Restart apache server to load modules correctly
    sudo service apache2 restart
  21. abhi9bakshi revised this gist Dec 15, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -43,7 +43,7 @@ Note: To

    Refer the [docs](https://docs.moodle.org/31/en/Installing_Moodle) at moodle official website to get an overview of the installation process or click [here](https://docs.moodle.org/32/en/Step-by-step_Installation_Guide_for_Ubuntu) to get the installation steps for Ubuntu 16.04 if you are using Ubuntu just like me. Since we are installing at a local system just for prototyping, we will be taking the simplistic approach and won't be bothering with the requirements needed to setup a production environment.

    _Note_: **Since users have reported that Learninglocker gives error with PHP7 \[[ref]\](https://groups.google.com/forum/#!msg/learning-locker/TPbdtmfCxhM/3623QRwWDAAJ), we will be opting for PHP5 to avoid those errors. If you already have PHP7 installed, you can downgrade to PHP5 by following [this](http://askubuntu.com/questions/756181/installing-php-5-6-on-xenial-16-04) tutorial.**
    _Note_: **Since users have reported that Learninglocker gives error with PHP7 \[[ref](https://groups.google.com/forum/#!msg/learning-locker/TPbdtmfCxhM/3623QRwWDAAJ)\], we will be opting for PHP5 to avoid those errors. If you already have PHP7 installed, you can downgrade to PHP5 by following [this](http://askubuntu.com/questions/756181/installing-php-5-6-on-xenial-16-04) tutorial.**

    If you have logged out of the LXC container, login back by typing `sudo lxc-console -n LMSprototype`.

  22. abhi9bakshi revised this gist Dec 15, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -43,7 +43,7 @@ Note: To

    Refer the [docs](https://docs.moodle.org/31/en/Installing_Moodle) at moodle official website to get an overview of the installation process or click [here](https://docs.moodle.org/32/en/Step-by-step_Installation_Guide_for_Ubuntu) to get the installation steps for Ubuntu 16.04 if you are using Ubuntu just like me. Since we are installing at a local system just for prototyping, we will be taking the simplistic approach and won't be bothering with the requirements needed to setup a production environment.

    _Note_: Since users have reported that Learninglocker gives error with PHP7 [ref](https://groups.google.com/forum/#!msg/learning-locker/TPbdtmfCxhM/3623QRwWDAAJ), we will be opting for PHP5 to avoid those errors. If you already have PHP7 installed, you can downgrade to PHP5 by following [this](http://askubuntu.com/questions/756181/installing-php-5-6-on-xenial-16-04) tutorial.
    _Note_: **Since users have reported that Learninglocker gives error with PHP7 \[[ref]\](https://groups.google.com/forum/#!msg/learning-locker/TPbdtmfCxhM/3623QRwWDAAJ), we will be opting for PHP5 to avoid those errors. If you already have PHP7 installed, you can downgrade to PHP5 by following [this](http://askubuntu.com/questions/756181/installing-php-5-6-on-xenial-16-04) tutorial.**

    If you have logged out of the LXC container, login back by typing `sudo lxc-console -n LMSprototype`.

  23. abhi9bakshi revised this gist Dec 15, 2016. 1 changed file with 6 additions and 2 deletions.
    8 changes: 6 additions & 2 deletions tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -41,7 +41,11 @@ Note: To

    ##Setting up Moodle

    Refer the [docs](https://docs.moodle.org/31/en/Installing_Moodle) at moodle official website to get an overview of the installation process or click [here](https://docs.moodle.org/32/en/Step-by-step_Installation_Guide_for_Ubuntu) to get the installation steps for Ubuntu 16.04 if you are using Ubuntu just like me. Since we are installing at a local system just for prototyping, we will be taking the simplistic approach and won't be bothering with the requirements needed to setup a production environment.
    Refer the [docs](https://docs.moodle.org/31/en/Installing_Moodle) at moodle official website to get an overview of the installation process or click [here](https://docs.moodle.org/32/en/Step-by-step_Installation_Guide_for_Ubuntu) to get the installation steps for Ubuntu 16.04 if you are using Ubuntu just like me. Since we are installing at a local system just for prototyping, we will be taking the simplistic approach and won't be bothering with the requirements needed to setup a production environment.

    _Note_: Since users have reported that Learninglocker gives error with PHP7 [ref](https://groups.google.com/forum/#!msg/learning-locker/TPbdtmfCxhM/3623QRwWDAAJ), we will be opting for PHP5 to avoid those errors. If you already have PHP7 installed, you can downgrade to PHP5 by following [this](http://askubuntu.com/questions/756181/installing-php-5-6-on-xenial-16-04) tutorial.

    If you have logged out of the LXC container, login back by typing `sudo lxc-console -n LMSprototype`.

    ```bash
    //Update packages
    @@ -251,7 +255,7 @@ Create an account at [moodle.org](moodle.org) for getting full experience of moo

    ##Installing MongoDB

    If you have logged out of the LXC container, login back by typing `sudo lxc-attach -n LMSprototype`. Then, enter the following commands to install MongoDB
    If you have logged out of the LXC container, login back by typing `sudo lxc-console -n LMSprototype`. Then, enter the following commands to install MongoDB

    ```bash
    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
  24. abhi9bakshi revised this gist Dec 15, 2016. 1 changed file with 13 additions and 4 deletions.
    17 changes: 13 additions & 4 deletions tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ Before we get our hands dirty with the entire setup, it is necessary to ensure w

    ```bash
    sudo apt-get install lxc lxd-client
    lxc-create -t download -n LMSprototype
    sudo lxc-create -t download -n LMSprototype

    //It will prompt you to choose a distribution. At the time of making this tutorial, the stable version is Ubuntu Xenial, so I will opt for the same
    Distribution: ubuntu
    @@ -19,13 +19,22 @@ sudo lxc-ls --fancy
    //Launch the LXC container in background
    sudo lxc-start -d -n LMSprototype

    //Login to LXC container and set root password
    //Login to LXC container and set password for 'ubuntu' user
    sudo lxc-attach -n LMSprototype
    passwd
    passwd ubuntu
    //It will prompt you for a password, choose your desired password

    //Login back as ubuntu and enter the password chosen earlier
    exit
    sudo lxc-console -n LMSprototype
    LMSprototype login: ubuntu
    Password:
    ```

    Note: To stop the LXC container, you can use command `sudo lxc-stop --name LMSprototype` or to destroy it permanently, use `sudo lxc-destroy --name LMSprototype`
    Note: To
    * Exit the LXC console, you can use command `Ctrl+a` followed by `q`.
    * Stop the LXC container, you can use command `sudo lxc-stop --name LMSprototype`.
    * Destroy it permanently, use `sudo lxc-destroy --name LMSprototype`.


    #_Part 2: Moodle_
  25. abhi9bakshi revised this gist Dec 15, 2016. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -28,7 +28,9 @@ passwd
    Note: To stop the LXC container, you can use command `sudo lxc-stop --name LMSprototype` or to destroy it permanently, use `sudo lxc-destroy --name LMSprototype`


    _#Part 2: Moodle_
    #_Part 2: Moodle_

    ##Setting up Moodle

    Refer the [docs](https://docs.moodle.org/31/en/Installing_Moodle) at moodle official website to get an overview of the installation process or click [here](https://docs.moodle.org/32/en/Step-by-step_Installation_Guide_for_Ubuntu) to get the installation steps for Ubuntu 16.04 if you are using Ubuntu just like me. Since we are installing at a local system just for prototyping, we will be taking the simplistic approach and won't be bothering with the requirements needed to setup a production environment.

    @@ -236,7 +238,7 @@ Test working moodle installation by visiting that address e.g.`10.0.3.15/moodle`
    Create an account at [moodle.org](moodle.org) for getting full experience of moodle without any restrictions.


    #_Part 2: Learning Locker_
    #_Part 3: Learning Locker_

    ##Installing MongoDB

  26. abhi9bakshi revised this gist Dec 15, 2016. 1 changed file with 19 additions and 21 deletions.
    40 changes: 19 additions & 21 deletions tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,6 @@
    #Setting Up TinCan API with Moodle LMS and Learning Locker LRS

    #_Part 1: Moodle_

    ##Setting up a virtual container
    #_Part 1: Virtual Container_

    Before we get our hands dirty with the entire setup, it is necessary to ensure we do not mess with the existing installation. Setting up and configuring a local server is tricky and may sometimes break your existing configuration rendering other programs which rely on it useless. So we will use LXC to create a virtual container, where we will do all good stuff. You can read the official LXC documentation [here](https://help.ubuntu.com/lts/serverguide/lxc.html) or a brief introduction about LXC [here](http://blog.scottlowe.org/2013/11/25/a-brief-introduction-to-linux-containers-with-lxc/) or get started right away with the commands below.

    @@ -30,24 +28,7 @@ passwd
    Note: To stop the LXC container, you can use command `sudo lxc-stop --name LMSprototype` or to destroy it permanently, use `sudo lxc-destroy --name LMSprototype`



    ##Getting tin can prototypes

    Now that we are done with setting up a container, we can start working on our setup. You can get readymade TinCan API prototypes at [github](https://github.com/RusticiSoftware/TinCan_Prototypes)

    Download(git clone) them inside LMSprototype container and make sure to update submodules.

    ```bash
    cd /home/ubuntu
    mkdir Documents
    cd Documents
    mkdir LMSprototype
    cd LMSprototype
    git clone https://github.com/RusticiSoftware/TinCan_Prototypes.git
    git submodule update --init --recursive
    ```

    ##Setting Up Moodle
    _#Part 2: Moodle_

    Refer the [docs](https://docs.moodle.org/31/en/Installing_Moodle) at moodle official website to get an overview of the installation process or click [here](https://docs.moodle.org/32/en/Step-by-step_Installation_Guide_for_Ubuntu) to get the installation steps for Ubuntu 16.04 if you are using Ubuntu just like me. Since we are installing at a local system just for prototyping, we will be taking the simplistic approach and won't be bothering with the requirements needed to setup a production environment.

    @@ -356,4 +337,21 @@ sudo apt-get install vim apache2 mysql-client mysql-server php5.6 libapache2-mod
    Discussion: https://groups.google.com/forum/#!msg/learning-locker/TPbdtmfCxhM/3623QRwWDAAJ
    Downgrading to php5: http://askubuntu.com/questions/756181/installing-php-5-6-on-xenial-16-04
    //////////////////
    ```
    ##Getting tin can prototypes
    Now that we are done with setting up a container, we can start working on our setup. You can get readymade TinCan API prototypes at [github](https://github.com/RusticiSoftware/TinCan_Prototypes)
    Download(git clone) them inside LMSprototype container and make sure to update submodules.
    ```bash
    cd /home/ubuntu
    mkdir Documents
    cd Documents
    mkdir LMSprototype
    cd LMSprototype
    git clone https://github.com/RusticiSoftware/TinCan_Prototypes.git
    git submodule update --init --recursive
    ```
  27. abhi9bakshi revised this gist Dec 15, 2016. 1 changed file with 22 additions and 0 deletions.
    22 changes: 22 additions & 0 deletions tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -335,3 +335,25 @@ Run Install
    ```bash
    cd /var/www/html/learninglocker/
    composer require jenssegers/mongodb --ignore-platform-reqs
    ```
    #Errors
    ```bash
    //////////////////////////////
    sudo apt-get install curl nano apache2 php7.0 php-mongodb php7.0-mcrypt git nodejs npm mysql-server postfix

    sudo apt-get install curl nano apache2 php7.0 php-mongodb php7.0-mcrypt git mysql-server postfix


    https://groups.google.com/forum/#!msg/learning-locker/TPbdtmfCxhM/3623QRwWDAAJ
    http://askubuntu.com/questions/756181/installing-php-5-6-on-xenial-16-04


    /////////////////
    sudo apt-get install vim apache2 mysql-client mysql-server php5.6 libapache2-mod-php5.6 graphviz aspell php5.6-pspell php5.6-curl php5.6-gd php5.6-intl php5.6-mysql php5.6-xml php5.6-xmlrpc php5.6-ldap php5.6-zip git git-core nano

    //////////////////
    Discussion: https://groups.google.com/forum/#!msg/learning-locker/TPbdtmfCxhM/3623QRwWDAAJ
    Downgrading to php5: http://askubuntu.com/questions/756181/installing-php-5-6-on-xenial-16-04
    //////////////////
    ```
  28. abhi9bakshi revised this gist Dec 15, 2016. 1 changed file with 7 additions and 2 deletions.
    9 changes: 7 additions & 2 deletions tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -272,7 +272,7 @@ sudo service mongod start
    ##Installing Learning Locker

    ```bash
    sudo apt-get install curl php-mongodb php7.0-mcrypt nodejs npm postfix
    sudo apt-get install curl php-mongodb php7.0-mcrypt nodejs npm postfix libapache2-mod-php7.0 php-mbstring
    ```
    The Postfix configuration will ask you to choose the mail server type. Choose Internet Site, then you can use the default “mail name” that appears

    @@ -329,4 +329,9 @@ nano /var/www/html/learninglocker/app/config/database.php
    'username' => 'learnlockuser',
    'password' => 'learnlockpass',
    'database' => 'learninglocker'
    ```
    ```
    Run Install
    ```bash
    cd /var/www/html/learninglocker/
    composer require jenssegers/mongodb --ignore-platform-reqs
  29. abhi9bakshi revised this gist Dec 15, 2016. 1 changed file with 32 additions and 2 deletions.
    34 changes: 32 additions & 2 deletions tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -269,7 +269,7 @@ sudo apt-get install -y mongodb-org
    sudo service mongod start
    ```

    ##Installing essentials for Learning Locker
    ##Installing Learning Locker

    ```bash
    sudo apt-get install curl php-mongodb php7.0-mcrypt nodejs npm postfix
    @@ -291,12 +291,42 @@ sudo phpenmod mcrypt

    Install bower
    ```bash
    npm install -g bower
    sudo npm install -g bower
    //If the above command gives error, try 'npm install -g bower'
    ```

    Install composer
    ```bash
    cd
    curl -sS https://getcomposer.org/installer | php
    sudo mv composer.phar /usr/local/bin/composer
    ```

    Fetch Learning Locker
    ```bash
    cd /var/www/html/
    sudo git clone https://github.com/LearningLocker/learninglocker.git
    ```

    Create collection and user in MongoDB
    ```bash
    mongo
    use learninglocker
    db.createUser( { user: "learnlockuser", pwd: "learnlockpass", roles: [ "readWrite" ] } );
    exit
    sudo service mongod restart
    ```
    Put mongoDB credentials in learning locker
    ```bash
    nano /var/www/html/learninglocker/app/config/database.php
    ```
    ```php
    'driver' => 'mongodb',
    'host' => 'localhost',
    'port' => 27017,
    'username' => 'learnlockuser',
    'password' => 'learnlockpass',
    'database' => 'learninglocker'
    ```
  30. abhi9bakshi revised this gist Dec 15, 2016. 1 changed file with 45 additions and 1 deletion.
    46 changes: 45 additions & 1 deletion tincan_moodle_learninglocker_setup.md
    Original file line number Diff line number Diff line change
    @@ -56,7 +56,7 @@ Refer the [docs](https://docs.moodle.org/31/en/Installing_Moodle) at moodle offi
    sudo apt-get update

    //Install php, mysql and essential packages
    sudo apt-get install vim apache2 mysql-client mysql-server php7.0 libapache2-mod-php7.0 graphviz aspell php7.0-pspell php7.0-curl php7.0-gd php7.0-intl php7.0-mysql php7.0-xml php7.0-xmlrpc php7.0-ldap php7.0-zip git-core nano
    sudo apt-get install vim apache2 mysql-client mysql-server php7.0 libapache2-mod-php7.0 graphviz aspell php7.0-pspell php7.0-curl php7.0-gd php7.0-intl php7.0-mysql php7.0-xml php7.0-xmlrpc php7.0-ldap php7.0-zip git git-core nano
    //Set a root password for mysql

    //Restart apache server to load modules correctly
    @@ -256,3 +256,47 @@ Create an account at [moodle.org](moodle.org) for getting full experience of moo


    #_Part 2: Learning Locker_

    ##Installing MongoDB

    If you have logged out of the LXC container, login back by typing `sudo lxc-attach -n LMSprototype`. Then, enter the following commands to install MongoDB

    ```bash
    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
    echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
    sudo apt-get update
    sudo apt-get install -y mongodb-org
    sudo service mongod start
    ```

    ##Installing essentials for Learning Locker

    ```bash
    sudo apt-get install curl php-mongodb php7.0-mcrypt nodejs npm postfix
    ```
    The Postfix configuration will ask you to choose the mail server type. Choose Internet Site, then you can use the default “mail name” that appears

    Verify whether all services are running before proceeding
    ```bash
    sudo service apache2 status
    sudo service mongod status
    sudo service mysql status
    sudo service postfix status
    ```

    Enable mcrypt
    ```bash
    sudo phpenmod mcrypt
    ```

    Install bower
    ```bash
    npm install -g bower
    ```

    Install composer
    ```bash
    cd
    curl -sS https://getcomposer.org/installer | php
    sudo mv composer.phar /usr/local/bin/composer
    ```