|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 // This file is part of Moodle - http://moodle.org/ 00003 // 00004 // Moodle is free software: you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation, either version 3 of the License, or 00007 // (at your option) any later version. 00008 // 00009 // Moodle is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU General Public License 00015 // along with Moodle. If not, see <http://www.gnu.org/licenses/>. 00016 00028 defined('MOODLE_INTERNAL') || die(); 00029 00030 require_once($CFG->dirroot . '/question/engine/upgrade/simpletest/helper.php'); 00031 00032 00039 class qtype_multichoice_attempt_upgrader_test extends question_attempt_upgrader_test_base { 00040 00041 public function test_multichoice_deferredfeedback_history960() { 00042 $quiz = (object) array( 00043 'id' => '1', 00044 'course' => '3', 00045 'name' => 'Test quiz 1', 00046 'intro' => '', 00047 'introformat' => FORMAT_HTML, 00048 'questiondecimalpoints' => '-1', 00049 'showuserpicture' => '1', 00050 'showblocks' => '1', 00051 'timeopen' => '0', 00052 'timeclose' => '0', 00053 'preferredbehaviour' => 'deferredfeedback', 00054 'attempts' => '0', 00055 'attemptonlast' => '0', 00056 'grademethod' => '1', 00057 'decimalpoints' => '2', 00058 'questionsperpage' => '0', 00059 'shufflequestions' => '0', 00060 'shuffleanswers' => '1', 00061 'questions' => '1,0', 00062 'timecreated' => '0', 00063 'timemodified' => '1278603396', 00064 'timelimit' => '0', 00065 'password' => '', 00066 'subnet' => '', 00067 'popup' => '0', 00068 'delay1' => '0', 00069 'delay2' => '0', 00070 'sumgrades' => '1.00000', 00071 'grade' => '10.00000', 00072 'questiondecimalpoints' => '-1', 00073 'showuserpicture' => '0', 00074 'introformat' => '0', 00075 'preferredbehaviour' => 'deferredfeedback', 00076 'reviewattempt' => '69904', 00077 'reviewcorrectness' => '69904', 00078 'reviewmarks' => '69904', 00079 'reviewspecificfeedback' => '69904', 00080 'reviewgeneralfeedback' => '69904', 00081 'reviewrightanswer' => '69904', 00082 'reviewoverallfeedback' => '4368', 00083 ); 00084 $attempt = (object) array( 00085 'id' => '2', 00086 'uniqueid' => '2', 00087 'quiz' => '2', 00088 'userid' => '4', 00089 'attempt' => '1', 00090 'timestart' => '1278604557', 00091 'timefinish' => '1278604570', 00092 'timemodified' => '1278604597', 00093 'layout' => '2,0', 00094 'preview' => '0', 00095 'sumgrades' => '0.90000', 00096 'needsupgradetonewqe' => '1', 00097 ); 00098 $question = (object) array( 00099 'id' => '2', 00100 'category' => '2', 00101 'parent' => '0', 00102 'name' => 'Which is the amphibian', 00103 'questiontext' => 'Which is the amphibian?', 00104 'questiontextformat' => '1', 00105 'generalfeedback' => '', 00106 'generalfeedbackformat' => '1', 00107 'qtype' => 'multichoice', 00108 'length' => '1', 00109 'stamp' => 'tjh238.vledev.open.ac.uk+100708154547+JrHygi', 00110 'version' => 'tjh238.vledev.open.ac.uk+100708154548+a3zh8v', 00111 'hidden' => '0', 00112 'timecreated' => '1278603947', 00113 'timemodified' => '1278603947', 00114 'createdby' => '3', 00115 'modifiedby' => '3', 00116 'defaultmark' => '1.0000000', 00117 'penalty' => '0.3333333', 00118 'maxmark' => '1.00000', 00119 'options' => (object) array( 00120 'id' => '1', 00121 'question' => '2', 00122 'layout' => '0', 00123 'answers' => array( 00124 3 => (object) array( 00125 'question' => '2', 00126 'answer' => 'Cat', 00127 'feedback' => '', 00128 'fraction' => '0.0000000', 00129 'id' => 3, 00130 ), 00131 4 => (object) array( 00132 'question' => '2', 00133 'answer' => 'Frog', 00134 'feedback' => '', 00135 'fraction' => '1.0000000', 00136 'id' => 4, 00137 ), 00138 5 => (object) array( 00139 'question' => '2', 00140 'answer' => 'Ant', 00141 'feedback' => '', 00142 'fraction' => '0.0000000', 00143 'id' => 5, 00144 ), 00145 6 => (object) array( 00146 'question' => '2', 00147 'answer' => 'Dog', 00148 'feedback' => '', 00149 'fraction' => '0.0000000', 00150 'id' => 6, 00151 ), 00152 ), 00153 'single' => '1', 00154 'shuffleanswers' => '1', 00155 'correctfeedback' => '', 00156 'partiallycorrectfeedback' => '', 00157 'incorrectfeedback' => '', 00158 'answernumbering' => 'none', 00159 'shownumcorrect' => '0', 00160 ), 00161 'hints' => array ( 00162 1 => (object) array( 00163 'hint' => 'First hint', 00164 'questionid' => '2', 00165 'shownumcorrect' => null, 00166 'clearwrong' => null, 00167 'options' => null, 00168 'id' => 1, 00169 ), 00170 2 => (object) array( 00171 'hint' => 'Second hint', 00172 'questionid' => '2', 00173 'shownumcorrect' => null, 00174 'clearwrong' => null, 00175 'options' => null, 00176 'id' => 2, 00177 ), 00178 ), 00179 ); 00180 $qsession = (object) array( 00181 'id' => '2', 00182 'attemptid' => '2', 00183 'questionid' => '2', 00184 'newest' => '6', 00185 'newgraded' => '6', 00186 'sumpenalty' => '0.3333333', 00187 'manualcomment' => 'Well done!', 00188 'manualcommentformat' => '1', 00189 'flagged' => '1', 00190 ); 00191 $qstates = array( 00192 0 => (object) array( 00193 'id' => '4', 00194 'attempt' => '2', 00195 'question' => '2', 00196 'originalquestion' => '0', 00197 'seq_number' => '0', 00198 'answer' => '5,4,6,3:', 00199 'timestamp' => '1278604557', 00200 'event' => '0', 00201 'grade' => '0', 00202 'raw_grade' => '0', 00203 'penalty' => '0', 00204 ), 00205 1 => (object) array( 00206 'id' => '5', 00207 'attempt' => '2', 00208 'question' => '2', 00209 'originalquestion' => '0', 00210 'seq_number' => '1', 00211 'answer' => '5,4,6,3:4', 00212 'timestamp' => '1278604562', 00213 'event' => '6', 00214 'grade' => '1', 00215 'raw_grade' => '1', 00216 'penalty' => '0.3333333', 00217 ), 00218 2 => (object) array( 00219 'id' => '6', 00220 'attempt' => '2', 00221 'question' => '2', 00222 'originalquestion' => '0', 00223 'seq_number' => '2', 00224 'answer' => '5,4,6,3:4', 00225 'timestamp' => '1278604597', 00226 'event' => '9', 00227 'grade' => '0.9', 00228 'raw_grade' => '0.9', 00229 'penalty' => '0', 00230 ), 00231 ); 00232 00233 $qa = $this->updater->convert_question_attempt($quiz, $attempt, $question, $qsession, $qstates); 00234 00235 $expectedqa = (object) array( 00236 'behaviour' => 'deferredfeedback', 00237 'questionid' => 2, 00238 'variant' => 1, 00239 'maxmark' => 1, 00240 'minfraction' => 0, 00241 'flagged' => 0, 00242 'questionsummary' => 'Which is the amphibian?', 00243 'rightanswer' => 'Frog', 00244 'responsesummary' => 'Frog', 00245 'timemodified' => 1278604597, 00246 'steps' => array( 00247 0 => (object) array( 00248 'sequencenumber' => 0, 00249 'state' => 'todo', 00250 'fraction' => null, 00251 'timecreated' => 1278604557, 00252 'userid' => 4, 00253 'data' => array('_order' => '5,4,6,3'), 00254 ), 00255 1 => (object) array( 00256 'sequencenumber' => 1, 00257 'state' => 'gradedright', 00258 'fraction' => 1, 00259 'timecreated' => 1278604562, 00260 'userid' => 4, 00261 'data' => array('-finish' => '1', 'answer' => '1'), 00262 ), 00263 2 => (object) array( 00264 'sequencenumber' => 2, 00265 'state' => 'mangrpartial', 00266 'fraction' => 0.9, 00267 'timecreated' => 1278604597, 00268 'userid' => null, 00269 'data' => array('-comment' => 'Well done!', '-mark' => '0.9', '-maxmark' => '1'), 00270 ), 00271 ), 00272 ); 00273 00274 $this->compare_qas($expectedqa, $qa); 00275 } 00276 00277 public function test_multichoice_deferredfeedback_history0() { 00278 $quiz = (object) array( 00279 'id' => '8', 00280 'course' => '1095', 00281 'name' => 'End of course quiz', 00282 'intro' => 'Use this self-assessment quiz to judge your overall understanding. ', 00283 'introformat' => FORMAT_HTML, 00284 'questiondecimalpoints' => '-1', 00285 'showuserpicture' => '1', 00286 'showblocks' => '1', 00287 'timeopen' => '1150107600', 00288 'timeclose' => '0', 00289 'preferredbehaviour' => 'deferredfeedback', 00290 'attempts' => '0', 00291 'attemptonlast' => '0', 00292 'grademethod' => '1', 00293 'decimalpoints' => '2', 00294 'review' => '71760879', 00295 'questionsperpage' => '0', 00296 'shufflequestions' => '1', 00297 'shuffleanswers' => '1', 00298 'questions' => '71,72,73,89,74,75,76,92,77,78,79,93,80,90,81,91,94,95,82,83,84,85,86,87,88,0', 00299 'sumgrades' => '25', 00300 'grade' => '25', 00301 'timecreated' => '0', 00302 'timemodified' => '1150107596', 00303 'password' => '', 00304 'subnet' => '', 00305 'popup' => '0', 00306 'delay1' => '0', 00307 'delay2' => '0', 00308 'timelimit' => '0', 00309 ); 00310 $attempt = (object) array( 00311 'id' => '17', 00312 'uniqueid' => '17', 00313 'quiz' => '8', 00314 'userid' => '26290', 00315 'attempt' => '1', 00316 'sumgrades' => '0', 00317 'timestart' => '1150203042', 00318 'timefinish' => '0', 00319 'timemodified' => '1150203042', 00320 'layout' => '93,76,82,75,87,74,90,94,73,77,81,95,79,92,88,80,91,86,72,83,84,89,85,78,71,0', 00321 'preview' => '1', 00322 'needsupgradetonewqe' => '1', 00323 ); 00324 $question = (object) array( 00325 'id' => '72', 00326 'category' => '10', 00327 'parent' => '0', 00328 'name' => 'Q02', 00329 'questiontext' => 'Why were standards such an important driver in the growth of systems integration?', 00330 'questiontextformat' => '1', 00331 'defaultmark' => '1', 00332 'penalty' => '0.1', 00333 'qtype' => 'multichoice', 00334 'length' => '1', 00335 'stamp' => 'learn.open.ac.uk+060612113403+Fz0GGO', 00336 'version' => 'learn.open.ac.uk+060612160802+I6ctMQ', 00337 'hidden' => '0', 00338 'generalfeedback' => '', 00339 'generalfeedbackformat' => '1', 00340 'timecreated' => '0', 00341 'timemodified' => '0', 00342 'createdby' => null, 00343 'modifiedby' => null, 00344 'unlimited' => null, 00345 'maxmark' => '1', 00346 'options' => (object) array( 00347 'id' => '44', 00348 'question' => '72', 00349 'layout' => '0', 00350 'answers' => array( 00351 200 => (object) array( 00352 'question' => '72', 00353 'answer' => 'Because they enable stored data and interfaces to be standardised.', 00354 'fraction' => '1', 00355 'feedback' => 'Standards enable the various components of an integrated system to communicate using well defined mechanisms and enable the components to have a standard view of stored data.', 00356 'id' => 200, 00357 ), 00358 201 => (object) array( 00359 'question' => '72', 00360 'answer' => 'Because they enable the members of an integration team to communicate together.', 00361 'fraction' => '0', 00362 'feedback' => 'Standards enable the various components of an integrated system to communicate using well defined mechanisms and enable the components to have a standard view of stored data.', 00363 'id' => 201, 00364 ), 00365 202 => (object) array( 00366 'question' => '72', 00367 'answer' => 'Because they produce good quality documentation.', 00368 'fraction' => '0', 00369 'feedback' => 'Standards enable the various components of an integrated system to communicate using well defined mechanisms and enable the components to have a standard view of stored data.', 00370 'id' => 202, 00371 ), 00372 ), 00373 'single' => '1', 00374 'shuffleanswers' => '1', 00375 'correctfeedback' => '', 00376 'partiallycorrectfeedback' => '', 00377 'incorrectfeedback' => '', 00378 'answernumbering' => 'abc', 00379 ), 00380 'hints' => false, 00381 ); 00382 $qsession = (object) array( 00383 'id' => '132', 00384 'attemptid' => '17', 00385 'questionid' => '72', 00386 'newest' => '196', 00387 'newgraded' => '196', 00388 'sumpenalty' => '0', 00389 'manualcomment' => '', 00390 'manualcommentformat' => '1', 00391 'flagged' => '1', 00392 ); 00393 $qstates = array( 00394 196 => (object) array( 00395 'attempt' => '17', 00396 'question' => '72', 00397 'originalquestion' => '0', 00398 'seq_number' => '0', 00399 'answer' => '200,202,201:', 00400 'timestamp' => '1150203042', 00401 'event' => '0', 00402 'grade' => '0', 00403 'raw_grade' => '0', 00404 'penalty' => '0', 00405 'id' => 196, 00406 ), 00407 ); 00408 00409 $qa = $this->updater->convert_question_attempt($quiz, $attempt, $question, $qsession, $qstates); 00410 00411 $expectedqa = (object) array( 00412 'behaviour' => 'deferredfeedback', 00413 'questionid' => 72, 00414 'variant' => 1, 00415 'maxmark' => 1, 00416 'minfraction' => 0, 00417 'flagged' => 0, 00418 'questionsummary' => 'Why were standards such an important driver in the growth of systems integration?', 00419 'rightanswer' => 'Because they enable stored data and interfaces to be standardised.', 00420 'responsesummary' => '', 00421 'timemodified' => 1150203042, 00422 'steps' => array( 00423 0 => (object) array( 00424 'sequencenumber' => 0, 00425 'state' => 'todo', 00426 'fraction' => null, 00427 'timecreated' => 1150203042, 00428 'userid' => 26290, 00429 'data' => array('_order' => '200,202,201'), 00430 ), 00431 ), 00432 ); 00433 00434 $this->compare_qas($expectedqa, $qa); 00435 } 00436 00437 public function test_multichoice_deferredfeedback_history60() { 00438 $quiz = (object) array( 00439 'id' => '13', 00440 'course' => '1416', 00441 'name' => 'Self assessment', 00442 'intro' => '<p>This quiz enables you to rate how much you have demonstrated certain skills in assignments. 00443 </p> 00444 <p>Each question is phrased so that you agree or disagree with a statement that describes your level of attainment, and is accompanied by a link to advice on recognising and practising the skill. 00445 </p> 00446 <p>The quiz is intended to form part of a dialogue on skills improvement between you and your tutor. Hence there is no "right" answer to it, and it is awarded no marks towards the course result. 00447 </p> 00448 <p>Any benefits to you depend on your being realistic about what you have demonstrated. Reserve the extreme ratings for when you think you have demonstrated mastery or complete incompetence! 00449 <br /> 00450 </p>', 00451 'introformat' => FORMAT_HTML, 00452 'questiondecimalpoints' => '-1', 00453 'showuserpicture' => '1', 00454 'showblocks' => '1', 00455 'timeopen' => '0', 00456 'timeclose' => '0', 00457 'preferredbehaviour' => 'deferredfeedback', 00458 'attempts' => '0', 00459 'attemptonlast' => '1', 00460 'grademethod' => '4', 00461 'decimalpoints' => '0', 00462 'review' => '71760879', 00463 'questionsperpage' => '0', 00464 'shufflequestions' => '0', 00465 'shuffleanswers' => '0', 00466 'questions' => '218,221,219,220,223,224,222,0', 00467 'sumgrades' => '7', 00468 'grade' => '0', 00469 'timecreated' => '0', 00470 'timemodified' => '1160991947', 00471 'password' => '', 00472 'subnet' => '', 00473 'popup' => '0', 00474 'delay1' => '0', 00475 'delay2' => '0', 00476 'timelimit' => '0', 00477 ); 00478 $attempt = (object) array( 00479 'id' => '181', 00480 'uniqueid' => '181', 00481 'quiz' => '13', 00482 'userid' => '9932', 00483 'attempt' => '1', 00484 'sumgrades' => '0', 00485 'timestart' => '1161946984', 00486 'timefinish' => '1161947130', 00487 'timemodified' => '1161947130', 00488 'layout' => '218,221,219,220,223,224,222,0', 00489 'preview' => '0', 00490 'needsupgradetonewqe' => '1', 00491 ); 00492 $question = (object) array( 00493 'id' => '218', 00494 'category' => '21', 00495 'parent' => '0', 00496 'name' => 'Answering the question that is asked', 00497 'questiontext' => '<p>I have demonstrated the ability to analyse and <strong>answer the question</strong> that is asked. (<a title="Advice" href="http://learnacct.open.ac.uk/mod/resourcepage/view.php?id=5989">Click for advice on this skill</a>)', 00498 'questiontextformat' => '1', 00499 'defaultmark' => '1', 00500 'penalty' => '0', 00501 'qtype' => 'multichoice', 00502 'length' => '1', 00503 'stamp' => 'learn.open.ac.uk+060822084343+5JvlNr', 00504 'version' => 'learn.open.ac.uk+060822084343+CQPfhb', 00505 'hidden' => '0', 00506 'generalfeedback' => '', 00507 'generalfeedbackformat' => '1', 00508 'timecreated' => '0', 00509 'timemodified' => '0', 00510 'createdby' => null, 00511 'modifiedby' => null, 00512 'unlimited' => null, 00513 'maxmark' => '1', 00514 'options' => (object) array( 00515 'id' => '152', 00516 'question' => '218', 00517 'layout' => '0', 00518 'answers' => array( 00519 664 => (object) array( 00520 'question' => '218', 00521 'answer' => 'Agree', 00522 'fraction' => '0', 00523 'feedback' => ' ', 00524 'id' => 664, 00525 ), 00526 665 => (object) array( 00527 'question' => '218', 00528 'answer' => 'Uncertain', 00529 'fraction' => '0', 00530 'feedback' => ' ', 00531 'id' => 665, 00532 ), 00533 666 => (object) array( 00534 'question' => '218', 00535 'answer' => 'Disagree', 00536 'fraction' => '0', 00537 'feedback' => ' ', 00538 'id' => 666, 00539 ), 00540 667 => (object) array( 00541 'question' => '218', 00542 'answer' => 'Strongly disagree', 00543 'fraction' => '0', 00544 'feedback' => ' ', 00545 'id' => 667, 00546 ), 00547 668 => (object) array( 00548 'question' => '218', 00549 'answer' => 'Strongly agree', 00550 'fraction' => '0', 00551 'feedback' => ' ', 00552 'id' => 668, 00553 ), 00554 ), 00555 'single' => '0', 00556 'shuffleanswers' => '0', 00557 'correctfeedback' => '', 00558 'partiallycorrectfeedback' => '', 00559 'incorrectfeedback' => '', 00560 'answernumbering' => 'abc', 00561 ), 00562 'hints' => false, 00563 ); 00564 $qsession = (object) array( 00565 'id' => '2412', 00566 'attemptid' => '181', 00567 'questionid' => '218', 00568 'newest' => '3891', 00569 'newgraded' => '3891', 00570 'sumpenalty' => '0', 00571 'manualcomment' => '', 00572 'manualcommentformat' => '1', 00573 'flagged' => '1', 00574 ); 00575 $qstates = array( 00576 3888 => (object) array( 00577 'attempt' => '181', 00578 'question' => '218', 00579 'originalquestion' => '0', 00580 'seq_number' => '0', 00581 'answer' => '664,665,666,667,668:', 00582 'timestamp' => '1161946984', 00583 'event' => '0', 00584 'grade' => '0', 00585 'raw_grade' => '0', 00586 'penalty' => '0', 00587 'id' => 3888, 00588 ), 00589 3891 => (object) array( 00590 'attempt' => '181', 00591 'question' => '218', 00592 'originalquestion' => '0', 00593 'seq_number' => '1', 00594 'answer' => '664,665,666,667,668:664', 00595 'timestamp' => '1161947130', 00596 'event' => '6', 00597 'grade' => '0', 00598 'raw_grade' => '0', 00599 'penalty' => '0', 00600 'id' => 3891, 00601 ), 00602 ); 00603 00604 $qa = $this->updater->convert_question_attempt($quiz, $attempt, $question, $qsession, $qstates); 00605 00606 $expectedqa = (object) array( 00607 'behaviour' => 'deferredfeedback', 00608 'questionid' => 218, 00609 'variant' => 1, 00610 'maxmark' => 1, 00611 'minfraction' => 0, 00612 'flagged' => 0, 00613 'questionsummary' => 'I have demonstrated the ability to analyse and ANSWER THE QUESTION that is asked. (Click for advice on this skill)', 00614 'rightanswer' => '', 00615 'responsesummary' => 'Agree', 00616 'timemodified' => 1161947130, 00617 'steps' => array( 00618 0 => (object) array( 00619 'sequencenumber' => 0, 00620 'state' => 'todo', 00621 'fraction' => null, 00622 'timecreated' => 1161946984, 00623 'userid' => 9932, 00624 'data' => array('_order' => '664,665,666,667,668'), 00625 ), 00626 1 => (object) array( 00627 'sequencenumber' => 1, 00628 'state' => 'gradedwrong', 00629 'fraction' => 0, 00630 'timecreated' => 1161947130, 00631 'userid' => 9932, 00632 'data' => array('choice0' => 1, 'choice1' => 0, 'choice2' => 0, 'choice3' => 0, 'choice4' => 0, '-finish' => 1), 00633 ), 00634 ), 00635 ); 00636 00637 $this->compare_qas($expectedqa, $qa); 00638 } 00639 00640 public function test_multichoice_deferredfeedback_history6220() { 00641 $quiz = (object) array( 00642 'id' => '95', 00643 'course' => '1181', 00644 'name' => 'Study Guide 7 Quiz', 00645 'intro' => '', 00646 'introformat' => FORMAT_HTML, 00647 'questiondecimalpoints' => '-1', 00648 'showuserpicture' => '1', 00649 'showblocks' => '1', 00650 'timeopen' => '0', 00651 'timeclose' => '0', 00652 'preferredbehaviour' => 'deferredfeedback', 00653 'attempts' => '0', 00654 'attemptonlast' => '1', 00655 'grademethod' => '1', 00656 'decimalpoints' => '2', 00657 'review' => '71760879', 00658 'questionsperpage' => '2', 00659 'shufflequestions' => '0', 00660 'shuffleanswers' => '0', 00661 'questions' => '2855,2856,0,2857,2858,0,2859,2860,0,2861,2862,0,2863,2864,0,2865,0', 00662 'sumgrades' => '59', 00663 'grade' => '59', 00664 'timecreated' => '0', 00665 'timemodified' => '1170427431', 00666 'password' => '', 00667 'subnet' => '', 00668 'popup' => '0', 00669 'delay1' => '0', 00670 'delay2' => '0', 00671 'timelimit' => '0', 00672 ); 00673 $attempt = (object) array( 00674 'id' => '3237', 00675 'uniqueid' => '3237', 00676 'quiz' => '95', 00677 'userid' => '120555', 00678 'attempt' => '1', 00679 'sumgrades' => '35.4166', 00680 'timestart' => '1177006492', 00681 'timefinish' => '1177008802', 00682 'timemodified' => '1177008794', 00683 'layout' => '2855,2856,0,2857,2858,0,2859,2860,0,2861,2862,0,2863,2864,0,2865,0', 00684 'preview' => '0', 00685 'needsupgradetonewqe' => '1', 00686 ); 00687 $question = (object) array( 00688 'id' => '2855', 00689 'category' => '114', 00690 'parent' => '0', 00691 'name' => 'Question 1', 00692 'questiontext' => '<p>Which of the following techniques can identify non-functional requirements?</p>', 00693 'questiontextformat' => '1', 00694 'defaultmark' => '1', 00695 'penalty' => '0', 00696 'qtype' => 'multichoice', 00697 'length' => '1', 00698 'stamp' => 'learn.open.ac.uk+061221143845+nohATp', 00699 'version' => 'learn.open.ac.uk+070131102906+bviJOZ', 00700 'hidden' => '0', 00701 'generalfeedback' => 'The correct answers are b and c. 00702 For further information about this question see Study Guide 7 SAQ 2.1(b and c) 00703 Misuse cases were discussed in SG4', 00704 'generalfeedbackformat' => '1', 00705 'timecreated' => '0', 00706 'timemodified' => '0', 00707 'createdby' => null, 00708 'modifiedby' => null, 00709 'unlimited' => null, 00710 'maxmark' => '5', 00711 'options' => (object) array( 00712 'id' => '943', 00713 'question' => '2855', 00714 'layout' => '0', 00715 'answers' => array( 00716 8356 => (object) array( 00717 'question' => '2855', 00718 'answer' => 'Use cases.', 00719 'fraction' => '-0.33333', 00720 'feedback' => '', 00721 'id' => 8356, 00722 ), 00723 8357 => (object) array( 00724 'question' => '2855', 00725 'answer' => 'Verb identification.', 00726 'fraction' => '0.5', 00727 'feedback' => '', 00728 'id' => 8357, 00729 ), 00730 8358 => (object) array( 00731 'question' => '2855', 00732 'answer' => 'Misuse cases.', 00733 'fraction' => '0.5', 00734 'feedback' => '', 00735 'id' => 8358, 00736 ), 00737 8359 => (object) array( 00738 'question' => '2855', 00739 'answer' => 'Adjective identification.', 00740 'fraction' => '-0.33333', 00741 'feedback' => '', 00742 'id' => 8359, 00743 ), 00744 8360 => (object) array( 00745 'question' => '2855', 00746 'answer' => 'Noun identification.', 00747 'fraction' => '-0.33333', 00748 'feedback' => '', 00749 'id' => 8360, 00750 ), 00751 ), 00752 'single' => '0', 00753 'shuffleanswers' => '0', 00754 'correctfeedback' => 'Your answer is correct.', 00755 'partiallycorrectfeedback' => 'Your answer is partially correct.', 00756 'incorrectfeedback' => 'Your answer is incorrect.', 00757 'answernumbering' => 'abc', 00758 ), 00759 'hints' => false, 00760 ); 00761 $qsession = (object) array( 00762 'id' => '30584', 00763 'attemptid' => '3237', 00764 'questionid' => '2855', 00765 'newest' => '72341', 00766 'newgraded' => '72341', 00767 'sumpenalty' => '0', 00768 'manualcomment' => '', 00769 'manualcommentformat' => '1', 00770 'flagged' => '1', 00771 ); 00772 $qstates = array( 00773 72307 => (object) array( 00774 'attempt' => '3237', 00775 'question' => '2855', 00776 'originalquestion' => '0', 00777 'seq_number' => '0', 00778 'answer' => '8356,8357,8358,8359,8360:', 00779 'timestamp' => '1177006492', 00780 'event' => '0', 00781 'grade' => '0', 00782 'raw_grade' => '0', 00783 'penalty' => '0', 00784 'id' => 72307, 00785 ), 00786 72318 => (object) array( 00787 'attempt' => '3237', 00788 'question' => '2855', 00789 'originalquestion' => '0', 00790 'seq_number' => '1', 00791 'answer' => '8356,8357,8358,8359,8360:8357,8359', 00792 'timestamp' => '1177007066', 00793 'event' => '2', 00794 'grade' => '0', 00795 'raw_grade' => '0.83335', 00796 'penalty' => '0', 00797 'id' => 72318, 00798 ), 00799 72328 => (object) array( 00800 'attempt' => '3237', 00801 'question' => '2855', 00802 'originalquestion' => '0', 00803 'seq_number' => '2', 00804 'answer' => '8356,8357,8358,8359,8360:8357,8359', 00805 'timestamp' => '1177008016', 00806 'event' => '2', 00807 'grade' => '0', 00808 'raw_grade' => '0.83335', 00809 'penalty' => '0', 00810 'id' => 72328, 00811 ), 00812 72341 => (object) array( 00813 'attempt' => '3237', 00814 'question' => '2855', 00815 'originalquestion' => '0', 00816 'seq_number' => '3', 00817 'answer' => '8356,8357,8358,8359,8360:8357,8359', 00818 'timestamp' => '1177008016', 00819 'event' => '6', 00820 'grade' => '0.83335', 00821 'raw_grade' => '0.83335', 00822 'penalty' => '0', 00823 'id' => 72341, 00824 ), 00825 ); 00826 00827 $qa = $this->updater->convert_question_attempt($quiz, $attempt, $question, $qsession, $qstates); 00828 00829 $expectedqa = (object) array( 00830 'behaviour' => 'deferredfeedback', 00831 'questionid' => 2855, 00832 'variant' => 1, 00833 'maxmark' => 5, 00834 'minfraction' => 0, 00835 'flagged' => 0, 00836 'questionsummary' => 'Which of the following techniques can identify non-functional requirements?', 00837 'rightanswer' => 'Verb identification.; Misuse cases.', 00838 'responsesummary' => 'Verb identification.; Adjective identification.', 00839 'timemodified' => 1177008016, 00840 'steps' => array( 00841 0 => (object) array( 00842 'sequencenumber' => 0, 00843 'state' => 'todo', 00844 'fraction' => null, 00845 'timecreated' => 1177006492, 00846 'userid' => 120555, 00847 'data' => array('_order' => '8356,8357,8358,8359,8360'), 00848 ), 00849 1 => (object) array( 00850 'sequencenumber' => 1, 00851 'state' => 'complete', 00852 'fraction' => null, 00853 'timecreated' => 1177007066, 00854 'userid' => 120555, 00855 'data' => array('choice0' => 0, 'choice1' => 1, 'choice2' => 0, 'choice3' => 1, 'choice4' => 0), 00856 ), 00857 2 => (object) array( 00858 'sequencenumber' => 2, 00859 'state' => 'complete', 00860 'fraction' => null, 00861 'timecreated' => 1177008016, 00862 'userid' => 120555, 00863 'data' => array('choice0' => 0, 'choice1' => 1, 'choice2' => 0, 'choice3' => 1, 'choice4' => 0), 00864 ), 00865 3 => (object) array( 00866 'sequencenumber' => 3, 00867 'state' => 'gradedpartial', 00868 'fraction' => 0.16667, 00869 'timecreated' => 1177008016, 00870 'userid' => 120555, 00871 'data' => array('choice0' => 0, 'choice1' => 1, 'choice2' => 0, 'choice3' => 1, 'choice4' => 0, '-finish' => 1), 00872 ), 00873 ), 00874 ); 00875 00876 $this->compare_qas($expectedqa, $qa); 00877 } 00878 00879 public function test_multichoice_deferredfeedback_missing() { 00880 $quiz = (object) array( 00881 'id' => '8', 00882 'course' => '1095', 00883 'name' => 'End of course quiz', 00884 'intro' => 'Use this self-assessment quiz to judge your overall understanding. ', 00885 'introformat' => FORMAT_HTML, 00886 'questiondecimalpoints' => '-1', 00887 'showuserpicture' => '1', 00888 'showblocks' => '1', 00889 'timeopen' => '1150107600', 00890 'timeclose' => '0', 00891 'preferredbehaviour' => 'deferredfeedback', 00892 'attempts' => '0', 00893 'attemptonlast' => '0', 00894 'grademethod' => '1', 00895 'decimalpoints' => '2', 00896 'review' => '71760879', 00897 'questionsperpage' => '0', 00898 'shufflequestions' => '1', 00899 'shuffleanswers' => '1', 00900 'questions' => '71,72,73,89,74,75,76,92,77,78,79,93,80,90,81,91,94,95,82,83,84,85,86,87,88,0', 00901 'sumgrades' => '25', 00902 'grade' => '25', 00903 'timecreated' => '0', 00904 'timemodified' => '1150107596', 00905 'password' => '', 00906 'subnet' => '', 00907 'popup' => '0', 00908 'delay1' => '0', 00909 'delay2' => '0', 00910 'timelimit' => '0', 00911 ); 00912 $attempt = (object) array( 00913 'id' => '17', 00914 'uniqueid' => '17', 00915 'quiz' => '8', 00916 'userid' => '26290', 00917 'attempt' => '1', 00918 'sumgrades' => '0', 00919 'timestart' => '1150203042', 00920 'timefinish' => '0', 00921 'timemodified' => '1150203042', 00922 'layout' => '93,76,82,75,87,74,90,94,73,77,81,95,79,92,88,80,91,86,72,83,84,89,85,78,71,0', 00923 'preview' => '1', 00924 'needsupgradetonewqe' => '1', 00925 ); 00926 $question = (object) array( 00927 'id' => '72', 00928 'category' => '10', 00929 'parent' => '0', 00930 'name' => 'Q02', 00931 'questiontext' => 'Why were standards such an important driver in the growth of systems integration?', 00932 'questiontextformat' => '1', 00933 'defaultmark' => '1', 00934 'penalty' => '0.1', 00935 'qtype' => 'multichoice', 00936 'length' => '1', 00937 'stamp' => 'learn.open.ac.uk+060612113403+Fz0GGO', 00938 'version' => 'learn.open.ac.uk+060612160802+I6ctMQ', 00939 'hidden' => '0', 00940 'generalfeedback' => '', 00941 'generalfeedbackformat' => '1', 00942 'timecreated' => '0', 00943 'timemodified' => '0', 00944 'createdby' => null, 00945 'modifiedby' => null, 00946 'unlimited' => null, 00947 'maxmark' => '1', 00948 'options' => (object) array( 00949 'id' => '44', 00950 'question' => '72', 00951 'layout' => '0', 00952 'answers' => array( 00953 200 => (object) array( 00954 'question' => '72', 00955 'answer' => 'Because they enable stored data and interfaces to be standardised.', 00956 'fraction' => '1', 00957 'feedback' => 'Standards enable the various components of an integrated system to communicate using well defined mechanisms and enable the components to have a standard view of stored data.', 00958 'id' => 200, 00959 ), 00960 201 => (object) array( 00961 'question' => '72', 00962 'answer' => 'Because they enable the members of an integration team to communicate together.', 00963 'fraction' => '0', 00964 'feedback' => 'Standards enable the various components of an integrated system to communicate using well defined mechanisms and enable the components to have a standard view of stored data.', 00965 'id' => 201, 00966 ), 00967 202 => (object) array( 00968 'question' => '72', 00969 'answer' => 'Because they produce good quality documentation.', 00970 'fraction' => '0', 00971 'feedback' => 'Standards enable the various components of an integrated system to communicate using well defined mechanisms and enable the components to have a standard view of stored data.', 00972 'id' => 202, 00973 ), 00974 ), 00975 'single' => '1', 00976 'shuffleanswers' => '1', 00977 'correctfeedback' => '', 00978 'partiallycorrectfeedback' => '', 00979 'incorrectfeedback' => '', 00980 'answernumbering' => 'abc', 00981 ), 00982 'hints' => false, 00983 ); 00984 00985 $qa = $this->updater->supply_missing_question_attempt($quiz, $attempt, $question); 00986 00987 $expectedqa = (object) array( 00988 'behaviour' => 'deferredfeedback', 00989 'questionid' => 72, 00990 'variant' => 1, 00991 'maxmark' => 1, 00992 'minfraction' => 0, 00993 'flagged' => 0, 00994 'questionsummary' => 'Why were standards such an important driver in the growth of systems integration?', 00995 'rightanswer' => 'Because they enable stored data and interfaces to be standardised.', 00996 'responsesummary' => '', 00997 'timemodified' => 1150203042, 00998 'steps' => array( 00999 0 => (object) array( 01000 'sequencenumber' => 0, 01001 'state' => 'todo', 01002 'fraction' => null, 01003 'timecreated' => 1150203042, 01004 'userid' => 26290, 01005 'data' => array('_order' => '200,201,202'), 01006 ), 01007 ), 01008 ); 01009 01010 $this->compare_qas($expectedqa, $qa); 01011 } 01012 01013 public function test_multichoice_deferredfeedback_qsession140() { 01014 $quiz = (object) array( 01015 'id' => '58', 01016 'course' => '3420', 01017 'name' => 'Practice Quiz', 01018 'intro' => '', 01019 'introformat' => FORMAT_HTML, 01020 'questiondecimalpoints' => '-1', 01021 'showuserpicture' => '1', 01022 'showblocks' => '1', 01023 'timeopen' => '0', 01024 'timeclose' => '0', 01025 'optionflags' => '0', 01026 'attempts' => '0', 01027 'attemptonlast' => '0', 01028 'grademethod' => '3', 01029 'decimalpoints' => '2', 01030 'review' => '71760879', 01031 'questionsperpage' => '2', 01032 'shufflequestions' => '0', 01033 'shuffleanswers' => '1', 01034 'questions' => '178,179,0,180,181,0,182,183,0,184,185,0,189,187,0', 01035 'sumgrades' => '10', 01036 'grade' => '10', 01037 'timecreated' => '0', 01038 'timemodified' => '1200043605', 01039 'password' => '', 01040 'subnet' => '', 01041 'popup' => '0', 01042 'delay1' => '0', 01043 'delay2' => '0', 01044 'timelimit' => '0', 01045 'preferredbehaviour' => 'deferredfeedback', 01046 ); 01047 $attempt = (object) array( 01048 'id' => '38', 01049 'uniqueid' => '38', 01050 'quiz' => '58', 01051 'userid' => '51335', 01052 'attempt' => '1', 01053 'sumgrades' => '5', 01054 'timestart' => '1198254245', 01055 'timefinish' => '1198254438', 01056 'timemodified' => '1198254352', 01057 'layout' => '178,179,180,181,182,183,184,185,189,187,0', 01058 'preview' => '0', 01059 'needsupgradetonewqe' => '1', 01060 ); 01061 $question = (object) array( 01062 'id' => '179', 01063 'category' => '51', 01064 'parent' => '0', 01065 'name' => 'Question 2', 01066 'questiontext' => '<p>Where will the 19th International Biology Olympiad be held?</p>', 01067 'questiontextformat' => '1', 01068 'defaultmark' => '1', 01069 'penalty' => '0.1', 01070 'qtype' => 'multichoice', 01071 'length' => '1', 01072 'stamp' => 'openlearn.open.ac.uk+071210172238+HpCRWO', 01073 'version' => 'openlearn.open.ac.uk+071211115640+SZulvf', 01074 'hidden' => '0', 01075 'generalfeedback' => '<p></p>', 01076 'generalfeedbackformat' => '1', 01077 'timecreated' => '0', 01078 'timemodified' => '0', 01079 'createdby' => null, 01080 'modifiedby' => null, 01081 'unlimited' => null, 01082 'maxmark' => '1', 01083 'options' => (object) array( 01084 'id' => '71', 01085 'question' => '179', 01086 'layout' => '0', 01087 'answers' => array( 01088 372 => (object) array( 01089 'question' => '179', 01090 'answer' => 'Mumbai, India', 01091 'fraction' => '1', 01092 'feedback' => '', 01093 'id' => 372, 01094 ), 01095 373 => (object) array( 01096 'question' => '179', 01097 'answer' => 'Rome, Italy', 01098 'fraction' => '-1', 01099 'feedback' => '', 01100 'id' => 373, 01101 ), 01102 374 => (object) array( 01103 'question' => '179', 01104 'answer' => 'Oslo, Norway', 01105 'fraction' => '-1', 01106 'feedback' => '', 01107 'id' => 374, 01108 ), 01109 375 => (object) array( 01110 'question' => '179', 01111 'answer' => 'Tokyo, Japan', 01112 'fraction' => '-1', 01113 'feedback' => '', 01114 'id' => 375, 01115 ), 01116 ), 01117 'single' => '1', 01118 'shuffleanswers' => '1', 01119 'correctfeedback' => '', 01120 'partiallycorrectfeedback' => '', 01121 'incorrectfeedback' => '', 01122 'answernumbering' => 'abc', 01123 ), 01124 'hints' => false, 01125 ); 01126 $qsession = (object) array( 01127 'id' => '140', 01128 'attemptid' => '38', 01129 'questionid' => '179', 01130 'newest' => '273', 01131 'newgraded' => '273', 01132 'sumpenalty' => '0.2', 01133 'manualcomment' => '', 01134 'manualcommentformat' => '1', 01135 'flagged' => '1', 01136 ); 01137 $qstates = array( 01138 243 => (object) array( 01139 'attempt' => '38', 01140 'question' => '179', 01141 'originalquestion' => '0', 01142 'seq_number' => '0', 01143 'answer' => '375,372,374,373:', 01144 'timestamp' => '1198254245', 01145 'event' => '0', 01146 'grade' => '0', 01147 'raw_grade' => '0', 01148 'penalty' => '0', 01149 'id' => 243, 01150 ), 01151 254 => (object) array( 01152 'attempt' => '38', 01153 'question' => '179', 01154 'originalquestion' => '0', 01155 'seq_number' => '1', 01156 'answer' => '375,372,374,373:375', 01157 'timestamp' => '1198254261', 01158 'event' => '3', 01159 'grade' => '0', 01160 'raw_grade' => '0', 01161 'penalty' => '0.1', 01162 'id' => 254, 01163 ), 01164 273 => (object) array( 01165 'attempt' => '38', 01166 'question' => '179', 01167 'originalquestion' => '0', 01168 'seq_number' => '2', 01169 'answer' => '375,372,374,373:375', 01170 'timestamp' => '1198254261', 01171 'event' => '6', 01172 'grade' => '0', 01173 'raw_grade' => '0', 01174 'penalty' => '0.1', 01175 'id' => 273, 01176 ), 01177 ); 01178 01179 $qa = $this->updater->convert_question_attempt($quiz, $attempt, $question, $qsession, $qstates); 01180 01181 $expectedqa = (object) array( 01182 'behaviour' => 'deferredfeedback', 01183 'questionid' => 179, 01184 'variant' => 1, 01185 'maxmark' => 1, 01186 'minfraction' => 0, 01187 'flagged' => 0, 01188 'questionsummary' => 'Where will the 19th International Biology Olympiad be held?', 01189 'rightanswer' => 'Mumbai, India', 01190 'responsesummary' => 'Tokyo, Japan', 01191 'timemodified' => 1198254261, 01192 'steps' => array( 01193 0 => (object) array( 01194 'sequencenumber' => 0, 01195 'state' => 'todo', 01196 'fraction' => null, 01197 'timecreated' => 1198254245, 01198 'userid' => 51335, 01199 'data' => array('_order' => '375,372,374,373'), 01200 ), 01201 1 => (object) array( 01202 'sequencenumber' => 1, 01203 'state' => 'gradedwrong', 01204 'fraction' => 0, 01205 'timecreated' => 1198254261, 01206 'userid' => 51335, 01207 'data' => array('answer' => '0', '-finish' => '1'), 01208 ), 01209 ), 01210 ); 01211 01212 $this->compare_qas($expectedqa, $qa); 01213 } 01214 01215 public function test_multichoice_deferredfeedback_qsession2018195() { 01216 $quiz = (object) array( 01217 'id' => '1832', 01218 'course' => '4912', 01219 'name' => 'Unit 12 IL & ICT review quiz', 01220 'intro' => '<p>This quiz has been developed to help you review your skills development in information literacy and ICT and to gather feedback on the use of the skills activities within K315 and within the Social Work degree Practice Learning courses.</p> 01221 <p>We would welcome your input (allow 10-15 minutes). The data you provide will be anonymised and used for research purposes only. This project is administered under the OU’s general data protection policy guidelines, which can be seen here: <a href="http://www3.open.ac.uk/our-student-policies/pdf/dataprotection.pdf">http://www3.open.ac.uk/our-student-policies/pdf/dataprotection.pdf</a></p>', 01222 'introformat' => FORMAT_HTML, 01223 'questiondecimalpoints' => '-1', 01224 'showuserpicture' => '1', 01225 'showblocks' => '1', 01226 'timeopen' => '0', 01227 'timeclose' => '0', 01228 'optionflags' => '0', 01229 'penaltyscheme' => '1', 01230 'attempts' => '0', 01231 'attemptonlast' => '0', 01232 'grademethod' => '1', 01233 'decimalpoints' => '2', 01234 'review' => '71565312', 01235 'questionsperpage' => '2', 01236 'shufflequestions' => '0', 01237 'shuffleanswers' => '0', 01238 'questions' => '26132,26128,0,26143,26140,0,26144,26141,0,26145,26142,0,26126,26127,0,26134,26135,0,26131,26133,0,26130,26129,0,26136,26137,0,26139,26138,0', 01239 'sumgrades' => '0', 01240 'grade' => '0', 01241 'timecreated' => '0', 01242 'timemodified' => '1232636874', 01243 'password' => '', 01244 'subnet' => '', 01245 'popup' => '0', 01246 'delay1' => '0', 01247 'delay2' => '0', 01248 'timelimit' => '0', 01249 'preferredbehaviour' => 'deferredfeedback', 01250 ); 01251 $attempt = (object) array( 01252 'id' => '174744', 01253 'uniqueid' => '174745', 01254 'quiz' => '1832', 01255 'userid' => '181806', 01256 'attempt' => '1', 01257 'sumgrades' => '0', 01258 'timestart' => '1249488674', 01259 'timefinish' => '1250702880', 01260 'timemodified' => '1249488674', 01261 'layout' => '26132,26128,0,26143,26140,0,26144,26141,0,26145,26142,0,26126,26127,0,26134,26135,0,26131,26133,0,26130,26129,0,26136,26137,0,26139,26138,0', 01262 'preview' => '0', 01263 'needsupgradetonewqe' => '1', 01264 ); 01265 $question = (object) array( 01266 'id' => '26132', 01267 'category' => '2506', 01268 'parent' => '0', 01269 'name' => '01 most useful', 01270 'questiontext' => 'Which was the most useful K315 information literacy or ICT activity?', 01271 'questiontextformat' => '1', 01272 'defaultmark' => '1', 01273 'penalty' => '0.1', 01274 'qtype' => 'multichoice', 01275 'length' => '1', 01276 'stamp' => 'learn.open.ac.uk+080529101041+d4XuNI', 01277 'version' => 'learn.open.ac.uk+100725192556+KIetVC', 01278 'hidden' => '0', 01279 'generalfeedback' => '', 01280 'generalfeedbackformat' => '1', 01281 'timecreated' => '1212055841', 01282 'timemodified' => '1280085956', 01283 'createdby' => '28856', 01284 'modifiedby' => '25299', 01285 'unlimited' => '0', 01286 'maxmark' => '0', 01287 'options' => (object) array( 01288 'id' => '11628', 01289 'question' => '26132', 01290 'layout' => '0', 01291 'answers' => array( 01292 77406 => (object) array( 01293 'question' => '26132', 01294 'answer' => 'Introduction to & evaluation of MyStuff (Course Introduction)', 01295 'fraction' => '0', 01296 'feedback' => '', 01297 'id' => 77406, 01298 ), 01299 77407 => (object) array( 01300 'question' => '26132', 01301 'answer' => 'Values Exchange case studies', 01302 'fraction' => '1', 01303 'feedback' => '', 01304 'id' => 77407, 01305 ), 01306 77408 => (object) array( 01307 'question' => '26132', 01308 'answer' => 'Secure accommodation orders (Unit 2, Activity 3.3)', 01309 'fraction' => '0', 01310 'feedback' => '', 01311 'id' => 77408, 01312 ), 01313 77409 => (object) array( 01314 'question' => '26132', 01315 'answer' => 'Advanced search tools (Unit 3, Activity 1.3)', 01316 'fraction' => '0', 01317 'feedback' => '', 01318 'id' => 77409, 01319 ), 01320 77410 => (object) array( 01321 'question' => '26132', 01322 'answer' => 'Different types of information (Unit 7, Activity 1.2)', 01323 'fraction' => '0', 01324 'feedback' => '', 01325 'id' => 77410, 01326 ), 01327 77411 => (object) array( 01328 'question' => '26132', 01329 'answer' => 'Informing your practice with empirical evidence (Unit 8, Activity 3.1)', 01330 'fraction' => '0', 01331 'feedback' => '', 01332 'id' => 77411, 01333 ), 01334 77412 => (object) array( 01335 'question' => '26132', 01336 'answer' => 'Reviewing and saving your work (Unit 12, Activity 2.2)', 01337 'fraction' => '0', 01338 'feedback' => '', 01339 'id' => 77412, 01340 ), 01341 ), 01342 'single' => '1', 01343 'shuffleanswers' => '0', 01344 'correctfeedback' => '', 01345 'partiallycorrectfeedback' => '', 01346 'incorrectfeedback' => '', 01347 'answernumbering' => 'abc', 01348 ), 01349 'hints' => false, 01350 ); 01351 $qsession = (object) array( 01352 'id' => '2018195', 01353 'attemptid' => '174745', 01354 'questionid' => '26132', 01355 'newest' => '5162301', 01356 'newgraded' => '5162301', 01357 'sumpenalty' => '0', 01358 'manualcomment' => '', 01359 'manualcommentformat' => '1', 01360 'flagged' => '1', 01361 ); 01362 $qstates = array( 01363 5107187 => (object) array( 01364 'attempt' => '174745', 01365 'question' => '26132', 01366 'originalquestion' => '0', 01367 'seq_number' => '0', 01368 'answer' => '77406,77407,77408,77409,77410,77411,77412:', 01369 'timestamp' => '1249488674', 01370 'event' => '0', 01371 'grade' => '0', 01372 'raw_grade' => '0', 01373 'penalty' => '0', 01374 'id' => 5107187, 01375 ), 01376 5107188 => (object) array( 01377 'attempt' => '174745', 01378 'question' => '26132', 01379 'originalquestion' => '0', 01380 'seq_number' => '0', 01381 'answer' => '', 01382 'timestamp' => '1249488674', 01383 'event' => '0', 01384 'grade' => '0', 01385 'raw_grade' => '0', 01386 'penalty' => '0', 01387 'id' => 5107188, 01388 ), 01389 5107190 => (object) array( 01390 'attempt' => '174745', 01391 'question' => '26132', 01392 'originalquestion' => '0', 01393 'seq_number' => '1', 01394 'answer' => '77406,77407,77408,77409,77410,77411,77412:77407', 01395 'timestamp' => '1249488763', 01396 'event' => '2', 01397 'grade' => '0', 01398 'raw_grade' => '0', 01399 'penalty' => '0', 01400 'id' => 5107190, 01401 ), 01402 5162301 => (object) array( 01403 'attempt' => '174745', 01404 'question' => '26132', 01405 'originalquestion' => '0', 01406 'seq_number' => '2', 01407 'answer' => '77406,77407,77408,77409,77410,77411,77412:77407', 01408 'timestamp' => '1249488763', 01409 'event' => '6', 01410 'grade' => '0', 01411 'raw_grade' => '0', 01412 'penalty' => '0', 01413 'id' => 5162301, 01414 ), 01415 ); 01416 01417 $qa = $this->updater->convert_question_attempt($quiz, $attempt, $question, $qsession, $qstates); 01418 01419 $expectedqa = (object) array( 01420 'behaviour' => 'deferredfeedback', 01421 'questionid' => 26132, 01422 'variant' => 1, 01423 'maxmark' => 0, 01424 'minfraction' => 0, 01425 'flagged' => 0, 01426 'questionsummary' => 'Which was the most useful K315 information literacy or ICT activity?', 01427 'rightanswer' => 'Values Exchange case studies', 01428 'responsesummary' => 'Values Exchange case studies', 01429 'timemodified' => 1249488763, 01430 'steps' => array( 01431 0 => (object) array( 01432 'sequencenumber' => 0, 01433 'state' => 'todo', 01434 'fraction' => null, 01435 'timecreated' => 1249488674, 01436 'userid' => 181806, 01437 'data' => array('_order' => '77406,77407,77408,77409,77410,77411,77412'), 01438 ), 01439 1 => (object) array( 01440 'sequencenumber' => 1, 01441 'state' => 'complete', 01442 'fraction' => null, 01443 'timecreated' => 1249488763, 01444 'userid' => 181806, 01445 'data' => array('answer' => '1'), 01446 ), 01447 2 => (object) array( 01448 'sequencenumber' => 2, 01449 'state' => 'finished', 01450 'fraction' => null, 01451 'timecreated' => 1249488763, 01452 'userid' => 181806, 01453 'data' => array('answer' => '1', '-finish' => '1'), 01454 ), 01455 ), 01456 ); 01457 01458 $this->compare_qas($expectedqa, $qa); 01459 } 01460 01461 public function test_multichoice_deferredfeedback_qsession2653368() { 01462 $quiz = (object) array( 01463 'id' => '3273', 01464 'course' => '5862', 01465 'name' => 'Assessing information sources', 01466 'intro' => 'Assessing information sources - literature review table', 01467 'introformat' => FORMAT_HTML, 01468 'questiondecimalpoints' => '-1', 01469 'showuserpicture' => '1', 01470 'showblocks' => '1', 01471 'timeopen' => '0', 01472 'timeclose' => '0', 01473 'optionflags' => '0', 01474 'penaltyscheme' => '1', 01475 'attempts' => '0', 01476 'attemptonlast' => '1', 01477 'grademethod' => '4', 01478 'decimalpoints' => '2', 01479 'review' => '71727591', 01480 'questionsperpage' => '0', 01481 'shufflequestions' => '0', 01482 'shuffleanswers' => '0', 01483 'questions' => '60135,60136,60137,0', 01484 'sumgrades' => '3', 01485 'grade' => '10', 01486 'timecreated' => '0', 01487 'timemodified' => '1223992271', 01488 'password' => '', 01489 'subnet' => '', 01490 'popup' => '0', 01491 'delay1' => '0', 01492 'delay2' => '0', 01493 'timelimit' => '0', 01494 'preferredbehaviour' => 'deferredfeedback', 01495 ); 01496 $attempt = (object) array( 01497 'id' => '229025', 01498 'uniqueid' => '229026', 01499 'quiz' => '3273', 01500 'userid' => '597153', 01501 'attempt' => '4', 01502 'sumgrades' => '0.999999', 01503 'timestart' => '1258492857', 01504 'timefinish' => '1258492862', 01505 'timemodified' => '1258492857', 01506 'layout' => '60135,60136,60137,0', 01507 'preview' => '0', 01508 'needsupgradetonewqe' => '1', 01509 ); 01510 $question = (object) array( 01511 'id' => '60137', 01512 'category' => '6026', 01513 'parent' => '0', 01514 'name' => 'Assessing information sources - No. 3', 01515 'questiontext' => 'For source 3, the \'Loose Change\' video, select the statements to indicate \'yes\':', 01516 'questiontextformat' => '1', 01517 'defaultmark' => '1', 01518 'penalty' => '0.1', 01519 'qtype' => 'multichoice', 01520 'length' => '1', 01521 'stamp' => 'learn.open.ac.uk+080811153454+BMEq1t', 01522 'version' => 'learn.open.ac.uk+081010072800+oSu1g3', 01523 'hidden' => '0', 01524 'generalfeedback' => '', 01525 'generalfeedbackformat' => '1', 01526 'timecreated' => '1218468894', 01527 'timemodified' => '1223623680', 01528 'createdby' => '26409', 01529 'modifiedby' => '351133', 01530 'unlimited' => null, 01531 'maxmark' => '1', 01532 'options' => (object) array( 01533 'id' => '23896', 01534 'question' => '60137', 01535 'layout' => '0', 01536 'answers' => array( 01537 181821 => (object) array( 01538 'question' => '60137', 01539 'answer' => 'Would you regard this source as objective?', 01540 'fraction' => '0.142857', 01541 'feedback' => '', 01542 'id' => 181821, 01543 ), 01544 181822 => (object) array( 01545 'question' => '60137', 01546 'answer' => 'Does the source provide references?', 01547 'fraction' => '0.142857', 01548 'feedback' => '', 01549 'id' => 181822, 01550 ), 01551 181823 => (object) array( 01552 'question' => '60137', 01553 'answer' => 'Are all viewpoints considered?', 01554 'fraction' => '0.142857', 01555 'feedback' => '', 01556 'id' => 181823, 01557 ), 01558 181824 => (object) array( 01559 'question' => '60137', 01560 'answer' => 'Are quotations placed in their full context?', 01561 'fraction' => '0.142857', 01562 'feedback' => '', 01563 'id' => 181824, 01564 ), 01565 181825 => (object) array( 01566 'question' => '60137', 01567 'answer' => 'Does the source include conclusions based on evidence?', 01568 'fraction' => '0.142857', 01569 'feedback' => '', 01570 'id' => 181825, 01571 ), 01572 181826 => (object) array( 01573 'question' => '60137', 01574 'answer' => 'Would you trust this source?', 01575 'fraction' => '0.142857', 01576 'feedback' => '', 01577 'id' => 181826, 01578 ), 01579 181827 => (object) array( 01580 'question' => '60137', 01581 'answer' => 'Has it been peer-reviewed?', 01582 'fraction' => '0.142857', 01583 'feedback' => '', 01584 'id' => 181827, 01585 ), 01586 ), 01587 'single' => '0', 01588 'shuffleanswers' => '0', 01589 'correctfeedback' => 'This is a very polemical source which clearly has a standpoint. Whether or not you would use this material would be largely dependent on your reseach question. If you did use it, you would need to be clear that you would require academic sources that would support the claims being made.<br />', 01590 'partiallycorrectfeedback' => 'This is a very polemical source which clearly has a standpoint. Whether or not you would use this material would be largely dependent on your reseach question. If you did use it, you would need to be clear that you would require academic sources that would support the claims being made.<br /><br />', 01591 'incorrectfeedback' => 'This is a very polemical source which clearly has a standpoint. Whether or not you would use this material would be largely dependent on your reseach question. If you did use it, you would need to be clear that you would require academic sources that would support the claims being made.<br /><br />', 01592 'answernumbering' => 'abc', 01593 ), 01594 'hints' => false, 01595 ); 01596 $qsession = (object) array( 01597 'id' => '2653368', 01598 'attemptid' => '229026', 01599 'questionid' => '60137', 01600 'newest' => '6676055', 01601 'newgraded' => '6676055', 01602 'sumpenalty' => '0.1', 01603 'manualcomment' => '', 01604 'manualcommentformat' => '1', 01605 'flagged' => '1', 01606 ); 01607 $qstates = array( 01608 6676031 => (object) array( 01609 'attempt' => '229026', 01610 'question' => '60137', 01611 'originalquestion' => '0', 01612 'seq_number' => '0', 01613 'answer' => '181821,181822,181823,181824,181825,181826,181827:181821,181822,181823,181824,181825,181826', 01614 'timestamp' => '1258492857', 01615 'event' => '0', 01616 'grade' => '0', 01617 'raw_grade' => '0.857142', 01618 'penalty' => '0', 01619 'id' => 6676031, 01620 ), 01621 6676034 => (object) array( 01622 'attempt' => '229026', 01623 'question' => '60137', 01624 'originalquestion' => '0', 01625 'seq_number' => '1', 01626 'answer' => '181821,181822,181823,181824,181825,181826,181827:', 01627 'timestamp' => '1258492857', 01628 'event' => '0', 01629 'grade' => '0', 01630 'raw_grade' => '0', 01631 'penalty' => '0.1', 01632 'id' => 6676034, 01633 ), 01634 6676055 => (object) array( 01635 'attempt' => '229026', 01636 'question' => '60137', 01637 'originalquestion' => '0', 01638 'seq_number' => '2', 01639 'answer' => '181821,181822,181823,181824,181825,181826,181827:', 01640 'timestamp' => '1258492857', 01641 'event' => '6', 01642 'grade' => '0', 01643 'raw_grade' => '0', 01644 'penalty' => '0.1', 01645 'id' => 6676055, 01646 ), 01647 ); 01648 01649 $qa = $this->updater->convert_question_attempt($quiz, $attempt, $question, $qsession, $qstates); 01650 01651 $expectedqa = (object) array( 01652 'behaviour' => 'deferredfeedback', 01653 'questionid' => 60137, 01654 'variant' => 1, 01655 'maxmark' => 1, 01656 'minfraction' => 0, 01657 'flagged' => 0, 01658 'questionsummary' => "For source 3, the 'Loose Change' video, select the statements to indicate 'yes':", 01659 'rightanswer' => 'Would you regard this source as objective?; Does the source provide references?; Are all viewpoints considered?; Are quotations placed in their full context?; Does the source include conclusions based on evidence?; Would you trust this source?; Has it been peer-reviewed?', 01660 'responsesummary' => 'Would you regard this source as objective?; Does the source provide references?; Are all viewpoints considered?; Are quotations placed in their full context?; Does the source include conclusions based on evidence?; Would you trust this source?', 01661 'timemodified' => 1258492857, 01662 'steps' => array( 01663 0 => (object) array( 01664 'sequencenumber' => 0, 01665 'state' => 'todo', 01666 'fraction' => null, 01667 'timecreated' => 1258492857, 01668 'userid' => 597153, 01669 'data' => array('_order' => '181821,181822,181823,181824,181825,181826,181827'), 01670 ), 01671 1 => (object) array( 01672 'sequencenumber' => 1, 01673 'state' => 'gradedwrong', 01674 'fraction' => 0, 01675 'timecreated' => 1258492857, 01676 'userid' => 597153, 01677 'data' => array('choice0' => 0, 'choice1' => 0, 'choice2' => 0, 'choice3' => 0, 'choice4' => 0, 'choice5' => 0, 'choice6' => 0, '-finish' => '1'), 01678 ), 01679 ), 01680 ); 01681 01682 $this->compare_qas($expectedqa, $qa); 01683 } 01684 01685 public function test_multichoice_deferredfeedback_qsession3131() { 01686 $quiz = (object) array( 01687 'id' => '10', 01688 'course' => '608', 01689 'name' => 'TMA 01, Part 1 (Activity 12)', 01690 'intro' => '<p>Activity 12 is a multiple-choice assessment quiz. It is Part 1 of TMA 01 and contributes 20 per cent of the marks for the TMA. It invites you to check your understandings of the topics with which you engaged in Activities 6–11.</p> 01691 01692 <p>Activity 12 is distinctive in that you are welcome to try as much as you want at any one time and to try as often as you wish. However, you have to get <strong>full marks</strong> on it in order to proceed to the second part of TMA 01, Activity 15.</p> 01693 01694 <p>There are 30 questions, which can be attempted in any order. When you are ready to attempt a question, choose your answer and then \'Submit\'. You will get feedback. If you need to try again, follow the same process. When you are satisfied with your answer to one question, go on to another. Remember to choose \'Submit\' for each answer that you want to be saved.</p> 01695 01696 <p>You do not have to do the questions all at one sitting: at any time you can choose \'Save without submitting\'. This saves the current state of all questions so you can come back later to do some more.</p> 01697 01698 <p>When you are satisfied with your answers to all 30 questions, choose \'Submit all and finish\'. This marks all questions, closes the current quiz attempt and gives the PCAP team formal notification that you have successfully completed this part of the TMA. <strong>Should you inadvertently choose this option you will need to start from scratch when you next attempt the task.</strong></p>', 01699 'introformat' => FORMAT_HTML, 01700 'questiondecimalpoints' => '-1', 01701 'showuserpicture' => '1', 01702 'showblocks' => '1', 01703 'timeopen' => '0', 01704 'timeclose' => '0', 01705 'optionflags' => '0', 01706 'attempts' => '0', 01707 'attemptonlast' => '0', 01708 'grademethod' => '2', 01709 'decimalpoints' => '2', 01710 'review' => '71760879', 01711 'questionsperpage' => '1', 01712 'shufflequestions' => '0', 01713 'shuffleanswers' => '1', 01714 'questions' => '161,0,160,0,162,0,163,0,164,0,165,0,166,0,190,0,191,0,192,0,193,0,194,0,195,0,196,0,197,0,198,0,168,0,169,0,170,0,171,0,172,0,173,0,174,0,175,0,176,0,177,0,178,0,179,0,180,0,181,0', 01715 'sumgrades' => '30', 01716 'grade' => '10', 01717 'timecreated' => '0', 01718 'timemodified' => '1266247621', 01719 'password' => '', 01720 'subnet' => '', 01721 'popup' => '0', 01722 'delay1' => '0', 01723 'delay2' => '0', 01724 'timelimit' => '0', 01725 'preferredbehaviour' => 'deferredfeedback', 01726 ); 01727 $attempt = (object) array( 01728 'id' => '302', 01729 'uniqueid' => '302', 01730 'quiz' => '10', 01731 'userid' => '63173', 01732 'attempt' => '1', 01733 'sumgrades' => '30', 01734 'timestart' => '1163428543', 01735 'timefinish' => '1166546613', 01736 'timemodified' => '1166546472', 01737 'layout' => '161,0,160,0,162,0,163,0,164,0,165,0,166,0,190,0,191,0,192,0,193,0,194,0,195,0,196,0,197,0,198,0,168,0,169,0,170,0,171,0,172,0,173,0,174,0,175,0,176,0,177,0,178,0,179,0,180,0,181,0', 01738 'preview' => '0', 01739 'needsupgradetonewqe' => '1', 01740 ); 01741 $question = (object) array( 01742 'id' => '163', 01743 'category' => '15', 01744 'parent' => '0', 01745 'name' => 'Question 04', 01746 'questiontext' => 'Can we have a \'realist\' or objective social science?', 01747 'questiontextformat' => '1', 01748 'defaultmark' => '1', 01749 'penalty' => '1', 01750 'qtype' => 'multichoice', 01751 'length' => '1', 01752 'stamp' => 'learn.open.ac.uk+060614160624+gkAYii', 01753 'version' => 'learn.open.ac.uk+060614160624+LYm8Rl', 01754 'hidden' => '0', 01755 'generalfeedback' => '', 01756 'generalfeedbackformat' => '1', 01757 'timecreated' => '0', 01758 'timemodified' => '0', 01759 'createdby' => null, 01760 'modifiedby' => null, 01761 'unlimited' => null, 01762 'maxmark' => '1', 01763 'options' => (object) array( 01764 'id' => '117', 01765 'question' => '163', 01766 'layout' => '0', 01767 'answers' => array( 01768 456 => (object) array( 01769 'question' => '163', 01770 'answer' => 'No', 01771 'fraction' => '0', 01772 'feedback' => 'This is a common position but it does overlook areas in which it is possible to observe, tally and describe in pretty objective (low-inference) ways. Much social geography is of this sort.', 01773 'id' => 456, 01774 ), 01775 457 => (object) array( 01776 'question' => '163', 01777 'answer' => 'Yes', 01778 'fraction' => '0', 01779 'feedback' => 'A great deal of social science is to do with making sense of subjective phenomena. We might expect social scientists to be honest and careful but, where subjective phenomena are concerned there can be no objective truth. However, there are areas in which it is possible to observe, tally and describe in pretty objective (low-inference) ways. Much social geography is of this sort.', 01780 'id' => 457, 01781 ), 01782 458 => (object) array( 01783 'question' => '163', 01784 'answer' => 'Sometimes', 01785 'fraction' => '1', 01786 'feedback' => 'This is a judicious response to two positions, each of which has strengths but neither of which covers the range of social science practices.', 01787 'id' => 458, 01788 ), 01789 ), 01790 'single' => '1', 01791 'shuffleanswers' => '0', 01792 'correctfeedback' => '', 01793 'partiallycorrectfeedback' => '', 01794 'incorrectfeedback' => '', 01795 'answernumbering' => 'abc', 01796 ), 01797 'hints' => false, 01798 ); 01799 $qsession = (object) array( 01800 'id' => '3131', 01801 'attemptid' => '302', 01802 'questionid' => '163', 01803 'newest' => '14715', 01804 'newgraded' => '14715', 01805 'sumpenalty' => '0', 01806 'manualcomment' => '', 01807 'manualcommentformat' => '1', 01808 'flagged' => '1', 01809 ); 01810 $qstates = array( 01811 5922 => (object) array( 01812 'attempt' => '302', 01813 'question' => '163', 01814 'originalquestion' => '0', 01815 'seq_number' => '0', 01816 'answer' => '456,457,458:', 01817 'timestamp' => '1163428543', 01818 'event' => '0', 01819 'grade' => '0', 01820 'raw_grade' => '0', 01821 'penalty' => '0', 01822 'id' => 5922, 01823 ), 01824 5941 => (object) array( 01825 'attempt' => '302', 01826 'question' => '163', 01827 'originalquestion' => '0', 01828 'seq_number' => '1', 01829 'answer' => '456,457,458:', 01830 'timestamp' => '1163428576', 01831 'event' => '2', 01832 'grade' => '0', 01833 'raw_grade' => '0', 01834 'penalty' => '1', 01835 'id' => 5941, 01836 ), 01837 5942 => (object) array( 01838 'attempt' => '302', 01839 'question' => '163', 01840 'originalquestion' => '0', 01841 'seq_number' => '2', 01842 'answer' => '456,457,458:', 01843 'timestamp' => '1163428577', 01844 'event' => '2', 01845 'grade' => '0', 01846 'raw_grade' => '0', 01847 'penalty' => '1', 01848 'id' => 5942, 01849 ), 01850 14713 => (object) array( 01851 'attempt' => '302', 01852 'question' => '163', 01853 'originalquestion' => '0', 01854 'seq_number' => '3', 01855 'answer' => '456,457,458:456', 01856 'timestamp' => '1165355190', 01857 'event' => '3', 01858 'grade' => '0', 01859 'raw_grade' => '0', 01860 'penalty' => '1', 01861 'id' => 14713, 01862 ), 01863 14715 => (object) array( 01864 'attempt' => '302', 01865 'question' => '163', 01866 'originalquestion' => '0', 01867 'seq_number' => '4', 01868 'answer' => '456,457,458:458', 01869 'timestamp' => '1165355352', 01870 'event' => '3', 01871 'grade' => '1', 01872 'raw_grade' => '1', 01873 'penalty' => '1', 01874 'id' => 14715, 01875 ), 01876 ); 01877 01878 $qa = $this->updater->convert_question_attempt($quiz, $attempt, $question, $qsession, $qstates); 01879 01880 $expectedqa = (object) array( 01881 'behaviour' => 'deferredfeedback', 01882 'questionid' => 163, 01883 'variant' => 1, 01884 'maxmark' => 1, 01885 'minfraction' => 0, 01886 'flagged' => 0, 01887 'questionsummary' => 'Can we have a \'realist\' or objective social science?', 01888 'rightanswer' => 'Sometimes', 01889 'responsesummary' => 'Sometimes', 01890 'timemodified' => 1165355352, 01891 'steps' => array( 01892 0 => (object) array( 01893 'sequencenumber' => 0, 01894 'state' => 'todo', 01895 'fraction' => null, 01896 'timecreated' => 1163428543, 01897 'userid' => 63173, 01898 'data' => array('_order' => '456,457,458'), 01899 ), 01900 1 => (object) array( 01901 'sequencenumber' => 1, 01902 'state' => 'todo', 01903 'fraction' => null, 01904 'timecreated' => 1163428576, 01905 'userid' => 63173, 01906 'data' => array(), 01907 ), 01908 2 => (object) array( 01909 'sequencenumber' => 2, 01910 'state' => 'todo', 01911 'fraction' => null, 01912 'timecreated' => 1163428577, 01913 'userid' => 63173, 01914 'data' => array(), 01915 ), 01916 3 => (object) array( 01917 'sequencenumber' => 3, 01918 'state' => 'gradedright', 01919 'fraction' => 1, 01920 'timecreated' => 1165355352, 01921 'userid' => 63173, 01922 'data' => array('answer' => '2', '-finish' => '1'), 01923 ), 01924 ), 01925 ); 01926 01927 $this->compare_qas($expectedqa, $qa); 01928 } 01929 01930 public function test_multichoice_deferredfeedback_qsession4307870 () { 01931 $quiz = (object) array( 01932 'id' => '4070', 01933 'course' => '5139', 01934 'name' => 'Reading practice: Session 16', 01935 'intro' => '', 01936 'introformat' => FORMAT_HTML, 01937 'questiondecimalpoints' => '-1', 01938 'showuserpicture' => '1', 01939 'showblocks' => '1', 01940 'timeopen' => '0', 01941 'timeclose' => '0', 01942 'optionflags' => '0', 01943 'penaltyscheme' => '1', 01944 'attempts' => '0', 01945 'attemptonlast' => '0', 01946 'grademethod' => '1', 01947 'decimalpoints' => '0', 01948 'review' => '71727591', 01949 'questionsperpage' => '1', 01950 'shufflequestions' => '0', 01951 'shuffleanswers' => '1', 01952 'questions' => '89002,0,89040,0,89042,0,89043,0,89044,0,89045,0,89046,0,89047,0', 01953 'sumgrades' => '8', 01954 'grade' => '8', 01955 'timecreated' => '0', 01956 'timemodified' => '1265136533', 01957 'password' => '', 01958 'subnet' => '', 01959 'popup' => '0', 01960 'delay1' => '0', 01961 'delay2' => '0', 01962 'timelimit' => '0', 01963 'showscores' => '1', 01964 'preferredbehaviour' => 'deferredfeedback', 01965 ); 01966 $attempt = (object) array( 01967 'id' => '428769', 01968 'uniqueid' => '428770', 01969 'quiz' => '4070', 01970 'userid' => '605575', 01971 'attempt' => '3', 01972 'sumgrades' => '7', 01973 'timestart' => '1275088684', 01974 'timefinish' => '1275089588', 01975 'timemodified' => '1275089451', 01976 'layout' => '89002,0,89040,0,89042,0,89043,0,89044,0,89045,0,89046,0,89047,0', 01977 'preview' => '0', 01978 'needsupgradetonewqe' => '1', 01979 ); 01980 $question = (object) array( 01981 'id' => '89040', 01982 'category' => '6016', 01983 'parent' => '0', 01984 'name' => 'R2S16', 01985 'questiontext' => '<p>Read the text below and then answer the question based on the information given.</p><p><span lang="ZH-CN">我大哥没有我二哥高,我比我二哥高。</span></p><p>Who is the tallest?</p>', 01986 'questiontextformat' => '1', 01987 'defaultmark' => '1', 01988 'penalty' => '0.33', 01989 'qtype' => 'multichoice', 01990 'length' => '1', 01991 'stamp' => 'learn.open.ac.uk+100204101142+Bygd63', 01992 'version' => 'learn.open.ac.uk+100204101142+exBG6F', 01993 'hidden' => '0', 01994 'generalfeedback' => '', 01995 'generalfeedbackformat' => '1', 01996 'timecreated' => '1265278302', 01997 'timemodified' => '1265278302', 01998 'createdby' => '532546', 01999 'modifiedby' => '532546', 02000 'unlimited' => '0', 02001 'maxmark' => '1', 02002 'options' => (object) array( 02003 'id' => '33730', 02004 'question' => '89040', 02005 'layout' => '0', 02006 'answers' => array( 02007 300601 => (object) array( 02008 'question' => '89040', 02009 'answer' => '我。', 02010 'fraction' => '1', 02011 'feedback' => '', 02012 'id' => 300601, 02013 ), 02014 300602 => (object) array( 02015 'question' => '89040', 02016 'answer' => '我大哥。', 02017 'fraction' => '0', 02018 'feedback' => '', 02019 'id' => 300602, 02020 ), 02021 300603 => (object) array( 02022 'question' => '89040', 02023 'answer' => '我二哥。', 02024 'fraction' => '0', 02025 'feedback' => '', 02026 'id' => 300603, 02027 ), 02028 ), 02029 'single' => '1', 02030 'shuffleanswers' => '1', 02031 'correctfeedback' => '', 02032 'partiallycorrectfeedback' => '', 02033 'incorrectfeedback' => '', 02034 'answernumbering' => 'none', 02035 ), 02036 'hints' => false, 02037 ); 02038 $qsession = (object) array( 02039 'id' => '4307870', 02040 'attemptid' => '428770', 02041 'questionid' => '89040', 02042 'newest' => '11002905', 02043 'newgraded' => '11002905', 02044 'sumpenalty' => '0.33', 02045 'manualcomment' => '', 02046 'manualcommentformat' => '1', 02047 'flagged' => '1', 02048 ); 02049 $qstates = array( 02050 11002780 => (object) array( 02051 'attempt' => '428770', 02052 'question' => '89040', 02053 'originalquestion' => '0', 02054 'seq_number' => '0', 02055 'answer' => '300603,300602,300601:', 02056 'timestamp' => '1275088684', 02057 'event' => '0', 02058 'grade' => '0', 02059 'raw_grade' => '0', 02060 'penalty' => '0', 02061 'id' => 11002780, 02062 ), 02063 11002813 => (object) array( 02064 'attempt' => '428770', 02065 'question' => '89040', 02066 'originalquestion' => '0', 02067 'seq_number' => '1', 02068 'answer' => '300601', 02069 'timestamp' => '1275089101', 02070 'event' => '2', 02071 'grade' => '0', 02072 'raw_grade' => '1', 02073 'penalty' => '0.33', 02074 'id' => 11002813, 02075 ), 02076 11002905 => (object) array( 02077 'attempt' => '428770', 02078 'question' => '89040', 02079 'originalquestion' => '0', 02080 'seq_number' => '2', 02081 'answer' => '300603,300602,300601:300601', 02082 'timestamp' => '1275089101', 02083 'event' => '6', 02084 'grade' => '1', 02085 'raw_grade' => '1', 02086 'penalty' => '0.33', 02087 'id' => 11002905, 02088 ), 02089 ); 02090 02091 $qa = $this->updater->convert_question_attempt($quiz, $attempt, $question, $qsession, $qstates); 02092 02093 $expectedqa = (object) array( 02094 'behaviour' => 'deferredfeedback', 02095 'questionid' => 89040, 02096 'variant' => 1, 02097 'maxmark' => 1, 02098 'minfraction' => 0, 02099 'flagged' => 0, 02100 'questionsummary' => "Read the text below and then answer the question based on the information given.\n\n我大哥没有我二哥高,我比我二哥高。\n\nWho is the tallest?", 02101 'rightanswer' => '我。', 02102 'responsesummary' => '我。', 02103 'timemodified' => 1275089101, 02104 'steps' => array( 02105 0 => (object) array( 02106 'sequencenumber' => 0, 02107 'state' => 'todo', 02108 'fraction' => null, 02109 'timecreated' => 1275088684, 02110 'userid' => 605575, 02111 'data' => array('_order' => '300603,300602,300601'), 02112 ), 02113 1 => (object) array( 02114 'sequencenumber' => 1, 02115 'state' => 'complete', 02116 'fraction' => null, 02117 'timecreated' => 1275089101, 02118 'userid' => 605575, 02119 'data' => array('answer' => '2'), 02120 ), 02121 2 => (object) array( 02122 'sequencenumber' => 2, 02123 'state' => 'gradedright', 02124 'fraction' => 1, 02125 'timecreated' => 1275089101, 02126 'userid' => 605575, 02127 'data' => array('answer' => '2', '-finish' => '1'), 02128 ), 02129 ), 02130 ); 02131 02132 $this->compare_qas($expectedqa, $qa); 02133 } 02134 02135 public function test_multichoice_deferredfeedback_qsession49446() { 02136 $quiz = (object) array( 02137 'id' => '203', 02138 'course' => '2359', 02139 'name' => 'Quiz 1', 02140 'intro' => '', 02141 'introformat' => FORMAT_HTML, 02142 'questiondecimalpoints' => '-1', 02143 'showuserpicture' => '1', 02144 'showblocks' => '1', 02145 'timeopen' => '0', 02146 'timeclose' => '0', 02147 'preferredbehaviour' => 'deferredfeedback', 02148 'attempts' => '0', 02149 'attemptonlast' => '1', 02150 'grademethod' => '1', 02151 'decimalpoints' => '2', 02152 'review' => '71760879', 02153 'questionsperpage' => '2', 02154 'shufflequestions' => '0', 02155 'shuffleanswers' => '0', 02156 'questions' => '3859,3860,0,3861,3862,0,3863,3864,0,3865,3866,0,3867,3868,0', 02157 'sumgrades' => '50', 02158 'grade' => '50', 02159 'timecreated' => '0', 02160 'timemodified' => '1176461532', 02161 'password' => '', 02162 'subnet' => '', 02163 'popup' => '0', 02164 'delay1' => '0', 02165 'delay2' => '0', 02166 'timelimit' => '0', 02167 ); 02168 $attempt = (object) array( 02169 'id' => '4338', 02170 'uniqueid' => '4338', 02171 'quiz' => '203', 02172 'userid' => '30631', 02173 'attempt' => '2', 02174 'sumgrades' => '30', 02175 'timestart' => '1179303963', 02176 'timefinish' => '1179303960', 02177 'timemodified' => '1179303420', 02178 'layout' => '3859,3860,0,3861,3862,0,3863,3864,0,3865,3866,0,3867,3868,0', 02179 'preview' => '0', 02180 'needsupgradetonewqe' => '1', 02181 ); 02182 $question = (object) array( 02183 'id' => '3863', 02184 'category' => '187', 02185 'parent' => '0', 02186 'name' => 'Question 5', 02187 'questiontext' => 'What is SOAP?', 02188 'questiontextformat' => '1', 02189 'defaultmark' => '1', 02190 'penalty' => '0', 02191 'qtype' => 'multichoice', 02192 'length' => '1', 02193 'stamp' => 'learn.open.ac.uk+070404142540+CpseAv', 02194 'version' => 'learn.open.ac.uk+070405112519+qNb2kt', 02195 'hidden' => '0', 02196 'generalfeedback' => '<p></p>', 02197 'generalfeedbackformat' => '1', 02198 'timecreated' => '0', 02199 'timemodified' => '0', 02200 'createdby' => null, 02201 'modifiedby' => null, 02202 'unlimited' => null, 02203 'maxmark' => '5', 02204 'options' => (object) array( 02205 'id' => '1439', 02206 'question' => '3863', 02207 'layout' => '0', 02208 'answers' => array( 02209 11686 => (object) array( 02210 'question' => '3863', 02211 'answer' => 'It is a technology used for sending bulk data through the internet.', 02212 'fraction' => '0', 02213 'feedback' => 'Your answer is incorrect. <br />The correct answer is b. ', 02214 'id' => 11686, 02215 ), 02216 11687 => (object) array( 02217 'question' => '3863', 02218 'answer' => 'It is the transport mechanism used with web services.', 02219 'fraction' => '1', 02220 'feedback' => 'Your answer is correct ', 02221 'id' => 11687, 02222 ), 02223 11688 => (object) array( 02224 'question' => '3863', 02225 'answer' => 'It is a distributed object technology', 02226 'fraction' => '0', 02227 'feedback' => 'Your answer is incorrect. <br />The correct answer is b. ', 02228 'id' => 11688, 02229 ), 02230 ), 02231 'single' => '1', 02232 'shuffleanswers' => '0', 02233 'correctfeedback' => '', 02234 'partiallycorrectfeedback' => '', 02235 'incorrectfeedback' => '', 02236 'answernumbering' => 'abc', 02237 ), 02238 'hints' => false, 02239 ); 02240 $qsession = (object) array( 02241 'id' => '49446', 02242 'attemptid' => '4338', 02243 'questionid' => '3863', 02244 'newest' => '112195', 02245 'newgraded' => '112195', 02246 'sumpenalty' => '0', 02247 'manualcomment' => '', 02248 'manualcommentformat' => '1', 02249 'flagged' => '1', 02250 ); 02251 $qstates = array( 02252 112159 => (object) array( 02253 'attempt' => '4338', 02254 'question' => '3863', 02255 'originalquestion' => '0', 02256 'seq_number' => '0', 02257 'answer' => '11686,11687,11688:', 02258 'timestamp' => '1179303963', 02259 'event' => '8', 02260 'grade' => '0', 02261 'raw_grade' => '0', 02262 'penalty' => '0', 02263 'id' => 112159, 02264 ), 02265 112164 => (object) array( 02266 'attempt' => '4338', 02267 'question' => '3863', 02268 'originalquestion' => '0', 02269 'seq_number' => '0', 02270 'answer' => '11686,11687,11688:', 02271 'timestamp' => '1179303963', 02272 'event' => '0', 02273 'grade' => '0', 02274 'raw_grade' => '0', 02275 'penalty' => '0', 02276 'id' => 112164, 02277 ), 02278 112176 => (object) array( 02279 'attempt' => '4338', 02280 'question' => '3863', 02281 'originalquestion' => '0', 02282 'seq_number' => '1', 02283 'answer' => '11686,11687,11688:11687', 02284 'timestamp' => '1179303218', 02285 'event' => '2', 02286 'grade' => '0', 02287 'raw_grade' => '5', 02288 'penalty' => '0', 02289 'id' => 112176, 02290 ), 02291 112195 => (object) array( 02292 'attempt' => '4338', 02293 'question' => '3863', 02294 'originalquestion' => '0', 02295 'seq_number' => '2', 02296 'answer' => '11686,11687,11688:11687', 02297 'timestamp' => '1179303218', 02298 'event' => '6', 02299 'grade' => '5', 02300 'raw_grade' => '5', 02301 'penalty' => '0', 02302 'id' => 112195, 02303 ), 02304 ); 02305 02306 $qa = $this->updater->convert_question_attempt($quiz, $attempt, $question, $qsession, $qstates); 02307 02308 $expectedqa = (object) array( 02309 'behaviour' => 'deferredfeedback', 02310 'questionid' => 3863, 02311 'variant' => 1, 02312 'maxmark' => 5, 02313 'minfraction' => 0, 02314 'flagged' => 0, 02315 'questionsummary' => 'What is SOAP?', 02316 'rightanswer' => 'It is the transport mechanism used with web services.', 02317 'responsesummary' => 'It is the transport mechanism used with web services.', 02318 'timemodified' => 1179303963, 02319 'steps' => array( 02320 0 => (object) array( 02321 'sequencenumber' => 0, 02322 'state' => 'todo', 02323 'fraction' => null, 02324 'timecreated' => 1179303963, 02325 'userid' => 30631, 02326 'data' => array('_order' => '11686,11687,11688'), 02327 ), 02328 1 => (object) array( 02329 'sequencenumber' => 1, 02330 'state' => 'complete', 02331 'fraction' => null, 02332 'timecreated' => 1179303218, 02333 'userid' => 30631, 02334 'data' => array('answer' => 1), 02335 ), 02336 2 => (object) array( 02337 'sequencenumber' => 2, 02338 'state' => 'gradedright', 02339 'fraction' => 1, 02340 'timecreated' => 1179303218, 02341 'userid' => 30631, 02342 'data' => array('answer' => 1, '-finish' => 1), 02343 ), 02344 ), 02345 ); 02346 02347 $this->compare_qas($expectedqa, $qa); 02348 } 02349 02350 public function test_multichoice_deferredfeedback_qsession591() { 02351 $quiz = (object) array( 02352 'id' => '22', 02353 'course' => '272', 02354 'name' => 'ICT self-assessment quiz', 02355 'intro' => '<p>Work through the ICT skills self-assessment quiz in order to assess your ability to use ICT for study on the Youth Justice Programme. Doing this will also help you to plan a short programme of learning.</p> 02356 <p>Use the questions to rate your ability in each area as either:</p> 02357 <ul> 02358 <li>\'Well developed\'</li> 02359 <li>\'Not sure\', or</li> 02360 <li>\'Needs development\'.</li> 02361 </ul> 02362 <p>Once you have done that, and seen the feedback associated with your answers, you will need to think about prioritising the skills that need development. You will also need to allocate some time in order to develop the skills you need to concentrate on. Within the feedback for each question are some subject-related links which you may find useful.</p>', 02363 'introformat' => FORMAT_HTML, 02364 'questiondecimalpoints' => '-1', 02365 'showuserpicture' => '1', 02366 'showblocks' => '1', 02367 'timeopen' => '0', 02368 'timeclose' => '0', 02369 'preferredbehaviour' => 'deferredfeedback', 02370 'attempts' => '0', 02371 'attemptonlast' => '0', 02372 'grademethod' => '4', 02373 'decimalpoints' => '0', 02374 'review' => '71760879', 02375 'questionsperpage' => '1', 02376 'shufflequestions' => '0', 02377 'shuffleanswers' => '0', 02378 'questions' => '242,0,243,0,244,0,245,0,246,0,247,0', 02379 'sumgrades' => '0', 02380 'grade' => '0', 02381 'timecreated' => '0', 02382 'timemodified' => '1174581121', 02383 'password' => '', 02384 'subnet' => '', 02385 'popup' => '0', 02386 'delay1' => '0', 02387 'delay2' => '0', 02388 'timelimit' => '0', 02389 ); 02390 $attempt = (object) array( 02391 'id' => '95', 02392 'uniqueid' => '94', 02393 'quiz' => '22', 02394 'userid' => '9721', 02395 'attempt' => '1', 02396 'timestart' => '1177777016', 02397 'timefinish' => '1177777128', 02398 'timemodified' => '1177777101', 02399 'layout' => '242,0,243,0,244,0,245,0,246,0,247,0', 02400 'preview' => '0', 02401 'sumgrades' => '0', 02402 'needsupgradetonewqe' => '1', 02403 ); 02404 $question = (object) array( 02405 'id' => '247', 02406 'category' => '12', 02407 'parent' => '0', 02408 'name' => 'Regular access to a computer', 02409 'questiontext' => '[CUT]', 02410 'questiontextformat' => '1', 02411 'defaultmark' => '0', 02412 'penalty' => '0', 02413 'qtype' => 'multichoice', 02414 'length' => '1', 02415 'stamp' => 'learn.open.ac.uk+070321164105+qIeJ9g', 02416 'hidden' => '0', 02417 'version' => 'learn.open.ac.uk+070427170153+plBFqV', 02418 'generalfeedback' => '', 02419 'generalfeedbackformat' => '1', 02420 'timecreated' => '0', 02421 'timemodified' => '0', 02422 'createdby' => null, 02423 'modifiedby' => null, 02424 'unlimited' => null, 02425 'maxmark' => '0', 02426 'options' => (object) array( 02427 'id' => '180', 02428 'question' => '247', 02429 'layout' => '0', 02430 'answers' => array( 02431 666 => (object) array( 02432 'question' => '247', 02433 'answer' => 'Well developed', 02434 'feedback' => 'It\'s good that you don\'t feel as though you will have problems accessing a computer in order to study within the Youth Justice Programme. However, you may find the OU Library\'s information page on <a href="http://library.open.ac.uk/libraries/update/access_computers.html" target="blank"><b>Using public access computers in libraries and other venues</b></a> of interest.', 02435 'fraction' => '1', 02436 'id' => 666, 02437 ), 02438 667 => (object) array( 02439 'question' => '247', 02440 'answer' => 'Not sure', 02441 'feedback' => 'We recommend that you visit the OU Library\'s information page on <a href="http://library.open.ac.uk/libraries/update/access_computers.html" target="blank"><b>Using public access computers in libraries and other venues</b></a>.', 02442 'fraction' => '1', 02443 'id' => 667, 02444 ), 02445 668 => (object) array( 02446 'question' => '247', 02447 'answer' => 'Needs development', 02448 'feedback' => 'We recommend that you visit the OU Library\'s information page on <a href="http://library.open.ac.uk/libraries/update/access_computers.html" target="blank"><b>Using public access computers in libraries and other venues</b></a>.', 02449 'fraction' => '1', 02450 'id' => 668, 02451 ), 02452 ), 02453 'single' => '1', 02454 'shuffleanswers' => '0', 02455 'answernumbering' => 'abc', 02456 'correctfeedback' => '', 02457 'partiallycorrectfeedback' => '', 02458 'incorrectfeedback' => '', 02459 ), 02460 'hints' => false, 02461 ); 02462 $qsession = (object) array( 02463 'id' => '591', 02464 'attemptid' => '94', 02465 'questionid' => '247', 02466 'newest' => '1220', 02467 'newgraded' => '1220', 02468 'sumpenalty' => '0', 02469 'manualcomment' => '', 02470 'manualcommentformat' => '1', 02471 'flagged' => '1', 02472 ); 02473 $qstates = array( 02474 1208 => (object) array( 02475 'attempt' => '94', 02476 'question' => '247', 02477 'originalquestion' => '0', 02478 'seq_number' => '0', 02479 'answer' => '666,667,668:', 02480 'timestamp' => '1177777016', 02481 'event' => '0', 02482 'grade' => '0', 02483 'raw_grade' => '0', 02484 'penalty' => '0', 02485 'id' => 1208, 02486 ), 02487 1219 => (object) array( 02488 'attempt' => '94', 02489 'question' => '247', 02490 'originalquestion' => '0', 02491 'seq_number' => '1', 02492 'answer' => '666,667,668:666', 02493 'timestamp' => '1177777116', 02494 'event' => '2', 02495 'grade' => '0', 02496 'raw_grade' => '0', 02497 'penalty' => '0', 02498 'id' => 1219, 02499 ), 02500 1220 => (object) array( 02501 'attempt' => '94', 02502 'question' => '247', 02503 'originalquestion' => '0', 02504 'seq_number' => '2', 02505 'answer' => '666,667,668:666', 02506 'timestamp' => '1177777116', 02507 'event' => '6', 02508 'grade' => '0', 02509 'raw_grade' => '0', 02510 'penalty' => '0', 02511 'id' => 1220, 02512 ), 02513 ); 02514 02515 $qa = $this->updater->convert_question_attempt($quiz, $attempt, $question, $qsession, $qstates); 02516 02517 $expectedqa = (object) array( 02518 'behaviour' => 'deferredfeedback', 02519 'questionid' => 247, 02520 'variant' => 1, 02521 'maxmark' => 0, 02522 'minfraction' => 0, 02523 'flagged' => 0, 02524 'questionsummary' => '[CUT]', 02525 'rightanswer' => 'Well developed', 02526 'responsesummary' => 'Well developed', 02527 'timemodified' => 1177777116, 02528 'steps' => array( 02529 0 => (object) array( 02530 'sequencenumber' => 0, 02531 'state' => 'todo', 02532 'fraction' => null, 02533 'timecreated' => 1177777016, 02534 'userid' => 9721, 02535 'data' => array('_order' => '666,667,668'), 02536 ), 02537 1 => (object) array( 02538 'sequencenumber' => 1, 02539 'state' => 'complete', 02540 'fraction' => null, 02541 'timecreated' => 1177777116, 02542 'userid' => 9721, 02543 'data' => array('answer' => 0), 02544 ), 02545 2 => (object) array( 02546 'sequencenumber' => 2, 02547 'state' => 'finished', 02548 'fraction' => null, 02549 'timecreated' => 1177777116, 02550 'userid' => 9721, 02551 'data' => array('answer' => 0, '-finish' => 1), 02552 ), 02553 ), 02554 ); 02555 02556 $this->compare_qas($expectedqa, $qa); 02557 } 02558 02559 public function test_multichoice_deferredfeedback_qsession594() { 02560 $quiz = (object) array( 02561 'id' => '22', 02562 'course' => '272', 02563 'name' => 'ICT self-assessment quiz', 02564 'intro' => '<p>Work through the ICT skills self-assessment quiz in order to assess your ability to use ICT for study on the Youth Justice Programme. Doing this will also help you to plan a short programme of learning.</p> 02565 <p>Use the questions to rate your ability in each area as either:</p> 02566 <ul> 02567 <li>\'Well developed\'</li> 02568 <li>\'Not sure\', or</li> 02569 <li>\'Needs development\'.</li> 02570 </ul> 02571 <p>Once you have done that, and seen the feedback associated with your answers, you will need to think about prioritising the skills that need development. You will also need to allocate some time in order to develop the skills you need to concentrate on. Within the feedback for each question are some subject-related links which you may find useful.</p>', 02572 'introformat' => FORMAT_HTML, 02573 'questiondecimalpoints' => '-1', 02574 'showuserpicture' => '1', 02575 'showblocks' => '1', 02576 'timeopen' => '0', 02577 'timeclose' => '0', 02578 'preferredbehaviour' => 'deferredfeedback', 02579 'attempts' => '0', 02580 'attemptonlast' => '0', 02581 'grademethod' => '4', 02582 'decimalpoints' => '0', 02583 'review' => '71760879', 02584 'questionsperpage' => '1', 02585 'shufflequestions' => '0', 02586 'shuffleanswers' => '0', 02587 'questions' => '242,0,243,0,244,0,245,0,246,0,247,0', 02588 'sumgrades' => '0', 02589 'grade' => '0', 02590 'timecreated' => '0', 02591 'timemodified' => '1174581121', 02592 'password' => '', 02593 'subnet' => '', 02594 'popup' => '0', 02595 'delay1' => '0', 02596 'delay2' => '0', 02597 'timelimit' => '0', 02598 ); 02599 $attempt = (object) array( 02600 'id' => '95', 02601 'uniqueid' => '94', 02602 'quiz' => '22', 02603 'userid' => '9721', 02604 'attempt' => '1', 02605 'timestart' => '1177777016', 02606 'timefinish' => '1177777128', 02607 'timemodified' => '1177777101', 02608 'layout' => '242,0,243,0,244,0,245,0,246,0,247,0', 02609 'preview' => '0', 02610 'sumgrades' => '0', 02611 'needsupgradetonewqe' => '1', 02612 ); 02613 $question = (object) array( 02614 'id' => '242', 02615 'category' => '12', 02616 'parent' => '0', 02617 'name' => 'Using the internet', 02618 'questiontext' => '<p><strong>Using the internet</strong></p> 02619 <p><font face="Verdana,Verdana" size="2">Many study resources are available online, and you will also be expected to find things out yourself using the web.</font></p> 02620 <p><i><font face="Verdana,Verdana" size="2">How would you rate your skills in using browsers and managing documents you find on the internet? </font></i></p>', 02621 'questiontextformat' => '1', 02622 'defaultmark' => '0', 02623 'penalty' => '0', 02624 'qtype' => 'multichoice', 02625 'length' => '1', 02626 'stamp' => 'learn.open.ac.uk+070321161800+WlAJ5D', 02627 'hidden' => '0', 02628 'version' => 'learn.open.ac.uk+070329133200+dO4WQO', 02629 'generalfeedback' => '', 02630 'generalfeedbackformat' => '1', 02631 'timecreated' => '0', 02632 'timemodified' => '0', 02633 'createdby' => null, 02634 'modifiedby' => null, 02635 'unlimited' => null, 02636 'maxmark' => '0', 02637 'options' => (object) array( 02638 'id' => '175', 02639 'question' => '242', 02640 'layout' => '0', 02641 'answers' => array( 02642 651 => (object) array( 02643 'question' => '242', 02644 'answer' => 'Well developed', 02645 'feedback' => 'You obviously feel confident about using the internet in order to manage your documentation and find information on the World Wide Web. However, you may still find the OU\'s <a href="http://www.open.ac.uk/webguide/" target="blank"><b>Web Guide</b></a> site of interest.', 02646 'fraction' => '1', 02647 'id' => 651, 02648 ), 02649 652 => (object) array( 02650 'question' => '242', 02651 'answer' => 'Not sure', 02652 'feedback' => 'We recommend that you visit the OU\'s <a href="http://www.open.ac.uk/webguide/" target="blank"><b>Web Guide</b></a> site and work through some of the tips and advice about using the web effectively.', 02653 'fraction' => '1', 02654 'id' => 652, 02655 ), 02656 653 => (object) array( 02657 'question' => '242', 02658 'answer' => 'Needs development', 02659 'feedback' => 'We recommend that you visit the OU\'s <a href="http://www.open.ac.uk/webguide/" target="blank"><b>Web Guide</b></a> site and work through some of the tips and advice about using the web effectively.', 02660 'fraction' => '1', 02661 'id' => 653, 02662 ), 02663 ), 02664 'single' => '1', 02665 'shuffleanswers' => '0', 02666 'answernumbering' => 'abc', 02667 'correctfeedback' => '', 02668 'partiallycorrectfeedback' => '', 02669 'incorrectfeedback' => '', 02670 ), 02671 'hints' => false, 02672 ); 02673 $qsession = (object) array( 02674 'id' => '594', 02675 'attemptid' => '94', 02676 'questionid' => '242', 02677 'newest' => '1223', 02678 'newgraded' => '1223', 02679 'sumpenalty' => '0', 02680 'manualcomment' => '', 02681 'manualcommentformat' => '1', 02682 'flagged' => '1', 02683 ); 02684 $qstates = array( 02685 1211 => (object) array( 02686 'attempt' => '94', 02687 'question' => '242', 02688 'originalquestion' => '0', 02689 'seq_number' => '0', 02690 'answer' => '651,652,653:', 02691 'timestamp' => '1177777016', 02692 'event' => '0', 02693 'grade' => '0', 02694 'raw_grade' => '0', 02695 'penalty' => '0', 02696 'id' => 1211, 02697 ), 02698 1214 => (object) array( 02699 'attempt' => '94', 02700 'question' => '242', 02701 'originalquestion' => '0', 02702 'seq_number' => '1', 02703 'answer' => '651,652,653:651', 02704 'timestamp' => '1177777040', 02705 'event' => '2', 02706 'grade' => '0', 02707 'raw_grade' => '0', 02708 'penalty' => '0', 02709 'id' => 1214, 02710 ), 02711 1223 => (object) array( 02712 'attempt' => '94', 02713 'question' => '242', 02714 'originalquestion' => '0', 02715 'seq_number' => '2', 02716 'answer' => '651,652,653:651', 02717 'timestamp' => '1177777040', 02718 'event' => '6', 02719 'grade' => '0', 02720 'raw_grade' => '0', 02721 'penalty' => '0', 02722 'id' => 1223, 02723 ), 02724 ); 02725 02726 $qa = $this->updater->convert_question_attempt($quiz, $attempt, $question, $qsession, $qstates); 02727 02728 $expectedqa = (object) array( 02729 'behaviour' => 'deferredfeedback', 02730 'questionid' => 242, 02731 'variant' => 1, 02732 'maxmark' => 0, 02733 'minfraction' => 0, 02734 'flagged' => 0, 02735 'questionsummary' => "USING THE INTERNET \n\nMany study resources are available online, and you will also be expected to find things out yourself using the web. \n\n_How would you rate your skills in using browsers and managing documents you find on the internet? _", 02736 'rightanswer' => 'Well developed', 02737 'responsesummary' => 'Well developed', 02738 'timemodified' => 1177777040, 02739 'steps' => array( 02740 0 => (object) array( 02741 'sequencenumber' => 0, 02742 'state' => 'todo', 02743 'fraction' => null, 02744 'timecreated' => 1177777016, 02745 'userid' => 9721, 02746 'data' => array('_order' => '651,652,653'), 02747 ), 02748 1 => (object) array( 02749 'sequencenumber' => 1, 02750 'state' => 'complete', 02751 'fraction' => null, 02752 'timecreated' => 1177777040, 02753 'userid' => 9721, 02754 'data' => array('answer' => '0'), 02755 ), 02756 2 => (object) array( 02757 'sequencenumber' => 2, 02758 'state' => 'finished', 02759 'fraction' => null, 02760 'timecreated' => 1177777040, 02761 'userid' => 9721, 02762 'data' => array('answer' => '0', '-finish' => 1), 02763 ), 02764 ), 02765 ); 02766 02767 $this->compare_qas($expectedqa, $qa); 02768 } 02769 }