Permalink
Browse files

Fixes for display of public categories

  • Loading branch information...
1 parent c74a0ca commit b55a466b60e0630fac82a797abb1ddb6111c16e8 moodler committed Oct 20, 2002
Showing with 6 additions and 5 deletions.
  1. +5 −5 mod/quiz/lib.php
  2. +1 −0 mod/quiz/question.php
View
@@ -469,19 +469,19 @@ function quiz_get_category_menu($courseid, $published=false) {
function quiz_print_category_form($course, $current) {
// Prints a form to choose categories
- if (!$categories = quiz_get_category_menu($course->id, true)) {
+ if (!$categories = get_records_sql("SELECT * FROM quiz_categories WHERE course='$course->id' OR publish = '1' ORDER by name ASC")) {
if (!$category = quiz_get_default_category($course->id)) {
notify("Error creating a default category!");
return false;
}
- $categories[$category->id] = $category->name;
}
foreach ($categories as $key => $category) {
if ($category->publish) {
- if ($course = get_record_sql("course", "id", $category->course)) {
- $categories[$key]->name .= " ($course->shortname)";
+ if ($catcourse = get_record("course", "id", $category->course)) {
+ $category->name .= " ($catcourse->shortname)";
}
}
+ $catmenu[$category->id] = $category->name;
}
$strcategory = get_string("category", "quiz");
$strshow = get_string("show", "quiz");
@@ -490,7 +490,7 @@ function quiz_print_category_form($course, $current) {
echo "<TABLE width=\"100%\"><TR><TD>";
echo "<FORM METHOD=POST ACTION=edit.php>";
echo "<B>$strcategory:</B>&nbsp;";
- choose_from_menu($categories, "cat", "$current");
+ choose_from_menu($catmenu, "cat", "$current");
echo "<INPUT TYPE=submit VALUE=\"$strshow\">";
echo "</FORM>";
echo "</TD><TD align=right>";
@@ -193,6 +193,7 @@
}
+ make_upload_directory("$course->id"); // Just in case
$coursefiles = get_directory_list("$CFG->dataroot/$course->id", $CFG->moddata);
foreach ($coursefiles as $filename) {
if (mimeinfo("icon", $filename) == "image.gif") {

0 comments on commit b55a466

Please sign in to comment.