ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilQuestionPoolFactory.php
Go to the documentation of this file.
1<?php
2
26{
27 public function createNewInstance($parentRef = null): ilObjQuestionPool
28 {
29 // create new questionpool object
30 $newObj = new ilObjQuestionPool(0, true);
31
32 // set title of questionpool object to "dummy"
33 $newObj->setTitle("dummy");
34
35 // set description of questionpool object
36 $newObj->setDescription("derived questionpool");
37
38 // create the questionpool class in the ILIAS database (object_data table)
39 $newObj->create(true);
40
41 if ($parentRef) {
42 // create a reference for the questionpool object in the ILIAS database (object_reference table)
43 $newObj->createReference();
44
45 // put the questionpool object in the administration tree
46 $newObj->putInTree($parentRef);
47
48 // get default permissions and set the permissions for the questionpool object
49 $newObj->setPermissions($parentRef);
50 }
51
52 return $newObj;
53 }
54}