public function test_multichoice_adaptivenopenalty_qsession36362() {
$quiz = (object) array(
'id' => '77',
'course' => '863',
'name' => 'Quiz about hypothesis testing',
'intro' => 'This is a short quiz to give you some extra practice questions. The \'score\' is not recorded (and doesn\'t count towards your mark for the course in any way) - it\'s just to let you know how many you get right. Feel free to re-take the quiz as many times as you like.
There is also no explanation provided for the answers: if you get a question wrong then you need to work out for yourself why you got it wrong, and how the correct answer can be obtained.
Please use the discussion forum for the course to ask for help if you\'re stuck on any of the questions, and to help others if you think you have the right answer. ',
'introformat' => '1',
'timeopen' => '0',
'timeclose' => '0',
'preferredbehaviour' => 'adaptivenopenalty',
'attempts' => '0',
'attemptonlast' => '1',
'grademethod' => '1',
'decimalpoints' => '0',
'questiondecimalpoints' => '-2',
'reviewattempt' => '65536',
'reviewcorrectness' => '69632',
'reviewmarks' => '69632',
'reviewspecificfeedback' => '0',
'reviewgeneralfeedback' => '0',
'reviewrightanswer' => '0',
'reviewoverallfeedback' => '0',
'questionsperpage' => '0',
'shufflequestions' => '0',
'shuffleanswers' => '0',
'questions' => '2078,2079,2081,2080,2082,0',
'sumgrades' => '10.00000',
'grade' => '10.00000',
'timecreated' => '0',
'timemodified' => '1267003116',
'timelimit' => '0',
'password' => '',
'subnet' => '',
'popup' => '0',
'delay1' => '0',
'delay2' => '0',
'showuserpicture' => '0',
'showblocks' => '0',
);
$attempt = (object) array(
'id' => '5435',
'uniqueid' => '5443',
'quiz' => '77',
'userid' => '3023',
'attempt' => '3',
'sumgrades' => '8.00000',
'timestart' => '1270550410',
'timefinish' => '1271960138',
'timemodified' => '1271960138',
'layout' => '2078,2079,2081,2080,2082,0',
'preview' => '0',
'needsupgradetonewqe' => 1,
);
$question = (object) array(
'id' => '2081',
'category' => '175',
'parent' => '0',
'name' => 'p-value',
'questiontext' => 'If the p-value of a hypothesis test is equal to 0.046, at which of the following significance levels would you reject $H_0$?
',
'questiontextformat' => '1',
'generalfeedback' => '',
'oldquestiontextformat' => '1',
'generalfeedbackformat' => '1',
'defaultmark' => '2.0000000',
'penalty' => '0.0000000',
'qtype' => 'multichoice',
'length' => '1',
'stamp' => 'maths.york.ac.uk+100224100416+vjM7Ob',
'version' => 'maths.york.ac.uk+100224100600+ftUggz',
'hidden' => '0',
'timecreated' => '1267005856',
'timemodified' => '1267005960',
'createdby' => '2677',
'modifiedby' => '2677',
'maxmark' => '2.0000000',
'options' => (object) array(
'id' => '1764',
'question' => '2081',
'layout' => '0',
'answers' => array(
8917 => (object) array(
'id' => '8917',
'question' => '2081',
'answer' => '0.01',
'answerformat' => '0',
'fraction' => '0.0000000',
'feedback' => '',
'feedbackformat' => '1',
),
8918 => (object) array(
'id' => '8918',
'question' => '2081',
'answer' => '0.05',
'answerformat' => '0',
'fraction' => '0.5000000',
'feedback' => '',
'feedbackformat' => '1',
),
8919 => (object) array(
'id' => '8919',
'question' => '2081',
'answer' => '0.1',
'answerformat' => '0',
'fraction' => '0.5000000',
'feedback' => '',
'feedbackformat' => '1',
),
8920 => (object) array(
'id' => '8920',
'question' => '2081',
'answer' => '0.04',
'answerformat' => '0',
'fraction' => '0.0000000',
'feedback' => '',
'feedbackformat' => '1',
),
),
'single' => '0',
'shuffleanswers' => '1',
'correctfeedback' => '',
'correctfeedbackformat' => '1',
'partiallycorrectfeedback' => '1',
'partiallycorrectfeedbackformat' => '0',
'incorrectfeedback' => '',
'incorrectfeedbackformat' => '1',
'answernumbering' => 'abc',
'shownumcorrect' => '0',
),
'hints' => array(
),
);
$qsession = (object) array(
'id' => '36362',
'attemptid' => '5443',
'questionid' => '2081',
'newest' => '96681',
'newgraded' => '96681',
'sumpenalty' => '0.0000000',
'manualcomment' => '',
'manualcommentformat' => '1',
'flagged' => '0',
);
$qstates = array(
94928 => (object) array(
'id' => '94928',
'attempt' => '5443',
'question' => '2081',
'seq_number' => '0',
'answer' => '8917,8918,8919,8920:8918,8919',
'timestamp' => '1270550410',
'event' => '0',
'grade' => '0.0000000',
'raw_grade' => '2.0000000',
'penalty' => '0.0000000',
),
94934 => (object) array(
'id' => '94934',
'attempt' => '5443',
'question' => '2081',
'seq_number' => '1',
'answer' => '8917,8918,8919,8920:8918,8919',
'timestamp' => '1270550420',
'event' => '3',
'grade' => '2.0000000',
'raw_grade' => '2.0000000',
'penalty' => '0.0000000',
),
96678 => (object) array(
'id' => '96678',
'attempt' => '5443',
'question' => '2081',
'seq_number' => '2',
'answer' => '8917,8918,8919,8920:',
'timestamp' => '1271960138',
'event' => '0',
'grade' => '2.0000000',
'raw_grade' => '0.0000000',
'penalty' => '0.0000000',
),
96681 => (object) array(
'id' => '96681',
'attempt' => '5443',
'question' => '2081',
'seq_number' => '3',
'answer' => '8917,8918,8919,8920:',
'timestamp' => '1271960138',
'event' => '6',
'grade' => '2.0000000',
'raw_grade' => '0.0000000',
'penalty' => '0.0000000',
),
);
$qa = $this->updater->convert_question_attempt($quiz, $attempt, $question, $qsession, $qstates);
$expectedqa = (object) array(
'behaviour' => 'adaptivenopenalty',
'questionid' => 2081,
'variant' => 1,
'maxmark' => 2.0000000,
'minfraction' => 0,
'flagged' => 0,
'questionsummary' => '',
'rightanswer' => '',
'responsesummary' => '',
'timemodified' => 0,
'steps' => array(
0 => (object) array(
'sequencenumber' => 0,
'state' => '',
'fraction' => null,
'timecreated' => 1270550410,
'userid' => 3023,
'data' => array(),
),
1 => (object) array(
'sequencenumber' => 1,
'state' => '',
'fraction' => null,
'timecreated' => 1270550420,
'userid' => 3023,
'data' => array(),
),
2 => (object) array(
'sequencenumber' => 2,
'state' => '',
'fraction' => null,
'timecreated' => 1271960138,
'userid' => 3023,
'data' => array(),
),
3 => (object) array(
'sequencenumber' => 3,
'state' => '',
'fraction' => null,
'timecreated' => 1271960138,
'userid' => 3023,
'data' => array(),
),
),
);
$this->compare_qas($expectedqa, $qa);
}