You are here

function question_category_select_menu in Quiz 6.5

Same name and namespace in other branches
  1. 6.6 includes/moodle/lib/questionlib.php \question_category_select_menu()

Output a select menu of question categories.

Categories from this course and (optionally) published categories from other courses are included. Optionally, only categories the current user may edit can be included.

Parameters

integer $courseid the id of the course to get the categories for.:

integer $published if true, include publised categories from other courses.:

integer $only_editable if true, exclude categories this user is not allowed to edit.:

integer $selected optionally, the id of a category to be selected by default in the dropdown.:

File

includes/moodle/lib/questionlib.php, line 1871

Code

function question_category_select_menu($contexts, $top = false, $currentcat = 0, $selected = "", $nochildrenof = -1) {
  $categoriesarray = question_category_options($contexts, $top, $currentcat, false, $nochildrenof);
  if ($selected) {
    $nothing = '';
  }
  else {
    $nothing = 'choose';
  }
  choose_from_menu_nested($categoriesarray, 'category', $selected, $nothing);
}