You are here

function qformat_coursetestmanager::getcoursedirs in Quiz 6.6

Same name and namespace in other branches
  1. 6.5 includes/moodle/question/format/coursetestmanager/format.php \qformat_coursetestmanager::getcoursedirs()
1 call to qformat_coursetestmanager::getcoursedirs()
qformat_coursetestmanager::findfile in includes/moodle/question/format/coursetestmanager/format.php

File

includes/moodle/question/format/coursetestmanager/format.php, line 477

Class

qformat_coursetestmanager

Code

function getcoursedirs() {
  global $CFG;

  // for every course in the system, find the root of the data directory
  $courses = get_records_sql("select distinct id,fullname from " . $CFG->prefix . "course");
  $dirs = array();
  if ($courses) {
    foreach ($courses as $course) {
      $dir = $CFG->dataroot . "/" . $course->id;
      if (is_dir($dir)) {
        $dirs[] = $dir;
      }
    }
  }
  return $dirs;
}