function attempt(AssessmentTestSession $session, $identifier, array &$average = null) { $start = microtime(); $session->beginAttempt(); $session->endAttempt(new State(array(new ResponseVariable('RESPONSE', Cardinality::SINGLE, BaseType::IDENTIFIER, new Identifier($identifier))))); if (is_null($average) === false) { spentTime($start, microtime(), $average); } }