ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
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 26 of file class.ilLOSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilLOSettings::__construct ( int  $a_cont_id)
protected

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

79 {
80 global $DIC;
81
82 $this->logger = $DIC->logger()->crs();
83 $this->db = $DIC->database();
84 $this->tree = $DIC->repositoryTree();
85 $this->container_id = $a_cont_id;
86 $this->read();
87 }
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 180 of file class.ilLOSettings.php.

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

References ILIAS\UI\Implementation\Component\Input\Field\$options, 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 326 of file class.ilLOSettings.php.

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

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 301 of file class.ilLOSettings.php.

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

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 89 of file class.ilLOSettings.php.

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

Referenced by ilLOEditorGUI\__construct(), ilLOEditorStatus\__construct(), ilLOTestAssignments\__construct(), ilCourseObjectivesGUI\__construct(), ilLOTestQuestionAdapter\__construct(), ilCourseObjectivesTableGUI\__construct(), ilCourseObjectiveQuestionAssignmentTableGUI\__construct(), ilLOMemberTestResultTableGUI\__construct(), ilLOTestAssignmentForm\__construct(), ilLOTestAssignmentTableGUI\__construct(), ilTestLearningObjectivesStatusGUI\buildStatusItems(), cloneSettings(), ilLOTestAssignmentTableGUI\deleteTest(), 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 251 of file class.ilLOSettings.php.

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

References $container_id.

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

+ Here is the caller graph for this function:

◆ getPassedObjectiveMode()

ilLOSettings::getPassedObjectiveMode ( )

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

229 : int
230 {
232 }

References $passed_objective_mode.

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

+ Here is the caller graph for this function:

◆ getQualifiedTest()

ilLOSettings::getQualifiedTest ( )

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

311 : int
312 {
314 }

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 266 of file class.ilLOSettings.php.

266 : int
267 {
268 switch ($a_type) {
270 return $this->getInitialTest();
271
273 return $this->getQualifiedTest();
274 }
275 return 0;
276 }

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 278 of file class.ilLOSettings.php.

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

References getInitialTest(), and getQualifiedTest().

+ Here is the call graph for this function:

◆ getType()

ilLOSettings::getType ( )

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

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

References $type.

◆ hasSeparateInitialTests()

ilLOSettings::hasSeparateInitialTests ( )

Check if separate initial test are configured.

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

140 : bool
141 {
142 return $this->getInitialTestType() == self::TYPE_INITIAL_PLACEMENT_SELECTED || $this->getInitialTestType() == self::TYPE_INITIAL_QUALIFYING_SELECTED;
143 }
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 148 of file class.ilLOSettings.php.

148 : bool
149 {
151 }
const TYPE_QUALIFYING_SELECTED

References getQualifyingTestType(), and TYPE_QUALIFYING_SELECTED.

+ Here is the call graph for this function:

◆ isGeneralInitialTestVisible()

ilLOSettings::isGeneralInitialTestVisible ( )

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

239 : bool
240 {
241 return
242 $this->getInitialTestType() === self::TYPE_INITIAL_PLACEMENT_ALL ||
244 }
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 224 of file class.ilLOSettings.php.

224 : bool
225 {
227 }

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 156 of file class.ilLOSettings.php.

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

References getInitialTestType(), and TYPE_INITIAL_QUALIFYING_SELECTED.

+ Here is the call graph for this function:

◆ isInitialTestStart()

ilLOSettings::isInitialTestStart ( )

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

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

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 164 of file class.ilLOSettings.php.

164 : bool
165 {
166 global $DIC;
167
168 $ilDB = $DIC->database();
169 // Check for direct assignment
170 $query = 'SELECT obj_id FROM loc_settings ' .
171 'WHERE itest = ' . $ilDB->quote($a_trst_ref_id, 'integer') . ' ' .
172 'OR qtest = ' . $ilDB->quote($a_trst_ref_id, 'integer');
173 $res = $ilDB->query($query);
174 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
175 return $row->obj_id;
176 }
177 return (bool) ilLOTestAssignments::lookupContainerForTest($a_trst_ref_id);
178 }
const FETCHMODE_OBJECT
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 132 of file class.ilLOSettings.php.

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

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 290 of file class.ilLOSettings.php.

290 : bool
291 {
292 $tst = $this->getTestByType($a_type);
294 }
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 321 of file class.ilLOSettings.php.

321 : bool
322 {
324 }

References $reset_results.

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

+ Here is the caller graph for this function:

◆ purgeReferences()

ilLOSettings::purgeReferences ( )
protected

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

458 : void
459 {
460 if ($this->getInitialTest() > 0) {
462 if (!$obj instanceof ilObjTest) {
463 $this->setInitialTest(0);
464 $this->update();
465 }
466 }
467 if ($this->getQualifiedTest() > 0) {
469 if (!$obj instanceof ilObjTest) {
470 $this->setQualifiedTest(0);
471 $this->update();
472 }
473 }
474 }
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 431 of file class.ilLOSettings.php.

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

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

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

+ Here is the caller graph for this function:

◆ setInitialTest()

ilLOSettings::setInitialTest ( int  $a_id)

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

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

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

+ Here is the caller graph for this function:

◆ setInitialTestAsStart()

