ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilTestQuestionPoolSelectorExplorer.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
28{
30
31 public function __construct(
33 string $roundtrip_cmd,
34 string $select_cmd,
35 private ilObjectDataCache $obj_cache
36 ) {
37 parent::__construct($target_gui, $roundtrip_cmd, $target_gui, $select_cmd);
38
39 $this->setTypeWhiteList(['grp', 'cat', 'crs', 'fold', 'qpl']);
40 $this->setClickableTypes(['qpl']);
41 $this->setSelectMode('', false);
42 $this->selection_par = 'quest_pool_ref';
43 }
44
45 public function getAvailableQuestionPools(): array
46 {
48 }
49
51 {
52 $this->availableQuestionPools = $availableQuestionPools;
53 }
54
55 public function isAvailableQuestionPool($qpl_ref_id): bool
56 {
57 $qpl_obj_id = $this->obj_cache->lookupObjId((int) $qpl_ref_id);
58 return in_array($qpl_obj_id, $this->getAvailableQuestionPools());
59 }
60
61 public function isNodeClickable($a_node): bool
62 {
63 if ($a_node['type'] != 'qpl') {
64 return parent::isNodeClickable($a_node);
65 }
66
67 return $this->isAvailableQuestionPool($a_node['child']);
68 }
69
70 public function isNodeVisible($a_node): bool
71 {
72 if ($a_node['type'] != 'qpl') {
73 return parent::isNodeVisible($a_node);
74 }
75
76 return $this->isAvailableQuestionPool($a_node['child']);
77 }
78}
setSelectMode(string $a_postvar, bool $a_multi=false)
Set select mode (to deactivate, pass an empty string as postvar)
class ilObjectDataCache
Explorer for selecting repository items.
__construct(ilTestRandomQuestionSetConfigGUI $target_gui, string $roundtrip_cmd, string $select_cmd, private ilObjectDataCache $obj_cache)
setTypeWhiteList(array $a_val)
Set type white list.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc