ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilLOXmlWriter Class Reference

Class ilLOXmlWriter. More...

+ Collaboration diagram for ilLOXmlWriter:

Public Member Functions

 __construct (int $a_ref_id)
 Constructor. More...
 
 write ()
 Write xml. More...
 
 getXml ()
 

Data Fields

const TYPE_TST_PO = 1
 
const TYPE_TST_ALL = 2
 
const TYPE_TST_RND = 3
 

Protected Member Functions

 getWriter ()
 

Protected Attributes

ilSetting $setting
 

Private Attributes

int $ref_id = 0
 
int $obj_id = 0
 
ilXmlWriter $writer
 
ilLogger $log
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilLOXmlWriter::__construct ( int  $a_ref_id)

Constructor.

Definition at line 40 of file class.ilLOXmlWriter.php.

41 {
42 global $DIC;
43
44 $this->ref_id = $a_ref_id;
45 $this->obj_id = ilObject::_lookupObjectId($a_ref_id);
46 $this->writer = new ilXmlWriter();
47 $this->setting = $DIC->settings();
48 $this->log = $DIC->logger()->crs();
49 }
static _lookupObjectId(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:26

References $DIC, and ilObject\_lookupObjectId().

+ Here is the call graph for this function:

Member Function Documentation

◆ getWriter()

ilLOXmlWriter::getWriter ( )
protected

Definition at line 51 of file class.ilLOXmlWriter.php.

52 {
53 return $this->writer;
54 }

References $writer.

Referenced by getXml(), and write().

+ Here is the caller graph for this function:

◆ getXml()

ilLOXmlWriter::getXml ( )

Definition at line 83 of file class.ilLOXmlWriter.php.

83 : string
84 {
85 return $this->getWriter()->xmlDumpMem(false);
86 }

References getWriter().

+ Here is the call graph for this function:

◆ write()

ilLOXmlWriter::write ( )

Write xml.

Definition at line 59 of file class.ilLOXmlWriter.php.

59 : void
60 {
61 $this->getWriter()->xmlStartTag('Objectives');
62
63 // export settings
64 $settings = ilLOSettings::getInstanceByObjId($this->obj_id);
65 $settings->toXml($this->getWriter());
66
67 $factory = new ilObjectFactory();
68 $course = $factory->getInstanceByRefId($this->ref_id, false);
69 if (!$course instanceof ilObjCourse) {
70 $this->log->warning('Cannot create course instance for ref_id: ' . $this->ref_id);
71 return;
72 }
73 $this->log->debug('Writing objective xml');
74 foreach (ilCourseObjective::_getObjectiveIds($this->obj_id) as $objective_id) {
75 $this->log->debug('Handling objective_id: ' . $objective_id);
76 $objective = new ilCourseObjective($course, $objective_id);
77 $objective->toXml($this->getWriter());
78 }
79
80 $this->getWriter()->xmlEndTag('Objectives');
81 }
class ilcourseobjective
static _getObjectiveIds(int $course_id, bool $a_activated_only=false)
static getInstanceByObjId(int $a_obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilObjectFactory This class offers methods to get instances of the type-specific object classes ...

References ilCourseObjective\_getObjectiveIds(), ilLOSettings\getInstanceByObjId(), and getWriter().

+ Here is the call graph for this function:

Field Documentation

◆ $log

ilLogger ilLOXmlWriter::$log
private

Definition at line 34 of file class.ilLOXmlWriter.php.

◆ $obj_id

int ilLOXmlWriter::$obj_id = 0
private

Definition at line 31 of file class.ilLOXmlWriter.php.

◆ $ref_id

int ilLOXmlWriter::$ref_id = 0
private

Definition at line 30 of file class.ilLOXmlWriter.php.

◆ $setting

ilSetting ilLOXmlWriter::$setting
protected

Definition at line 35 of file class.ilLOXmlWriter.php.

◆ $writer

ilXmlWriter ilLOXmlWriter::$writer
private

Definition at line 32 of file class.ilLOXmlWriter.php.

Referenced by getWriter().

◆ TYPE_TST_ALL

const ilLOXmlWriter::TYPE_TST_ALL = 2

Definition at line 27 of file class.ilLOXmlWriter.php.

Referenced by ilCourseObjectiveQuestion\toXml().

◆ TYPE_TST_PO

const ilLOXmlWriter::TYPE_TST_PO = 1

Definition at line 26 of file class.ilLOXmlWriter.php.

Referenced by ilLOTestAssignments\toXml().

◆ TYPE_TST_RND

const ilLOXmlWriter::TYPE_TST_RND = 3

Definition at line 28 of file class.ilLOXmlWriter.php.

Referenced by ilLORandomTestQuestionPools\toXml().


The documentation for this class was generated from the following file: