ILIAS  release_8 Revision v8.24
class.ilSkillResourcesManager.php
Go to the documentation of this file.
1<?php
2
28{
30 protected int $current_target_level = 0;
31
32 public function __construct(int $a_base_skill = 0, int $a_tref_id = 0)
33 {
34 $this->res = new ilSkillResources($a_base_skill, $a_tref_id);
35 }
36
37 public function isLevelTooLow(array $a_levels, array $profile_levels, array $actual_levels): bool
38 {
39 $too_low = true;
40
41 foreach ($a_levels as $k => $v) {
42 foreach ($profile_levels as $pl) {
43 if ($pl["level_id"] == $v["id"] &&
44 $pl["base_skill_id"] == $v["skill_id"]) {
45 $too_low = true;
46 $this->current_target_level = $v["id"];
47 }
48 }
49
50 if ($actual_levels[$v["skill_id"]][$this->res->getTemplateRefId()] == $v["id"]) {
51 $too_low = false;
52 }
53 }
54
55 return $too_low;
56 }
57
61 public function getSuggestedResources(): array
62 {
63 $resources = $this->res->getResources();
64 $imp_resources = [];
65 foreach ($resources as $level) {
66 foreach ($level as $r) {
67 if ($r["imparting"] &&
68 $this->current_target_level == $r["level_id"]) {
69 $imp_resources[] = $r;
70 }
71 }
72 }
73
74 return $imp_resources;
75 }
76}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
isLevelTooLow(array $a_levels, array $profile_levels, array $actual_levels)
__construct(int $a_base_skill=0, int $a_tref_id=0)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$resources
Definition: ltiservices.php:68