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

Settings for LO courses. More...

+ Collaboration diagram for ilLOSettings:

Public Member Functions

 setInitialTestType (int $a_type)
 
 getInitialTestType ()
 
 getQualifyingTestType ()
 
 setQualifyingTestType (int $a_type)
 
 setInitialTestAsStart (bool $a_type)
 
 isInitialTestStart ()
 
 setQualifyingTestAsStart (bool $a_type)
 
 isQualifyingTestStart ()
 
 hasSeparateInitialTests ()
 Check if separate initial test are configured. More...
 
 hasSeparateQualifiedTests ()
 Check if separate qualified tests are configured. More...
 
 isInitialTestQualifying ()
 Check if initial test is qualifying*. More...
 
 worksWithStartObjects ()
 Check if start objects are enabled. More...
 
 worksWithInitialTest ()
 Check if the loc is configured for initial tests. More...
 
 isGeneralQualifiedTestVisible ()
 
 getPassedObjectiveMode ()
 
 setPassedObjectiveMode (int $a_mode)
 
 isGeneralInitialTestVisible ()
 
 settingsExist ()
 
 getObjId ()
 
 setType (int $a_type)
 
 getType ()
 
 getTestByType (int $a_type)
 
 getTests ()
 
 isRandomTestType (int $a_type)
 
 setInitialTest (int $a_id)
 
 getInitialTest ()
 
 setQualifiedTest (int $a_id)
 
 getQualifiedTest ()
 
 resetResults (bool $a_status)
 
 isResetResultsEnabled ()
 
 create ()
 
 update ()
 
 updateStartObjects (ilContainerStartObjects $start)
 Update start objects Depends on course objective settings. More...
 
 toXml (ilXmlWriter $writer)
 

Static Public Member Functions

static getInstanceByObjId (int $a_obj_id)
 
static isObjectiveTest (int $a_trst_ref_id)
 Check if test ref_id is used in an objective course. More...
 
static cloneSettings (int $a_copy_id, int $a_container_id, int $a_new_container_id)
 

Data Fields

const QST_PASSED_FLAG = 1
 
const QST_PASSED_HIDE = 2
 
const TYPE_INITIAL_PLACEMENT_ALL = 1
 
const TYPE_INITIAL_PLACEMENT_SELECTED = 2
 
const TYPE_INITIAL_QUALIFYING_ALL = 3
 
const TYPE_INITIAL_QUALIFYING_SELECTED = 4
 
const TYPE_INITIAL_NONE = 5
 
const TYPE_QUALIFYING_ALL = 1
 
const TYPE_QUALIFYING_SELECTED = 2
 
const TYPE_TEST_UNDEFINED = 0
 
const TYPE_TEST_INITIAL = 1
 
const TYPE_TEST_QUALIFIED = 2
 
const QT_VISIBLE_ALL = 0
 
const QT_VISIBLE_OBJECTIVE = 1
 
const LOC_INITIAL_ALL = 1
 
const LOC_INITIAL_SEL = 2
 
const LOC_QUALIFIED = 3
 
const LOC_PRACTISE = 4
 
const HIDE_PASSED_OBJECTIVE_QST = 1
 
const MARK_PASSED_OBJECTIVE_QST = 2
 

Protected Member Functions

 __construct (int $a_cont_id)
 
 read ()
 Read. More...
 
 purgeReferences ()
 

Protected Attributes

ilDBInterface $db
 
ilTree $tree
 

Private Attributes

int $it_type = self::TYPE_INITIAL_PLACEMENT_ALL
 
int $qt_type = self::TYPE_QUALIFYING_ALL
 
bool $it_start = false
 
bool $qt_start = false
 
int $container_id = 0
 
int $type = 0
 
int $initial_test = 0
 
int $qualified_test = 0
 
bool $reset_results = true
 
int $passed_objective_mode = self::HIDE_PASSED_OBJECTIVE_QST
 
bool $entry_exists = false
 
ilLogger $logger
 

Static Private Attributes

static array $instances = []
 

Detailed Description

Settings for LO courses.

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

Definition at line 25 of file class.ilLOSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilLOSettings::__construct ( int  $a_cont_id)
protected

Definition at line 77 of file class.ilLOSettings.php.

78 {
79 global $DIC;
80
81 $this->logger = $DIC->logger()->crs();
82 $this->db = $DIC->database();
83 $this->tree = $DIC->repositoryTree();
84 $this->container_id = $a_cont_id;
85 $this->read();
86 }
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\Repository\logger(), and read().

+ Here is the call graph for this function:

Member Function Documentation

◆ cloneSettings()

static ilLOSettings::cloneSettings ( int  $a_copy_id,
int  $a_container_id,
int  $a_new_container_id 
)
static

Definition at line 179 of file class.ilLOSettings.php.

