function qformat_blackboard_6::copy_file_to_course in Quiz 6.6
Same name and namespace in other branches
- 6.5 includes/moodle/question/format/blackboard_6/format.php \qformat_blackboard_6::copy_file_to_course()
1 call to qformat_blackboard_6::copy_file_to_course()
- qformat_blackboard_6::process_block in includes/
moodle/ question/ format/ blackboard_6/ format.php
File
- includes/
moodle/ question/ format/ blackboard_6/ format.php, line 129
Class
Code
function copy_file_to_course($filename) {
global $CFG, $COURSE;
$filename = str_replace('\\', '/', $filename);
$fullpath = $this->temp_dir . '/res00001/' . $filename;
$basename = basename($filename);
$copy_to = $CFG->dataroot . '/' . $COURSE->id . '/bb_import';
if ($this
->check_dir_exists($copy_to, true)) {
if (is_readable($fullpath)) {
$copy_to .= '/' . $basename;
if (!copy($fullpath, $copy_to)) {
return false;
}
else {
return $copy_to;
}
}
}
else {
return false;
}
}