diff --git a/CHANGES.md b/CHANGES.md index a46e2d3..b5902aa 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ Changes in version 3.36.31.1 (2015123101) - Prevent Style Override of Crossword - Add missing language string game:addinstance - More RTL fixes +- Fixing problems on Millionaire with quiz Changes in version 3.36.29.1 (2015122901) ------------------------------------------------------------------ diff --git a/millionaire/play.php b/millionaire/play.php index d0825a3..21f93e9 100755 --- a/millionaire/play.php +++ b/millionaire/play.php @@ -412,7 +412,7 @@ function game_millionaire_selectquestion( &$aanswer, $game, $attempt, &$milliona function game_millionaire_select_serial_question( $game, $table, $select, $idfields = "id", $level, $order) { global $DB, $USER; - $sql = "SELECT $idfields,$id_fields FROM ".$table." WHERE $select "; + $sql = "SELECT $idfields,$idfields FROM ".$table." WHERE $select "; if ($order != '') { $sql .= " ORDER BY $order"; } diff --git a/showanswers.php b/showanswers.php index eb33ee6..cdf1a08 100755 --- a/showanswers.php +++ b/showanswers.php @@ -198,11 +198,17 @@ function game_showanswers_question( $game, $context) { function game_showanswers_quiz( $game, $context) { global $CFG; - $select = "quiz='$game->quizid' ". - ' AND qqi.question=q.id'. - ' AND q.hidden=0'. - game_showanswers_appendselect( $game); - $table = '{question} q,{quiz_question_instances} qqi'; + if (game_get_moodle_version() < '02.07') { + $select = "quiz='$game->quizid' ". + ' AND qqi.question=q.id'. + ' AND q.hidden=0'. + game_showanswers_appendselect( $game); + $table = '{question} q,{quiz_question_instances} qqi'; + } else { + $select = "qs.quizid='$game->quizid' ". + " AND qs.questionid=q.id"; + $table = "{question} q,{quiz_slots} qs"; + } game_showanswers_question_select( $game, $table, $select, 'q.*', 'category,questiontext', false, $game->course, $context); }