���ѧۧݧ�ӧ�� �ާ֧ߧ֧էا֧� - ���֧էѧܧ�ڧ��ӧѧ�� - /home3/cpr76684/public_html/result.tar
���ѧ٧ѧ�
other.php 0000644 00000003213 15152167624 0006406 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/>. /** * Contains class mod_h5pactivity\output\result\other * * @package mod_h5pactivity * @copyright 2020 Ferran Recio * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_h5pactivity\output\result; defined('MOODLE_INTERNAL') || die(); use mod_h5pactivity\output\result; use renderer_base; use stdClass; /** * Class to display H5P other result. * * @copyright 2020 Ferran Recio * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class other extends result { /** * Export this data so it can be used as the context for a mustache template. * * @param renderer_base $output * @return stdClass */ public function export_for_template(renderer_base $output): stdClass { $data = parent::export_for_template($output); if (empty($data->description)) { $data->description = get_string('result_other', 'mod_h5pactivity'); } return $data; } } fillin.php 0000644 00000010542 15152167624 0006545 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/>. /** * Contains class mod_h5pactivity\output\result\fillin * * @package mod_h5pactivity * @copyright 2020 Ferran Recio * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_h5pactivity\output\result; defined('MOODLE_INTERNAL') || die(); use mod_h5pactivity\output\result; use renderer_base; use stdClass; /** * Class to display H5P fill-in result. * * @copyright 2020 Ferran Recio * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class fillin extends result { /** * Return the options data structure. * * @return array of options */ protected function export_options(): ?array { $correctpatterns = $this->correctpattern; $additionals = $this->additionals; $extensions = (array) $additionals->extensions ?? []; // There are two way in which H5P could force case sensitivity, with extensions // or using options in the correctpatterns. By default it is case sensible. $casesensitive = $extensions['https://h5p.org/x-api/case-sensitivity'] ?? true; if (!empty($this->result->correctpattern) && strpos($this->result->correctpattern, '{case_matters=false}') !== null) { $casesensitive = false; } $values = []; // Add all possibilities from $additionals. if (isset($extensions['https://h5p.org/x-api/alternatives'])) { foreach ($extensions['https://h5p.org/x-api/alternatives'] as $key => $value) { if (!is_array($value)) { $value = [$value]; } $values[$key] = ($casesensitive) ? $value : array_change_key_case($value); } } // Add possibilities from correctpattern. foreach ($correctpatterns as $correctpattern) { foreach ($correctpattern as $key => $pattern) { // The xAPI admits more params a part form values. // For now this extra information is not used in reporting // but it is posible future H5P types need them. $value = preg_replace('/\{.+=.*\}/', '', $pattern); $value = ($casesensitive) ? $value : strtolower($value); if (!isset($values[$key])) { $values[$key] = []; } if (!in_array($value, $values[$key])) { array_unshift($values[$key], $value); } } } // Generate options. $options = []; $num = 1; foreach ($values as $key => $value) { $option = (object)[ 'id' => $key, 'description' => get_string('result_fill-in_gap', 'mod_h5pactivity', $num), ]; $gapresponse = $this->response[$key] ?? null; $gapresponse = ($casesensitive) ? $gapresponse : strtolower($gapresponse); if ($gapresponse !== null && in_array($gapresponse, $value)) { $state = parent::CORRECT; } else { $state = parent::INCORRECT; } $option->useranswer = $this->get_answer($state, $gapresponse); $option->correctanswer = $this->get_answer(parent::TEXT, implode(' / ', $value)); $options[] = $option; $num++; } return $options; } /** * Return a label for result user options/choices * * Specific result types can override this method to customize * the result options table header. * * @return string to use in options table */ protected function get_optionslabel(): string { return get_string('result_matching', 'mod_h5pactivity'); } } sequencing.php 0000644 00000006041 15152167624 0007430 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/>. /** * Contains class mod_h5pactivity\output\result\sequencing * * @package mod_h5pactivity * @copyright 2020 Ferran Recio * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_h5pactivity\output\result; defined('MOODLE_INTERNAL') || die(); use mod_h5pactivity\output\result; use renderer_base; /** * Class to display H5P sequencing result. * * @copyright 2020 Ferran Recio * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class sequencing extends result { /** * Return the options data structure. * * @return array of options */ protected function export_options(): ?array { $correctpattern = reset($this->correctpattern); $additionals = $this->additionals; $response = $this->response; if (isset($additionals->choices)) { $choices = $this->get_descriptions($additionals->choices); } else { $choices = []; } $options = []; $num = 1; foreach ($correctpattern as $key => $pattern) { if (!isset($choices[$pattern])) { continue; } $option = (object)[ 'id' => 'true', 'description' => get_string('result_sequencing_position', 'mod_h5pactivity', $num), 'correctanswer' => $this->get_answer(parent::TEXT, $choices[$pattern]->description), 'correctanswerid' => 'item_'.$key, ]; if (isset($response[$key])) { $answerstate = ($response[$key] == $option->correctanswerid) ? parent::PASS : parent::FAIL; } else { $answerstate = parent::FAIL; } $option->useranswer = $this->get_answer($answerstate); $options[$key] = $option; $num ++; } return $options; } /** * Return a label for result user options/choices. * * @return string to use in options table */ protected function get_optionslabel(): string { return get_string('result_sequencing_choice', 'mod_h5pactivity'); } /** * Return a label for result user correct answer. * * @return string to use in options table */ protected function get_correctlabel(): string { return get_string('result_sequencing_answer', 'mod_h5pactivity'); } } choice.php 0000644 00000007021 15152167624 0006520 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/>. /** * Contains class mod_h5pactivity\output\result\choice * * @package mod_h5pactivity * @copyright 2020 Ferran Recio * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_h5pactivity\output\result; defined('MOODLE_INTERNAL') || die(); use mod_h5pactivity\output\result; use renderer_base; /** * Class to display H5P choice result. * * @copyright 2020 Ferran Recio * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class choice extends result { /** * Return the options data structure. * * @return array of options */ protected function export_options(): ?array { // Suppose H5P choices have only a single list of valid answers. $correctpattern = reset($this->correctpattern); if (empty($correctpattern)) { $correctpattern = []; } $additionals = $this->additionals; // H5P has a special extension for long choices. $extensions = (array) $additionals->extensions ?? []; $filter = isset($extensions['https://h5p.org/x-api/line-breaks']) ? true : false; if (isset($additionals->choices)) { $options = $this->get_descriptions($additionals->choices); } else { $options = []; } // Some H5P activities like Find the Words don't user the standard CMI format delimiter // and don't use propper choice additionals. In those cases the report needs to fix this // using the correct pattern as choices and using a non standard delimiter. if (empty($options)) { if (count($correctpattern) == 1) { $correctpattern = explode(',', reset($correctpattern)); } foreach ($correctpattern as $value) { $option = (object)[ 'id' => $value, 'description' => $value, ]; $options[$value] = $option; } } foreach ($options as $key => $value) { $correctstate = (in_array($key, $correctpattern)) ? parent::CHECKED : parent::UNCHECKED; if (in_array($key, $this->response)) { $answerstate = ($correctstate == parent::CHECKED) ? parent::PASS : parent::FAIL; // In some cases, like Branching scenario H5P activity, no correct Pattern is provided // so any answer is just a check. if (empty($correctpattern)) { $answerstate = parent::CHECKED; } $value->useranswer = $this->get_answer($answerstate); } $value->correctanswer = $this->get_answer($correctstate); if ($filter && $correctstate == parent::UNCHECKED && !isset($value->useranswer)) { unset($options[$key]); } } return $options; } } truefalse.php 0000644 00000005021 15152167624 0007256 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/>. /** * Contains class mod_h5pactivity\output\result\truefalse * * @package mod_h5pactivity * @copyright 2020 Ferran Recio * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_h5pactivity\output\result; defined('MOODLE_INTERNAL') || die(); use mod_h5pactivity\output\result; use renderer_base; /** * Class to display H5P choice result. * * @copyright 2020 Ferran Recio * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class truefalse extends result { /** * Return the options data structure. * * @return array of options */ protected function export_options(): ?array { // This interaction type have only one entry which is the correct option. $correctpattern = reset($this->correctpattern); $correctpattern = filter_var(reset($correctpattern), FILTER_VALIDATE_BOOLEAN); $correctpattern = $correctpattern ? 'true' : 'false'; $response = filter_var(reset($this->response), FILTER_VALIDATE_BOOLEAN); $response = $response ? 'true' : 'false'; $options = [ (object)[ 'id' => 'true', 'description' => get_string('true', 'mod_h5pactivity'), ], (object)[ 'id' => 'false', 'description' => get_string('false', 'mod_h5pactivity'), ], ]; foreach ($options as $value) { $correctstate = ($value->id == $correctpattern) ? parent::CHECKED : parent::UNCHECKED; if ($value->id == $response) { $answerstate = ($correctstate == parent::CHECKED) ? parent::PASS : parent::FAIL; $value->useranswer = $this->get_answer($answerstate); } $value->correctanswer = $this->get_answer($correctstate); } return $options; } } matching.php 0000644 00000010375 15152167624 0007066 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/>. /** * Contains class mod_h5pactivity\output\result\matching * * @package mod_h5pactivity * @copyright 2020 Ferran Recio * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_h5pactivity\output\result; defined('MOODLE_INTERNAL') || die(); use mod_h5pactivity\output\result; use renderer_base; /** * Class to display H5P matching result. * * @copyright 2020 Ferran Recio * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class matching extends result { /** * Return the options data structure. * * @return array of options */ protected function export_options(): ?array { // Suppose H5P choices have only list of valid answers. $correctpattern = reset($this->correctpattern); $additionals = $this->additionals; // Get sources (options). if (isset($additionals->source)) { $options = $this->get_descriptions($additionals->source); } else { $options = []; } // Get targets. if (isset($additionals->target)) { $targets = $this->get_descriptions($additionals->target); } else { $targets = []; } // Correct answers. foreach ($correctpattern as $pattern) { if (!is_array($pattern) || count($pattern) != 2) { continue; } // One pattern must be from options and the other from targets. if (isset($options[$pattern[0]]) && isset($targets[$pattern[1]])) { $option = $options[$pattern[0]]; $target = $targets[$pattern[1]]; } else if (isset($targets[$pattern[0]]) && isset($options[$pattern[1]])) { $option = $options[$pattern[1]]; $target = $targets[$pattern[0]]; } else { $option = null; } if ($option) { $option->correctanswer = $this->get_answer(parent::TEXT, $target->description); $option->correctanswerid = $target->id; } } // User responses. foreach ($this->response as $response) { if (!is_array($response) || count($response) != 2) { continue; } // One repsonse must be from options and the other from targets. if (isset($options[$response[0]]) && isset($targets[$response[1]])) { $option = $options[$response[0]]; $target = $targets[$response[1]]; $answer = $response[1]; } else if (isset($targets[$response[0]]) && isset($options[$response[1]])) { $option = $options[$response[1]]; $target = $targets[$response[0]]; $answer = $response[0]; } else { $option = null; } if ($option) { if (isset($option->correctanswerid) && $option->correctanswerid == $answer) { $state = parent::CORRECT; } else { $state = parent::INCORRECT; } $option->useranswer = $this->get_answer($state, $target->description); } } return $options; } /** * Return a label for result user options/choices * * Specific result types can override this method to customize * the result options table header. * * @return string to use in options table */ protected function get_optionslabel(): string { return get_string('result_matching', 'mod_h5pactivity'); } } longfillin.php 0000644 00000003700 15152167624 0007423 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/>. /** * Contains class mod_h5pactivity\output\result\longfillin * * @package mod_h5pactivity * @copyright 2020 Ferran Recio * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_h5pactivity\output\result; defined('MOODLE_INTERNAL') || die(); use mod_h5pactivity\output\result; use renderer_base; use stdClass; /** * Class to display H5P long fill in result. * * @copyright 2020 Ferran Recio * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class longfillin extends result { /** * Export this data so it can be used as the context for a mustache template. * * @param renderer_base $output * @return stdClass */ public function export_for_template(renderer_base $output): stdClass { $data = parent::export_for_template($output); $userresponse = reset($this->response); $data->content = format_text($userresponse, FORMAT_PLAIN); $data->track = true; // Long fill-in is used for Essay type exercices. H5P adds // extra characters to the description in all fill-in interactions // but in the essay questions is unnecesary. $data->description = preg_replace('/__________$/', '', $data->description); return $data; } }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | ���֧ߧ֧�ѧ�ڧ� ����ѧߧڧ��: 0 |
proxy
|
phpinfo
|
���ѧ����ۧܧ