Moodle plugins directory: Game | Moodle.org
Game
Activities ::: mod_game
Maintained by Vasilis Daloukas
Part of set Gamification.
The game activity module makes use of questions, quizzes and glossaries to create offer a variety of interactive games.
Latest release:
8614 sites
2k downloads
307 fans
Current versions available: 1
This module gets input from quiz, glossary or questions and plays some games. The games are:
* hangman
* crossword
* cryptex
* millionaire
* sudoku
* Snakes and Ladders
* The hidden picture
* Book with questions
If you like this module please consider donating via PayPal at
to help me continue working on this project. When you donate you can ask for new facilities e.g. support for new languages, new games, new statistics, more documentation on some forms or extra support.It's a project that has been active since 2007 and is the number 7 on downloads in the last 12 months according to https://moodle.org/plugins/stats.php?plugin_category=1.
This module is and will remain free, but your donation allows me to continue the development, and any amount is greatly appreciated.
Now is GDPR compliant.
Publications (Google Scholar profile):
Contributors
Vasilis Daloukas (Lead maintainer)
Please login to view contributors details and/or to contact them
Can you send me the exact error message (this will be very helpfull).
I have moodle 3.7+ installed and created a glossary to use in a crossword game. The crossword appears alright and the answers are entered/checked correctly when the user enters them (i.e. wrong number of letters).
But, after the user has completed the crossword, pressing either the check crossword option or the complete crossword option leads to simply reload the crossword with a blank one and the previous attempt is recorded as a total failure (0%), even if the user has completed all the answers correctly.
Is it something I am doing wrong? Maybe with the glossary?
Thank you very much...
Thank you for your time!
If another user is delegated as an administrator to the site, this behavior does NOT happen.
Finally, one error that is reported is when one tries to preview, or see the solution of a completed cryptex, via the administration menu of the "Show attempts" choice. It reports with the error:
"Too few arguments to function game_cryptex_play(), 9 passed in [dirroot]/mod/game/preview.php on line 81 and exactly 12 expected".
I added these extra three parameters as I saw fit and everything worked fine!
Thank you again, and keep up the good work!
Have a nice weekend!
I have spotted a few bugs in the hangman game which I would like to share them with you along with some proposed fixes. Most of them concern the "Show Attemtps" administrative menu, after the user has completed the game successfully, or not successfully.
1) More in particular, when the user fully completes the game (i.e. finds all of the words) and the manager goes in the "Show Attempts" menu then the following happens:
If the "Preview" button is clicked, then the preview of the last word is shown, along with the game score. If the administrator returns back to the previous screen and refreshes the screen, then the user's score is increased to 200 and the number of attempts by one. If the Preview button is pressed again and the administrator returns back and refereshes the "Show attempts" screen, then the score remains at 200 and the attemtps again go up by one. Every time the "Preview" button is clicked, the attempts go up by one and the score remains at 200. The same score is also displayed in the user's view of attempts (i.e. it is updated in the DB).
2) If the user completely fails the test (achieves 0 score), then if the Administrator clicks on the "Solution" button, then it does not show the solution, but the preview.
3) If the game had more than one words, then in both the solution and the preview screens, the "Grade in the Whole Game" displayed is increased by 0,25 (25%). For example, if the game had 4 words and the user found only 1, then the Grade in the whole game will be displayed 50% instead of 25% and so on.
PROPOSED FIXES
Since you are the architect of this very nice and complicated set of code, I would like to contribute with some proposed solutions and if you find them fit, you could incorporate them.
All the fixes are in the moodle_dir/mod/game/hangman/play.php file.
1) LINE 312, the call to hangman_oncorrect should incorporate the $onlyshow parameter, to account for that case also
hangman_oncorrect( $cm, $wordline, $game, $attempt, $hangman, $onlyshow, $query, $course);
2) LINE 320, the calculation of the total score, should not include the percent calculation if we Preview or view the solution of the game:
if ($done or $onlyshow or $showsolution) {
$percent = 0;
}
3) LINE 475, it should take into account the $onlyshow, because it erroneously increases the corrects by one, increasing the Grade of the Whole game at the end:
if ($done and !$onlyshow) {
$hangman->corrects = $hangman->corrects + 1;
$updrec->corrects = $hangman->corrects;
}
4) LINES 527 and 540, in the hangman_oncorrect method, both the signature of the method should include the $onlyshow and at the end should skip the game_hangman_show_nextword method call if $onlyshow is used, because it updates the database with increased number of attempts for every preview click
function hangman_oncorrect( $cm, $wordline, $game, $attempt, $hangman, $onlyshow, $query, $course) {
.......
......
if ($onlyshow) {
return;
}
game_hangman_show_nextword( $cm, $game, $attempt, $hangman, $course);
5) LINE 565 in the hangman_onincorrect method, should differentiate between the onlyshow and showsolution cases, because it does not display the solution at all if the user did not solve the word at all:
// REPLACE THIS with the one below if ( $onlyshow or $showsolution ) {
if ( $onlyshow ) {
return;
}
and in the same method at the end include the $showsolution check before the game_hangman_show_nextword method:
if ($showsolution) {
return;
}
game_hangman_show_nextword( $cm, $game, $attempt, $hangman, $course);
............
And that's it. Hope that I have helped. The version we are using is Moodle 3.7.1, the latest.
Best Regards,
-Fk
thanks before.