Hi,
I'm not sure if this is the right place to post this, but if it is of any use to anybody, this is what I worked on for the past month (tested on moodle 2.9 only - would love to hear if this is compatible with other versions):
So what is it? It is a bit of javascript that will transform a quiz made up of multiple-choice type questions into a little game. Here is a screenshot:
Here is a backup of a quiz activity. Download it, and restore it into a course (preferably one that isn't in use right now) and read this explanation:
What is the purpose of this template?
The only purpose of this game is fun - if you or your students find it to be, well, not fun, I can't think of anything it would serve. This tool wasn't tested to prove whether it has any impact on the level of understanding of the subject matter by student, nor was it designed to make such impact.
Gamification of educational contents as a whole stands on a very shaky scientific foundation, with very little in the way of concrete evidence showing a statistically significant difference observed between groups who learn a subject through gamified means to groups who don't, in a controlled environment.
So, don't expect this game to provide any benefit beyond, hopefully, adding some fun time to a, possibly, otherwise not-so-fun lesson.
How does this work?
The activity you just restored contains a quiz, which already contains 2 description type questions, and one multiple-choice type question.
The first description is called "resources" - and if you try editing it, at first you'l see nothing in the "question text" field. However if you switch to the html editor (by pressing the <> option in the toolbar - you'll be doing that a lot throughout this tutorial), you'll see that it is filled with hidden audio and img tags. These are all the resources that the game uses - every single UI element, sprite, sound effect, and the background music.
Please don't edit any of these unless you are sure you know what you are doing.
The second paragraph is called "code" - again, you'll have to switch to the html editor to see what it contains. this is all the relevant code for the game.
In general, what I do is, once the quiz page is loaded, find and hide every single question from the form - and at the same time parse the questions and possible answers, and feed them into the game.
What can I do with this?
By now I suspect you have already tried playing the game - it contains only one question. you can add and remove questions to the game as you wish, just like you would to a normal quiz! (just be careful not to accidentally remove either the code or resources "questions")
Here is what you must keep in mind, though:
- You can only add multiple choice type questions to the game
- All questions you want to add to the game must appear on the
same page as the resources and code questions - and that's a good thing! that
means you can add different questions of all types in pages before and after
the game!
- You must set every question that will appear in the game to
"only one answer"
- You must set the "Shuffle Choices" option to
"none" - this is very important! the questions will be shuffled
automatically anyway in the game, but the option in the question editor must be
unchecked!
- Set "Number the choices?" to "No numbering"
- The first answer you input must be the correct answer - don't
worry, the answers will be automatically shuffled in-game (more on cheating
later)
- Any single answer can contain either text, or images - but not
both.
- If you choose to use a textual answer, as will be the case 90%
of the time, go into the html editor, and make sure that the text isn't
surrounded by <p> tags, or any tags what-so-ever, actually - or they'll
show in the game.
- the game supports anywhere from 2 to 5 different answers per
question (technically supports even more, but it will look weird)
- All answers that aren't the first answer will be considered
"wrong" by the game
How the game works
After hitting the play button, you'll see a tree. On the tree top, a question will be displayed, and apples will fall down, each one with a possible answer on it. Upon clicking on an apple, it will burst, and out of it will appear a symbol - either an X or a check-mark (V), which signifies whether or not the apple that was clicked contained the correct answer.
If a question is answered incorrectly, it will re-appear later in the game, and if it is answered incorrectly once more, it will reappear later again, and so on.
Once a question is answered correctly, the player is granted points - 10 if they answered correctly on their first try, 5 on the second try, 3 on the third, 2 on the fourth, and one if they needed 5 or more tries)
Before answers start falling, there will be some time to read the question - that time gets shorter in subsequent attempts to answer the same question - the rational being that on its first appearance, the student needs a lot of time to read the question, but after they have read it once, they can quickly recognize it when it re-appears.
At the end of the game, based on the score, the player will get an apple/medal thing which will presumably make them very happy about their life accomplishments. Medals are granted based on the score the player got divided by the maximum possible score for the game - a gold medal requires a perfect game.
Scoring
There are two different systems in place for keeping track on score - one is the in-game system, which is detailed above.
However, the results of the game are also kept in the moodle! Notice that if you navigate to the results tab for a quiz that contains a game, you'll see results for all the questions, including those that should only appear in the game.
How is this calculated? When a player clicks an apple, if this is their first attempt at the question, the game tricks moodle into thinking that the player has chosen this answer out of the multiple possible answers.
I really recommend ignoring the results you see in the results tab - don't judge your students by a number that is made out of both understanding of the subject, but also hand-eye coordination and digital literacy.
What you can do, is use the statistics tab, to make sure that the questions in your game are balanced and reflective of the students' knowledge.
Hotkeys
- Pressing M will mute/unmute the game
- Clicking the game once will enter to fullscreen mode. You can
toggle that off using the esc key, or toggle it on/off sing the f key, or
toggle it on at any time by double clicking on the game
- If you move the cursor to the edge of the screen, you'll see a
mini-menu, which will also allow you to toggle fullscreen and mute.
- Pressing the S key will display two stats: speed, and graphics.
- the speed is 1 by default, but if you know in advance that one of your students is slower, or has a difficulty handling the mouse, you can use the 5 and 6 keys, while pressing S, to slow and speed up their game. This will only remain in effect for a single session. You can go from a max of *2, to a minimum of *0.25.
- the graphics are "auto" by default - that means that they will start on "high", and automatically switch to "low" if the framerate drops under some number which I don't remember.
Cheating
If your class has students who know programming, it might be best to stay away from this template; here are some ways one could use to cheat:
- Turning off javascript from the url bar (in chrome) - this means
that instead of the game taking over, the questions will just be listed. This
is bad, since, as you'll recall, the first answer of every question is the
correct one - the shuffling only occurs in-game.
- On some versions of Internet Explorer, javascript scripts are turned off by default, which could be a problem...
- One could theoretically use the browser console to print out the
questions array, including which answers are correct
- A student could learn about the S+5 hot key combination and make
the game easier for themselves.
But - I wouldn't worry about these, in general. If cheating the system is what your students find fun, and you, as per the recommendation above, use this game only for the fun of it, and not for assessment, then you'll achieve your goal anyway.
I want to change something!
The code is in your hands, you can change anything you want! But here are some suggestions:
- If you want your game to be in a right-to-left language, like
Arabic or Hebrew, open the "code" question, switch to the html
editor, and press ctrl+f, to search the code. Search for the phrase var
rtlWholeGame = false; and replace the word "false" with the word
"true".
- If you want the bulk of the game to be from right to left, but to have a single answer, or multiple answers, for some questions written from left to right (say, if you are trying to teach English to Arabic speaking students, so you want questions to be in Arabic and answers to be in English), just add to the answer, in text, the word "ltr" - it will be automatically removed from the answer in the game, and will be formatted properly.
- If you want to change message that appears in the main menu,
search the code for "openingMessage =" and replace whatever is there
with the message you want.
- same for the message in the ending screen - only search for
"closingMessage ="
- If you want to change the splash question, that is, the
questions that has only a single answer, and appears if the player has answered
any question incorrectly, to notify them that the falsely-answered questions
will now re-appear, search for the word "splash", and you'll probably
understand what to do from there
- If you want to change the background music - edit the
"resources" question. Upload your new sound file, go to the html
editor and copy the src value. now delete the tag, and paste the src instead of
the src in the first audio tag, which has a "background_music" id.
known issues
- Sometimes doesn't work on IE because it auto-blocks scripts
- If you try duplicating a course using course backup, the game
might not work out of the box in the restored version of the course. I have no
idea why, but manually backing up the game activity seems to work.
- Most importantly - the game isn't really fun in my opinion, and
is more of a proof of concept. Which, in itself, is problematic, because it is
built from the ground up in a weird and twisted way that anyone who actually
has access to their Moodle's code, and knows their way around it, would never
want to use.
- That being said, I think that making a library of some javascript tricks that people who are, say, managers and teachers, can use without needing an admin to install a plugin, or a developer to mess with the code, could be really helpful for some.
That's it, I think - I'll be happy to offer support to anyone who wants to try implementing this game, and I'll be more than happy to hear feedback (constructive or otherwise), and maybe get some tips as to how to improve the compatibility of this template with different browsers and devices!