diff --git a/locallib.php b/locallib.php index 2d74f2e..9d0263d 100755 --- a/locallib.php +++ b/locallib.php @@ -567,8 +567,8 @@ function game_questions_shortanswer_question( $game) $select = 'q.category='.$game->questioncategoryid; if( $game->subcategories){ $cats = question_categorylist( $game->questioncategoryid); - if( strpos( $cats, ',') > 0){ - $select = 'q.category in ('.$cats.')'; + if( count( $cats)){ + $select = 'q.category in ('.implode(',', $cats).')'; } } diff --git a/millionaire/play.php b/millionaire/play.php index ed8cccc..dfc81be 100755 --- a/millionaire/play.php +++ b/millionaire/play.php @@ -311,9 +311,9 @@ function game_millionaire_SelectQuestion( &$aAnswer, $game, $attempt, &$milliona $select = 'category='.$game->questioncategoryid; if( $game->subcategories){ $cats = question_categorylist( $game->questioncategoryid); - if( strpos( $cats, ',') > 0){ - $select = 'category in ('.$cats.')'; - } + if( count( $cats)){ + $select = 'q.category in ('.implode(',', $cats).')'; + } } $select .= " AND qtype='multichoice'"; diff --git a/version.php b/version.php index 6d65596..db4d534 100755 --- a/version.php +++ b/version.php @@ -11,7 +11,7 @@ defined('MOODLE_INTERNAL') || die(); $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->cron = 0; // Period for cron to check this module (secs) -$module->release = 'v.2.13.27 (2013012704)'; +$module->release = 'v.2.13.28 (2013012801)';