ÿØÿà JFIF    ÿÛ „  ( %"1!%)+...383,7(-.+  -+++--++++---+-+-----+---------------+---+-++7-----ÿÀ  ß â" ÿÄ     ÿÄ H    !1AQaq"‘¡2B±ÁÑð#R“Ò Tbr‚²á3csƒ’ÂñDS¢³$CÿÄ   ÿÄ %  !1AQa"23‘ÿÚ   ? ôÿ ¨pŸªáÿ —åYõõ\?àÒü©ŠÄï¨pŸªáÿ —åYõõ\?àÓü©ŠÄá 0Ÿªáÿ Ÿå[úƒ ú®ði~TÁbqÐ8OÕpÿ ƒOò¤Oè`–RÂáœá™êi€ßÉ< FtŸI“öÌ8úDf´°å}“¾œ6  öFá°y¥jñÇh†ˆ¢ã/ÃÐ:ªcÈ "Y¡ðÑl>ÿ ”ÏËte:qž\oäŠe÷󲍷˜HT4&ÿ ÓÐü6ö®¿øþßèô Ÿ•7Ñi’•j|“ñì>b…þS?*Óôÿ ÓÐü*h¥£ír¶ü UãS炟[AÐaè[ûª•õ&õj?†Éö+EzP—WeÒírJFt ‘BŒ†Ï‡%#tE Øz ¥OÛ«!1›üä±Í™%ºÍãö]°î(–:@<‹ŒÊö×òÆt¦ãº+‡¦%ÌÁ²h´OƒJŒtMÜ>ÀÜÊw3Y´•牋4ǍýʏTì>œú=Íwhyë,¾Ôò×õ¿ßÊa»«þˆѪQ|%6ž™A õ%:øj<>É—ÿ Å_ˆCbõ¥š±ý¯Ýƒï…¶|RëócÍf溪“t.СøTÿ *Ä¿-{†çàczůŽ_–^XþŒ±miB[X±d 1,é”zEù»& î9gœf™9Ð'.;—™i}!ôšåîqêÛ٤ёý£½ÆA–àôe"A$˝Úsäÿ ÷Û #°xŸëí(l »ý3—¥5m! rt`†0~'j2(]S¦¦kv,ÚÇ l¦øJA£Šƒ J3E8ÙiŽ:cÉžúeZ°€¯\®kÖ(79«Ž:¯X”¾³Š&¡* ….‰Ž(ÜíŸ2¥ª‡×Hi²TF¤ò[¨íÈRëÉ䢍mgÑ.Ÿ<öäS0í„ǹÁU´f#Vß;Õ–…P@3ío<ä-±»Ž.L|kªÀê›fÂ6@»eu‚|ÓaÞÆŸ…¨ááå>åŠ?cKü6ùTÍÆ”†sĤÚ;H2RÚ†õ\Ö·Ÿn'¾ ñ#ºI¤Å´%çÁ­‚â7›‹qT3Iï¨ÖÚ5I7Ë!ÅOóŸ¶øÝñØôת¦$Tcö‘[«Ö³šÒ';Aþ ¸èíg A2Z"i¸vdÄ÷.iõ®§)¿]¤À†–‡É&ä{V¶iŽ”.Ó×Õÿ û?h¬Mt–íª[ÿ Ñÿ ÌV(í}=ibÔ¡›¥¢±b Lô¥‡piη_Z<‡z§èŒ)iÖwiÇ 2hÙ3·=’d÷8éŽ1¦¸c¤µ€7›7Ø ð\á)} ¹fËí›pAÃL%âc2 í§æQz¿;T8sæ°qø)QFMð‰XŒÂ±N¢aF¨…8¯!U  Z©RÊ ÖPVÄÀÍin™Ì-GˆªÅËŠ›•zË}º±ŽÍFò¹}Uw×#ä5B¤{î}Ð<ÙD é©¤&‡ïDbàÁôMÁ.. /** * Question behaviour that is like the interactive behaviour, but where the * student is credited for parts of the question they got right on earlier tries. * * @package qbehaviour * @subpackage interactivecountback * @copyright 2009 The Open University * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); require_once(__DIR__ . '/../interactive/behaviour.php'); /** * Question behaviour for interactive mode with count-back scoring. * * As an example, suppose we have a matching question with 4 parts, and 3 tries * (penalty 1/3), and the question is worth 12 marks (so, 3 marks for each part). * Suppose also that: * - on the first try, the student gets the first two parts right, and the * other two wrong. * - on the second try, they are sure they got the first part right, so keep * their answer the same, but they change their answer to the second part. * They also get the answer to the thrid part right on this try, but still * get the 4th part wrong. * - On the final try, they get the first 3 parts right, but the 4th part still * wrong. * We want to grade them as follows. * - For the first part, they were right first time, and did not change their * answer, so we credit that part as right first time: 3/3 * - For the second part, although they were right first time, they then changed * their mind, an only finally got it right on the third try, so 1/3. * - For the third part, they got it right on the second try, and then did not * change their answer, so 2/3. * - For the last part, they were wrong at the last try, so 0/3. * So, total mark is 6/12. (Really, a fraction of 0.5.) * * Of course, the details of the grading are actually up to the particular * question type. The point is that the final grade can take into account all * of the tries the student made. * * @copyright 2009 The Open University * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class qbehaviour_interactivecountback extends qbehaviour_interactive { public function is_compatible_question(question_definition $question) { return $question instanceof question_automatically_gradable_with_countback; } protected function adjust_fraction($fraction, question_attempt_pending_step $pendingstep) { $totaltries = $this->qa->get_step(0)->get_behaviour_var('_triesleft'); $responses = array(); $lastsave = array(); foreach ($this->qa->get_step_iterator() as $step) { if ($step->has_behaviour_var('submit') && $step->get_state() != question_state::$invalid) { $responses[] = $step->get_qt_data(); $lastsave = array(); } else { $lastsave = $step->get_qt_data(); } } $lastresponse = $pendingstep->get_qt_data(); if (!empty($lastresponse)) { $responses[] = $lastresponse; } else if (!empty($lastsave)) { $responses[] = $lastsave; } return $this->question->compute_final_grade($responses, $totaltries); } }