You are here

function question_add_context_in_key in Quiz 6.5

Same name and namespace in other branches
  1. 6.6 includes/moodle/lib/questionlib.php \question_add_context_in_key()
1 call to question_add_context_in_key()
question_category_options in includes/moodle/lib/questionlib.php
Output an array of question categories.

File

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

Code

function question_add_context_in_key($categories) {
  $newcatarray = array();
  foreach ($categories as $id => $category) {
    $category->parent = "{$category->parent},{$category->contextid}";
    $category->id = "{$category->id},{$category->contextid}";
    $newcatarray["{$id},{$category->contextid}"] = $category;
  }
  return $newcatarray;
}