ÿØÿà 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-Ї Ç smkb8269/public_html/lms.smk-almanshuriyah.sch.id/mod/lti/backup/moodle2/restore_lti_stepslib.php000064400000027261152267141520027745 0ustar00home. // // This file is part of BasicLTI4Moodle // // BasicLTI4Moodle is an IMS BasicLTI (Basic Learning Tools for Interoperability) // consumer for Moodle 1.9 and Moodle 2.0. BasicLTI is a IMS Standard that allows web // based learning tools to be easily integrated in LMS as native ones. The IMS BasicLTI // specification is part of the IMS standard Common Cartridge 1.1 Sakai and other main LMS // are already supporting or going to support BasicLTI. This project Implements the consumer // for Moodle. Moodle is a Free Open source Learning Management System by Martin Dougiamas. // BasicLTI4Moodle is a project iniciated and leaded by Ludo(Marc Alier) and Jordi Piguillem // at the GESSI research group at UPC. // SimpleLTI consumer for Moodle is an implementation of the early specification of LTI // by Charles Severance (Dr Chuck) htp://dr-chuck.com , developed by Jordi Piguillem in a // Google Summer of Code 2008 project co-mentored by Charles Severance and Marc Alier. // // BasicLTI4Moodle is copyright 2009 by Marc Alier Forment, Jordi Piguillem and Nikolas Galanis // of the Universitat Politecnica de Catalunya http://www.upc.edu // Contact info: Marc Alier Forment granludo @ gmail.com or marc.alier @ upc.edu. /** * This file contains all the restore steps that will be used * by the restore_lti_activity_task * * @package mod_lti * @copyright 2009 Marc Alier, Jordi Piguillem, Nikolas Galanis * marc.alier@upc.edu * @copyright 2009 Universitat Politecnica de Catalunya http://www.upc.edu * @author Marc Alier * @author Jordi Piguillem * @author Nikolas Galanis * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die; use mod_lti\local\ltiopenid\registration_helper; /** * Structure step to restore one lti activity */ class restore_lti_activity_structure_step extends restore_activity_structure_step { /** @var bool */ protected $newltitype = false; protected function define_structure() { $paths = array(); // To know if we are including userinfo. $userinfo = $this->get_setting_value('userinfo'); $lti = new restore_path_element('lti', '/activity/lti'); $paths[] = $lti; $paths[] = new restore_path_element('ltitype', '/activity/lti/ltitype'); $paths[] = new restore_path_element('ltitypesconfig', '/activity/lti/ltitype/ltitypesconfigs/ltitypesconfig'); $paths[] = new restore_path_element('ltitypesconfigencrypted', '/activity/lti/ltitype/ltitypesconfigs/ltitypesconfigencrypted'); $paths[] = new restore_path_element('ltitoolproxy', '/activity/lti/ltitype/ltitoolproxy'); $paths[] = new restore_path_element('ltitoolsetting', '/activity/lti/ltitype/ltitoolproxy/ltitoolsettings/ltitoolsetting'); if ($userinfo) { $submission = new restore_path_element('ltisubmission', '/activity/lti/ltisubmissions/ltisubmission'); $paths[] = $submission; } $paths[] = new restore_path_element('lticoursevisible', '/activity/lti/lticoursevisible'); // Add support for subplugin structures. $this->add_subplugin_structure('ltisource', $lti); $this->add_subplugin_structure('ltiservice', $lti); // Return the paths wrapped into standard activity structure. return $this->prepare_activity_structure($paths); } protected function process_lti($data) { global $DB; $data = (object)$data; $oldid = $data->id; $data->course = $this->get_courseid(); $data->servicesalt = uniqid('', true); // Any changes to the list of dates that needs to be rolled should be same during course restore and course reset. // See MDL-9367. // Grade used to be a float (whole numbers only), restore as int. $data->grade = (int) $data->grade; $data->typeid = 0; // Try to decrypt resourcekey and password. Null if not possible (DB default). // Note these fields were originally encrypted on backup using {link @encrypted_final_element}. $data->resourcekey = isset($data->resourcekey) ? $this->decrypt($data->resourcekey) : null; $data->password = isset($data->password) ? $this->decrypt($data->password) : null; $newitemid = $DB->insert_record('lti', $data); // Immediately after inserting "activity" record, call this. $this->apply_activity_instance($newitemid); } /** * Process an lti type restore * @param mixed $data The data from backup XML file * @return void */ protected function process_ltitype($data) { global $DB, $USER; $data = (object)$data; $oldid = $data->id; if (!empty($data->createdby)) { $data->createdby = $this->get_mappingid('user', $data->createdby) ?: $USER->id; } $courseid = $this->get_courseid(); $data->course = ($this->get_mappingid('course', $data->course) == $courseid) ? $courseid : SITEID; // Try to find existing lti type with the same properties. $ltitypeid = $this->find_existing_lti_type($data); $this->newltitype = false; if (!$ltitypeid && $data->course == $courseid) { unset($data->toolproxyid); // Course tools can not use LTI2. if (!empty($data->clientid)) { // Need to rebuild clientid to ensure uniqueness. $data->clientid = registration_helper::get()->new_clientid(); } $ltitypeid = $DB->insert_record('lti_types', $data); $this->newltitype = true; $this->set_mapping('ltitype', $oldid, $ltitypeid); } // Add the typeid entry back to LTI module. $DB->update_record('lti', ['id' => $this->get_new_parentid('lti'), 'typeid' => $ltitypeid]); } /** * Process an lti coursevisible restore * @param mixed $data The data from backup XML file * @return void */ protected function process_lticoursevisible($data) { global $DB; $data = (object)$data; $data->typeid = $this->get_new_parentid('ltitype'); $data->courseid = $this->get_courseid(); if ($data->typeid) { $DB->insert_record('lti_coursevisible', $data); } } /** * Attempts to find existing record in lti_type * @param stdClass $data * @return int|null field lti_types.id or null if tool is not found */ protected function find_existing_lti_type($data) { global $DB; if ($ltitypeid = $this->get_mappingid('ltitype', $data->id)) { return $ltitypeid; } $ltitype = null; $params = (array)$data; if ($this->task->is_samesite()) { // If we are restoring on the same site try to find lti type with the same id. $sql = 'id = :id AND course = :course'; $sql .= ($data->toolproxyid) ? ' AND toolproxyid = :toolproxyid' : ' AND toolproxyid IS NULL'; if ($DB->record_exists_select('lti_types', $sql, $params)) { $this->set_mapping('ltitype', $data->id, $data->id); if ($data->toolproxyid) { $this->set_mapping('ltitoolproxy', $data->toolproxyid, $data->toolproxyid); } return $data->id; } } if ($data->course != $this->get_courseid()) { // Site tools are not backed up and are not restored. return null; } // Now try to find the same type on the current site available in this course. // Compare only fields baseurl, course and name, if they are the same we assume it is the same tool. // LTI2 is not possible in the course so we add "lt.toolproxyid IS NULL" to the query. $sql = 'SELECT id FROM {lti_types} WHERE ' . $DB->sql_compare_text('baseurl', 255) . ' = ' . $DB->sql_compare_text(':baseurl', 255) . ' AND course = :course AND name = :name AND toolproxyid IS NULL'; if ($ltitype = $DB->get_record_sql($sql, $params, IGNORE_MULTIPLE)) { $this->set_mapping('ltitype', $data->id, $ltitype->id); return $ltitype->id; } return null; } /** * Process an lti config restore * @param mixed $data The data from backup XML file */ protected function process_ltitypesconfig($data) { global $DB; $data = (object)$data; $data->typeid = $this->get_new_parentid('ltitype'); // Only add configuration if the new lti_type was created. if ($data->typeid && $this->newltitype) { if ($data->name == 'servicesalt') { $data->value = uniqid('', true); } $DB->insert_record('lti_types_config', $data); } } /** * Process an lti config restore * @param mixed $data The data from backup XML file */ protected function process_ltitypesconfigencrypted($data) { global $DB; $data = (object)$data; $data->typeid = $this->get_new_parentid('ltitype'); // Only add configuration if the new lti_type was created. if ($data->typeid && $this->newltitype) { $data->value = $this->decrypt($data->value); if (!is_null($data->value)) { $DB->insert_record('lti_types_config', $data); } } } /** * Process a restore of LTI tool registration * This method is empty because we actually process registration as part of process_ltitype() * @param mixed $data The data from backup XML file */ protected function process_ltitoolproxy($data) { } /** * Process an lti tool registration settings restore (only settings for the current activity) * @param mixed $data The data from backup XML file */ protected function process_ltitoolsetting($data) { global $DB; $data = (object)$data; $data->toolproxyid = $this->get_new_parentid('ltitoolproxy'); if (!$data->toolproxyid) { return; } $data->course = $this->get_courseid(); $data->coursemoduleid = $this->task->get_moduleid(); $DB->insert_record('lti_tool_settings', $data); } /** * Process a submission restore * @param mixed $data The data from backup XML file */ protected function process_ltisubmission($data) { global $DB; $data = (object)$data; $oldid = $data->id; $data->ltiid = $this->get_new_parentid('lti'); $data->datesubmitted = $this->apply_date_offset($data->datesubmitted); $data->dateupdated = $this->apply_date_offset($data->dateupdated); if ($data->userid > 0) { $data->userid = $this->get_mappingid('user', $data->userid); } $newitemid = $DB->insert_record('lti_submission', $data); $this->set_mapping('ltisubmission', $oldid, $newitemid); } protected function after_execute() { // Add lti related files, no need to match by itemname (just internally handled context). $this->add_related_files('mod_lti', 'intro', null); } }