Skip to content

Commit

Permalink
Linting: linting code
Browse files Browse the repository at this point in the history
  • Loading branch information
WunderJacob committed Dec 19, 2023
1 parent 62c878a commit d4a84a3
Show file tree
Hide file tree
Showing 14 changed files with 59 additions and 5,933 deletions.
1,870 changes: 2 additions & 1,868 deletions amd/build/app-lazy.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions amd/build/app-lazy.min.js.map

Large diffs are not rendered by default.

1,901 changes: 0 additions & 1,901 deletions amd/src/.fuse_hidden000003bb00000003

This file was deleted.

2,156 changes: 3 additions & 2,153 deletions amd/src/app-lazy.js

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions amd/src/app-lazy.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*!
* vuex v4.1.0
* (c) 2022 Evan You
* @license MIT
*/

/*! #__NO_SIDE_EFFECTS__ */

/**
*
* @package local_adele
* @author Jacob Viertel
* @copyright 2023 Wunderbyte GmbH
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

/**
* Validate if the string does excist.
*
* @package local_adele
* @author Jacob Viertel
* @copyright 2023 Wunderbyte GmbH
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
10 changes: 9 additions & 1 deletion classes/completion.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ public static function completed($event) {
break;
}
// Get next Condition and return null if no child node exsists.
$currentcondition = self::searchnestedarray($node['completion']['nodes'], $currentcondition['childCondition'], 'childCondition');
$currentcondition = self::searchnestedarray($node['completion']['nodes'],
$currentcondition['childCondition'], 'childCondition');
}
}
}
Expand Down Expand Up @@ -103,6 +104,13 @@ public static function completed($event) {
}
}

/**
* Observer for course completed
*
* @param array $haystack
* @param string $needle
* @param string $key
*/
public function searchnestedarray($haystack, $needle, $key) {
foreach ($haystack as $item) {
if (isset($item[$key]) && $item[$key] === $needle) {
Expand Down
9 changes: 5 additions & 4 deletions classes/course_completion/conditions/course_completed.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,17 @@ private function get_label_string() {
/**
* Helper function to return localized description strings.
*
* @param array $node
* @param int $userid
* @return boolean
*/
public function get_completion_status($node, $userid) {
// Load the course
$course = get_course($node['data']['course_node_id']);
// Check if the course completion is enabled
// Check if the course completion is enabled.
if ($course->enablecompletion) {
// Get the course completion instance
// Get the course completion instance.
$completion = new completion_info($course);
// Check if the user has completed the course
// Check if the user has completed the course.
$coursecompleted = $completion->is_course_complete($userid);
if ($coursecompleted) {
return true;
Expand Down
3 changes: 2 additions & 1 deletion classes/course_completion/conditions/manual.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ private function get_label_string() {

/**
* Helper function to return localized description strings.
*
* @param array $node
* @param int $userid
* @return boolean
*/
public function get_completion_status($node, $userid) {
Expand Down
2 changes: 2 additions & 0 deletions classes/course_completion/course_completion.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ public function get_description();
* (when displaying all information about the activity) and 'student' cases
* (when displaying only conditions they don't meet).
*
* @param array $node
* @param int $userid
* @return array Information string (for admin) about all restrictions on
* this item
*/
Expand Down
2 changes: 2 additions & 0 deletions classes/course_completion/course_completion_status.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public function __construct() {
/**
* Returns conditions depending on the conditions param.
*
* @param array $node
* @param int $userid
* @return array
*/
public static function get_condition_status($node, $userid): array {
Expand Down
3 changes: 3 additions & 0 deletions classes/external/get_lp_user_path_relation.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ public static function execute_parameters(): external_function_parameters {
* Webservice for the local catquiz plugin to get next question.
*
* @param int $learningpathid
* @param int $userid
* @param int $learninggoalid
* @param int $userpathid
* @return array
*/
public static function execute($learningpathid, $userid, $learninggoalid, $userpathid): array {
Expand Down
1 change: 1 addition & 0 deletions classes/external/get_lp_user_path_relations.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public static function execute_parameters(): external_function_parameters {
/**
* Webservice for the local catquiz plugin to get next question.
*
* @param int $userid
* @param int $learningpathid
* @return array
*/
Expand Down
8 changes: 4 additions & 4 deletions classes/learning_paths.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,14 @@ public static function delete_learning_path($params) {
/**
* Get user path relations.
*
* @param array $params
* @param array $data
* @return array
*/
public static function get_learning_user_relations($data) {
global $DB;

$params = [
'learning_path_id' => (int)$data['learninggoalid']
'learning_path_id' => (int)$data['learninggoalid'],
];

$sql = "SELECT lpu.user_id, lpu.status, lpu.json, usr.username,
Expand Down Expand Up @@ -238,7 +238,7 @@ public static function get_learning_user_relations($data) {
/**
* Get user path relation.
*
* @param array $params
* @param array $data
* @return array
*/
public static function get_learning_user_relation($data) {
Expand Down Expand Up @@ -275,7 +275,7 @@ public static function get_learning_user_relation($data) {
/**
* Get user path relation.
*
* @param array $params
* @param string $json
* @return array
*/
public static function addnodemanualcondition($json) {
Expand Down
2 changes: 1 addition & 1 deletion classes/restriction/conditions/timed.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* @copyright 2023 Wunderbyte GmbH
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class timed {
class timed {

/** @var int $id Standard Conditions have hardcoded ids. */
public $id = COURSES_COND_TIMED;
Expand Down

0 comments on commit d4a84a3

Please sign in to comment.