Browse Source

Fix: Backward compatibility with Moodle 2.0 and textlib

MOODLE_20_STABLE
bdaloukas 12 years ago
parent
commit
76e002e15b
  1. 8
      hangman/play.php
  2. 2
      locallib.php
  3. 4
      version.php

8
hangman/play.php

@ -154,10 +154,10 @@ function game_hangman_continue( $id, $game, $attempt, $hangman, $newletter, $act
$letters = ''; $letters = '';
if( $game->param1){ if( $game->param1){
$letters .= game_substr3( $min->answer, 0, 1); $letters .= game_substr( $min->answer, 0, 1);
} }
if( $game->param2){ if( $game->param2){
$letters .= game_substr3( $min->answer, -1, 1); $letters .= game_substr( $min->answer, -1, 1);
} }
$newrec->letters = $letters; $newrec->letters = $letters;
@ -327,7 +327,7 @@ function hangman_showpage(&$done, &$correct, &$wrong, $max, &$word_line, &$word_
$correct = 0; $correct = 0;
for ($x=0; $x < $len; $x++) for ($x=0; $x < $len; $x++)
{ {
$char = game_substr3( $word, $x, 1); $char = game_substr( $word, $x, 1);
if( $showsolution){ if( $showsolution){
$word_line2 .= ( $char == " " ? '&nbsp; ' : $char); $word_line2 .= ( $char == " " ? '&nbsp; ' : $char);
@ -351,7 +351,7 @@ function hangman_showpage(&$done, &$correct, &$wrong, $max, &$word_line, &$word_
for ($c=0; $c < $len_alpha; $c++) 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) if ( game_strpos($letters, $char) === false)
{ {

2
locallib.php

@ -434,7 +434,7 @@ function game_questions_selectrandom_detail( $table, $select, $id_field="id", $c
return $a; return $a;
}else }else
{ {
$id = array_rand( $a, $count);print_r( $a); echo "count=$count<br>"; $id = array_rand( $a, $count);
return ( $count == 1 ? array( $id) : $id); return ( $count == 1 ? array( $id) : $id);
} }
} }

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 = 2013082402; // The current module version (Date: YYYYMMDDXX) $module->version = 2013082403; // 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 = '3.8.24.2'; $module->release = '3.8.24.3';

Loading…
Cancel
Save