Browse Source

Fixing problems on Millionaire with quiz

MOODLE_20_STABLE
Vasilis Daloukas 9 years ago
parent
commit
d118183673
  1. 1
      CHANGES.md
  2. 2
      millionaire/play.php
  3. 6
      showanswers.php

1
CHANGES.md

@ -5,6 +5,7 @@ Changes in version 3.36.31.1 (2015123101)
- Prevent Style Override of Crossword - Prevent Style Override of Crossword
- Add missing language string game:addinstance - Add missing language string game:addinstance
- More RTL fixes - More RTL fixes
- Fixing problems on Millionaire with quiz
Changes in version 3.36.29.1 (2015122901) Changes in version 3.36.29.1 (2015122901)
------------------------------------------------------------------ ------------------------------------------------------------------

2
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) { function game_millionaire_select_serial_question( $game, $table, $select, $idfields = "id", $level, $order) {
global $DB, $USER; global $DB, $USER;
$sql = "SELECT $idfields,$id_fields FROM ".$table." WHERE $select "; $sql = "SELECT $idfields,$idfields FROM ".$table." WHERE $select ";
if ($order != '') { if ($order != '') {
$sql .= " ORDER BY $order"; $sql .= " ORDER BY $order";
} }

6
showanswers.php

@ -198,11 +198,17 @@ function game_showanswers_question( $game, $context) {
function game_showanswers_quiz( $game, $context) { function game_showanswers_quiz( $game, $context) {
global $CFG; global $CFG;
if (game_get_moodle_version() < '02.07') {
$select = "quiz='$game->quizid' ". $select = "quiz='$game->quizid' ".
' AND qqi.question=q.id'. ' AND qqi.question=q.id'.
' AND q.hidden=0'. ' AND q.hidden=0'.
game_showanswers_appendselect( $game); game_showanswers_appendselect( $game);
$table = '{question} q,{quiz_question_instances} qqi'; $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); game_showanswers_question_select( $game, $table, $select, 'q.*', 'category,questiontext', false, $game->course, $context);
} }

Loading…
Cancel
Save