|
@ -519,39 +519,3 @@ function game_showanswers_bookquiz( $game, $context) { |
|
|
game_showanswers_question_select( $game, $table, $select, "DISTINCT q.*", |
|
|
game_showanswers_question_select( $game, $table, $select, "DISTINCT q.*", |
|
|
"bc.pagenum,questiontext", $showcategories, $game->course, $context); |
|
|
"bc.pagenum,questiontext", $showcategories, $game->course, $context); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Show extra info for answers in millionaire |
|
|
|
|
|
* |
|
|
|
|
|
* @param stdClass $game |
|
|
|
|
|
*/ |
|
|
|
|
|
function game_showanswers_extra_millionaire( $game) { |
|
|
|
|
|
global $CFG, $DB; |
|
|
|
|
|
|
|
|
|
|
|
if ($game->questioncategoryid == 0) { |
|
|
|
|
|
print_error( get_string( 'must_select_questioncategory', 'game')); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Include subcategories. |
|
|
|
|
|
$select = 'category='.$game->questioncategoryid; |
|
|
|
|
|
if ($game->subcategories) { |
|
|
|
|
|
$cats = question_categorylist( $game->questioncategoryid); |
|
|
|
|
|
if (count( $cats)) { |
|
|
|
|
|
$select = 'q.category in ('.implode(',', $cats).')'; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (game_get_moodle_version() < '02.06') { |
|
|
|
|
|
$table = "{$CFG->prefix}question q, {$CFG->prefix}question_multichoice qmo"; |
|
|
|
|
|
$select .= " AND qtype='multichoice' AND qmo.single <> 1 AND qmo.question=q.id"; |
|
|
|
|
|
} else { |
|
|
|
|
|
$table = "{$CFG->prefix}question q, {$CFG->prefix}qtype_multichoice_options qmo"; |
|
|
|
|
|
$select .= " AND qtype='multichoice' AND qmo.single <> 1 AND qmo.questionid=q.id"; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$sql = "SELECT COUNT(*) as c FROM $table WHERE $select"; |
|
|
|
|
|
$rec = $DB->get_record_sql( $sql); |
|
|
|
|
|
if ($rec->c != 0) { |
|
|
|
|
|
echo get_string( 'millionaire_also_multichoice', 'game').': '.$rec->c; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|