bdaloukas / moodle-mod_game

moodle-mod_game
GNU General Public License v3.0
15 stars 40 forks source link

Error in Hangman when run out of letters #28

Closed tomhash2 closed 5 years ago

tomhash2 commented 5 years ago

PROBLEM: Moodle 3.6.2, mod_game version 2019010500. Trying to get property of non-object in /var/www/demo/lib/completionlib.php on line 255 Debug info: SELECT * FROM {course} WHERE id IS NULL [array ( )] Error code: invalidrecord

RESOLUTION: In file hangman/play.php in function hangman_onincorrect() you call game_hangman_show_nextword() with last argument "true" but game_hangman_show_nextword() expects the last argument to be object $course.

Secondly, functions hangman_onincorrect() first argument is "id" but should be object $cm because game_hangman_show_nextword(), when called, expects the fist argument to be object $cm.

bdaloukas commented 5 years ago

Done.