ILIAS  trunk Revision v11.0_alpha-1753-gb21ca8c4367
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null