protected function get_question_ids($categoryid, $includesubcategories, $tagids = []) {
        $this->ensure_questions_for_category_loaded($categoryid, $includesubcategories, $tagids);
        $categorykey = $this->get_category_key($categoryid, $includesubcategories, $tagids);
        $cachedvalues = $this->availablequestionscache[$categorykey];
        $questionids = [];

        foreach ($cachedvalues as $usecount => $ids) {
            $questionids = array_merge($questionids, array_keys($ids));
        }

        return $questionids;
    }