function qformat_coursetestmanager::getquestioncategories in Quiz 6.5
Same name and namespace in other branches
- 6.6 includes/moodle/question/format/coursetestmanager/format.php \qformat_coursetestmanager::getquestioncategories()
1 call to qformat_coursetestmanager::getquestioncategories()
- qformat_coursetestmanager::importprocess in includes/moodle/question/format/coursetestmanager/format.php
- Process the file
This method should not normally be overidden
File
- includes/moodle/question/format/coursetestmanager/format.php, line 338
Class
- qformat_coursetestmanager
Code
function getquestioncategories($filename, $mdapath = "", $hostname = "") {
global $CFG, $result;
$sql = "SELECT Distinct module FROM TBQuestions";
if (PHP_OS == "WINNT") {
$ldb =& $this
->connect_win($filename);
$qset = $ldb
->Execute("{$sql}");
if (!$qset->EOF) {
$records = $qset
->GetArray(true);
foreach ($records as $record) {
$categories[$record[0]] = $record[0];
}
}
else {
$this
->err("There were no records in the database.", $dsn);
$ldb
->Close();
return false;
}
$ldb
->Close();
}
else {
$result = $this
->query_linux($sql, $filename, $mdapath, $hostname);
for ($i = 0; $i < count($result); $i++) {
$categories[$result[$i][0]] = $result[$i][0];
}
}
return $categories;
}