ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLOXmlWriter Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. 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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilLOXmlWriter

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

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

Constructor & Destructor Documentation

◆ __construct()

ilLOXmlWriter::__construct ( int  $a_ref_id)

Constructor.

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

References $DIC, and ilObject\_lookupObjectId().

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  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
static _lookupObjectId(int $ref_id)
+ Here is the call graph for this function:

Member Function Documentation

◆ getWriter()

ilLOXmlWriter::getWriter ( )
protected

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

References $writer.

Referenced by getXml(), and write().

51  : ilXmlWriter
52  {
53  return $this->writer;
54  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ getXml()

ilLOXmlWriter::getXml ( )

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

References getWriter().

83  : string
84  {
85  return $this->getWriter()->xmlDumpMem(false);
86  }
+ Here is the call graph for this function:

◆ write()

ilLOXmlWriter::write ( )

Write xml.

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

References $factory, ILIAS\LTI\ToolProvider\$settings, ilCourseObjective\_getObjectiveIds(), ilLOSettings\getInstanceByObjId(), and getWriter().

59  : void
60  {
61  $this->getWriter()->xmlStartTag('Objectives');
62 
63  // export settings
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  }
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
static _getObjectiveIds(int $course_id, bool $a_activated_only=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstanceByObjId(int $a_obj_id)
$factory
Definition: metadata.php:75
+ 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: