function qformat_gift::repchar in Quiz 6.5
Same name and namespace in other branches
- 6.6 includes/moodle/question/format/gift/format.php \qformat_gift::repchar()
1 call to qformat_gift::repchar()
- qformat_gift::writequestion in includes/moodle/question/format/gift/format.php
- convert a single question object into text output in the given
format.
This must be overriden
File
- includes/moodle/question/format/gift/format.php, line 517
Class
- qformat_gift
- @package questionbank
@subpackage importexport
Code
function repchar($text, $format = 0) {
$reserved = array(
'#',
'=',
'~',
'{',
'}',
':',
"\n",
"\r",
);
$escaped = array(
'\\#',
'\\=',
'\\~',
'\\{',
'\\}',
'\\:',
'\\n',
'',
);
$newtext = str_replace($reserved, $escaped, $text);
$format = 0;
if ($format) {
$newtext = format_text($format);
}
return $newtext;
}