ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilTestQuestionPoolSelectorExplorer.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once 'Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php';
12 {
13  protected $availableQuestionPools = array();
14 
15  public function __construct($targetGUI, $roundtripCMD, $selectCMD)
16  {
17  parent::__construct($targetGUI, $roundtripCMD, $targetGUI, $selectCMD);
18 
19  $this->setTypeWhiteList(array('grp', 'cat', 'crs', 'fold', 'qpl'));
20  $this->setClickableTypes(array('qpl'));
21  $this->setSelectMode('', false);
22  $this->selection_par = 'quest_pool_ref';
23  }
24 
25  public function getAvailableQuestionPools()
26  {
28  }
29 
31  {
32  $this->availableQuestionPools = $availableQuestionPools;
33  }
34 
35  public function isAvailableQuestionPool($qplRefId)
36  {
37  /* @var ilObjectDataCache $objCache */
38  $objCache = isset($GLOBALS['DIC']) ? $GLOBALS['DIC']['ilObjDataCache'] : $GLOBALS['ilObjDataCache'];
39 
40  $qplObjId = $objCache->lookupObjId($qplRefId);
41  return in_array($qplObjId, $this->getAvailableQuestionPools());
42  }
43 
44  public function isNodeClickable($a_node)
45  {
46  if ($a_node['type'] != 'qpl') {
47  return parent::isNodeClickable($a_node);
48  }
49 
50  return $this->isAvailableQuestionPool($a_node['child']);
51  }
52 
53  public function isNodeVisible($a_node)
54  {
55  if ($a_node['type'] != 'qpl') {
56  return parent::isNodeVisible($a_node);
57  }
58 
59  return $this->isAvailableQuestionPool($a_node['child']);
60  }
61 }
Explorer for selecting repository items.
setSelectMode($a_postvar, $a_multi=false)
Set select mode (to deactivate, pass an empty string as postvar)
setTypeWhiteList($a_val)
Set type white list.
__construct($targetGUI, $roundtripCMD, $selectCMD)
setClickableTypes($a_types)
set Whitelist for clickable items
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.