diff --git a/CHANGES.md b/CHANGES.md index 0c54558..00629d6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,6 @@ +Changes in version 2016-02-14 (20160214) +- Fix compatibility with Moodle 2.5 + Changes in version 2015-12-31 (4) (2015123104) ------------------------------------------------------------------ - Fix translations check at translate.php diff --git a/millionaire/play.php b/millionaire/play.php index 21f93e9..07b23b3 100755 --- a/millionaire/play.php +++ b/millionaire/play.php @@ -312,7 +312,12 @@ function game_millionaire_selectquestion( &$aanswer, $game, $attempt, &$milliona if ($game->quizid == 0) { print_error( get_string( 'must_select_quiz', 'game')); } - if (game_get_moodle_version() < '02.07') { + if (game_get_moodle_version() < '02.06') { + $select = "qtype='multichoice' AND quiz='$game->quizid' AND qmo.question=q.id". + " AND qqi.question=q.id"; + $table = "{quiz_question_instances} qqi,{question} q, {question_multichoice} qmo"; + $order = ''; + } else if (game_get_moodle_version() < '02.07') { $select = "qtype='multichoice' AND quiz='$game->quizid' AND qmo.questionid=q.id". " AND qqi.question=q.id"; $table = "{quiz_question_instances} qqi,{question} q, {qtype_multichoice_options} qmo"; @@ -324,6 +329,7 @@ function game_millionaire_selectquestion( &$aanswer, $game, $attempt, &$milliona $order = 'qs.page,qs.slot'; } } else { + // Source is questions. if ($game->questioncategoryid == 0) { print_error( get_string( 'must_select_questioncategory', 'game')); } @@ -336,9 +342,14 @@ function game_millionaire_selectquestion( &$aanswer, $game, $attempt, &$milliona $select = 'q.category in ('.implode(',', $cats).')'; } } - $select .= " AND qtype='multichoice' AND qmo.single=1 AND qmo.questionid=q.id"; - $table = '{question} q, {qtype_multichoice_options} qmo'; + if (game_get_moodle_version() < '02.06') { + $select .= " AND qtype='multichoice' AND qmo.single=1 AND qmo.question=q.id"; + $table = '{question} q, {question_multichoice} qmo'; + } else { + $select .= " AND qtype='multichoice' AND qmo.single=1 AND qmo.questionid=q.id"; + $table = '{question} q, {qtype_multichoice_options} qmo'; + } } $select .= ' AND hidden=0'; if ($game->shuffle or $game->quizid == 0) { diff --git a/version.php b/version.php index e1473d0..2be7f87 100755 --- a/version.php +++ b/version.php @@ -36,10 +36,10 @@ if (!isset( $plugin)) { } $plugin->component = 'mod_game'; // Full name of the plugin (used for diagnostics). -$plugin->version = 2016020201; // The current module version (Date: YYYYMMDDXX). +$plugin->version = 2016021401; // The current module version (Date: YYYYMMDDXX). $plugin->requires = 2010112400; // Requires Moodle 2.0. $plugin->cron = 0; // Period for cron to check this module (secs). -$plugin->release = '2016-02-02'; +$plugin->release = '2016-02-14'; if ($useplugin != 2) { $module = $plugin;