__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

root@216.73.217.120: ~ $
<?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/>.

namespace mod_quiz;

/**
 * PHPUnit data generator testcase
 *
 * @package    mod_quiz
 * @category   phpunit
 * @copyright  2012 Matt Petro
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 * @covers \mod_quiz_generator
 */
final class generator_test extends \advanced_testcase {
    public function test_generator(): void {
        global $DB, $SITE;

        $this->resetAfterTest(true);

        $this->assertEquals(0, $DB->count_records('quiz'));

        /** @var \mod_quiz_generator $generator */
        $generator = $this->getDataGenerator()->get_plugin_generator('mod_quiz');
        $this->assertInstanceOf('mod_quiz_generator', $generator);
        $this->assertEquals('quiz', $generator->get_modulename());

        $generator->create_instance(['course' => $SITE->id]);
        $generator->create_instance(['course' => $SITE->id]);
        $createtime = time();
        $quiz = $generator->create_instance(['course' => $SITE->id, 'timecreated' => 0]);
        $this->assertEquals(3, $DB->count_records('quiz'));

        $cm = get_coursemodule_from_instance('quiz', $quiz->id);
        $this->assertEquals($quiz->id, $cm->instance);
        $this->assertEquals('quiz', $cm->modname);
        $this->assertEquals($SITE->id, $cm->course);

        $context = \context_module::instance($cm->id);
        $this->assertEquals($quiz->cmid, $context->instanceid);

        $this->assertEqualsWithDelta($createtime,
                $DB->get_field('quiz', 'timecreated', ['id' => $cm->instance]), 2);
    }

    public function test_generating_a_user_override(): void {
        $this->resetAfterTest(true);

        $generator = $this->getDataGenerator();
        $course = $generator->create_course();
        $user = $generator->create_user();
        $quiz = $generator->create_module('quiz', ['course' => $course->id]);
        $generator->enrol_user($user->id, $course->id, 'student');

        /** @var \mod_quiz_generator $quizgenerator */
        $quizgenerator = $generator->get_plugin_generator('mod_quiz');
        $quizgenerator->create_override([
            'quiz' => $quiz->id,
            'userid' => $user->id,
            'timeclose' => strtotime('2022-10-20'),
        ]);

        // Check the corresponding calendar event now exists.
        $events = calendar_get_events(strtotime('2022-01-01'),
                strtotime('2022-12-31'), $user->id, false, $course->id);
        $this->assertCount(1, $events);
        $event = reset($events);
        $this->assertEquals($user->id, $event->userid);
        $this->assertEquals(0, $event->groupid);
        $this->assertEquals(0, $event->courseid);
        $this->assertEquals('quiz', $event->modulename);
        $this->assertEquals($quiz->id, $event->instance);
        $this->assertEquals('close', $event->eventtype);
        $this->assertEquals(strtotime('2022-10-20'), $event->timestart);
    }

    public function test_generating_a_group_override(): void {
        $this->resetAfterTest(true);

        $generator = $this->getDataGenerator();
        $course = $generator->create_course();
        $quiz = $generator->create_module('quiz', ['course' => $course->id]);
        $group = $generator->create_group(['courseid' => $course->id]);

        /** @var \mod_quiz_generator $quizgenerator */
        $quizgenerator = $generator->get_plugin_generator('mod_quiz');
        $quizgenerator->create_override([
            'quiz' => $quiz->id,
            'groupid' => $group->id,
            'timeclose' => strtotime('2022-10-20'),
        ]);

        // Check the corresponding calendar event now exists.
        $events = calendar_get_events(strtotime('2022-01-01'),
                strtotime('2022-12-31'), false, $group->id, $course->id);
        $this->assertCount(1, $events);
        $event = reset($events);
        $this->assertEquals(0, $event->userid);
        $this->assertEquals($group->id, $event->groupid);
        $this->assertEquals($course->id, $event->courseid);
        $this->assertEquals('quiz', $event->modulename);
        $this->assertEquals($quiz->id, $event->instance);
        $this->assertEquals('close', $event->eventtype);
        $this->assertEquals(strtotime('2022-10-20'), $event->timestart);
    }

    public function test_generating_a_grade_item(): void {
        $this->resetAfterTest();

        // Create a quiz to use in the test.
        $generator = $this->getDataGenerator();
        $course = $generator->create_course();
        $quiz = $generator->create_module('quiz', ['course' => $course->id]);

        // Create a grade item.
        /** @var \mod_quiz_generator $quizgenerator */
        $quizgenerator = $generator->get_plugin_generator('mod_quiz');
        $newgradeitem = $quizgenerator->create_grade_item([
            'quizid' => $quiz->id,
            'name' => 'Awesomeness!',
        ]);

        // Verify the grade item was created correctly.
        $this->assertObjectHasProperty('id', $newgradeitem);
        $this->assertEquals($quiz->id, $newgradeitem->quizid);
        $this->assertEquals('Awesomeness!', $newgradeitem->name);
    }
}

Filemanager

Name Type Size Permission Actions
backup Folder 0755
behat Folder 0755
classes Folder 0755
event Folder 0755
external Folder 0755
fixtures Folder 0755
generator Folder 0755
local Folder 0755
output Folder 0755
privacy Folder 0755
question Folder 0755
attempt_test.php File 27.6 KB 0644
attempt_walkthrough_from_csv_test.php File 1.23 KB 0644
attempt_walkthrough_test.php File 29.43 KB 0644
attempts_test.php File 40.43 KB 0644
calendar_event_modified_test.php File 18.59 KB 0644
custom_completion_test.php File 21.25 KB 0644
dates_test.php File 7.16 KB 0644
generator_test.php File 5.66 KB 0644
lib_test.php File 43.33 KB 0644
local_structure_slot_random_test.php File 12.15 KB 0644
locallib_test.php File 29.87 KB 0644
notification_helper_test.php File 9.83 KB 0644
privacy_legacy_quizaccess_polyfill_test.php File 6.9 KB 0644
qbank_helper_test.php File 9.08 KB 0644
quiz_notify_attempt_manual_grading_completed_test.php File 11.99 KB 0644
quiz_question_bank_view_test.php File 9.51 KB 0644
quiz_question_helper_test_trait.php File 1019 B 0644
quiz_question_restore_test.php File 27.72 KB 0644
quiz_question_version_test.php File 11.91 KB 0644
quizobj_test.php File 5.24 KB 0644
repaginate_test.php File 10.58 KB 0644
reportlib_test.php File 7.24 KB 0644
restore_attempt_test.php File 4.38 KB 0644
restore_override_test.php File 3.64 KB 0644
structure_test.php File 40.23 KB 0644
tags_test.php File 4.55 KB 0644
Filemanager