Linux aries.aptans.com 4.18.0-348.20.1.lve.1.el8.x86_64 #1 SMP Wed Mar 16 08:45:39 EDT 2022 x86_64
Apache
: 135.181.142.107 | : 172.70.126.134
Cant Read [ /etc/named.conf ]
7.4.33
aja
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
home /
aja /
public_html /
ead /
mod /
assign /
tests /
[ HOME SHELL ]
Name
Size
Permission
Action
behat
[ DIR ]
drwxr-xr-x
fixtures
[ DIR ]
drwxr-xr-x
generator
[ DIR ]
drwxr-xr-x
base_test.php
9.41
KB
-rw-r--r--
events_test.php
54.26
KB
-rw-r--r--
externallib_test.php
131.16
KB
-rw-r--r--
feedback_test.php
5.84
KB
-rw-r--r--
generator.php
4.65
KB
-rw-r--r--
lib_test.php
56.02
KB
-rw-r--r--
locallib_participants_test.php
7.49
KB
-rw-r--r--
locallib_test.php
188.1
KB
-rw-r--r--
markerallocation_test.php
5.72
KB
-rw-r--r--
portfolio_caller_test.php
10.08
KB
-rw-r--r--
privacy_feedback_legacy_polyfi...
9.5
KB
-rw-r--r--
privacy_submission_legacy_poly...
9.73
KB
-rw-r--r--
privacy_test.php
34.39
KB
-rw-r--r--
restore_date_test.php
3.66
KB
-rw-r--r--
search_test.php
4.22
KB
-rw-r--r--
upgradelib_test.php
4.91
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : markerallocation_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/>. /** * Unit tests for (some of) mod/assign/markerallocaion_test.php. * * @package mod_assign * @category test * @copyright 2017 Andrés Melo <andres.torres@blackboard.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); global $CFG; require_once($CFG->dirroot . '/lib/accesslib.php'); require_once($CFG->dirroot . '/course/lib.php'); /** * This class tests some of marker allocation functionality. * * @package mod_assign * @copyright 2017 Andrés Melo <andres.torres@blackboard.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class mod_assign_markerallocation_testcase extends advanced_testcase { /** * Create all the needed elements to test the difference between both functions. */ public function test_markerusers() { $this->resetAfterTest(); global $DB; // Create a course, by default it is created with 5 sections. $this->course = $this->getDataGenerator()->create_course(); // Setting assing module, markingworkflow and markingallocation set to 1 to enable marker allocation. $record = new stdClass(); $record->course = $this->course; $modulesettings = array( 'alwaysshowdescription' => 1, 'submissiondrafts' => 1, 'requiresubmissionstatement' => 0, 'sendnotifications' => 0, 'sendstudentnotifications' => 1, 'sendlatenotifications' => 0, 'duedate' => 0, 'allowsubmissionsfromdate' => 0, 'grade' => 100, 'cutoffdate' => 0, 'teamsubmission' => 0, 'requireallteammemberssubmit' => 0, 'teamsubmissiongroupingid' => 0, 'blindmarking' => 0, 'attemptreopenmethod' => 'none', 'maxattempts' => -1, 'markingworkflow' => 1, 'markingallocation' => 1, ); $assignelement = $this->getDataGenerator()->create_module('assign', $record, $modulesettings); $coursesectionid = course_add_cm_to_section($this->course->id, $assignelement->id, 1); // Adding users to the course. $userdata = array(); $userdata['firstname'] = 'teacher1'; $userdata['lasttname'] = 'lastname_teacher1'; $user1 = $this->getDataGenerator()->create_user($userdata); $this->getDataGenerator()->enrol_user($user1->id, $this->course->id, 'teacher'); $userdata = array(); $userdata['firstname'] = 'teacher2'; $userdata['lasttname'] = 'lastname_teacher2'; $user2 = $this->getDataGenerator()->create_user($userdata); $this->getDataGenerator()->enrol_user($user2->id, $this->course->id, 'teacher'); $userdata = array(); $userdata['firstname'] = 'student'; $userdata['lasttname'] = 'lastname_student'; $user3 = $this->getDataGenerator()->create_user($userdata); $this->getDataGenerator()->enrol_user($user3->id, $this->course->id, 'student'); // Adding manager to the system. $userdata = array(); $userdata['firstname'] = 'Manager'; $userdata['lasttname'] = 'lastname_Manager'; $user4 = $this->getDataGenerator()->create_user($userdata); // Getting id of manager role. $managerrole = $DB->get_record('role', array('shortname' => 'manager')); if (!empty($managerrole)) { // By default the context of the system is assigned. $idassignment = $this->getDataGenerator()->role_assign($managerrole->id, $user4->id); } $oldusers = array($user1, $user2, $user4); $newusers = array($user1, $user2); list($sort, $params) = users_order_by_sql('u'); // Old code, it must return 3 users: teacher1, teacher2 and Manger. $oldmarkers = get_users_by_capability(context_course::instance($this->course->id), 'mod/assign:grade', '', $sort); // New code, it must return 2 users: teacher1 and teacher2. $newmarkers = get_enrolled_users(context_course::instance($this->course->id), 'mod/assign:grade', 0, 'u.*', $sort); // Test result quantity. $this->assertEquals(count($oldusers), count($oldmarkers)); $this->assertEquals(count($newusers), count($newmarkers)); $this->assertEquals(count($oldmarkers) > count($newmarkers), true); // Elements expected with new code. foreach ($newmarkers as $key => $nm) { $this->assertEquals($nm, $newusers[array_search($nm, $newusers)]); } // Elements expected with old code. foreach ($oldusers as $key => $os) { $this->assertEquals($os->id, $oldmarkers[$os->id]->id); unset($oldmarkers[$os->id]); } $this->assertEquals(count($oldmarkers), 0); } }
Close