public function test_multichoice_deferredfeedback_qsession11531() {
$quiz = (object) array(
'id' => '36',
'course' => '247',
'name' => 'Quiz no. 1',
'intro' => 'This quiz consists of ten questions in the form of multiple choice answers. Click the correct answer and move to the next question. Your result will be shown once you complete it. ',
'introformat' => '1',
'timeopen' => '1093959900',
'timeclose' => '1251726300',
'preferredbehaviour' => 'deferredfeedback',
'attempts' => '0',
'attemptonlast' => '0',
'grademethod' => '1',
'decimalpoints' => '2',
'questiondecimalpoints' => '-2',
'reviewattempt' => '69632',
'reviewcorrectness' => '69632',
'reviewmarks' => '69632',
'reviewspecificfeedback' => '69632',
'reviewgeneralfeedback' => '69632',
'reviewrightanswer' => '69632',
'reviewoverallfeedback' => '4096',
'questionsperpage' => '0',
'shufflequestions' => '1',
'shuffleanswers' => '0',
'questions' => '148,140,147,149,146,141,142,144,145,143',
'sumgrades' => '10.00000',
'grade' => '0.00000',
'timecreated' => '0',
'timemodified' => '1192782252',
'timelimit' => '0',
'password' => '',
'subnet' => '',
'popup' => '0',
'delay1' => '0',
'delay2' => '0',
'showuserpicture' => '0',
'showblocks' => '0',
);
$attempt = (object) array(
'id' => '902',
'uniqueid' => '902',
'quiz' => '36',
'userid' => '1850',
'attempt' => '2',
'sumgrades' => '6.00000',
'timestart' => '1124876814',
'timefinish' => '1124876826',
'timemodified' => '1124876826',
'layout' => '1,2,3,4,5,6,7,8,9,10',
'preview' => '0',
'needsupgradetonewqe' => 1,
);
$question = (object) array(
'id' => '140',
'category' => '35',
'parent' => '0',
'name' => 'parliaments',
'questiontext' => 'How many national Parliaments and Assemblies are there in the UK?',
'questiontextformat' => '1',
'generalfeedback' => '',
'oldquestiontextformat' => '1',
'generalfeedbackformat' => '1',
'defaultmark' => '1.0000000',
'penalty' => '0.1000000',
'qtype' => 'multichoice',
'length' => '1',
'stamp' => 'learn.gold.ac.uk+040831135202+QRgILf',
'version' => '5',
'hidden' => '0',
'timecreated' => '0',
'timemodified' => '0',
'createdby' => null,
'modifiedby' => null,
'maxmark' => '1.0000000',
'options' => (object) array(
'id' => '55',
'question' => '140',
'layout' => '0',
'answers' => array(
284 => (object) array(
'id' => '284',
'question' => '140',
'answer' => '4 parliaments, no assemblies',
'answerformat' => '0',
'fraction' => '0.0000000',
'feedback' => '',
'feedbackformat' => '1',
),
285 => (object) array(
'id' => '285',
'question' => '140',
'answer' => '2 parliaments, 2 assemblies',
'answerformat' => '0',
'fraction' => '1.0000000',
'feedback' => 'Parliaments in England and Scotland, Assemblies in Wales and Northern Ireland',
'feedbackformat' => '1',
),
286 => (object) array(
'id' => '286',
'question' => '140',
'answer' => '1 parliament, 3 assemblies',
'answerformat' => '0',
'fraction' => '0.0000000',
'feedback' => '',
'feedbackformat' => '1',
),
),
'single' => '1',
'shuffleanswers' => '1',
'correctfeedback' => '',
'correctfeedbackformat' => '1',
'partiallycorrectfeedback' => '1',
'partiallycorrectfeedbackformat' => '0',
'incorrectfeedback' => '',
'incorrectfeedbackformat' => '1',
'answernumbering' => 'ABCD',
'shownumcorrect' => '0',
),
'hints' => array(
),
);
$qsession = (object) array(
'id' => '11531',
'attemptid' => '902',
'questionid' => '140',
'newest' => '3052',
'newgraded' => '3052',
'sumpenalty' => '0.0000000',
'manualcomment' => '',
'manualcommentformat' => '1',
'flagged' => '0',
);
$qstates = array(
3052 => (object) array(
'id' => '3052',
'attempt' => '902',
'question' => '140',
'seq_number' => '0',
'answer' => '286',
'timestamp' => '1124876826',
'event' => '0',
'grade' => '0.0000000',
'raw_grade' => '0.0000000',
'penalty' => '0.0000000',
),
);
$qa = $this->updater->convert_question_attempt($quiz, $attempt, $question, $qsession, $qstates);
$expectedqa = (object) array(
'behaviour' => 'deferredfeedback',
'questionid' => 140,
'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' => 1124876826,
'userid' => 1850,
'data' => array(),
),
),
);
$this->compare_qas($expectedqa, $qa);
}