original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: 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.
docstring_tokens: Get all the usable shortanswer questions from a particular question category .