ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilQuestionPoolFactory.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 'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
5 
13 {
14  public function createNewInstance($parentRef = null)
15  {
16  // create new questionpool object
17  $newObj = new ilObjQuestionPool(0, true);
18 
19  // set title of questionpool object to "dummy"
20  $newObj->setTitle("dummy");
21 
22  // set description of questionpool object
23  $newObj->setDescription("derived questionpool");
24 
25  // create the questionpool class in the ILIAS database (object_data table)
26  $newObj->create(true);
27 
28  if( $parentRef )
29  {
30  // create a reference for the questionpool object in the ILIAS database (object_reference table)
31  $newObj->createReference();
32 
33  // put the questionpool object in the administration tree
34  $newObj->putInTree($parentRef);
35 
36  // get default permissions and set the permissions for the questionpool object
37  $newObj->setPermissions($parentRef);
38  }
39 
40  return $newObj;
41  }
42 }