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;
    }
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;
    }
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 ; }
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
Look up the category record based on cateogry ID and context