179 : void
180 {
181 $options = ilCopyWizardOptions::_getInstance($a_copy_id);
182 $mappings = $options->getMappings();
183
184 $settings = self::getInstanceByObjId($a_container_id);
185 $new_settings = self::getInstanceByObjId($a_new_container_id);
186
187 $new_settings->setType($settings->getType());
188 $new_settings->setInitialTestType($settings->getInitialTestType());
189 $new_settings->setQualifyingTestType($settings->getQualifyingTestType());
190 $new_settings->resetResults($settings->isResetResultsEnabled());
191 $new_settings->setPassedObjectiveMode($settings->getPassedObjectiveMode());
192
193 if ($settings->getInitialTest() && array_key_exists($settings->getInitialTest(), $mappings)) {
194 $new_settings->setInitialTest($mappings[$settings->getInitialTest()]);
195 $new_settings->setInitialTestAsStart($new_settings->isInitialTestStart());
196 }
197
198 if ($settings->getQualifiedTest() && array_key_exists($settings->getQualifiedTest(), $mappings)) {
199 $new_settings->setQualifiedTest($mappings[$settings->getQualifiedTest()]);
200 $new_settings->setQualifyingTestAsStart($settings->isQualifyingTestStart());
201 }
202
203 // update calls create in case of no entry exists.
204 $new_settings->update();
205 }
static _getInstance(int $a_copy_id)
static getInstanceByObjId(int $a_obj_id)

References ilCopyWizardOptions\_getInstance(), and getInstanceByObjId().

Referenced by ilObjCourse\cloneDependencies().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ilLOSettings::create ( )

Definition at line 325 of file class.ilLOSettings.php.

325 : void
326 {
327 $query = 'INSERT INTO loc_settings ' .
328 '(obj_id, it_type,itest,qtest,it_start,qt_type,qt_start,reset_results,passed_obj_mode) VALUES ( ' .
329 $this->db->quote($this->getObjId(), 'integer') . ', ' .
330 $this->db->quote($this->getInitialTestType(), 'integer') . ', ' .
331 $this->db->quote($this->getInitialTest(), 'integer') . ', ' .
332 $this->db->quote($this->getQualifiedTest(), 'integer') . ', ' .
333 $this->db->quote($this->isInitialTestStart(), 'integer') . ', ' .
334 $this->db->quote($this->getQualifyingTestType(), 'integer') . ', ' .
335 $this->db->quote($this->isQualifyingTestStart(), 'integer') . ', ' .
336 $this->db->quote($this->isResetResultsEnabled(), 'integer') . ', ' .
337 $this->db->quote($this->getPassedObjectiveMode(), 'integer') . ' ' .
338 ') ';
339 $this->db->manipulate($query);
340 $this->entry_exists = true;
341 }

References getInitialTest(), getInitialTestType(), getObjId(), getPassedObjectiveMode(), getQualifiedTest(), getQualifyingTestType(), isInitialTestStart(), isQualifyingTestStart(), and isResetResultsEnabled().

Referenced by update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInitialTest()

ilLOSettings::getInitialTest ( )

Definition at line 300 of file class.ilLOSettings.php.

300 : int
301 {
302 return $this->initial_test;
303 }

References $initial_test.

Referenced by create(), getTestByType(), getTests(), purgeReferences(), toXml(), update(), and updateStartObjects().

+ Here is the caller graph for this function:

◆ getInitialTestType()

ilLOSettings::getInitialTestType ( )

◆ getInstanceByObjId()

static ilLOSettings::getInstanceByObjId ( int  $a_obj_id)
static

Definition at line 88 of file class.ilLOSettings.php.

88 : self
89 {
90 if (isset(self::$instances[$a_obj_id])) {
91 return self::$instances[$a_obj_id];
92 }
93 return self::$instances[$a_obj_id] = new ilLOSettings($a_obj_id);
94 }
Settings for LO courses.

Referenced by ilLOEditorGUI\__construct(), ilLOEditorStatus\__construct(), ilLOTestAssignments\__construct(), ilCourseObjectivesGUI\__construct(), ilLOTestQuestionAdapter\__construct(), ilCourseObjectivesTableGUI\__construct(), ilCourseObjectiveQuestionAssignmentTableGUI\__construct(), ilLOTestAssignmentTableGUI\__construct(), ilLOMemberTestResultTableGUI\__construct(), ilLOTestAssignmentForm\__construct(), ilTestLearningObjectivesStatusGUI\buildStatusItems(), cloneSettings(), ilLOEditorGUI\confirmDeleteTest(), ilLOEditorGUI\confirmDeleteTests(), ilLOEditorGUI\deleteTest(), ilLOEditorGUI\deleteTests(), ilLOEditorStatus\determineActiveSection(), ilLOUserResults\getCompletedObjectiveIds(), ilLOUserResults\getCourseResultsForUserPresentation(), ilLOEditorStatus\getHTML(), ilContainerObjectiveGUI\getMainContent(), ilLOUserResults\getObjectiveStatusForLP(), ilLOUserResults\getSummarizedObjectiveStatusForLP(), ilTrQuery\getUserObjectiveMatrix(), ilContainerObjectiveGUI\initRenderer(), ILIAS\Test\Results\Presentation\TitlesBuilder\initTestType(), ilLOXmlParser\parseSettings(), ILIAS\Containter\Content\ObjectiveRenderer\renderObjectives(), ilCourseObjectiveResult\reset(), ilLOEditorGUI\saveMultiTestAssignment(), ilLOEditorGUI\saveSettings(), ilLOEditorGUI\saveTest(), ilLOEditorGUI\setTabs(), ilContainerObjectiveGUI\showObjectives(), ILIAS\Containter\Content\ObjectiveRenderer\showObjectives(), ilLOEditorGUI\testOverview(), ilLOEditorGUI\testsOverview(), and ilLOXmlWriter\write().

