public function get_available_questions_from_category($categoryid, $subcategories) {
        if (isset($this->availablequestionsbycategory[$categoryid][$subcategories])) {
            return $this->availablequestionsbycategory[$categoryid][$subcategories];
        }

        $this->init_qtype_lists();
        if ($subcategories) {
            $categoryids = question_categorylist($categoryid);
        } else {
            $categoryids = array($categoryid);
        }

        $questionids = question_bank::get_finder()->get_questions_from_categories(
                $categoryids, 'qtype NOT IN (' . $this->excludedqtypes . ')');
        $this->availablequestionsbycategory[$categoryid][$subcategories] = $questionids;
        return $questionids;
    }
public function get_available_questions_from_category($categoryid, $subcategories) {
        if (isset($this->availablequestionsbycategory[$categoryid][$subcategories])) {
            return $this->availablequestionsbycategory[$categoryid][$subcategories];
        }

        $this->init_qtype_lists();
        if ($subcategories) {
            $categoryids = question_categorylist($categoryid);
        } else {
            $categoryids = array($categoryid);
        }

        $questionids = question_bank::get_finder()->get_questions_from_categories(
                $categoryids, 'qtype NOT IN (' . $this->excludedqtypes . ')');
        $this->availablequestionsbycategory[$categoryid][$subcategories] = $questionids;
        return $questionids;
    }
public function get_available_questions_from_category ( $ categoryid , $ subcategories ) { if ( isset ( $ this -> availablequestionsbycategory [ $ categoryid ] [ $ subcategories ] ) ) { return $ this -> availablequestionsbycategory [ $ categoryid ] [ $ subcategories ] ; } $ this -> init_qtype_lists ( ) ; if ( $ subcategories ) { $ categoryids = question_categorylist ( $ categoryid ) ; } else { $ categoryids = array ( $ categoryid ) ; } $ questionids = question_bank :: get_finder ( ) -> get_questions_from_categories ( $ categoryids , 'qtype NOT IN (' . $ this -> excludedqtypes . ')' ) ; $ this -> availablequestionsbycategory [ $ categoryid ] [ $ subcategories ] = $ questionids ; return $ questionids ; }
Get all the usable questions from a particular question category.

@param int $categoryid the id of a question category.
@param bool whether to include questions from subcategories.
@param string $questionsinuse comma-separated list of question ids to
exclude from consideration.
@return array of question records.
Get all the usable questions from a particular question category .