public function load_questions() {
        if ($this->choose > count($this->availablequestions)) {
            throw new coding_exception('notenoughtshortanswerquestions');
        }

        $questionids = draw_rand_array($this->availablequestions, $this->choose);
        $questions = array();
        foreach ($questionids as $questionid) {
            $questions[] = question_bank::load_question($questionid);
        }
        return $questions;
    }
public function load_questions() {
        if ($this->choose > count($this->availablequestions)) {
            throw new coding_exception('notenoughtshortanswerquestions');
        }

        $questionids = draw_rand_array($this->availablequestions, $this->choose);
        $questions = array();
        foreach ($questionids as $questionid) {
            $questions[] = question_bank::load_question($questionid);
        }
        return $questions;
    }
public function load_questions ( ) { if ( $ this -> choose > count ( $ this -> availablequestions ) ) { throw new coding_exception ( 'notenoughtshortanswerquestions' ) ; } $ questionids = draw_rand_array ( $ this -> availablequestions , $ this -> choose ) ; $ questions = array ( ) ; foreach ( $ questionids as $ questionid ) { $ questions [ ] = question_bank :: load_question ( $ questionid ) ; } return $ questions ; }
Choose and load the desired number of questions.
@return array of short answer questions.
Choose and load the desired number of questions .