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

        if ($subcategories) {
            $categoryids = question_categorylist($categoryid);
        } else {
            $categoryids = array($categoryid);
        }

        $questionids = question_bank::get_finder()->get_questions_from_categories(
                $categoryids, "qtype = 'shortanswer'");
        $this->availablesaquestionsbycategory[$categoryid][$subcategories] = $questionids;
        return $questionids;
    }
public function get_available_saquestions_from_category($categoryid, $subcategories) {
        if (isset($this->availablesaquestionsbycategory[$categoryid][$subcategories])) {
            return $this->availablesaquestionsbycategory[$categoryid][$subcategories];
        }

        if ($subcategories) {
            $categoryids = question_categorylist($categoryid);
        } else {
            $categoryids = array($categoryid);
        }

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

@param integer $categoryid the id of a question category.
@param bool $subcategories whether to include questions from subcategories.
@return array of question records.
Get all the usable shortanswer questions from a particular question category .