original_string: public function is_question_available($categoryid, $includesubcategories, $questionid, $tagids = []) {
          $this->ensure_questions_for_category_loaded($categoryid, $includesubcategories, $tagids);
          $categorykey = $this->get_category_key($categoryid, $includesubcategories, $tagids);
  
          foreach ($this->availablequestionscache[$categorykey] as $questionids) {
              if (isset($questionids[$questionid])) {
                  $this->use_question($questionid);
                  return true;
              }
          }
  
          return false;
      }
code: public function is_question_available($categoryid, $includesubcategories, $questionid, $tagids = []) {
          $this->ensure_questions_for_category_loaded($categoryid, $includesubcategories, $tagids);
          $categorykey = $this->get_category_key($categoryid, $includesubcategories, $tagids);
  
          foreach ($this->availablequestionscache[$categorykey] as $questionids) {
              if (isset($questionids[$questionid])) {
                  $this->use_question($questionid);
                  return true;
              }
          }
  
          return false;
      }
code_tokens: public function is_question_available ( $ categoryid , $ includesubcategories , $ questionid , $ tagids = [ ] ) { $ this -> ensure_questions_for_category_loaded ( $ categoryid , $ includesubcategories , $ tagids ) ; $ categorykey = $ this -> get_category_key ( $ categoryid , $ includesubcategories , $ tagids ) ; foreach ( $ this -> availablequestionscache [ $ categorykey ] as $ questionids ) { if ( isset ( $ questionids [ $ questionid ] ) ) { $ this -> use_question ( $ questionid ) ; return true ; } } return false ; }
docstring: Check whether a given question is available in a given category. If so, mark it used.
  If an optional list of tag ids are provided, then the question must be tagged with
  ALL of the provided tags to be considered as available.
  
  @param int $categoryid the id of a category in the question bank.
  @param bool $includesubcategories wether to pick a question from exactly
  that category, or that category and subcategories.
  @param int $questionid the question that is being used.
  @param array $tagids An array of tag ids. Only the questions that are tagged with all the provided tagids can be available.
  @return bool whether the question is available in the requested category.
docstring_tokens: Check whether a given question is available in a given category . If so mark it used . If an optional list of tag ids are provided then the question must be tagged with ALL of the provided tags to be considered as available .