public function test_random_deferredfeedback_qsession17385() { $quiz = (object) array( 'id' => '62', 'course' => '864', 'name' => 'Quiz 2', 'intro' => '', 'introformat' => '1', 'timeopen' => '1264688100', 'timeclose' => '1265112000', 'preferredbehaviour' => 'deferredfeedback', 'attempts' => '1', 'attemptonlast' => '0', 'grademethod' => '3', 'decimalpoints' => '0', 'questiondecimalpoints' => '-2', 'reviewattempt' => '69904', 'reviewcorrectness' => '69904', 'reviewmarks' => '69904', 'reviewspecificfeedback' => '69904', 'reviewgeneralfeedback' => '0', 'reviewrightanswer' => '69904', 'reviewoverallfeedback' => '4368', 'questionsperpage' => '0', 'shufflequestions' => '1', 'shuffleanswers' => '0', 'questions' => '1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,0', 'sumgrades' => '10.00000', 'grade' => '10.00000', 'timecreated' => '0', 'timemodified' => '1264780727', 'timelimit' => '1800', 'password' => '', 'subnet' => '', 'popup' => '0', 'delay1' => '0', 'delay2' => '0', 'showuserpicture' => '0', 'showblocks' => '0', ); $attempt = (object) array( 'id' => '2416', 'uniqueid' => '2424', 'quiz' => '62', 'userid' => '3007', 'attempt' => '1', 'sumgrades' => '10.00000', 'timestart' => '1264727124', 'timefinish' => '1264728508', 'timemodified' => '1265629441', 'layout' => '3,10,8,5,9,6,7,4,1,2,0', 'preview' => '0', 'needsupgradetonewqe' => 1, ); $question = (object) array( 'id' => '1088', 'category' => '150', 'parent' => '1088', 'name' => 'Random (Default for Quiz 2 and sub-categories)', 'questiontext' => '1', 'questiontextformat' => '1', 'generalfeedback' => '', 'oldquestiontextformat' => '0', 'generalfeedbackformat' => '1', 'defaultmark' => '1.0000000', 'penalty' => '0.0000000', 'qtype' => 'random', 'length' => '1', 'stamp' => 'maths.york.ac.uk+100121113938+popbGc', 'version' => 'maths.york.ac.uk+100121113938+DirQfh', 'hidden' => '0', 'timecreated' => '1264073978', 'timemodified' => '1264073978', 'createdby' => '2668', 'modifiedby' => '2668', 'maxmark' => '1.0000000', ); $qsession = (object) array( 'id' => '17385', 'attemptid' => '2424', 'questionid' => '1088', 'newest' => '47328', 'newgraded' => '47328', 'sumpenalty' => '0.0000000', 'manualcomment' => '', 'manualcommentformat' => '1', 'flagged' => '0', ); $qstates = array( 46452 => (object) array( 'id' => '46452', 'attempt' => '2424', 'question' => '1088', 'seq_number' => '0', 'answer' => 'random1054-', 'timestamp' => '1264727124', 'event' => '0', 'grade' => '0.0000000', 'raw_grade' => '0.0000000', 'penalty' => '0.0000000', ), 46454 => (object) array( 'id' => '46454', 'attempt' => '2424', 'question' => '1088', 'seq_number' => '1', 'answer' => 'random1054-4345', 'timestamp' => '1264728508', 'event' => '7', 'grade' => '0.0000000', 'raw_grade' => '0.0000000', 'penalty' => '0.0000000', ), 47328 => (object) array( 'id' => '47328', 'attempt' => '2424', 'question' => '1088', 'seq_number' => '2', 'answer' => 'random1054-4345', 'timestamp' => '1265629441', 'event' => '9', 'grade' => '1.0000000', 'raw_grade' => '1.0000000', 'penalty' => '0.0000000', ), ); Warning: Missing argument 2 for local_qeupgradehelper_load_question(), called in /home/bostelm/apps/git/mathsmoodle.git/local/qeupgradehelper/locallib.php on line 557 and defined in /home/bostelm/apps/git/mathsmoodle.git/local/qeupgradehelper/locallib.php on line 636 Notice: Undefined variable: quizid in /home/bostelm/apps/git/mathsmoodle.git/local/qeupgradehelper/locallib.php on line 644 Notice: Trying to get property of non-object in /home/bostelm/apps/git/mathsmoodle.git/local/qeupgradehelper/locallib.php on line 648 Notice: Undefined property: stdClass::$id in /home/bostelm/apps/git/mathsmoodle.git/question/type/questiontypebase.php on line 644 Notice: Undefined property: stdClass::$id in /home/bostelm/apps/git/mathsmoodle.git/question/type/questiontypebase.php on line 648 $realquestion = (object) array( 'maxmark' => '1.0000000', ); $this->loader->put_question_in_cache($realquestion); $qa = $this->updater->convert_question_attempt($quiz, $attempt, $question, $qsession, $qstates); $expectedqa = (object) array( 'behaviour' => 'deferredfeedback', 'questionid' => 1088, 'variant' => 1, 'maxmark' => 1.0000000, 'minfraction' => 0, 'flagged' => 0, 'questionsummary' => '', 'rightanswer' => '', 'responsesummary' => '', 'timemodified' => 0, 'steps' => array( 0 => (object) array( 'sequencenumber' => 0, 'state' => '', 'fraction' => null, 'timecreated' => 1264727124, 'userid' => 3007, 'data' => array(), ), 1 => (object) array( 'sequencenumber' => 1, 'state' => '', 'fraction' => null, 'timecreated' => 1264728508, 'userid' => 3007, 'data' => array(), ), 2 => (object) array( 'sequencenumber' => 2, 'state' => '', 'fraction' => null, 'timecreated' => 1265629441, 'userid' => 3007, 'data' => array(), ), ), ); $this->compare_qas($expectedqa, $qa); }