+ Here is the caller graph for this function:

◆ getObjId()

ilLOSettings::getObjId ( )

Definition at line 250 of file class.ilLOSettings.php.

250 : int
251 {
252 return $this->container_id;
253 }

References $container_id.

Referenced by create(), read(), and update().

+ Here is the caller graph for this function:

◆ getPassedObjectiveMode()

ilLOSettings::getPassedObjectiveMode ( )

Definition at line 228 of file class.ilLOSettings.php.

228 : int
229 {
231 }

References $passed_objective_mode.

Referenced by create(), toXml(), and update().

+ Here is the caller graph for this function:

◆ getQualifiedTest()

ilLOSettings::getQualifiedTest ( )

Definition at line 310 of file class.ilLOSettings.php.

310 : int
311 {
313 }

References $qualified_test.

Referenced by create(), getTestByType(), getTests(), purgeReferences(), toXml(), update(), and updateStartObjects().

+ Here is the caller graph for this function:

◆ getQualifyingTestType()

ilLOSettings::getQualifyingTestType ( )

◆ getTestByType()

ilLOSettings::getTestByType ( int  $a_type)

Definition at line 265 of file class.ilLOSettings.php.

265 : int
266 {
267 switch ($a_type) {
269 return $this->getInitialTest();
270
272 return $this->getQualifiedTest();
273 }
274 return 0;
275 }

References getInitialTest(), getQualifiedTest(), TYPE_TEST_INITIAL, and TYPE_TEST_QUALIFIED.

Referenced by isRandomTestType(), ilLOEditorGUI\saveTest(), and ilLOEditorGUI\testOverview().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTests()

ilLOSettings::getTests ( )

Definition at line 277 of file class.ilLOSettings.php.

277 : array
278 {
279 $tests = array();
280 if ($this->getInitialTest()) {
281 $tests[] = $this->getInitialTest();
282 }
283 if ($this->getQualifiedTest()) {
284 $tests[] = $this->getQualifiedTest();
285 }
286 return $tests;
287 }

References getInitialTest(), and getQualifiedTest().

+ Here is the call graph for this function:

◆ getType()

ilLOSettings::getType ( )

Definition at line 260 of file class.ilLOSettings.php.

260 : int
261 {
262 return $this->type;
263 }

References $type.

◆ hasSeparateInitialTests()

ilLOSettings::hasSeparateInitialTests ( )

Check if separate initial test are configured.

Definition at line 139 of file class.ilLOSettings.php.

139 : bool
140 {
141 return $this->getInitialTestType() == self::TYPE_INITIAL_PLACEMENT_SELECTED || $this->getInitialTestType() == self::TYPE_INITIAL_QUALIFYING_SELECTED;
142 }
const TYPE_INITIAL_QUALIFYING_SELECTED

References getInitialTestType(), and TYPE_INITIAL_QUALIFYING_SELECTED.

+ Here is the call graph for this function:

◆ hasSeparateQualifiedTests()

ilLOSettings::hasSeparateQualifiedTests ( )

Check if separate qualified tests are configured.

Definition at line 147 of file class.ilLOSettings.php.

147 : bool
148 {
150 }
const TYPE_QUALIFYING_SELECTED

References getQualifyingTestType(), and TYPE_QUALIFYING_SELECTED.

+ Here is the call graph for this function:

◆ isGeneralInitialTestVisible()

ilLOSettings::isGeneralInitialTestVisible ( )

Definition at line 238 of file class.ilLOSettings.php.

238 : bool
239 {
240 return
241 $this->getInitialTestType() === self::TYPE_INITIAL_PLACEMENT_ALL ||
243 }
const TYPE_INITIAL_QUALIFYING_ALL

References getInitialTestType(), and TYPE_INITIAL_QUALIFYING_ALL.

+ Here is the call graph for this function:

◆ isGeneralQualifiedTestVisible()

ilLOSettings::isGeneralQualifiedTestVisible ( )

Definition at line 223 of file class.ilLOSettings.php.

223 : bool
224 {
226 }

