Automatically Add QRcodes to #Moodle Database Entries #edtech

You can use the Moodle database module to create many types of student activity and carefully controlled Content Management Systems.  One of the things you can do is create an advanced type of glossary, for example, you could create an inventory of tools used in a vocational area with images and descriptions of use.  The database is a default part of the Moodle install, and is one of the few activities that is guaranteed to allow you to add custom JavaScript.  On the templates tab there is the opportunity to add custom CSS and JavaScript to your database, which when combined with Google allows for the automatic creation of QR codes so Smartphones can pick up the database entry easily.

Firstly set up a Moodle course that allows guest access (not essential, but saves users logging in on a phone)

Create a database and populate it.  (see Youtube video below to see how this is done)

Click on the “Templates” tab and choose “JavaScript template”

Paste in the following code, which asks Google to make the QRCode:-
function init(){    var namedElements = document.getElementById(“qrcode”);    namedElements.innerHTML = “<img src=’”+encodeURIComponent(document.location.href)+”&=200×200′ alt=’QR Code to this page’ />”;  }  window.onload = init;

Choose the “Single template” and turn on ‘html’ view.  Paste the following small piece of html where you want the QRcode to be (I put mine at the bottom as I want to print it and place next to the physical item described in the database)

<div id=”qrcode”></div>


This entry was posted in edtech, Moodle and tagged , , . Bookmark the permalink.

2 Responses to Automatically Add QRcodes to #Moodle Database Entries #edtech

  1. Pingback: Moodle | Pearltrees

  2. Uttam says:

    A further issue is that video games are tlcpialyy serious as the name indicated with the key focus on studying rather than leisure. Although, we have an entertainment aspect to keep your young ones engaged, each and every game is normally designed to work on a specific set of skills or programs, such as mathematics or science. Thanks for your post.

Leave a Reply

Your email address will not be published. Required fields are marked *

Please type the characters of this captcha image in the input box

Please type the characters of this captcha image in the input box