Browse Source

Fix compatibility problems with Moodle 2.5

MOODLE_20_STABLE
Vasilis Daloukas 9 years ago
parent
commit
4713b45e2e
  1. 3
      CHANGES.md
  2. 17
      millionaire/play.php
  3. 4
      version.php

3
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

17
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) {

4
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;

Loading…
Cancel
Save