References getQualifyingTestType(), and TYPE_QUALIFYING_ALL.

+ Here is the call graph for this function:

◆ isInitialTestQualifying()

ilLOSettings::isInitialTestQualifying ( )

Check if initial test is qualifying*.

Definition at line 155 of file class.ilLOSettings.php.

155 : bool
156 {
157 return $this->getInitialTestType() == self::TYPE_INITIAL_QUALIFYING_ALL || $this->getInitialTestType() == self::TYPE_INITIAL_QUALIFYING_SELECTED;
158 }

References getInitialTestType(), and TYPE_INITIAL_QUALIFYING_SELECTED.

+ Here is the call graph for this function:

◆ isInitialTestStart()

ilLOSettings::isInitialTestStart ( )

Definition at line 121 of file class.ilLOSettings.php.

121 : bool
122 {
123 return $this->it_start;
124 }

References $it_start.

Referenced by create(), toXml(), update(), updateStartObjects(), and worksWithStartObjects().

+ Here is the caller graph for this function:

◆ isObjectiveTest()

static ilLOSettings::isObjectiveTest ( int  $a_trst_ref_id)
static

Check if test ref_id is used in an objective course.

Definition at line 163 of file class.ilLOSettings.php.

163 : bool
164 {
165 global $DIC;
166
167 $ilDB = $DIC->database();
168 // Check for direct assignment
169 $query = 'SELECT obj_id FROM loc_settings ' .
170 'WHERE itest = ' . $ilDB->quote($a_trst_ref_id, 'integer') . ' ' .
171 'OR qtest = ' . $ilDB->quote($a_trst_ref_id, 'integer');
172 $res = $ilDB->query($query);
173 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
174 return $row->obj_id;
175 }
176 return (bool) ilLOTestAssignments::lookupContainerForTest($a_trst_ref_id);
177 }
static lookupContainerForTest(int $a_test_ref_id)
$res
Definition: ltiservices.php:69

References $DIC, $ilDB, $res, ilDBConstants\FETCHMODE_OBJECT, and ilLOTestAssignments\lookupContainerForTest().

Referenced by ilObjTestGUI\determineObjectiveOrientedContainer(), and ilObjTestListGUI\modifyTitleLink().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isQualifyingTestStart()

ilLOSettings::isQualifyingTestStart ( )

Definition at line 131 of file class.ilLOSettings.php.

131 : bool
132 {
133 return $this->qt_start;
134 }

References $qt_start.

Referenced by create(), ilLOEditorGUI\saveSettings(), toXml(), update(), updateStartObjects(), and worksWithStartObjects().

+ Here is the caller graph for this function:

◆ isRandomTestType()

ilLOSettings::isRandomTestType ( int  $a_type)

Definition at line 289 of file class.ilLOSettings.php.

289 : bool
290 {
291 $tst = $this->getTestByType($a_type);
293 }
getTestByType(int $a_type)
static _lookupRandomTest(int $obj_id)
static _lookupObjId(int $ref_id)

References ilObject\_lookupObjId(), ilObjTest\_lookupRandomTest(), and getTestByType().

+ Here is the call graph for this function:

◆ isResetResultsEnabled()

ilLOSettings::isResetResultsEnabled ( )

Definition at line 320 of file class.ilLOSettings.php.

320 : bool
321 {
323 }

References $reset_results.

Referenced by create(), toXml(), and update().

+ Here is the caller graph for this function:

◆ purgeReferences()

ilLOSettings::purgeReferences ( )
protected

Definition at line 457 of file class.ilLOSettings.php.

457 : void
458 {
459 if ($this->getInitialTest() > 0) {
461 if (!$obj instanceof ilObjTest) {
462 $this->setInitialTest(0);
463 $this->update();
464 }
465 }
466 if ($this->getQualifiedTest() > 0) {
468 if (!$obj instanceof ilObjTest) {
469 $this->setQualifiedTest(0);
470 $this->update();
471 }
472 }
473 }
setInitialTest(int $a_id)
setQualifiedTest(int $a_id)
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id

References getInitialTest(), ilObjectFactory\getInstanceByRefId(), getQualifiedTest(), setInitialTest(), setQualifiedTest(), and update().

Referenced by read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilLOSettings::read ( )
protected

Read.

Definition at line 430 of file class.ilLOSettings.php.

