From 76e002e15bcd819c35f0eba306ca232aca60475f Mon Sep 17 00:00:00 2001 From: bdaloukas Date: Sat, 24 Aug 2013 09:53:41 +0300 Subject: [PATCH] Fix: Backward compatibility with Moodle 2.0 and textlib --- hangman/play.php | 8 ++++---- locallib.php | 2 +- version.php | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hangman/play.php b/hangman/play.php index b2aeaea..f162887 100755 --- a/hangman/play.php +++ b/hangman/play.php @@ -154,10 +154,10 @@ function game_hangman_continue( $id, $game, $attempt, $hangman, $newletter, $act $letters = ''; if( $game->param1){ - $letters .= game_substr3( $min->answer, 0, 1); + $letters .= game_substr( $min->answer, 0, 1); } if( $game->param2){ - $letters .= game_substr3( $min->answer, -1, 1); + $letters .= game_substr( $min->answer, -1, 1); } $newrec->letters = $letters; @@ -327,7 +327,7 @@ function hangman_showpage(&$done, &$correct, &$wrong, $max, &$word_line, &$word_ $correct = 0; for ($x=0; $x < $len; $x++) { - $char = game_substr3( $word, $x, 1); + $char = game_substr( $word, $x, 1); if( $showsolution){ $word_line2 .= ( $char == " " ? '  ' : $char); @@ -351,7 +351,7 @@ function hangman_showpage(&$done, &$correct, &$wrong, $max, &$word_line, &$word_ for ($c=0; $c < $len_alpha; $c++) { - $char = game_substr3( $alpha, $c, 1); + $char = game_substr( $alpha, $c, 1); if ( game_strpos($letters, $char) === false) { diff --git a/locallib.php b/locallib.php index 4b5a9b0..589f5f4 100755 --- a/locallib.php +++ b/locallib.php @@ -434,7 +434,7 @@ function game_questions_selectrandom_detail( $table, $select, $id_field="id", $c return $a; }else { - $id = array_rand( $a, $count);print_r( $a); echo "count=$count
"; + $id = array_rand( $a, $count); return ( $count == 1 ? array( $id) : $id); } } diff --git a/version.php b/version.php index 7d874bb..9b3faab 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 = 2013082402; // The current module version (Date: YYYYMMDDXX) +$module->version = 2013082403; // 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 = '3.8.24.2'; +$module->release = '3.8.24.3';