public function add_question(question_definition $question, $maxmark = null) {
        $qa = new question_attempt($question, $this->get_id(), $this->observer, $maxmark);
        $qa->set_slot($this->next_slot_number());
        $this->questionattempts[$this->next_slot_number()] = $qa;
        $this->observer->notify_attempt_added($qa);
        return $qa->get_slot();
    }