430 : void
431 {
432 $query = 'SELECT * FROM loc_settings ' .
433 'WHERE obj_id = ' . $this->db->quote($this->getObjId(), 'integer');
434 $res = $this->db->query($query);
435 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
436 $this->entry_exists = true;
437
438 $this->setInitialTestType((int) $row->it_type);
439 $this->setInitialTestAsStart((bool) $row->it_start);
440 $this->setQualifyingTestType((int) $row->qt_type);
441 $this->setQualifyingTestAsStart((bool) $row->qt_start);
442 $this->setInitialTest((int) $row->itest);
443 $this->setQualifiedTest((int) $row->qtest);
444 $this->resetResults((bool) $row->reset_results);
445 $this->setPassedObjectiveMode((int) $row->passed_obj_mode);
446 }
447
448 if ($this->tree->isDeleted($this->getInitialTest())) {
449 $this->setInitialTest(0);
450 }
451 if ($this->tree->isDeleted($this->getQualifiedTest())) {
452 $this->setQualifiedTest(0);
453 }
454 $this->purgeReferences();
455 }
setQualifyingTestAsStart(bool $a_type)
setQualifyingTestType(int $a_type)
resetResults(bool $a_status)
setInitialTestType(int $a_type)
setInitialTestAsStart(bool $a_type)
setPassedObjectiveMode(int $a_mode)

References $res, ilDBConstants\FETCHMODE_OBJECT, getObjId(), purgeReferences(), resetResults(), setInitialTest(), setInitialTestAsStart(), setInitialTestType(), setPassedObjectiveMode(), setQualifiedTest(), setQualifyingTestAsStart(), and setQualifyingTestType().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetResults()

ilLOSettings::resetResults ( bool  $a_status)

Definition at line 315 of file class.ilLOSettings.php.

315 : void
316 {
317 $this->reset_results = $a_status;
318 }

Referenced by read(), and ilLOEditorGUI\saveSettings().

+ Here is the caller graph for this function:

◆ setInitialTest()

ilLOSettings::setInitialTest ( int  $a_id)

Definition at line 295 of file class.ilLOSettings.php.

295 : void
296 {
297 $this->initial_test = $a_id;
298 }

Referenced by ilLOEditorGUI\deleteTest(), purgeReferences(), read(), and ilLOEditorGUI\updateTestAssignments().

+ Here is the caller graph for this function:

◆ setInitialTestAsStart()

ilLOSettings::setInitialTestAsStart ( bool  $a_type)

Definition at line 116 of file class.ilLOSettings.php.

116 : void
117 {
118 $this->it_start = $a_type;
119 }

Referenced by read(), and ilLOEditorGUI\saveSettings().

+ Here is the caller graph for this function:

◆ setInitialTestType()

ilLOSettings::setInitialTestType ( int  $a_type)

Definition at line 96 of file class.ilLOSettings.php.

96 : void
97 {
98 $this->it_type = $a_type;
99 }

Referenced by read(), and ilLOEditorGUI\saveSettings().

+ Here is the caller graph for this function:

◆ setPassedObjectiveMode()

ilLOSettings::setPassedObjectiveMode ( int  $a_mode)

Definition at line 233 of file class.ilLOSettings.php.

233 : void
234 {
235 $this->passed_objective_mode = $a_mode;
236 }

Referenced by read(), and ilLOEditorGUI\saveSettings().

+ Here is the caller graph for this function:

◆ setQualifiedTest()

ilLOSettings::setQualifiedTest ( int  $a_id)

Definition at line 305 of file class.ilLOSettings.php.

305 : void
306 {
307 $this->qualified_test = $a_id;
308 }

Referenced by ilLOEditorGUI\deleteTest(), purgeReferences(), read(), and ilLOEditorGUI\updateTestAssignments().

+ Here is the caller graph for this function:

◆ setQualifyingTestAsStart()

ilLOSettings::setQualifyingTestAsStart ( bool  $a_type)

Definition at line 126 of file class.ilLOSettings.php.

126 : void
127 {
128 $this->qt_start = $a_type;
129 }

Referenced by read(), and ilLOEditorGUI\saveSettings().

+ Here is the caller graph for this function:

◆ setQualifyingTestType()

ilLOSettings::setQualifyingTestType ( int  $a_type)

Definition at line 111 of file class.ilLOSettings.php.

111 : void
112 {
113 $this->qt_type = $a_type;
114 }

Referenced by read(), and ilLOEditorGUI\saveSettings().

+ Here is the caller graph for this function:

◆ settingsExist()

ilLOSettings::settingsExist ( )

Definition at line 245 of file class.ilLOSettings.php.

245 : bool
246 {
247 return $this->entry_exists;
248 }

References $entry_exists.

◆ setType()

ilLOSettings::setType ( int  $a_type)

Definition at line 255 of file class.ilLOSettings.php.

255 : void
256 {
257 $this->type = $a_type;
258 }

◆ toXml()

ilLOSettings::toXml ( ilXmlWriter  $writer)

Definition at line 476 of file class.ilLOSettings.php.

476 : void
477 {
478 $writer->xmlElement(
479 'Settings',
480 array(
481 'initialTestType' => $this->getInitialTestType(),
482 'initialTestStart' => (int) $this->isInitialTestStart(),
483 'qualifyingTestType' => $this->getQualifyingTestType(),
484 'qualifyingTestStart' => (int) $this->isQualifyingTestStart(),
485 'resetResults' => (int) $this->isResetResultsEnabled(),
486 'passedObjectivesMode' => $this->getPassedObjectiveMode(),
487 'iTest' => $this->getInitialTest(),
488 'qTest' => $this->getQualifiedTest()
489 )
490 );
491 }
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)

