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.69.17.90
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 /
analytics /
tests /
[ HOME SHELL ]
Name
Size
Permission
Action
behat
[ DIR ]
drwxr-xr-x
fixtures
[ DIR ]
drwxr-xr-x
analysis_test.php
3.76
KB
-rw-r--r--
calculation_info_test.php
4.09
KB
-rw-r--r--
community_of_inquiry_activitie...
14.3
KB
-rw-r--r--
course_test.php
6
KB
-rw-r--r--
dataset_manager_test.php
7.24
KB
-rw-r--r--
indicator_test.php
3.25
KB
-rw-r--r--
manager_test.php
24.39
KB
-rw-r--r--
model_test.php
24.54
KB
-rw-r--r--
prediction_actions_test.php
10.17
KB
-rw-r--r--
prediction_test.php
41.75
KB
-rw-r--r--
privacy_test.php
21.27
KB
-rw-r--r--
stats_test.php
6.35
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : stats_test.php
<?php // This file is part of Moodle - https://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/>. /** * Provides the {@link analytics_stats_testcase} class. * * @package core_analytics * @category test * @copyright 2019 David Mudrák <david@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); require_once(__DIR__ . '/fixtures/test_indicator_fullname.php'); require_once(__DIR__ . '/fixtures/test_target_shortname.php'); /** * Unit tests for the analytics stats. * * @copyright 2019 David Mudrák <david@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class analytics_stats_testcase extends advanced_testcase { /** * Set up the test environment. */ public function setUp(): void { $this->setAdminUser(); } /** * Test the {@link \core_analytics\stats::enabled_models()} implementation. */ public function test_enabled_models() { $this->resetAfterTest(true); // By default, sites have {@link \core_course\analytics\target\no_teaching} and // {@link \core_user\analytics\target\upcoming_activities_due} enabled. $this->assertEquals(4, \core_analytics\stats::enabled_models()); $model = \core_analytics\model::create( \core_analytics\manager::get_target('\core_course\analytics\target\course_dropout'), [ \core_analytics\manager::get_indicator('\core\analytics\indicator\any_write_action'), ] ); // Purely adding a new model does not make it included in the stats. $this->assertEquals(4, \core_analytics\stats::enabled_models()); // New models must be enabled to have them counted. $model->enable('\core\analytics\time_splitting\quarters'); $this->assertEquals(5, \core_analytics\stats::enabled_models()); } /** * Test the {@link \core_analytics\stats::predictions()} implementation. */ public function test_predictions() { $this->resetAfterTest(true); $model = \core_analytics\model::create( \core_analytics\manager::get_target('test_target_shortname'), [ \core_analytics\manager::get_indicator('test_indicator_fullname'), ] ); $model->enable('\core\analytics\time_splitting\no_splitting'); // Train the model. $this->getDataGenerator()->create_course(['shortname' => 'a', 'fullname' => 'a', 'visible' => 1]); $this->getDataGenerator()->create_course(['shortname' => 'b', 'fullname' => 'b', 'visible' => 1]); $model->train(); // No predictions yet. $this->assertEquals(0, \core_analytics\stats::predictions()); // Get one new prediction. $this->getDataGenerator()->create_course(['shortname' => 'aa', 'fullname' => 'aa', 'visible' => 0]); $result = $model->predict(); $this->assertEquals(1, count($result->predictions)); $this->assertEquals(1, \core_analytics\stats::predictions()); // Nothing changes if there is no new prediction. $result = $model->predict(); $this->assertFalse(isset($result->predictions)); $this->assertEquals(1, \core_analytics\stats::predictions()); // Get two more predictions, we have three in total now. $this->getDataGenerator()->create_course(['shortname' => 'bb', 'fullname' => 'bb', 'visible' => 0]); $this->getDataGenerator()->create_course(['shortname' => 'cc', 'fullname' => 'cc', 'visible' => 0]); $result = $model->predict(); $this->assertEquals(2, count($result->predictions)); $this->assertEquals(3, \core_analytics\stats::predictions()); } /** * Test the {@link \core_analytics\stats::actions()} and {@link \core_analytics\stats::actions_not_useful()} implementation. */ public function test_actions() { global $DB; $this->resetAfterTest(true); $model = \core_analytics\model::create( \core_analytics\manager::get_target('test_target_shortname'), [ \core_analytics\manager::get_indicator('test_indicator_fullname'), ] ); $model->enable('\core\analytics\time_splitting\no_splitting'); // Train the model. $this->getDataGenerator()->create_course(['shortname' => 'a', 'fullname' => 'a', 'visible' => 1]); $this->getDataGenerator()->create_course(['shortname' => 'b', 'fullname' => 'b', 'visible' => 1]); $model->train(); // Generate two predictions. $this->getDataGenerator()->create_course(['shortname' => 'aa', 'fullname' => 'aa', 'visible' => 0]); $this->getDataGenerator()->create_course(['shortname' => 'bb', 'fullname' => 'bb', 'visible' => 0]); $model->predict(); list($p1, $p2) = array_values($DB->get_records('analytics_predictions')); $p1 = new \core_analytics\prediction($p1, []); $p2 = new \core_analytics\prediction($p2, []); // No actions executed at the start. $this->assertEquals(0, \core_analytics\stats::actions()); $this->assertEquals(0, \core_analytics\stats::actions_not_useful()); // The user has acknowledged the first prediction. $p1->action_executed(\core_analytics\prediction::ACTION_FIXED, $model->get_target()); $this->assertEquals(1, \core_analytics\stats::actions()); $this->assertEquals(0, \core_analytics\stats::actions_not_useful()); // The user has marked the other prediction as not useful. $p2->action_executed(\core_analytics\prediction::ACTION_INCORRECTLY_FLAGGED, $model->get_target()); $this->assertEquals(2, \core_analytics\stats::actions()); $this->assertEquals(1, \core_analytics\stats::actions_not_useful()); } }
Close