function qformat_qti2::flatten_image_name in Quiz 6.5
Same name and namespace in other branches
- 6.6 includes/moodle/question/format/qti2/format.php \qformat_qti2::flatten_image_name()
returns a flattened image name - with all /, \ and : replaced with other characters
used to convert a file or url to a qti-permissable identifier
Parameters
string name:
Return value
string
2 calls to qformat_qti2::flatten_image_name()
- qformat_qti2::copy_and_flatten in includes/
moodle/ question/ format/ qti2/ format.php - flattens $object['media'], copies $object['media'] to $path, and sets $object['mediamimetype']
- qformat_qti2::handle_questions_media in includes/
moodle/ question/ format/ qti2/ format.php - copies all files needed by the questions to the given $path, and flattens the file names
File
- includes/
moodle/ question/ format/ qti2/ format.php, line 911
Class
Code
function flatten_image_name($name) {
return str_replace(array(
'/',
'\\',
':',
), array(
'_',
'-',
'.',
), $name);
}