References getInitialTest(), getInitialTestType(), getPassedObjectiveMode(), getQualifiedTest(), getQualifyingTestType(), isInitialTestStart(), isQualifyingTestStart(), isResetResultsEnabled(), and ilXmlWriter\xmlElement().

+ Here is the call graph for this function:

◆ update()

ilLOSettings::update ( )

Definition at line 343 of file class.ilLOSettings.php.

343 : void
344 {
345 if (!$this->entry_exists) {
346 $this->create();
347 return;
348 }
349
350 $query = 'UPDATE loc_settings ' . ' ' .
351 'SET it_type = ' . $this->db->quote($this->getInitialTestType(), 'integer') . ', ' .
352 'itest = ' . $this->db->quote($this->getInitialTest(), 'integer') . ', ' .
353 'qtest = ' . $this->db->quote($this->getQualifiedTest(), 'integer') . ', ' .
354 'it_start = ' . $this->db->quote($this->isInitialTestStart(), 'integer') . ', ' .
355 'qt_type = ' . $this->db->quote($this->getQualifyingTestType(), 'integer') . ', ' .
356 'qt_start = ' . $this->db->quote($this->isQualifyingTestStart(), 'integer') . ', ' .
357 'reset_results = ' . $this->db->quote($this->isResetResultsEnabled(), 'integer') . ', ' .
358 'passed_obj_mode = ' . $this->db->quote($this->getPassedObjectiveMode(), 'integer') . ' ' .
359 'WHERE obj_id = ' . $this->db->quote($this->getObjId(), 'integer');
360
361 $this->db->manipulate($query);
362 }

References create(), getInitialTest(), getInitialTestType(), getObjId(), getPassedObjectiveMode(), getQualifiedTest(), getQualifyingTestType(), isInitialTestStart(), isQualifyingTestStart(), and isResetResultsEnabled().

Referenced by ilLOEditorGUI\deleteTest(), purgeReferences(), ilLOEditorGUI\saveSettings(), and ilLOEditorGUI\updateTestAssignments().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateStartObjects()

ilLOSettings::updateStartObjects ( ilContainerStartObjects  $start)

Update start objects Depends on course objective settings.

Parameters
ilContainerStartObjects

Definition at line 369 of file class.ilLOSettings.php.

369 : void
370 {
371 if ($this->getInitialTestType() != self::TYPE_INITIAL_NONE) {
372 if ($start->exists($this->getQualifiedTest())) {
373 $start->deleteItem($this->getQualifiedTest());
374 }
375 }
376
377 switch ($this->getInitialTestType()) {
380
381 if ($this->isInitialTestStart()) {
382 if (!$start->exists($this->getInitialTest())) {
383 $start->add($this->getInitialTest());
384 }
385 } else {
386 if ($start->exists($this->getInitialTest())) {
387 $start->deleteItem($this->getInitialTest());
388 }
389 }
390 break;
391
393
394 if ($start->exists($this->getInitialTest())) {
395 $start->deleteItem($this->getInitialTest());
396 }
397 break;
398
399 default:
400
401 $this->logger->debug('Type initial default');
402 if ($start->exists($this->getInitialTest())) {
403 $this->logger->debug('Old start object exists. Trying to delete');
404 $start->deleteItem($this->getInitialTest());
405 }
406 break;
407 }
408
409 switch ($this->getQualifyingTestType()) {
411
412 if ($this->isQualifyingTestStart()) {
413 if (!$start->exists($this->getQualifiedTest())) {
414 $start->add($this->getQualifiedTest());
415 }
416 }
417 break;
418
419 default:
420 if ($start->exists($this->getQualifiedTest())) {
421 $start->deleteItem($this->getQualifiedTest());
422 }
423 break;
424 }
425 }
const TYPE_INITIAL_PLACEMENT_ALL

References ilContainerStartObjects\add(), ilContainerStartObjects\deleteItem(), ilContainerStartObjects\exists(), getInitialTest(), getInitialTestType(), getQualifiedTest(), getQualifyingTestType(), isInitialTestStart(), isQualifyingTestStart(), ILIAS\Repository\logger(), TYPE_INITIAL_NONE, TYPE_INITIAL_PLACEMENT_ALL, TYPE_INITIAL_QUALIFYING_ALL, and TYPE_QUALIFYING_ALL.

+ Here is the call graph for this function:

◆ worksWithInitialTest()

ilLOSettings::worksWithInitialTest ( )

Check if the loc is configured for initial tests.

Definition at line 218 of file class.ilLOSettings.php.

218 : bool
219 {
221 }

References getInitialTestType(), and TYPE_INITIAL_NONE.