ilLOSettings::setInitialTestAsStart ( bool  $a_type)

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

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

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

+ Here is the caller graph for this function:

◆ setInitialTestType()

ilLOSettings::setInitialTestType ( int  $a_type)

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

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

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

+ Here is the caller graph for this function:

◆ setPassedObjectiveMode()

ilLOSettings::setPassedObjectiveMode ( int  $a_mode)

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

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

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

+ Here is the caller graph for this function:

◆ setQualifiedTest()

ilLOSettings::setQualifiedTest ( int  $a_id)

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

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

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

+ Here is the caller graph for this function:

◆ setQualifyingTestAsStart()

ilLOSettings::setQualifyingTestAsStart ( bool  $a_type)

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

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

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

+ Here is the caller graph for this function:

◆ setQualifyingTestType()

ilLOSettings::setQualifyingTestType ( int  $a_type)

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

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

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

+ Here is the caller graph for this function:

◆ settingsExist()

ilLOSettings::settingsExist ( )

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

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

References $entry_exists.

◆ setType()

ilLOSettings::setType ( int  $a_type)

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

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

◆ toXml()

ilLOSettings::toXml ( ilXmlWriter  $writer)

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

477 : void
478 {
479 $writer->xmlElement(
480 'Settings',
481 array(
482 'initialTestType' => $this->getInitialTestType(),
483 'initialTestStart' => (int) $this->isInitialTestStart(),
484 'qualifyingTestType' => $this->getQualifyingTestType(),
485 'qualifyingTestStart' => (int) $this->isQualifyingTestStart(),
486 'resetResults' => (int) $this->isResetResultsEnabled(),
487 'passedObjectivesMode' => $this->getPassedObjectiveMode(),
488 'iTest' => $this->getInitialTest(),
489 'qTest' => $this->getQualifiedTest()
490 )
491 );
492 }
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 344 of file class.ilLOSettings.php.

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

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

Referenced by ilLOTestAssignmentTableGUI\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 370 of file class.ilLOSettings.php.

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

219 : bool
220 {
222 }

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 211 of file class.ilLOSettings.php.

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

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 65 of file class.ilLOSettings.php.

Referenced by getObjId().

◆ $db

ilDBInterface ilLOSettings::$db
protected

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

◆ $entry_exists

bool ilLOSettings::$entry_exists = false
private

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

Referenced by settingsExist().

◆ $initial_test

int ilLOSettings::$initial_test = 0
private

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

Referenced by getInitialTest().

◆ $instances

array ilLOSettings::$instances = []
staticprivate

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

◆ $it_start

bool ilLOSettings::$it_start = false
private

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

Referenced by isInitialTestStart().

◆ $it_type

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

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

Referenced by getInitialTestType().

◆ $logger

ilLogger ilLOSettings::$logger
private

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

◆ $passed_objective_mode

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

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

Referenced by getPassedObjectiveMode().

◆ $qt_start

bool ilLOSettings::$qt_start = false
private

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

Referenced by isQualifyingTestStart().

◆ $qt_type

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

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

Referenced by getQualifyingTestType().

◆ $qualified_test

int ilLOSettings::$qualified_test = 0
private

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

Referenced by getQualifiedTest().

◆ $reset_results

bool ilLOSettings::$reset_results = true
private

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

Referenced by isResetResultsEnabled().

◆ $tree

ilTree ilLOSettings::$tree
protected

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

◆ $type

int ilLOSettings::$type = 0
private

Definition at line 66 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 50 of file class.ilLOSettings.php.

◆ LOC_INITIAL_SEL

const ilLOSettings::LOC_INITIAL_SEL = 2

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

◆ LOC_PRACTISE

const ilLOSettings::LOC_PRACTISE = 4

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

◆ LOC_QUALIFIED

const ilLOSettings::LOC_QUALIFIED = 3

Definition at line 52 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 29 of file class.ilLOSettings.php.

◆ QST_PASSED_HIDE

const ilLOSettings::QST_PASSED_HIDE = 2

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

◆ QT_VISIBLE_ALL

const ilLOSettings::QT_VISIBLE_ALL = 0

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

◆ QT_VISIBLE_OBJECTIVE

const ilLOSettings::QT_VISIBLE_OBJECTIVE = 1

Definition at line 48 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 44 of file class.ilLOSettings.php.

Referenced by ilContainerObjectiveGUI\addItemDetails(), ilContainerObjectiveGUI\buildObjectiveMap(), ilLOTestAssignmentTableGUI\deleteTest(), ILIAS\Container\Content\ItemBlock\ItemBlockSequenceGenerator\getBlocksForPart(), ilLOEditorStatus\getFirstFailedStep(), ilLOEditorStatus\getHTML(), ilLOEditorStatus\getInitialTestStatus(), ilLOTestAssignments\getTestByObjective(), getTestByType(), ilLOTestAssignmentTableGUI\getTitleLangVar(), ilLOTestAssignments\getTypeByTest(), ilTestLearningObjectivesStatusGUI\getUsersObjectivesStatus(), ilCourseObjective\ilClone(), ilLOTestAssignmentForm\initForm(), ilCourseObjectivesGUI\initFormRandom(), 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

◆ TYPE_TEST_UNDEFINED


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