Browse Source

Fix: Problem when using subcategories in questions

MOODLE_20_STABLE
bdaloukas 12 years ago
parent
commit
754723e380
  1. 4
      locallib.php
  2. 6
      millionaire/play.php
  3. 4
      version.php

4
locallib.php

@ -567,8 +567,8 @@ function game_questions_shortanswer_question( $game)
$select = 'q.category='.$game->questioncategoryid; $select = 'q.category='.$game->questioncategoryid;
if( $game->subcategories){ if( $game->subcategories){
$cats = question_categorylist( $game->questioncategoryid); $cats = question_categorylist( $game->questioncategoryid);
if( strpos( $cats, ',') > 0){ if( count( $cats)){
$select = 'q.category in ('.$cats.')'; $select = 'q.category in ('.implode(',', $cats).')';
} }
} }

6
millionaire/play.php

@ -311,9 +311,9 @@ function game_millionaire_SelectQuestion( &$aAnswer, $game, $attempt, &$milliona
$select = 'category='.$game->questioncategoryid; $select = 'category='.$game->questioncategoryid;
if( $game->subcategories){ if( $game->subcategories){
$cats = question_categorylist( $game->questioncategoryid); $cats = question_categorylist( $game->questioncategoryid);
if( strpos( $cats, ',') > 0){ if( count( $cats)){
$select = 'category in ('.$cats.')'; $select = 'q.category in ('.implode(',', $cats).')';
} }
} }
$select .= " AND qtype='multichoice'"; $select .= " AND qtype='multichoice'";

4
version.php

@ -11,7 +11,7 @@
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
$module->component = 'mod_game'; // Full name of the plugin (used for diagnostics) $module->component = 'mod_game'; // Full name of the plugin (used for diagnostics)
$module->version = 2013012704; // The current module version (Date: YYYYMMDDXX) $module->version = 2013012801; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2010112400; // Requires Moodle 2.0 $module->requires = 2010112400; // Requires Moodle 2.0
$module->cron = 0; // Period for cron to check this module (secs) $module->cron = 0; // Period for cron to check this module (secs)
$module->release = 'v.2.13.27 (2013012704)'; $module->release = 'v.2.13.28 (2013012801)';

Loading…
Cancel
Save