Referenced by ilLOEditorGUI\setTabs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ worksWithStartObjects()

ilLOSettings::worksWithStartObjects ( )

Check if start objects are enabled.

Definition at line 210 of file class.ilLOSettings.php.

210 : bool
211 {
212 return $this->isInitialTestStart() || $this->isQualifyingTestStart();
213 }

References isInitialTestStart(), and isQualifyingTestStart().

Referenced by ilLOEditorGUI\setTabs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $container_id

int ilLOSettings::$container_id = 0
private

Definition at line 64 of file class.ilLOSettings.php.

Referenced by getObjId().

◆ $db

ilDBInterface ilLOSettings::$db
protected

Definition at line 74 of file class.ilLOSettings.php.

◆ $entry_exists

bool ilLOSettings::$entry_exists = false
private

Definition at line 71 of file class.ilLOSettings.php.

Referenced by settingsExist().

◆ $initial_test

int ilLOSettings::$initial_test = 0
private

Definition at line 66 of file class.ilLOSettings.php.

Referenced by getInitialTest().

◆ $instances

array ilLOSettings::$instances = []
staticprivate

Definition at line 57 of file class.ilLOSettings.php.

◆ $it_start

bool ilLOSettings::$it_start = false
private

Definition at line 62 of file class.ilLOSettings.php.

Referenced by isInitialTestStart().

◆ $it_type

int ilLOSettings::$it_type = self::TYPE_INITIAL_PLACEMENT_ALL
private

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

Referenced by getInitialTestType().

◆ $logger

ilLogger ilLOSettings::$logger
private

Definition at line 73 of file class.ilLOSettings.php.

◆ $passed_objective_mode

int ilLOSettings::$passed_objective_mode = self::HIDE_PASSED_OBJECTIVE_QST
private

Definition at line 69 of file class.ilLOSettings.php.

Referenced by getPassedObjectiveMode().

◆ $qt_start

bool ilLOSettings::$qt_start = false
private

Definition at line 63 of file class.ilLOSettings.php.

Referenced by isQualifyingTestStart().

◆ $qt_type

int ilLOSettings::$qt_type = self::TYPE_QUALIFYING_ALL
private

Definition at line 60 of file class.ilLOSettings.php.

Referenced by getQualifyingTestType().

◆ $qualified_test

int ilLOSettings::$qualified_test = 0
private

Definition at line 67 of file class.ilLOSettings.php.

Referenced by getQualifiedTest().

◆ $reset_results

bool ilLOSettings::$reset_results = true
private

Definition at line 68 of file class.ilLOSettings.php.

Referenced by isResetResultsEnabled().

◆ $tree

ilTree ilLOSettings::$tree
protected

Definition at line 75 of file class.ilLOSettings.php.

◆ $type

int ilLOSettings::$type = 0
private

Definition at line 65 of file class.ilLOSettings.php.

Referenced by getType().

◆ HIDE_PASSED_OBJECTIVE_QST

const ilLOSettings::HIDE_PASSED_OBJECTIVE_QST = 1

◆ LOC_INITIAL_ALL

const ilLOSettings::LOC_INITIAL_ALL = 1

Definition at line 49 of file class.ilLOSettings.php.

◆ LOC_INITIAL_SEL

const ilLOSettings::LOC_INITIAL_SEL = 2

Definition at line 50 of file class.ilLOSettings.php.

◆ LOC_PRACTISE

const ilLOSettings::LOC_PRACTISE = 4

Definition at line 52 of file class.ilLOSettings.php.

◆ LOC_QUALIFIED

const ilLOSettings::LOC_QUALIFIED = 3

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

◆ MARK_PASSED_OBJECTIVE_QST

const ilLOSettings::MARK_PASSED_OBJECTIVE_QST = 2

◆ QST_PASSED_FLAG

const ilLOSettings::QST_PASSED_FLAG = 1

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

◆ QST_PASSED_HIDE

const ilLOSettings::QST_PASSED_HIDE = 2

Definition at line 29 of file class.ilLOSettings.php.

◆ QT_VISIBLE_ALL

const ilLOSettings::QT_VISIBLE_ALL = 0

Definition at line 46 of file class.ilLOSettings.php.

◆ QT_VISIBLE_OBJECTIVE

const ilLOSettings::QT_VISIBLE_OBJECTIVE = 1

Definition at line 47 of file class.ilLOSettings.php.

◆ TYPE_INITIAL_NONE

◆ TYPE_INITIAL_PLACEMENT_ALL

const ilLOSettings::TYPE_INITIAL_PLACEMENT_ALL = 1

◆ TYPE_INITIAL_PLACEMENT_SELECTED

const ilLOSettings::TYPE_INITIAL_PLACEMENT_SELECTED = 2

◆ TYPE_INITIAL_QUALIFYING_ALL

◆ TYPE_INITIAL_QUALIFYING_SELECTED

