protected function use_question($questionid) {
        if (isset($this->recentlyusedquestions[$questionid])) {
            $this->recentlyusedquestions[$questionid] += 1;
        } else {
            $this->recentlyusedquestions[$questionid] = 1;
        }

        foreach ($this->availablequestionscache as $categorykey => $questionsforcategory) {
            foreach ($questionsforcategory as $numuses => $questionids) {
                if (!isset($questionids[$questionid])) {
                    continue;
                }
                unset($this->availablequestionscache[$categorykey][$numuses][$questionid]);
                if (empty($this->availablequestionscache[$categorykey][$numuses])) {
                    unset($this->availablequestionscache[$categorykey][$numuses]);
                }
            }
        }
    }
protected function use_question($questionid) {
        if (isset($this->recentlyusedquestions[$questionid])) {
            $this->recentlyusedquestions[$questionid] += 1;
        } else {
            $this->recentlyusedquestions[$questionid] = 1;
        }

        foreach ($this->availablequestionscache as $categorykey => $questionsforcategory) {
            foreach ($questionsforcategory as $numuses => $questionids) {
                if (!isset($questionids[$questionid])) {
                    continue;
                }
                unset($this->availablequestionscache[$categorykey][$numuses][$questionid]);
                if (empty($this->availablequestionscache[$categorykey][$numuses])) {
                    unset($this->availablequestionscache[$categorykey][$numuses]);
                }
            }
        }
    }
protected function use_question ( $ questionid ) { if ( isset ( $ this -> recentlyusedquestions [ $ questionid ] ) ) { $ this -> recentlyusedquestions [ $ questionid ] += 1 ; } else { $ this -> recentlyusedquestions [ $ questionid ] = 1 ; } foreach ( $ this -> availablequestionscache as $ categorykey => $ questionsforcategory ) { foreach ( $ questionsforcategory as $ numuses => $ questionids ) { if ( ! isset ( $ questionids [ $ questionid ] ) ) { continue ; } unset ( $ this -> availablequestionscache [ $ categorykey ] [ $ numuses ] [ $ questionid ] ) ; if ( empty ( $ this -> availablequestionscache [ $ categorykey ] [ $ numuses ] ) ) { unset ( $ this -> availablequestionscache [ $ categorykey ] [ $ numuses ] ) ; } } } }
Update the internal data structures to indicate that a given question has
been used one more time.

@param int $questionid the question that is being used.
Update the internal data structures to indicate that a given question has been used one more time .