ÿØÿà JFIF    ÿÛ „  ( %!1"%)+...383-7(-.+  -%%--------+------------/----------------------------ÿÀ  ¶" ÿÄ     ÿÄ @    !1AQaq‘¡"±ÁÑð2’BRráS‚ñ3b¢CT²Ò #cÿÄ    ÿÄ '   1!AQ2a"‘±#ÿÚ   ? ò(/p‘—–¢·,M|¯G»R£üešT. ôŸEoCFñ‡ 4ÔkåóxR|µÁ¨ÓDà!Ç´µ˜‡p ÍQ‹§!þž^õWsŒy  åÁ§$á«%ºq˜™JyyË0y«^Ϗ -3ÃÏËÈ£Æ\P’ä„s&•‹Üs üô'àWt¹pñCp$bÚF`·7.^)¾!)ÒÙ˜–ÅÏš^h¾ø³·ìe±ŒaeÖ—Í,e=B}Jéߦ$$½—šÙÜCC¯¶è8β–Åkèwx LÉngT±æ¹£Ócœ¿Í/©Éÿ ‰ÚCÒ­mq;Tt¶–}0"zÖPcd1š­¤tˆ„ÐÓâqú[™öUCŠ2޿د­É(¸ßúçšmW,Ò ºf‹Ån™ÄLêÁ8üÁkÁ€L¥ÍuJ1œôrÂSŒÓöt!7EUíïb)AËi¬â-ÙHk8òÁiXYwÅ)O^"ÇØriÛô{»wRUKÙÏÚlÓ¬€‚’שT ] ªb—ÊîKC^×M“xùäñz¬zJ× {4[¹M'IÆeH1LCWÕ]œûº WDæà°OÅ‚¹c²ÞuA–rL`HšpCez‡V’— Ž‚Ë„–ñ­'µR0ÕÖ=À:±G»C\nÆÉ5*¢ †3šhQ4ýÒi$Õ1"Ü]¢p-q3zcQ$ªö¨¥æf›‘»´ÝÚHá„e²JÇ–iÊ:·à¬Øc5Åk»Laª*wi [0Ówk ¦a¦0Õ²ÅÅ‚T¸’³q:Æ<¹ú Ò˜Æ}2VE•Ѐp¡Ô3Úº …h³^LJºçì¥Ánó|˜ÖˆÎˆ+« ¦dø‘Mº–d\ªDðÛ„Ì×LÝ——Ð9Ç|•FèçVm™¨€™3õS–9Äå¢<̉Ìm¢±`·º˜&Z²ž Ë®D«¶»6™‰©­HÈ Àá«h­i³04æ’hxœi3ï¨(ÓL·†‹¶ËpŒ ƒÜÒ? :õdsÀ –3æÓ·Üjâ¬9—]8n¼&]I F£¼…ì–—Œ0v°LǐÅfÛ2TÖ’aµ˜N@ÖBSÏ^à´4-±°b×nÈÈœÆD=KdŒø…ÄÈK,›ÖR§fjü$^ÔÎ!„6^ s:Üun\ôkCÞò÷<—Lúl Í›G¹ÀPá¼Nc¡šÒ…ÙWͳœ±vÊáЄ×9‹P‰cEØ‘™›µŸP<×g1 º©Ø¬wiÁ^l5× I/';Ë+´Z‡ÓÄFÕp[Èð’ HÄ ó 9¬Dl4“é±Ï”V=^Hð;žLädÉa‚°Ë,#/Ž~²BÔÛ QãñQtIeórVB,ÏÂf‹4#Μc‹É3ZIÖ Œ¢¥·üxa‡Ãçè„jŠ[5 Ä!U?,3žÎ×…ðdÓ÷háŠA‰ìÄ4÷ÃÜZÃE{‰®+W\ZÍE[‰»µk»MÝ­`¢©†˜ÃV‹-f¢¡†¢a«eŠ%«Y¨©q%jâd,Ôq`) ¤¦…šˆ ¦E>0Ùb²t–Ÿ  ÷jsςҒKÈcø(é›;k(’#ôŒQ ™C> õ³M9óºÆµ¤çâ;uÀ)5>RÔ¸fÓ~Ȧ—’-$fe«"FâUˆÊwµPÏu w+"åÉó¨6s™Û9(À¨ù©hE°½†n`m~“@©›p!Vkhµ Á1šbEqqÊ@ºèl›2 –Yã%‘‚hÛ{a¶‡ÅÞM²¬çL34®Çl]®‹ŽØŒm'RÜe35æöˆ­Á­ cP9šeÁköo´L³Ì=p8]”‡B¶,šº|ɏdzXˆØk*ÇÚ{#ñ‰pã(€¶‡9ý'šÜ³½¯kƒ†Â’ëSOƒ•Å®H6+a¢µˆ‹Y¨b˜b+XˆÖ!°u!¢"µˆˆn2ˆ Å0Ä`Å Ô®c(ÓÜGº•Ä»Œ âWî%q.áÐÄ÷î%umÍ£+ÜQ,Vn¦-GphU¸¢X­&,Gt ·K¢ÅÅ·¥RÄÊÉbKn N­R2g$VµÕó Qr#–ÓZUÏð0ÎtÙÀœz ëöo“Îk¯n„T°"SÞ+³/…€½"ižãO%Í%&Δâ‘ËØ´IˆÓ°Ë‰ÞM3.™yçÁzit›`4C`k¢¼á!álÄï sÂ[×!¤l¾æo"ƒIÔ'@ªu)3›ô®“@Z à¾] üœ'‡4¸PÞkÁ-qÄH‰ÓÍBd´ÿ —¹°ÄA&ÊUC„öz‚‚RæŠtf¬>˜ÑidšEçÑL÷áý¡V±h§­c¿¥¨ƒ@g¼…Ýö^ÞËc.ž„æ“I[ ª+·zÐÒÚ,½Ð»¶€C›7jk$๖€Ž¾ÅÙpp¶ÍþéΤ ½ØÎŒq ñpæžÅ¥#Øâ49ÃÂK^MYV“,¶Éz_òæ:…;Õ«¦I3âJ£¤û5$7Èxün\â]Êe¯(Ÿ&Ž‹¶2<6Ćf× æ¢ƱqWı[(ÙÂŽç‚T7¨@ÈÉÍß‚ïÙ"&3TYlGށ†)†#5ŠA©^T2ÆÁ†)©†©†¤yGXÁ†©"†)©¼ÅV WS†#©]R–r‹q5ÕbâWþBh¯u+ªÅÄ×ü„nÑ^êkªÁj‰jeœWˆÕÕ`µDµ2Ì+Ä µDµµ5Ô{¤Þ0RF’H÷AÛ<ÊÁ§ ƈæ0Ñ£ê4 öÚµ[¬/1²€â<-¬šö²r×0o×w ´xÐÒË„ g01¬„åEM蛇Ã\6µE›‘fÙO k÷CºnÓ1`iîÒ² áÂ!ÑLÄÿ ³¬\õ*:M=Ç»c‹2[‰ØsÕLò\ŒK L^™üÄN\¶#» Ç\……ßïIœÉ$¸ÎñÍ®ÔHÇ Ûí/´>Li”„†g^$ 7NÍÑÑ2M2ªNg=k½Ð}Ÿl6‡ —JWˆ”ÞéT·+µ¦üÂFè¢Vs6ýÆ4»2+2IÝ9ô9®ÇGÙÇ1+Ä8;*Õ§ž½D*îÑWÚçá3Ma¤·ˆ¥t}š²Ü…Q+Æüµ8HíS”üxGéÁˆ¦Ël„éÈ 5 µÄƒ6äÜ(kIš¯S†fÖ&¸®×v|Äyˆ*禌Éù@7-®Ä[]ÎÖ¿ê`º…=:…žJVnݳvðÖKE¼‚ »mà ÷f®:Ë ™–4rð¡4` ܹçž~‹C=œ…¾Ïj|VDtK.ƒ"9 Ï ­–éXá³6WÒïIL-Ї Ç PKf\ edit_form.phpnu[. /** * Edit form for grade scales * * @package core_grades * @copyright 2007 Petr Skoda * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ if (!defined('MOODLE_INTERNAL')) { die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page } require_once $CFG->libdir.'/formslib.php'; class edit_scale_form extends moodleform { function definition() { global $CFG; $mform =& $this->_form; // visible elements $mform->addElement('header', 'general', get_string('scale')); $mform->addElement('text', 'name', get_string('name'), 'size="40"'); $mform->addRule('name', get_string('required'), 'required', null, 'client'); $mform->setType('name', PARAM_TEXT); $mform->addElement('advcheckbox', 'standard', get_string('scalestandard')); $mform->addHelpButton('standard', 'scalestandard'); $mform->addElement('static', 'used', get_string('used')); $mform->addElement('textarea', 'scale', get_string('scale'), array('cols'=>50, 'rows'=>2)); $mform->addHelpButton('scale', 'scale'); $mform->addRule('scale', get_string('required'), 'required', null, 'client'); $mform->setType('scale', PARAM_TEXT); $mform->addElement('editor', 'description_editor', get_string('description'), null, $this->_customdata['editoroptions']); // hidden params $mform->addElement('hidden', 'id', 0); $mform->setType('id', PARAM_INT); $mform->addElement('hidden', 'courseid', 0); $mform->setType('courseid', PARAM_INT); /// add return tracking info $gpr = $this->_customdata['gpr']; $gpr->add_mform_elements($mform); //------------------------------------------------------------------------------- // buttons $this->add_action_buttons(); } /// tweak the form - depending on existing data function definition_after_data() { global $CFG; $mform =& $this->_form; $courseid = $mform->getElementValue('courseid'); if ($id = $mform->getElementValue('id')) { $scale = grade_scale::fetch(array('id'=>$id)); $used = $scale->is_used(); if ($used) { $mform->hardFreeze('scale'); } if (empty($courseid)) { $mform->hardFreeze('standard'); } else if (!has_capability('moodle/course:managescales', context_system::instance())) { //if they dont have managescales at system level the shouldnt be allowed to make scales standard (or not standard) $mform->hardFreeze('standard'); } else if ($used and !empty($scale->courseid)) { $mform->hardFreeze('standard'); } $usedstr = $scale->is_used() ? get_string('yes') : get_string('no'); $used_el =& $mform->getElement('used'); $used_el->setValue($usedstr); } else { $mform->removeElement('used'); if (empty($courseid) or !has_capability('moodle/course:managescales', context_system::instance())) { $mform->hardFreeze('standard'); } } } /// perform extra validation before submission function validation($data, $files) { global $CFG, $COURSE, $DB; $errors = parent::validation($data, $files); // we can not allow 2 scales with the same exact scale as this creates // problems for backup/restore $old = grade_scale::fetch(array('id'=>$data['id'])); if (array_key_exists('standard', $data)) { if (empty($data['standard'])) { $courseid = $COURSE->id; } else { $courseid = 0; } } else { $courseid = $old->courseid; } if (array_key_exists('scale', $data)) { $scalearray = explode(',', $data['scale']); $scalearray = array_map('trim', $scalearray); $scaleoptioncount = count($scalearray); if (count($scalearray) < 1) { $errors['scale'] = get_string('badlyformattedscale', 'grades'); } else { $thescale = implode(',',$scalearray); //this check strips out whitespace from the scale we're validating but not from those already in the DB $count = $DB->count_records_select('scale', "courseid=:courseid AND ".$DB->sql_compare_text('scale', core_text::strlen($thescale)).'=:scale', array('courseid'=>$courseid, 'scale'=>$thescale)); if ($count) { //if this is a new scale but we found a duplice in the DB //or we found a duplicate in another course report the error if (empty($old->id) or $old->courseid != $courseid) { $errors['scale'] = get_string('duplicatescale', 'grades'); } else if ($old->scale !== $thescale and $old->scale !== $data['scale']) { //if the old scale from DB is different but we found a duplicate then we're trying to modify a scale to be a duplicate $errors['scale'] = get_string('duplicatescale', 'grades'); } } } } return $errors; } } PKf\m-q&&edit.phpnu[. /** * Edit page for grade scales * * @package core_grades * @copyright 2007 Petr Skoda * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require_once '../../../config.php'; require_once $CFG->dirroot.'/grade/lib.php'; require_once $CFG->dirroot.'/grade/report/lib.php'; require_once 'edit_form.php'; $courseid = optional_param('courseid', 0, PARAM_INT); $id = optional_param('id', 0, PARAM_INT); $PAGE->set_url('/grade/edit/scale/edit.php', array('id' => $id, 'courseid' => $courseid)); $PAGE->set_pagelayout('admin'); navigation_node::override_active_url(new moodle_url('/grade/edit/scale/index.php', array('id' => $courseid))); $systemcontext = context_system::instance(); // a bit complex access control :-O if ($id) { /// editing existing scale if (!$scale_rec = $DB->get_record('scale', array('id' => $id))) { throw new \moodle_exception('invalidscaleid'); } if ($scale_rec->courseid) { $scale_rec->standard = 0; if (!$course = $DB->get_record('course', array('id' => $scale_rec->courseid))) { throw new \moodle_exception('invalidcourseid'); } require_login($course); $context = context_course::instance($course->id); require_capability('moodle/course:managescales', $context); $courseid = $course->id; } else { if ($courseid) { if (!$course = $DB->get_record('course', array('id' => $courseid))) { throw new \moodle_exception('invalidcourseid'); } } $scale_rec->standard = 1; $scale_rec->courseid = $courseid; require_login($courseid); require_capability('moodle/course:managescales', $systemcontext); } } else if ($courseid){ /// adding new scale from course if (!$course = $DB->get_record('course', array('id' => $courseid))) { throw new \moodle_exception('invalidcourseid'); } $scale_rec = new stdClass(); $scale_rec->standard = 0; $scale_rec->courseid = $courseid; require_login($course); $context = context_course::instance($course->id); require_capability('moodle/course:managescales', $context); } else { /// adding new scale from admin section $scale_rec = new stdClass(); $scale_rec->standard = 1; $scale_rec->courseid = 0; require_login(); require_capability('moodle/course:managescales', $systemcontext); } if (!$courseid) { require_once $CFG->libdir.'/adminlib.php'; admin_externalpage_setup('scales'); $PAGE->set_primary_active_tab('siteadminnode'); } // default return url $gpr = new grade_plugin_return(); $returnurl = $gpr->get_return_url('index.php?id='.$courseid); $editoroptions = array( 'maxfiles' => EDITOR_UNLIMITED_FILES, 'maxbytes' => $CFG->maxbytes, 'trusttext' => false, 'noclean' => true, 'context' => $systemcontext ); if (!empty($scale_rec->id)) { $editoroptions['subdirs'] = file_area_contains_subdirs($systemcontext, 'grade', 'scale', $scale_rec->id); $scale_rec = file_prepare_standard_editor($scale_rec, 'description', $editoroptions, $systemcontext, 'grade', 'scale', $scale_rec->id); } else { $editoroptions['subdirs'] = false; $scale_rec = file_prepare_standard_editor($scale_rec, 'description', $editoroptions, $systemcontext, 'grade', 'scale', null); } $mform = new edit_scale_form(null, compact('gpr', 'editoroptions')); $mform->set_data($scale_rec); if ($mform->is_cancelled()) { redirect($returnurl); } else if ($data = $mform->get_data()) { $scale = new grade_scale(array('id'=>$id)); $data->userid = $USER->id; if (empty($scale->id)) { $data->description = $data->description_editor['text']; $data->descriptionformat = $data->description_editor['format']; grade_scale::set_properties($scale, $data); if (!has_capability('moodle/grade:manage', $systemcontext)) { $data->standard = 0; } $scale->courseid = !empty($data->standard) ? 0 : $courseid; $scale->insert(); $data = file_postupdate_standard_editor($data, 'description', $editoroptions, $systemcontext, 'grade', 'scale', $scale->id); $DB->set_field($scale->table, 'description', $data->description, array('id'=>$scale->id)); } else { $data = file_postupdate_standard_editor($data, 'description', $editoroptions, $systemcontext, 'grade', 'scale', $id); grade_scale::set_properties($scale, $data); if (isset($data->standard)) { $scale->courseid = !empty($data->standard) ? 0 : $courseid; } else { unset($scale->courseid); // keep previous } $scale->update(); } redirect($returnurl); } $heading = $id ? get_string('editscale', 'grades') : get_string('addscale', 'grades'); $PAGE->navbar->add($heading); print_grade_page_head($COURSE->id, 'scale', null, $heading, false, false, false); $mform->display(); echo $OUTPUT->footer(); PKf\a   index.phpnu[. /** * A page for managing custom and standard scales * * @package core_grades * @copyright 2007 Petr Skoda * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require_once '../../../config.php'; require_once $CFG->dirroot.'/grade/lib.php'; require_once $CFG->libdir.'/gradelib.php'; $courseid = optional_param('id', 0, PARAM_INT); $action = optional_param('action', '', PARAM_ALPHA); $PAGE->set_url('/grade/edit/scale/index.php', array('id' => $courseid)); /// Make sure they can even access this course if ($courseid) { if (!$course = $DB->get_record('course', array('id' => $courseid))) { throw new \moodle_exception('invalidcourseid'); } require_login($course); $context = context_course::instance($course->id); require_capability('moodle/course:managescales', $context); $PAGE->set_pagelayout('admin'); } else { require_once $CFG->libdir.'/adminlib.php'; admin_externalpage_setup('scales'); $context = context_system::instance(); $PAGE->set_primary_active_tab('siteadminnode'); } /// return tracking object $gpr = new grade_plugin_return(array('type'=>'edit', 'plugin'=>'scale', 'courseid'=>$courseid)); $strscale = get_string('scale'); $strstandardscale = get_string('scalesstandard'); $strcustomscales = get_string('scalescustom'); $strname = get_string('name'); $strdelete = get_string('delete'); $stredit = get_string('edit'); $strused = get_string('used'); $stredit = get_string('edit'); switch ($action) { case 'delete': if (!confirm_sesskey()) { break; } $scaleid = required_param('scaleid', PARAM_INT); if (!$scale = grade_scale::fetch(array('id'=>$scaleid))) { break; } if (empty($scale->courseid)) { require_capability('moodle/course:managescales', context_system::instance()); } else if ($scale->courseid != $courseid) { throw new \moodle_exception('invalidcourseid'); } if (!$scale->can_delete()) { break; } $deleteconfirmed = optional_param('deleteconfirmed', 0, PARAM_BOOL); if (!$deleteconfirmed) { if ($courseid) { $PAGE->navbar->add(get_string('scales'), new moodle_url('/grade/edit/scale/index.php', ['id' => $courseid])); } $strdeletescale = get_string('deletescale', 'grades'); $PAGE->navbar->add($strdeletescale); $PAGE->set_title($strdeletescale); $PAGE->set_heading($COURSE->fullname); echo $OUTPUT->header(); $confirmurl = new moodle_url('index.php', array( 'id' => $courseid, 'scaleid' => $scale->id, 'action'=> 'delete', 'sesskey' => sesskey(), 'deleteconfirmed'=> 1)); echo $OUTPUT->confirm(get_string('scaleconfirmdelete', 'grades', $scale->get_name()), $confirmurl, "index.php?id={$courseid}"); echo $OUTPUT->footer(); die; } else { $scale->delete(); } break; } if (!$courseid) { echo $OUTPUT->header(); } $table = new html_table(); $table2 = new html_table(); $heading = ''; if ($courseid and $scales = grade_scale::fetch_all_local($courseid)) { $heading = $strcustomscales; $data = array(); foreach($scales as $scale) { $line = array(); $line[] = $scale->get_name() .'
'.str_replace(",", ", ", $scale->scale).'
'; $used = $scale->is_used(); $line[] = $used ? get_string('yes') : get_string('no'); $buttons = ""; $buttons .= grade_button('edit', $courseid, $scale); if (!$used) { $buttons .= grade_button('delete', $courseid, $scale); } $line[] = $buttons; $data[] = $line; } $table->head = array($strscale, $strused, $stredit); $table->size = array('70%', '20%', '10%'); $table->align = array('left', 'center', 'center'); $table->attributes['class'] = 'scaletable localscales generaltable table table-hover'; $table->data = $data; } if ($scales = grade_scale::fetch_all_global()) { $heading = $strstandardscale; $data = array(); foreach($scales as $scale) { $line = array(); $line[] = $scale->get_name().'
'.str_replace(",", ", ", $scale->scale).'
'; $used = $scale->is_used(); $line[] = $used ? get_string('yes') : get_string('no'); $buttons = ""; if (has_capability('moodle/course:managescales', context_system::instance())) { $buttons .= grade_button('edit', $courseid, $scale); } if (!$used and has_capability('moodle/course:managescales', context_system::instance())) { $buttons .= grade_button('delete', $courseid, $scale); } $line[] = $buttons; $data[] = $line; } $table2->head = array($strscale, $strused, $stredit); $table->attributes['class'] = 'scaletable globalscales generaltable table table-hover'; $table2->size = array('70%', '20%', '10%'); $table2->align = array('left', 'center', 'center'); $table2->data = $data; } $actionbar = new \core_grades\output\scales_action_bar($context); if ($courseid) { print_grade_page_head($courseid, 'scale', 'scale', false, false, false, true, null, null, null, $actionbar); } else { $renderer = $PAGE->get_renderer('core_grades'); echo $renderer->render_action_bar($actionbar); echo $OUTPUT->heading(get_string('scales', 'core')); } $hascustomscales = !empty($table->data); $hasstandardscales = !empty($table2->data); // If there are custom scales available in this context, output the custom scales table and a heading. if ($hascustomscales) { echo $OUTPUT->heading($strcustomscales, 3, 'main mt-3'); echo html_writer::table($table); } // If there are standard scales available in this context, output the standard scales table and a heading. if ($hasstandardscales) { echo $OUTPUT->heading($strstandardscale, 3, 'main mt-3'); echo html_writer::table($table2); } // If the are no available scales, display a notification. if (!$hascustomscales && !$hasstandardscales) { echo $OUTPUT->notification(get_string('noexistingscales', 'grades'), 'info', false); } echo $OUTPUT->footer(); PKf\ edit_form.phpnu[PKf\m-q&&edit.phpnu[PKf\a   c.index.phpnu[PKJ