Browse Source

Fix: Hangman with greek and english words in the same game

MOODLE_20_STABLE
Vasilis Daloukas 10 years ago
parent
commit
a9501acb77
  1. 2
      hangman/play.php
  2. 17
      locallib.php
  3. 4
      version.php

2
hangman/play.php

@ -52,7 +52,7 @@ function game_hangman_continue( $id, $game, $attempt, $hangman, $newletter, $act
}
$allletters = game_getallletters( $answer2, $game->language);
if( $allletters == ''){
continue;
}

17
locallib.php

@ -51,16 +51,27 @@ function game_get_moodle_version()
function game_upper( $str, $lang='')
{
$str = game_strtoupper( $str);
if( $lang == 'user')
return $str;
$str = game_strtoupper( $str);
/*
$strings = get_string_manager()->load_component_strings( 'game', ($lang == '' ? 'en' : $lang));
if( !isset( $strings[ 'convertfrom']))
return $str;
if( !isset( $strings[ 'convertto']))
return $str;
*/
switch( $lang)
{
case 'el':
$from = 'ΆΈΉΊΌΎΏ';
$to = 'ΑΕΗΙΟΥΩ';
break;
default:
return $str;
}
$from = $strings[ 'convertfrom'];
$to = $strings[ 'convertto'];
$len = game_strlen( $from);
for($i=0; $i < $len; $i++){
$str = str_replace( game_substr( $from, $i, 1), game_substr( $to, $i, 1), $str);

4
version.php

@ -22,10 +22,10 @@ if( !isset( $plugin))
$useplugin = 2;
$plugin->component = 'mod_game'; // Full name of the plugin (used for diagnostics)
$plugin->version = 2015071404; // The current module version (Date: YYYYMMDDXX)
$plugin->version = 20150715; // The current module version (Date: YYYYMMDDXX)
$plugin->requires = 2010112400; // Requires Moodle 2.0
$plugin->cron = 0; // Period for cron to check this module (secs)
$plugin->release = '3.30.14.4';
$plugin->release = '3.30.15';
if( $useplugin != 2)
$module = $plugin;

Loading…
Cancel
Save