/** * Override default behaviour so that we can use a specialised behaviour * that caches test results returned by the call to grade_response(). * * @param question_attempt $qa the attempt we are creating an behaviour for. * @param string $preferredbehaviour the requested type of behaviour. * @return question_behaviour the new behaviour object. */ public function make_behaviour(question_attempt $qa, $preferredbehaviour) { // TODO: see if there's some way or issuing a warning message when // coderunner questions aren't being used in an adaptive mode. if ($preferredbehaviour == 'adaptive') { return new qbehaviour_adaptive_adapted_for_coderunner($qa, $preferredbehaviour); } else { return parent::make_behaviour($qa, $preferredbehaviour); } }