ÿØÿà 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-Ї Ç home/smkb8269/public_html/lms.smk-almanshuriyah.sch.id/filter/classes/text_filter.php000064400000011126152266350320024652 0ustar00. namespace core_filters; use core\context; use core\exception\coding_exception; use moodle_page; /** * Base class for text filters. You just need to override this class and * implement the filter method. * * @package core_filters * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ abstract class text_filter { /** @var context The context we are in. */ protected $context; /** @var array Any local configuration for this filter in this context. */ protected $localconfig; /** * Set any context-specific configuration for this filter. * * @param context $context The current context. * @param array $localconfig Any context-specific configuration for this filter. */ public function __construct($context, array $localconfig) { $this->context = $context; $this->localconfig = $localconfig; } /** * Setup page with filter requirements and other prepare stuff. * * Override this method if the filter needs to setup page * requirements or needs other stuff to be executed. * * Note this method is invoked from {@see setup_page_for_filters()} * for each piece of text being filtered, so it is responsible * for controlling its own execution cardinality. * * @param moodle_page $page the page we are going to add requirements to. * @param context $context the context which contents are going to be filtered. * @since Moodle 2.3 */ public function setup($page, $context) { // Override me, if needed. } /** * Override this function to actually implement the filtering. * * Filter developers must make sure that filtering done after text cleaning * does not introduce security vulnerabilities. * * @param string $text some HTML content to process. * @param array $options options passed to the filters * @return string the HTML content after the filtering has been applied. */ abstract public function filter($text, array $options = []); /** * Filter text before changing format to HTML. * * @param string $text * @param array $options * @return string */ public function filter_stage_pre_format(string $text, array $options): string { // NOTE: override if necessary. return $text; } /** * Filter HTML text before sanitising text. * * NOTE: this is called even if $options['noclean'] is true and text is not cleaned. * * @param string $text * @param array $options * @return string */ public function filter_stage_pre_clean(string $text, array $options): string { // NOTE: override if necessary. return $text; } /** * Filter HTML text at the very end after text is sanitised. * * NOTE: this is called even if $options['noclean'] is true and text is not cleaned. * * @param string $text * @param array $options * @return string */ public function filter_stage_post_clean(string $text, array $options): string { // NOTE: override if necessary. return $this->filter($text, $options); } /** * Filter simple text coming from format_string(). * * Note that unless $CFG->formatstringstriptags is disabled * HTML tags are not expected in returned value. * * @param string $text * @param array $options * @return string */ public function filter_stage_string(string $text, array $options): string { // NOTE: override if necessary. return $this->filter($text, $options); } } // Alias this class to the old name. // This file will be autoloaded by the legacyclasses autoload system. // In future all uses of this class will be corrected and the legacy references will be removed. class_alias(text_filter::class, \moodle_text_filter::class); home/smkb8269/public_html/lms.smk-almanshuriyah.sch.id/filter/tex/classes/text_filter.php000064400000020553152266515500025461 0ustar00. namespace filter_tex; use core\context\system as context_system; use core\exception\coding_exception; use core\output\actions\popup_action; use core\url; use core_useragent; use stdClass; /** * Moodle - Filter for converting TeX expressions to cached gif images * * This Moodle text filter converts TeX expressions delimited * by either $$...$$ or by ... tags to gif images using * mimetex.cgi obtained from http: *www.forkosh.com/mimetex.html authored by * John Forkosh john@forkosh.com. Several binaries of this areincluded with * this distribution. * Note that there may be patent restrictions on the production of gif images * in Canada and some parts of Western Europe and Japan until July 2004. * * @package filter_tex * @subpackage tex * @copyright 2004 Zbigniew Fiedorowicz fiedorow@math.ohio-state.edu * Originally based on code provided by Bruno Vernier bruno@vsbeducation.ca * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class text_filter extends \core_filters\text_filter { #[\Override] public function filter($text, array $options = []) { global $CFG, $DB; // Do a quick check using stripos to avoid unnecessary work. if ( (!preg_match('/ TeX expression // or TeX expression // or $$ TeX expression $$ // or \[ TeX expression \] // original tag of MathType and TeXaide // or [tex] TeX expression [/tex] // somtime it's more comfortable than . $rules = [ '(.+?)<\/tex>', '\$\$(.+?)\$\$', '\\\\\[(.+?)\\\\\]', '\\\\\((.+?)\\\\\)', '\\[tex\\](.+?)\\[\/tex\\]', ]; $megarule = '/' . implode('|', $rules) . '/is'; preg_match_all($megarule, $text, $matches); for ($i = 0; $i < count($matches[0]); $i++) { $texexp = ''; for ($j = 0; $j < count($rules); $j++) { $texexp .= $matches[$j + 2][$i]; } $alt = $matches[1][$i]; $texexp = str_replace('', '', $texexp); $texexp = str_replace('', '', $texexp); $texexp = str_replace('', '', $texexp); $texexp = str_replace('', '', $texexp); $texexp = preg_replace("//i", '', $texexp); $align = "middle"; if (preg_match('/^align=bottom /', $texexp)) { $align = "text-bottom"; $texexp = preg_replace('/^align=bottom /', '', $texexp); } else if (preg_match('/^align=top /', $texexp)) { $align = "text-top"; $texexp = preg_replace('/^align=top /', '', $texexp); } // Decode entities encoded by editor, luckily there is very little chance of double decoding. $texexp = html_entity_decode($texexp, ENT_QUOTES, 'UTF-8'); if ($texexp === '') { continue; } // Sanitize the decoded string, because $this->get_image_markup() injects the final string between script tags. $texexp = clean_param($texexp, PARAM_TEXT); $md5 = md5($texexp); if (!$DB->record_exists("cache_filters", ["filter" => "tex", "md5key" => $md5])) { $texcache = new stdClass(); $texcache->filter = 'tex'; $texcache->version = 1; $texcache->md5key = $md5; $texcache->rawtext = $texexp; $texcache->timemodified = time(); $DB->insert_record("cache_filters", $texcache, false); } $convertformat = get_config('filter_tex', 'convertformat'); if ($convertformat == 'svg' && !core_useragent::supports_svg()) { $convertformat = 'png'; } $filename = $md5 . ".{$convertformat}"; $text = str_replace($matches[0][$i], $this->get_image_markup($filename, $texexp, 0, 0, $align, $alt), $text); } return $text; } /** * Create image link. * * @param string $imagefile name of file * @param string $tex TeX notation (html entities already decoded) * @param int $height O means automatic * @param int $width O means automatic * @param string $align * @param string $alt * @return string HTML markup */ protected function get_image_markup( string $imagefile, string $tex, int $height, int $width, string $align, string $alt, ): string { global $CFG, $OUTPUT; if (!$imagefile) { throw new coding_exception('Image file argument empty in get_image_markup()'); } // Work out any necessary inline style. $rules = []; if ($align !== 'middle') { $rules[] = 'vertical-align:' . $align . ';'; } if ($height) { $rules[] = 'height:' . $height . 'px;'; } if ($width) { $rules[] = 'width:' . $width . 'px;'; } if (!empty($rules)) { $style = ' style="' . implode('', $rules) . '" '; } else { $style = ''; } // Prepare the title attribute. // Note that we retain the title tag as TeX format rather than using // the alt text, even if supplied. The alt text is intended for blind // users (to provide a text equivalent to the equation) while the title // is there as a convenience for sighted users who want to see the TeX // code. $title = 'title="' . s($tex) . '"'; if ($alt === '') { $alt = s($tex); } else { $alt = s(html_entity_decode($tex, ENT_QUOTES, 'UTF-8')); } // Build the output. $anchorcontents = "\"$alt\"slasharguments) { // Use this method if possible for better client-side caching. $anchorcontents .= "$CFG->wwwroot/filter/tex/pix.php/$imagefile"; } else { $anchorcontents .= "$CFG->wwwroot/filter/tex/pix.php?file=$imagefile"; } $anchorcontents .= "\" $style/>"; $imagefound = file_exists("$CFG->dataroot/filter/tex/$imagefile"); if (!$imagefound && has_capability('moodle/site:config', context_system::instance())) { $link = '/filter/tex/texdebug.php'; $action = null; } else { $link = new url('/filter/tex/displaytex.php', ['texexp' => $tex]); $action = new popup_action('click', $link, 'popup', ['width' => 320, 'height' => 240]); } // TODO: the popups do not work when text caching is enabled. $output = $OUTPUT->action_link($link, $anchorcontents, $action, ['title' => 'TeX']); $output = "$output"; return $output; } }