]> git.mjollnir.org Git - moodle.git/commitdiff
Make sure category from correct course is shown.
authorgustav_delius <gustav_delius>
Tue, 18 Apr 2006 22:53:38 +0000 (22:53 +0000)
committergustav_delius <gustav_delius>
Tue, 18 Apr 2006 22:53:38 +0000 (22:53 +0000)
question/showbank.php

index 3ffcafdc61897fb61f77f5b74103d2e55a91bc7d..318ea7b9a4c4e4e7a8163723e30a35d9d9f96dad 100644 (file)
 
 /// all commands have been dealt with, now print the page
 
-    if (empty($SESSION->questioncat) or !record_exists('question_categories', 'id', $SESSION->questioncat)) {
+if (empty($SESSION->questioncat) or !count_records_select("question_categories", "id = '{$SESSION->questioncat}' AND (course = '{$course->id}' OR publish = '1')")) {
         $category = get_default_question_category($course->id);
         $SESSION->questioncat = $category->id;
     }