|
@ -2012,7 +2012,9 @@ function game_can_start_new_attempt( $game) |
|
|
|
|
|
|
|
|
function game_strlen( $str) |
|
|
function game_strlen( $str) |
|
|
{ |
|
|
{ |
|
|
if( game_get_moodle_version() >= '02.04') |
|
|
if( game_get_moodle_version() >= '02.08') |
|
|
|
|
|
return core_text::strlen( $str); |
|
|
|
|
|
else if( game_get_moodle_version() >= '02.04') |
|
|
return textlib::strlen( $str); |
|
|
return textlib::strlen( $str); |
|
|
else |
|
|
else |
|
|
return textlib_get_instance()->strlen( $str); |
|
|
return textlib_get_instance()->strlen( $str); |
|
@ -2025,12 +2027,16 @@ function game_substr() |
|
|
|
|
|
|
|
|
if( $num == 3) |
|
|
if( $num == 3) |
|
|
{ |
|
|
{ |
|
|
if( game_get_moodle_version() >= '02.04') |
|
|
if( game_get_moodle_version() >= '02.08') |
|
|
|
|
|
return core_text::substr( $a[ 0], $a[ 1], $a[ 2]); |
|
|
|
|
|
else if( game_get_moodle_version() >= '02.04') |
|
|
return textlib::substr( $a[ 0], $a[ 1], $a[ 2]); |
|
|
return textlib::substr( $a[ 0], $a[ 1], $a[ 2]); |
|
|
else |
|
|
else |
|
|
return textlib_get_instance()->substr( $a[ 0], $a[ 1], $a[ 2]); |
|
|
return textlib_get_instance()->substr( $a[ 0], $a[ 1], $a[ 2]); |
|
|
}else if( $num == 2) |
|
|
}else if( $num == 2) |
|
|
{ |
|
|
{ |
|
|
|
|
|
if( game_get_moodle_version() >= '02.08') |
|
|
|
|
|
return core_text::substr( $a[ 0], $a[ 1]); |
|
|
if( game_get_moodle_version() >= '02.04') |
|
|
if( game_get_moodle_version() >= '02.04') |
|
|
return textlib::substr( $a[ 0], $a[ 1]); |
|
|
return textlib::substr( $a[ 0], $a[ 1]); |
|
|
else |
|
|
else |
|
@ -2041,6 +2047,8 @@ function game_substr() |
|
|
|
|
|
|
|
|
function game_strtoupper( $str) |
|
|
function game_strtoupper( $str) |
|
|
{ |
|
|
{ |
|
|
|
|
|
if( game_get_moodle_version() >= '02.08') |
|
|
|
|
|
return core_text::strtoupper( $str); |
|
|
if( game_get_moodle_version() >= '02.04') |
|
|
if( game_get_moodle_version() >= '02.04') |
|
|
return textlib::strtoupper( $str); |
|
|
return textlib::strtoupper( $str); |
|
|
else if( game_get_moodle_version() >= '02.01') |
|
|
else if( game_get_moodle_version() >= '02.01') |
|
@ -2051,6 +2059,8 @@ function game_strtoupper( $str) |
|
|
|
|
|
|
|
|
function game_strpos( $haystack, $needle, $offset = 0) |
|
|
function game_strpos( $haystack, $needle, $offset = 0) |
|
|
{ |
|
|
{ |
|
|
|
|
|
if( game_get_moodle_version() >= '02.08') |
|
|
|
|
|
return core_text::strpos( $haystack, $needle, $offset); |
|
|
if( game_get_moodle_version() >= '02.04') |
|
|
if( game_get_moodle_version() >= '02.04') |
|
|
return textlib::strpos( $haystack, $needle, $offset); |
|
|
return textlib::strpos( $haystack, $needle, $offset); |
|
|
else |
|
|
else |
|
|