You are here

function qformat_qti2::file_full_path in Quiz 6.5

Same name and namespace in other branches
  1. 6.6 includes/moodle/question/format/qti2/format.php \qformat_qti2::file_full_path()

File

includes/moodle/question/format/qti2/format.php, line 915

Class

qformat_qti2

Code

function file_full_path($file, $courseid) {
  global $CFG;
  if (substr(strtolower($file), 0, 7) == 'http://') {
    $url = $file;
  }
  else {
    if ($CFG->slasharguments) {

      // Use this method if possible for better caching
      $url = "{$CFG->wwwroot}/file.php/{$courseid}/{$file}";
    }
    else {
      $url = "{$CFG->wwwroot}/file.php?file=/{$courseid}/{$file}";
    }
  }
  return $url;
}