You are here

function make_upload_directory in Quiz 6.6

Same name and namespace in other branches
  1. 6.5 includes/moodle_support.php \make_upload_directory()
4 calls to make_upload_directory()
get_course_media_files in includes/moodle/question/format/qti2/qt_common.php
gets a list of all the media files for the given course
qformat_coursetestmanager::importprocess in includes/moodle/question/format/coursetestmanager/format.php
Process the file This method should not normally be overidden
qformat_default::exportprocess in includes/moodle/question/format.php
Do the export For most types this should not need to be overrided
qformat_qti2::exportprocess in includes/moodle/question/format/qti2/format.php
exports the questions in a question category to the given location

File

includes/moodle_support.php, line 201

Code

function make_upload_directory($directory, $shownotices = true) {
  global $CFG;

  // just use Drupal's method for this
  $dir = file_directory_path() . "/{$directory}";

  // doesn't work?
  if (file_exists($dir)) {
    return $dir;
  }

  // already there
  $success = mkdir($dir, $CFG->directorypermissions, true);
  if ($success) {
    return $dir;
  }
  else {
    return false;
  }
}