const ilLOSettings::TYPE_INITIAL_QUALIFYING_SELECTED = 4

◆ TYPE_QUALIFYING_ALL

◆ TYPE_QUALIFYING_SELECTED

◆ TYPE_TEST_INITIAL

const ilLOSettings::TYPE_TEST_INITIAL = 1

Definition at line 43 of file class.ilLOSettings.php.

Referenced by ilContainerObjectiveGUI\addItemDetails(), ilContainerObjectiveGUI\buildObjectiveMap(), ilLOEditorGUI\confirmDeleteTest(), ilLOEditorGUI\confirmDeleteTests(), ilLOEditorGUI\deleteTest(), ilLOEditorGUI\deleteTests(), ILIAS\Container\Content\ItemBlock\ItemBlockSequenceGenerator\getBlocksForPart(), ilLOEditorStatus\getFirstFailedStep(), ilLOEditorStatus\getHTML(), ilLOEditorStatus\getInitialTestStatus(), ilLOTestAssignments\getTestByObjective(), getTestByType(), ilLOTestAssignments\getTypeByTest(), ilTestLearningObjectivesStatusGUI\getUsersObjectivesStatus(), ilCourseObjective\ilClone(), ilLOTestAssignmentForm\initForm(), ilCourseObjectivesGUI\initFormRandom(), ilLOTestAssignmentTableGUI\initTitle(), ilCourseObjectivesGUI\initWizard(), ilLOTestQuestionAdapter\isQualifiedStartRun(), ilLOTestQuestionAdapter\lookupRelevantObjectiveIdsForTest(), ilLOMemberTestResultTableGUI\parse(), ilCourseObjectivesTableGUI\parse(), ilContainerObjectiveGUI\parseLOUserResults(), ILIAS\Containter\Content\ObjectiveRenderer\parseLOUserResults(), ilCourseObjectiveResult\reset(), ilTestLP\resetCustomLPDataForUserIds(), ilCourseObjectivesGUI\saveRandom(), ilCourseObjectivesGUI\selfAssessmentAssignment(), ilLOEditorGUI\setTabs(), ilContainerObjectiveGUI\showObjectives(), ILIAS\Containter\Content\ObjectiveRenderer\showObjectives(), ilCourseObjectivesGUI\showRandomTestAssignment(), ilLOEditorGUI\testAssignment(), ilLOEditorGUI\testOverview(), ilLOEditorGUI\testOverviewInitial(), ilLOEditorGUI\testSettings(), ilLOEditorGUI\testsOverview(), ilLOEditorGUI\testsOverviewInitial(), ilLOTestQuestionAdapter\updateRandomQuestions(), and ilLOEditorGUI\updateTestAssignments().

◆ TYPE_TEST_QUALIFIED

const ilLOSettings::TYPE_TEST_QUALIFIED = 2

Definition at line 44 of file class.ilLOSettings.php.

Referenced by ilContainerObjectiveGUI\buildObjectiveMap(), ilLOEditorGUI\confirmDeleteTest(), ilLOEditorGUI\confirmDeleteTests(), ilLOEditorGUI\deleteTest(), ilLOEditorGUI\deleteTests(), ilCourseObjectivesGUI\finalTestAssignment(), ILIAS\Container\Content\ItemBlock\ItemBlockSequenceGenerator\getBlocksForPart(), ilLOEditorStatus\getFirstFailedStep(), ilLOEditorStatus\getHTML(), ilLOEditorStatus\getQualifiedTestStatus(), ilLOTestAssignments\getTestByObjective(), getTestByType(), ilLOTestAssignments\getTypeByTest(), ilTestLearningObjectivesStatusGUI\getUsersObjectivesStatus(), ilCourseObjective\ilClone(), ilLOTestAssignmentForm\initForm(), ilLOTestAssignmentTableGUI\initTitle(), ilCourseObjectivesGUI\initWizard(), ilObjCourseAccess\isObjectiveResultRangeAchieved(), ilLOTestQuestionAdapter\lookupRelevantObjectiveIdsForTest(), ilLOMemberTestResultTableGUI\parse(), ilCourseObjectivesTableGUI\parse(), ilContainerObjectiveGUI\parseLOUserResults(), ILIAS\Containter\Content\ObjectiveRenderer\parseLOUserResults(), ilCourseObjectiveResult\reset(), ilTestLP\resetCustomLPDataForUserIds(), ilCourseObjectivesGUI\saveRandom(), ilLOEditorGUI\setTabs(), ilLOEditorGUI\testAssignment(), ilLOEditorGUI\testOverview(), ilLOEditorGUI\testOverviewQualified(), ilLOEditorGUI\testSettings(), ilLOEditorGUI\testsOverview(), ilLOEditorGUI\testsOverviewQualified(), ilLOTestQuestionAdapter\updateRandomQuestions(), and ilLOEditorGUI\updateTestAssignments().

◆ TYPE_TEST_UNDEFINED


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