���ѧۧݧ�ӧ�� �ާ֧ߧ֧էا֧� - ���֧էѧܧ�ڧ��ӧѧ�� - /home3/cpr76684/public_html/other.tar
���ѧ٧ѧ�
todochecker.php 0000644 00000013337 15152310132 0007547 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * Check that, as in the coding guidelines, every to-do comment links to a tracker issue. * * As required by http://docs.moodle.org/dev/Coding_style. * * @package core * @copyright 2009 Tim Hunt * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require(__DIR__ . '/../../../config.php'); require_login(); $context = context_system::instance(); require_capability('moodle/site:config', $context); $PAGE->set_url('/lib/tests/other/todochecker.php'); $PAGE->set_context($context); $PAGE->set_title('To-do checker'); $PAGE->set_heading('To-do checker'); $thirdparty = load_third_party_lib_list(); $extensionstotest = array('php'); $extensionsregex = '/\.(?:' . implode('|', $extensionstotest) . ')$/'; $patterntofind = 'TO' . 'DO'; // Make it not match the regex. $found = array(); echo $OUTPUT->header(); echo $OUTPUT->heading('To-do checker', 2); echo $OUTPUT->box_start(); echo 'Checking code ...'; flush(); recurseFolders($CFG->dirroot, 'check_to_dos', $extensionsregex, false, array_keys($thirdparty)); echo ' done.'; echo $OUTPUT->box_end(); if (empty($found)) { echo '<p>No to-dos found.</p>'; } else { $total = 0; foreach ($found as $filepath => $matches) { $total += count($matches); } echo '<p>' . $total . ' to-dos found:</p><dl>'; foreach ($found as $filepath => $matches) { echo '<dt>' . $filepath . ' <b>(' . count($matches) . ')</b></dt><dd><ul>'; foreach ($matches as $lineno => $line) { $url = 'http://cvs.moodle.org/moodle/' . $filepath . '?view=annotate#l' . $lineno; $error = ''; // Make sure there is a tracker issue id mentioned $matches = array(); if (preg_match('/\bTODO\b.*?\b(MDL-\d+)/', $line, $matches)) { $issueid = $matches[1]; $issueurl = 'http://tracker.moodle.org/browse/' . $issueid; // Make sure the issue is still open. list($issueopen, $issuesummary) = issue_info($issueid); if ($issueopen) { $issuename = $issueid; } else { $issuename = '<strike>' . $issueid . '</strike>'; $error = 'The associated tracker issue is Resolved.'; } $line = str_replace($issueid, '<a href="' . $issueurl . '" title="' . s($issuesummary) . '">' . $issuename . '</a>', htmlspecialchars($line, ENT_COMPAT)); } else { $line = htmlspecialchars($line, ENT_COMPAT); $error = 'No associated tracker issue.'; } if ($error) { $error = '<span class="error">' . $error . '</span>'; } echo '<li><a href="' . $url . '">' . $lineno . '</a>: ' . $line . $error . '</li>'; } echo '</ul></dd>'; } echo '</dl>'; } echo $OUTPUT->footer(); function check_to_dos($filepath) { global $CFG, $found, $thirdparty; if (isset($thirdparty[$filepath])) { return; // Skip this file. } $lines = file($filepath); $matchesinfile = array(); foreach ($lines as $lineno => $line) { if (preg_match('/(?<!->|\$)\bTODO\b/i', $line)) { $matchesinfile[$lineno] = $line; } } if (!empty($matchesinfile)) { $shortpath = str_replace($CFG->dirroot . '/', '', $filepath); $found[$shortpath] = $matchesinfile; } } function issue_info($issueid) { static $cache = array(); if (array_key_exists($issueid, $cache)) { return $cache[$issueid]; } $xmlurl = 'http://tracker.moodle.org/si/jira.issueviews:issue-xml/' . $issueid . '/' . $issueid . '.xml'; $content = download_file_content($xmlurl); // Get the status. $open = preg_match('/Unresolved<\/resolution>/', $content); // Get the summary. $matches = array(); preg_match('/<title>\[' . $issueid . '\]\s+(.*?)<\/title>/', $content, $matches); $summary = $matches[1]; preg_match('/<assignee[^>]*>(.*?)<\/assignee>/', $content, $matches); $summary .= ' - Assignee: ' . $matches[1]; $cache[$issueid] = array($open, $summary); return $cache[$issueid]; } function load_third_party_lib_list() { global $CFG; $libs = array(); $xml = simplexml_load_file($CFG->libdir . '/thirdpartylibs.xml'); foreach ($xml->library as $libobject) { $libs[$CFG->libdir . '/' . $libobject->location] = 1; } return $libs; } function recurseFolders($path, $callback, $fileregexp = '/.*/', $exclude = false, $ignorefolders = array()) { $files = scandir($path); foreach ($files as $file) { $filepath = $path .'/'. $file; if (strpos($file, '.') === 0) { /// Don't check hidden files. continue; } else if (is_dir($filepath)) { if (!in_array($filepath, $ignorefolders)) { recurseFolders($filepath, $callback, $fileregexp, $exclude, $ignorefolders); } } else if ($exclude xor preg_match($fileregexp, $filepath)) { call_user_func($callback, $filepath); } } } spreadsheettestpage.php 0000644 00000023575 15152310132 0011326 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * This script produces sample Excel and ODF spreadsheets. * * @package core * @copyright 2013 Petr Skoda {@link http://skodak.org} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require(__DIR__ . '/../../../config.php'); require_once($CFG->libdir . '/excellib.class.php'); require_once($CFG->libdir . '/odslib.class.php'); $context = context_system::instance(); $PAGE->set_url('/lib/tests/other/spreadsheettestpage.php'); $PAGE->set_context($context); require_login(); require_capability('moodle/site:config', $context); $type = optional_param('type', '', PARAM_ALPHANUM); if (!in_array($type, array('xslx', 'ods'))) { $type = ''; } if (!$type) { $PAGE->set_title('Moodle spreadsheet export test'); $PAGE->set_heading('Moodle spreadsheet export test'); echo $OUTPUT->header(); echo $OUTPUT->box_start(); $notes = ' Tested with: * MS Excel Viewer 2003 (with Compatibility Pack), 2010 * LibreOffice 6.0 * NeoOffice 3.3 * Apple Numbers \'09 (2.3) and Preview * Google Drive spreadsheet import * IBM Lotus Symphony 3.0.1 * Gnumeric 1.11 * Calligra Suite 2.4, 2.5 Known problems: * Excel 2007 can not be opened in Calligra Suite '; echo markdown_to_html($notes); echo $OUTPUT->box_end(); echo $OUTPUT->single_button(new moodle_url($PAGE->url, array('type' => 'xslx')), 'Test Excel format'); echo $OUTPUT->single_button(new moodle_url($PAGE->url, array('type' => 'ods')), 'Test ODS format'); echo $OUTPUT->footer(); die; } if ($type === 'xslx') { $workbook = new MoodleExcelWorkbook('moodletest.xlsx', 'Xslx'); } else if ($type === 'ods') { $workbook = new MoodleODSWorkbook('moodletest.ods'); } $worksheet = array(); $worksheet = $workbook->add_worksheet('Supported'); $worksheet->hide_screen_gridlines(); $worksheet->write_string(0, 0, 'Moodle worksheet export test', $workbook->add_format(array('color' => 'red', 'size' => 20, 'bold' => 1, 'italic' => 1))); $worksheet->set_row(0, 25); $worksheet->write(1, 0, 'Moodle release: '.$CFG->release, $workbook->add_format(array('size' => 8, 'italic' => 1))); $worksheet->set_column(0, 0, 20); $worksheet->set_column(1, 1, 30); $worksheet->set_column(2, 2, 5); $worksheet->set_column(3, 3, 30); $worksheet->set_column(4, 4, 20); $miniheading = $workbook->add_format(array('size' => 15, 'bold' => 1, 'italic' => 1, 'underline' => 1)); $worksheet->write(2, 0, 'Cell types', $miniheading); $worksheet->set_row(2, 20); $worksheet->set_row(3, 5); $worksheet->write(4, 0, 'String'); $worksheet->write_string(4, 1, 'Žluťoučký koníček'); $worksheet->write(5, 0, 'Number as string'); $worksheet->write_string(5, 1, 3.14159); $worksheet->write(6, 0, 'Integer'); $worksheet->write_number(6, 1, 666); $worksheet->write(7, 0, 'Float'); $worksheet->write_number(7, 1, 3.14159); $worksheet->write(8, 0, 'URL'); $worksheet->write_url(8, 1, 'http://moodle.org'); $worksheet->write(9, 0, 'Date (now)'); $worksheet->write_date(9, 1, time()); $worksheet->write(10, 0, 'Formula'); $worksheet->write(10, 1, '=1+2'); $worksheet->write(11, 0, 'Blank'); $worksheet->write_blank(11, 1, $workbook->add_format(array('bg_color' => 'silver'))); $worksheet->write(14, 0, 'Text formats', $miniheading); $worksheet->set_row(14, 20); $worksheet->set_row(15, 5); // Following writes use alternative format array. $worksheet->write(16, 0, 'Bold', array('bold' => 1)); $worksheet->write(17, 0, 'Italic', array('italic' => 1)); $worksheet->write(18, 0, 'Single underline', array('underline' => 1)); $worksheet->write(19, 0, 'Double underline', array('underline' => 2)); $worksheet->write(20, 0, 'Strikeout', array('strikeout' => 1)); $worksheet->write(21, 0, 'Superscript', array('script' => 1)); $worksheet->write(22, 0, 'Subscript', array('script' => 2)); $worksheet->write(23, 0, 'Red', array('color' => 'red')); $worksheet->write(25, 0, 'Text align', $miniheading); $worksheet->set_row(25, 20); $worksheet->set_row(26, 5); $worksheet->write(27, 0, 'Wrapped text - Žloťoučký koníček', $workbook->add_format(array('text_wrap' => true, 'border' => 1))); $worksheet->set_row(27, 30); $worksheet->write(27, 1, 'All centered', $workbook->add_format(array('v_align' => 'center', 'h_align' => 'center', 'border' => 1))); $worksheet->write(28, 0, 'Top', $workbook->add_format(array('align' => 'top', 'border' => 1))); $worksheet->set_row(28, 25); $worksheet->write(29, 0, 'Vcenter', $workbook->add_format(array('align' => 'vcenter', 'border' => 1))); $worksheet->set_row(29, 25); $worksheet->write(30, 0, 'Bottom', $workbook->add_format(array('align' => 'bottom', 'border' => 1))); $worksheet->set_row(30, 25); $worksheet->write(28, 1, 'Left', $workbook->add_format(array('align' => 'left', 'border' => 1))); $worksheet->write(29, 1, 'Center', $workbook->add_format(array('align' => 'center', 'border' => 1))); $worksheet->write(30, 1, 'Right', $workbook->add_format(array('align' => 'right', 'border' => 1))); $worksheet->write(32, 0, 'Number formats', $miniheading); $worksheet->set_row(32, 20); $worksheet->set_row(33, 5); $worksheet->write_string(34, 0, '1: 0'); $worksheet->write_number(34, 1, 1003.14159, array('num_format' => 1)); $worksheet->write_string(35, 0, '2: 0.00'); $worksheet->write_number(35, 1, 1003.14159, array('num_format' => 2)); $worksheet->write_string(36, 0, '3: #,##0'); $worksheet->write_number(36, 1, 1003.14159, array('num_format' => 3)); $worksheet->write_string(37, 0, '3: #,##0.00'); $worksheet->write_number(37, 1, 1003.14159, array('num_format' => 4)); $worksheet->write_string(38, 0, '11: 0.00E+00'); $worksheet->write_number(38, 1, 3.14159, array('num_format' => 11)); $worksheet->write_string(39, 0, '12: # ?/?'); $worksheet->write_number(39, 1, 3.14, array('num_format' => 12)); $worksheet->write_string(40, 0, '13: # ??/??'); $worksheet->write_number(40, 1, 3.14, array('num_format' => 13)); $worksheet->write_string(41, 0, '15: d-mmm-yy'); $worksheet->write_date(41, 1, time(), array('num_format' => 15)); $worksheet->write_string(42, 0, '22: m/d/yy h:mm'); $worksheet->write_date(42, 1, time(), array('num_format' => 22)); $worksheet->write(2, 3, 'Borders', $miniheading); $worksheet->write(4, 3, 'Left', $workbook->add_format(array('left' => '1'))); $worksheet->write(6, 3, 'Bottom', $workbook->add_format(array('bottom' => '1'))); $worksheet->write(8, 3, 'Right', $workbook->add_format(array('right' => '1'))); $worksheet->write(10, 3, 'Top', $workbook->add_format(array('top' => '1'))); $worksheet->write(12, 3, 'Thick borders', $workbook->add_format(array('border' => '2'))); $worksheet->write(14, 3, 'Background colours', $miniheading); $worksheet->write(16, 3, 'Yellow', $workbook->add_format(array('bg_color' => 'yellow'))); $worksheet->write(17, 3, 'Red', $workbook->add_format(array('bg_color' => 'red'))); $worksheet->write(18, 3, 'Green', $workbook->add_format(array('bg_color' => 'green'))); $worksheet->write(19, 3, 'Blue', $workbook->add_format(array('bg_color' => 12))); $worksheet->write(20, 3, 'Cyan', $workbook->add_format(array('bg_color' => '#00FFFF'))); $worksheet->write(25, 3, 'Cell merging', $miniheading); $worksheet->merge_cells(27, 3, 28, 3); $worksheet->write(27, 3, 'Vertical merging of cells', $workbook->add_format(array('bg_color' => 'silver'))); $worksheet->merge_cells(30, 3, 30, 4); $worksheet->write(30, 3, 'Horizontal merging of cells', $workbook->add_format(array('pattern' => 1, 'bg_color' => 'silver'))); $worksheet->set_column(4, 4, 5); $worksheet->set_row(44, null, null, true); $worksheet->write(44, 0, 'Hidden row', array('bg_color' => 'yellow')); $worksheet->set_column(5, 5, null, null, true); $worksheet->write(0, 5, 'Hidden column', array('bg_color' => 'yellow')); $worksheet->write(45, 0, 'Outline row 1'); $worksheet->set_row(45, null, null, false, 1); $worksheet->write(46, 0, 'Outline row 2'); $worksheet->set_row(46, null, null, false, 2); $worksheet->write(0, 6, 'Outline column 1'); $worksheet->set_column(6, 6, 20, null, false, 1); $worksheet->write(0, 7, 'Outline column 2'); $worksheet->set_column(7, 7, 20, null, false, 2); // Some unfinished stuff. $worksheet2 = $workbook->add_worksheet('Unsupported'); $worksheet2->write(0, 0, 'Incomplete and missing features', $workbook->add_format(array('size' => 20, 'bold' => 1, 'italic' => 1))); $worksheet2->set_row(0, 25); $worksheet2->set_column(1, 1, 25); $worksheet2->write(3, 1, 'Gray row - buggy'); $worksheet2->set_row(3, null, array('bg_color' => 'silver')); $worksheet2->write(2, 6, 'Gray column - buggy'); $worksheet2->set_column(6, 6, 20, array('bg_color' => 'silver')); $worksheet2->hide_gridlines(); $worksheet2->write(5, 0, 'Outline text - not implemented', array('outline' => 1)); $worksheet2->write(6, 0, 'Shadow text - not implemented', array('outline' => 1)); $worksheet2->write(8, 0, 'Pattern 1'); $worksheet2->write_blank(8, 1, array('pattern' => 1)); $worksheet2->write(9, 0, 'Pattern 2'); $worksheet2->write_blank(9, 1, array('pattern' => 2)); $worksheet2->write(10, 0, 'Pattern 3'); $worksheet2->write_blank(10, 1, array('pattern' => 3)); // Other worksheet tests follow. $worksheet3 = $workbook->add_worksheet('Žlutý:koníček?přeskočil mrňavoučký potůček'); $worksheet3->write(1, 0, 'Test long Unicode worksheet name.'); $worksheet4 = $workbook->add_worksheet(''); $worksheet4->write(1, 0, 'Test missing worksheet name.'); $workbook->close(); die; jquerypage.php 0000644 00000006747 15152310132 0007440 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * Produces a sample page using JQuery. * * @package core * @copyright 20014 Petr Skoda * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require(__DIR__ . '/../../../config.php'); require_login(); $context = context_system::instance(); require_capability('moodle/site:config', $context); $PAGE->set_url('/lib/tests/other/jquerypage.php'); $PAGE->set_context($context); $PAGE->set_title('jQuery library test'); $PAGE->set_heading('jQuery library test'); $PAGE->requires->jquery(); $PAGE->requires->jquery_plugin('ui'); $PAGE->requires->jquery_plugin('ui-css'); echo $OUTPUT->header(); // Note: the examples were copied from http://jqueryui.com/accordion/, and // http://jqueryui.com/progressbar/#label. ?> <script> $(function() { $( "#accordion" ).accordion(); $( "#progressbar" ).progressbar({ value: false }); }); </script> <style> .ui-progressbar { position: relative; } .progress-label { position: absolute; left: 50%; top: 4px; font-weight: bold; text-shadow: 1px 1px 0 #fff; } </style> <div id="progressbar"><div class="progress-label">Loading...</div></div> <div id="accordion"> <h3>Section 1</h3> <div> <p> Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate. </p> </div> <h3>Section 2</h3> <div> <p> Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna. </p> </div> <h3>Section 3</h3> <div> <p> Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui. </p> <ul> <li>List item one</li> <li>List item two</li> <li>List item three</li> </ul> </div> <h3>Section 4</h3> <div> <p> Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est. </p> <p> Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. </p> </div> </div> <?php echo $OUTPUT->footer(); chartjstestpage.php 0000644 00000010767 15152310132 0010454 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * Test all supported Chart.js charts. * * @package core * @copyright 2016 Simey Lameze <simey@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require(__DIR__ . '/../../../config.php'); require_login(); $context = context_system::instance(); require_capability('moodle/site:config', $context); $PAGE->set_context($context); $PAGE->set_url('/lib/tests/other/chartjstestpage.php'); $PAGE->set_heading('Chart.js library test'); $PAGE->set_pagelayout('standard'); echo $OUTPUT->header(); $sales = new \core\chart_series('Sales', [1000, 1170, 660, 1030]); $expenses = new \core\chart_series('Expenses', [400, 460, 1120, 540]); $labels = ['2004', '2005', '2006', '2007']; $chart = new \core\chart_pie(); $chart->set_title('PIE CHART'); $chart->add_series($sales); $chart->set_labels($labels); $chart2 = new \core\chart_pie(); $chart2->set_title('DOUGHNUT CHART'); $chart2->set_doughnut(true); $chart2->add_series($sales); $chart2->set_labels($labels); $chart3 = new \core\chart_line(); $chart3->set_title('TENSIONED LINES CHART'); $chart3->add_series($sales); $chart3->add_series($expenses); $chart3->set_labels($labels); $chart4 = new \core\chart_line(); $chart4->set_smooth(true); $chart4->set_title('SMOOTH LINES CHART'); $chart4->add_series($sales); $chart4->add_series($expenses); $chart4->set_labels($labels); $chart5 = new \core\chart_bar(); $chart5->set_title('BAR CHART'); $chart5->add_series($sales); $chart5->add_series($expenses); $chart5->set_labels($labels); $chart6 = new \core\chart_bar(); $chart6->set_title('HORIZONTAL BAR CHART'); $chart6->set_horizontal(true); $chart6->add_series($sales); $chart6->add_series($expenses); $chart6->set_labels($labels); $chart7 = new \core\chart_bar(); $chart7->set_title('STACKED BAR CHART'); $chart7->set_stacked(true); $chart7->add_series($sales); $chart7->add_series($expenses); $chart7->set_labels($labels); $chart8 = new \core\chart_bar(); $chart8->set_title('BAR CHART COMBINED WITH LINE CHART'); $expensesline = new \core\chart_series('Expenses', [400, 460, 1120, 540]); $expensesline->set_type(\core\chart_series::TYPE_LINE); $chart8->add_series($expensesline); $chart8->add_series($sales); $chart8->set_labels($labels); $hills = new \core\chart_series('Hills', [700, 870, 660, 950]); $mountain = new \core\chart_series('Mountain', [400, 460, 1350, 540]); $sky = new \core\chart_series('Sky', [1400, 1500, 1550, 1500]); $chart9 = new \core\chart_line(); $chart9->set_title('AREA FILL CHART'); $chart9->add_series($hills); $chart9->add_series($mountain); $chart9->add_series($sky); $chart9->set_labels($labels); $hills->set_smooth(true); $hills->set_fill('origin'); $mountain->set_fill('-1'); $sky->set_fill('end'); $chart10 = new \core\chart_bar(); $chart10->set_title('BAR CHART WITH LEGEND OPTIONS (LEGEND POSITION IN THE LEFT)'); $expensesline = new \core\chart_series('Expenses', [400, 460, 1120, 540]); $expensesline->set_type(\core\chart_series::TYPE_LINE); $chart10->add_series($expensesline); $chart10->set_legend_options(['position' => 'left', 'reverse' => true]); $chart10->add_series($sales); $chart10->set_labels($labels); $chart11 = new \core\chart_bar(); $chart11->set_title('BAR CHART WITH LEGEND OPTIONS (LEGEND HIDDEN)'); $expensesline = new \core\chart_series('Expenses', [400, 460, 1120, 540]); $expensesline->set_type(\core\chart_series::TYPE_LINE); $chart11->add_series($expensesline); $chart11->set_legend_options(['display' => false]); $chart11->add_series($sales); $chart11->set_labels($labels); echo $OUTPUT->render($chart); echo $OUTPUT->render($chart2); echo $OUTPUT->render($chart3); echo $OUTPUT->render($chart4); echo $OUTPUT->render($chart5); echo $OUTPUT->render($chart6); echo $OUTPUT->render($chart7); echo $OUTPUT->render($chart8); echo $OUTPUT->render($chart9); echo $OUTPUT->render($chart10); echo $OUTPUT->render($chart11); echo $OUTPUT->footer(); completion.manualtest.txt 0000644 00000012011 15152310132 0011616 0 ustar 00 Completion system manual test ============================= This text file describes a manual process which can be used to check that the completion system is working correctly. This does not exercise every possible element of the completion system but it covers most of the basic parts. Site setup ---------- 1) Make a fresh install of the Moodle version you are testing. CHECK A: There is no error when installing the completion database tables. 2) Create users 'admin' (as part of install) and 'u1' 3) Set the server debug to 'Developer' so that you spot any warnings etc. 4) Create course 'CF101' (leave default except pick separate groups) and assign 'u1' as student Course setup ------------ 1) Create a web page resource 'w' 2) Create a forum 'f1' 3) Create a forum 'f2' 4) Create a quiz 'q1' with one question (e.g. true/false question) 5) Create a quiz 'q2' with one question (can use same question) 6) In gradebook/reports/gradebook setup, edit q2's grade (show advanced) to assign a 'grade to pass' of 5.0. [Note: Due to a bug in gradebook at time of writing, you may have to go into admin screens and make sure that 'Student' is included on the list of graded roles, or there will be an error at this step.] 7) Create 2 groups on the course. Assign u1 to one group. Completion settings ------------------- 1) Visit the course setting screen. CHECK B: The completion controls appear. Completion is enabled. 2) Turn off the setting (disable completion) and save. 3) Visit the admin page. Find the enablecompletion setting. CHECK C: The enablecompletion setting appears. Completion is enabled. 4) Turn off this setting and save. 4b) Note: At present I have not found a satisfactory way to set a default for the config option, so if necessary, please manually tick the 'Student' checkbox while on this screen. 5) Visit the course setting screen again. CHECK D: The completion controls do not appear. 6) Visit the setting screen for 'w' CHECK E: Completion controls do not appear 7) Go to admin screen and turn completion on again, then return to the 'w' settings CHECK F: Completion controls still do not appear 8) Go to course settings and turn completion on, then return to 'w' settings CHECK G: Completion controls appear. Completion is set to manual. 9) Go to 'f1' settings. Set completion to automatic and to 2 discussions/replies. 10) Go to 'f2' settings. Set completion to automatic and to 'view' 11) Go to 'q1' and 'q2' settings; set both to automatic and 'grade'. Set them to grade based on the most recent attempt rather than 'highest'. Completion actions ------------------ Note: Icons are subject to change, so references to a 'tick' etc might not be correct. 1) Log in as u1 and go to CF101. CHECK H: A completion tick (unticked) is visible next to 'w'. 2) Click the completion mark a few times. CHECK I: Completion toggles successfully. 2b) Go to u1's profile settings and turn on/off AJAX then repeat toggling the mark. Leave it ticked. CHECK I2: Completion still toggles successfully. 3) Visit 'f1' and post 1 message. Return to course home. CHECK J: There is no tickmark next to f1. (If examined carefully, the 'not complete' icon should be present.) 4) Visit 'f1' and post a reply to the message. Return to course home. CHECK K: There is now a tick next to f1. 5) Visit 'f2' and return to the home page. CHECK L: There is now a tick next to f2. 6) Visit 'q1' and attempt the quiz, getting it wrong and submitting answer. Return to the home page. CHECK M: There is a black 'completed' tick next to q1. 7) Visit 'q1' again and this time get it right. Return to home page. CHECK N: There is still a black 'completed' tick next to q1. 8) Visit 'q2' and get it right. Return to home. CHECK O: There is a green 'completed-passed' tick next to q2. 9) Visit 'q2' and get it wrong. Return to home. CHECK P: There is a red 'completed-failed' X next to q2. Completion progress ------------------- 1) Log in as admin again. 2) From the course admin block, click on the reports link. CHECK Q: A 'completion progress' link appears. 3) Click on the completion progress link. CHECK R: A groups dropdown should show the two groups (and 'all'). The progress table should include all activities for which completion was set, across the top. The progress table should show u1 down the side. Tick and X icons should match those shown when logged in as u1. 4) Choose a group that does not include u1 CHECK S: An informational ('no users') message should display instead of the progress table. 5) Choose the group that does include u1 CHECK T: The progress table should show u1 again. Backup/restore -------------- 1) Backup the course. Choose 'course users', user data for everything except q1 ('no user data'), and default options. 2) Restore to a new course, accepting all defaults. 3) Log in as u1 again and visit the new course. CHECK U: Completion should appear as it did in the previous version of the course ('w','f1','f2' complete, 'q2' complete-fail) except that q1 should show as incomplete. pdflibtestpage.php 0000644 00000013134 15152310132 0010245 0 ustar 00 <?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * Produces a sample PDF using lib/pdflib.php * * @package core * @copyright 2009 David Mudrak <david.mudrak@gmail.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require(__DIR__ . '/../../../config.php'); require_once($CFG->libdir . '/pdflib.php'); require_login(); $context = context_system::instance(); require_capability('moodle/site:config', $context); $getpdf = optional_param('getpdf', 0, PARAM_INT); $fontfamily = optional_param('fontfamily', PDF_FONT_NAME_MAIN, PARAM_ALPHA); // to be configurable if (!$fontfamily) { $fontfamily = PDF_FONT_NAME_MAIN; } /** * Extend the standard PDF class to get access to some protected values we want to display * at the test page. * * @copyright 2009 David Mudrak <david.mudrak@gmail.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ if ($getpdf) { $doc = new pdf(); $doc->SetTitle('Moodle PDF library test'); $doc->SetAuthor('Moodle ' . $CFG->release); $doc->SetCreator('lib/tests/other/pdflibtestpage.php'); $doc->SetKeywords('Moodle, PDF'); $doc->SetSubject('This has been generated by Moodle as its PDF library test page'); $doc->SetMargins(15, 30); $doc->setPrintHeader(true); $doc->setHeaderMargin(10); $doc->setHeaderFont(array($fontfamily, 'b', 10)); $doc->setHeaderData('pix/moodlelogo.png', 40, $SITE->fullname, $CFG->wwwroot); $doc->setPrintFooter(true); $doc->setFooterMargin(10); $doc->setFooterFont(array($fontfamily, '', 8)); $doc->AddPage(); $doc->SetTextColor(255,255,255); $doc->SetFillColor(255,203,68); $doc->SetFont($fontfamily, 'B', 24); $doc->Cell(0, 0, 'Moodle PDF library test', 0, 1, 'C', 1); $doc->SetFont($fontfamily, '', 12); $doc->Ln(6); $doc->SetTextColor(0,0,0); $c = '<h3>General information</h3>'; $c .= 'Moodle release: ' . $CFG->release . '<br />'; $c .= 'PDF producer: TCPDF ' . TCPDF_STATIC::getTCPDFVersion() . ' (http://www.tcpdf.org) <br />'; $c .= 'Font family used: ' . $fontfamily . '<br />'; $c .= '<h3>Current settings</h3>'; $c .= '<table border="1" cellspacing="0" cellpadding="1">'; foreach (array('K_PATH_MAIN', 'K_PATH_URL', 'K_PATH_FONTS', 'PDF_FONT_NAME_MAIN', 'K_PATH_CACHE', 'K_PATH_IMAGES', 'K_BLANK_IMAGE', 'K_CELL_HEIGHT_RATIO', 'K_SMALL_RATIO', 'PDF_CUSTOM_FONT_PATH', 'PDF_DEFAULT_FONT') as $setting) { if (defined($setting)) { $c .= '<tr style="font-size: x-small;"><td>' . $setting . '</td><td>' . constant($setting) . '</td></tr>'; } } $c .= '</table><br />'; $c .= '<h3>Available font families</h3>'; $fontfamilies = $doc->get_font_families(); $list = array(); foreach ($fontfamilies as $family => $fonts) { $f = $family; $spacer = ''; if ($doc->is_core_font_family($family)) { $f .= '<sup>*</sup>'; } else { $spacer = ' '; } if (count($fonts) > 1) { $f .= $spacer . '<i>(' . implode(', ', $fonts) . ')</i>'; } $list[] = $f; } $c .= implode(', ', $list); $c .= '<p><i><small>Note: * Standard core fonts are not embedded in PDF files, PDF viewers are using local fonts.</small></i></p>'; $c .= '<h3>Installed languages and their alphabets</h3>'; $languages = array(); $langdirs = get_list_of_plugins('lang', '', $CFG->dataroot); array_unshift($langdirs, 'en'); foreach ($langdirs as $langdir) { $enlangconfig = $CFG->dirroot . '/lang/en/langconfig.php'; if ('en' == $langdir) { $langconfig = $enlangconfig; } else { $langconfig = $CFG->dataroot . '/lang/' . $langdir . '/langconfig.php'; } // Ignore parents here for now. $string = array(); if (is_readable($langconfig)) { include($langconfig); if (is_array($string)) { $languages[$langdir] = new stdClass(); $languages[$langdir]->langname = isset($string['thislanguage']) ? $string['thislanguage'] : '(unknown)'; $languages[$langdir]->alphabet = isset($string['alphabet']) ? '"' . $string['alphabet'] . '"': '(no alphabet defined)'; } } } $c .= '<dl>'; foreach ($languages as $langcode => $language) { $c .= '<dt>' . $language->langname . ' (' . $langcode . ')</dt>'; $c .= '<dd>' . $language->alphabet . '</dd>'; } $c .= '</dl>'; $doc->writeHTML($c); $doc->Output('pdflibtestpage.pdf'); exit(); } $PAGE->set_url('/lib/tests/other/pdflibtestpage.php'); $PAGE->set_context($context); $PAGE->set_title('PDF library test'); $PAGE->set_heading('PDF library test'); echo $OUTPUT->header(); echo $OUTPUT->heading('Press the button to generate test PDF', 2); echo $OUTPUT->continue_button(new moodle_url($PAGE->url, array('getpdf' => 1, 'fontfamily' => PDF_FONT_NAME_MAIN))); echo $OUTPUT->footer();
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | ���֧ߧ֧�ѧ�ڧ� ����ѧߧڧ��: 0 |
proxy
|
phpinfo
|
���ѧ����ۧܧ