original_string: protected function get_current_category($categoryandcontext) {
          global $DB, $OUTPUT;
          list($categoryid, $contextid) = explode(',', $categoryandcontext);
          if (!$categoryid) {
              $this->print_choose_category_message($categoryandcontext);
              return false;
          }
  
          if (!$category = $DB->get_record('question_categories',
                  array('id' => $categoryid, 'contextid' => $contextid))) {
              echo $OUTPUT->box_start('generalbox questionbank');
              echo $OUTPUT->notification('Category not found!');
              echo $OUTPUT->box_end();
              return false;
          }
  
          return $category;
      }
code: protected function get_current_category($categoryandcontext) {
          global $DB, $OUTPUT;
          list($categoryid, $contextid) = explode(',', $categoryandcontext);
          if (!$categoryid) {
              $this->print_choose_category_message($categoryandcontext);
              return false;
          }
  
          if (!$category = $DB->get_record('question_categories',
                  array('id' => $categoryid, 'contextid' => $contextid))) {
              echo $OUTPUT->box_start('generalbox questionbank');
              echo $OUTPUT->notification('Category not found!');
              echo $OUTPUT->box_end();
              return false;
          }
  
          return $category;
      }
code_tokens: protected function get_current_category ( $ categoryandcontext ) { global $ DB , $ OUTPUT ; list ( $ categoryid , $ contextid ) = explode ( ',' , $ categoryandcontext ) ; if ( ! $ categoryid ) { $ this -> print_choose_category_message ( $ categoryandcontext ) ; return false ; } if ( ! $ category = $ DB -> get_record ( 'question_categories' , array ( 'id' => $ categoryid , 'contextid' => $ contextid ) ) ) { echo $ OUTPUT -> box_start ( 'generalbox questionbank' ) ; echo $ OUTPUT -> notification ( 'Category not found!' ) ; echo $ OUTPUT -> box_end ( ) ; return false ; } return $ category ; }
docstring: Look up the category record based on cateogry ID and context
  @param string $categoryandcontext categoryID,contextID as used with question_bank_view->display()
  @return \stdClass The category record
docstring_tokens: Look up the category record based on cateogry ID and context