ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilLOSettings Class Reference

Settings for LO courses. More...

+ Collaboration diagram for ilLOSettings:

Public Member Functions

 setInitialTestType ($a_type)
 Set Initial test type. More...
 
 getInitialTestType ()
 Get initial test type. More...
 
 getQualifyingTestType ()
 Get qualifying test type. More...
 
 setQualifyingTestType ($a_type)
 Set qualifying test type. More...
 
 setInitialTestAsStart ($a_type)
 
 isInitialTestStart ()
 Get initial test start. More...
 
 setQualifyingTestAsStart ($a_type)
 Set qt as start object. More...
 
 isQualifyingTestStart ()
 Is qt start object. More...
 
 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 ()
 Check if qualified test for all objectives is visible. More...
 
 setGeneralQualifiedTestVisibility ($a_stat)
 
 isQualifiedTestPerObjectiveVisible ()
 
 setQualifiedTestPerObjectiveVisibility ($a_stat)
 
 getPassedObjectiveMode ()
 
 setPassedObjectiveMode ($a_mode)
 
 isGeneralInitialTestVisible ()
 Check if initial test for all objectives is visible. More...
 
 settingsExist ()
 
 getObjId ()
 
 setType ($a_type)
 
 getType ()
 
 getTestByType ($a_type)
 
 getTests ()
 Get assigned tests. More...
 
 isRandomTestType ($a_type)
 Check if test is of type random test. More...
 
 setInitialTest ($a_id)
 set initial test id More...
 
 getInitialTest ()
 get initial test More...
 
 setQualifiedTest ($a_id)
 set qualified test More...
 
 getQualifiedTest ()
 get qualified test More...
 
 resetResults ($a_status)
 reset results More...
 
 isResetResultsEnabled ()
 check if reset result is enabled More...
 
 create ()
 Create new entry. More...
 
 update ()
 update settings @global type $ilDB More...
 
 updateStartObjects (ilContainerStartObjects $start)
 Update start objects Depends on course objective settings. More...
 
 toXml (ilXmlWriter $writer)
 export to xml More...
 

Static Public Member Functions

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

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 ($a_cont_id)
 Constructor. More...
 
 read ()
 Read. More...
 

Private Attributes

 $logger = null
 
 $it_type = self::TYPE_INITIAL_PLACEMENT_ALL
 
 $qt_type = self::TYPE_QUALIFYING_ALL
 
 $it_start = false
 
 $qt_start = false
 
 $container_id = 0
 
 $type = 0
 
 $initial_test = 0
 
 $qualified_test = 0
 
 $reset_results = true
 
 $passed_obj_mode = self::HIDE_PASSED_OBJECTIVE_QST
 
 $entry_exists = false
 

Static Private Attributes

static $instances = array()
 

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

Constructor & Destructor Documentation

◆ __construct()

ilLOSettings::__construct (   $a_cont_id)
protected

Constructor.

Parameters
int$a_cont_id

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

77 {
78 $this->logger = $GLOBALS['DIC']->logger()->crs();
79
80 $this->container_id = $a_cont_id;
81 $this->read();
82 }
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.

References $GLOBALS, and read().

+ Here is the call graph for this function:

Member Function Documentation

◆ cloneSettings()

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

Clone settings.

Parameters
type$a_copy_id
type$a_container_id
type$a_new_container_id

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

223 {
224 include_once './Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
226 $mappings = $options->getMappings();
227
228 $settings = self::getInstanceByObjId($a_container_id);
229 $new_settings = self::getInstanceByObjId($a_new_container_id);
230
231 $new_settings->setType($settings->getType());
232 $new_settings->setInitialTestType($settings->getInitialTestType());
233 $new_settings->setQualifyingTestType($settings->getQualifyingTestType());
234 $new_settings->resetResults($settings->isResetResultsEnabled());
235 $new_settings->setPassedObjectiveMode($settings->getPassedObjectiveMode());
236
237 if ($settings->getInitialTest() and array_key_exists($settings->getInitialTest(), $mappings)) {
238 $new_settings->setInitialTest($mappings[$settings->getInitialTest()]);
239 $new_settings->setInitialTestAsStart($new_settings->isInitialTestStart());
240 }
241
242 if ($settings->getQualifiedTest() and array_key_exists($settings->getQualifiedTest(), $mappings)) {
243 $new_settings->setQualifiedTest($mappings[$settings->getQualifiedTest()]);
244 $new_settings->setQualifyingTestAsStart($settings->isQualifyingTestStart());
245 }
246
247 // update calls create in case of no entry exists.
248 $new_settings->update();
249 }
static _getInstance($a_copy_id)
Get instance of copy wizard options.
static getInstanceByObjId($a_obj_id)
get singleton instance

References PHPMailer\PHPMailer\$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 ( )

Create new entry.

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

448 {
449 global $DIC;
450
451 $ilDB = $DIC['ilDB'];
452
453 $query = 'INSERT INTO loc_settings ' .
454 '(obj_id, it_type,itest,qtest,it_start,qt_type,qt_start,reset_results,passed_obj_mode) VALUES ( ' .
455 $ilDB->quote($this->getObjId(), 'integer') . ', ' .
456 $ilDB->quote($this->getInitialTestType(), 'integer') . ', ' .
457 $ilDB->quote($this->getInitialTest(), 'integer') . ', ' .
458 $ilDB->quote($this->getQualifiedTest(), 'integer') . ', ' .
459 $ilDB->quote($this->isInitialTestStart(), 'integer') . ', ' .
460 $ilDB->quote($this->getQualifyingTestType(), 'integer') . ', ' .
461 $ilDB->quote($this->isQualifyingTestStart(), 'integer') . ', ' .
462 $ilDB->quote($this->isResetResultsEnabled(), 'integer') . ', ' .
463 $ilDB->quote($this->getPassedObjectiveMode(), 'integer') . ' ' .
464 ') ';
465 $ilDB->manipulate($query);
466
467 $this->entry_exists = true;
468 }
getInitialTestType()
Get initial test type.
isInitialTestStart()
Get initial test start.
getInitialTest()
get initial test
isResetResultsEnabled()
check if reset result is enabled
isQualifyingTestStart()
Is qt start object.
getQualifiedTest()
get qualified test
getQualifyingTestType()
Get qualifying test type.
$query
global $DIC
Definition: saml.php:7
global $ilDB

References $DIC, $ilDB, $query, 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 ( )

get initial test

Returns
type
Todo:
refactor

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

402 {
403 return $this->initial_test;
404 }

References $initial_test.

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

+ Here is the caller graph for this function:

◆ getInitialTestType()

ilLOSettings::getInitialTestType ( )

Get initial test type.

Returns
type

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

111 {
112 return $this->it_type;
113 }

References $it_type.

Referenced by create(), hasSeparateInitialTests(), isGeneralInitialTestVisible(), isInitialTestQualifying(), toXml(), update(), updateStartObjects(), and worksWithInitialTest().

+ Here is the caller graph for this function:

◆ getInstanceByObjId()

static ilLOSettings::getInstanceByObjId (   $a_obj_id)
static

get singleton instance

Parameters
int$a_obj_id
Returns
ilLOSettings

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

90 {
91 if (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 ilLOTestAssignments\__construct(), ilCourseObjectivesGUI\__construct(), ilLOEditorGUI\__construct(), ilCourseObjectivesTableGUI\__construct(), ilCourseObjectiveQuestionAssignmentTableGUI\__construct(), ilLOTestAssignmentTableGUI\__construct(), ilLOMemberTestResultTableGUI\__construct(), ilLOTestQuestionAdapter\__construct(), ilLOTestAssignmentForm\__construct(), ilLOEditorStatus\__construct(), ilContainerObjectiveGUI\buildObjectiveProgressBar(), cloneSettings(), ilLOEditorGUI\confirmDeleteTest(), ilLOEditorGUI\confirmDeleteTests(), ilLOEditorGUI\deleteTest(), ilLOEditorGUI\deleteTests(), ilLOUserResults\getCompletedObjectiveIds(), ilLOUserResults\getCourseResultsForUserPresentation(), ilLOEditorStatus\getHTML(), ilContainerObjectiveGUI\getMainContent(), ilContainerObjectiveGUI\getObjectiveResultSummary(), ilLOUserResults\getObjectiveStatusForLP(), ilLOUserResults\getSummarizedObjectiveStatusForLP(), ilTrQuery\getUserObjectiveMatrix(), ilTestResultHeaderLabelBuilder\initTestType(), ilLOUtils\isCompleted(), ilLOUtils\lookupObjectiveRequiredPercentage(), ilLOXmlParser\parseSettings(), ilPortfolioPageGUI\renderMyCourses(), ilTestLearningObjectivesStatusGUI\renderStatus(), ilCourseObjectiveResult\reset(), ilTestLP\resetCustomLPDataForUserIds(), ilLOEditorGUI\saveMultiTestAssignment(), ilLOEditorGUI\saveSettings(), ilLOEditorGUI\saveTest(), ilLOEditorGUI\setTabs(), ilContainerObjectiveGUI\showObjectives(), ilLOEditorGUI\testOverview(), ilLOEditorGUI\testsOverview(), and ilLOXmlWriter\write().

+ Here is the caller graph for this function:

◆ getObjId()

ilLOSettings::getObjId ( )

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

325 {
326 return $this->container_id;
327 }

References $container_id.

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

+ Here is the caller graph for this function:

◆ getPassedObjectiveMode()

ilLOSettings::getPassedObjectiveMode ( )

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

297 {
298 return $this->passed_objective_mode;
299 }

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

+ Here is the caller graph for this function:

◆ getQualifiedTest()

ilLOSettings::getQualifiedTest ( )

get qualified test

Returns
type
Todo:
refactor

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

422 {
424 }

References $qualified_test.

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

+ Here is the caller graph for this function:

◆ getQualifyingTestType()

ilLOSettings::getQualifyingTestType ( )

Get qualifying test type.

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

119 {
120 return $this->qt_type;
121 }

References $qt_type.

Referenced by create(), hasSeparateQualifiedTests(), isGeneralQualifiedTestVisible(), isQualifiedTestPerObjectiveVisible(), toXml(), update(), and updateStartObjects().

+ Here is the caller graph for this function:

◆ getTestByType()

ilLOSettings::getTestByType (   $a_type)
Parameters
type$a_type
Returns
type
Todo:
refactor

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

346 {
347 switch ($a_type) {
349 return $this->getInitialTest();
350
352 return $this->getQualifiedTest();
353 }
354 }
$a_type
Definition: workflow.php:92

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

Referenced by isRandomTestType().

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

◆ getTests()

ilLOSettings::getTests ( )

Get assigned tests.

Returns
type
Todo:
refactor

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

362 {
363 $tests = array();
364 if ($this->getInitialTest()) {
365 $tests[] = $this->getInitialTest();
366 }
367 if ($this->getQualifiedTest()) {
368 $tests[] = $this->getQualifiedTest();
369 }
370 return $tests;
371 }
$tests
Definition: bench.php:104

References $tests, getInitialTest(), and getQualifiedTest().

+ Here is the call graph for this function:

◆ getType()

ilLOSettings::getType ( )

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

335 {
336 return $this->type;
337 }

References $type.

◆ hasSeparateInitialTests()

ilLOSettings::hasSeparateInitialTests ( )

Check if separate initial test are configured.

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

172 {
173 return $this->getInitialTestType() == self::TYPE_INITIAL_PLACEMENT_SELECTED || $this->getInitialTestType() == self::TYPE_INITIAL_QUALIFYING_SELECTED;
174 }
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 179 of file class.ilLOSettings.php.

180 {
182 }
const TYPE_QUALIFYING_SELECTED

References getQualifyingTestType(), and TYPE_QUALIFYING_SELECTED.

+ Here is the call graph for this function:

◆ isGeneralInitialTestVisible()

ilLOSettings::isGeneralInitialTestVisible ( )

Check if initial test for all objectives is visible.

Returns
bool

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

311 {
312 return $this->getInitialTestType() == self::TYPE_INITIAL_PLACEMENT_ALL || $this->getInitialTestType() == self::TYPE_INITIAL_QUALIFYING_ALL;
313 }
const TYPE_INITIAL_QUALIFYING_ALL

References getInitialTestType(), and TYPE_INITIAL_QUALIFYING_ALL.

+ Here is the call graph for this function:

◆ isGeneralQualifiedTestVisible()

ilLOSettings::isGeneralQualifiedTestVisible ( )

Check if qualified test for all objectives is visible.

Returns
type

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

273 {
275 }

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

188 {
189 return $this->getInitialTestType() == self::TYPE_INITIAL_QUALIFYING_ALL || $this->getInitialTestType() == self::TYPE_INITIAL_QUALIFYING_SELECTED;
190 }

References getInitialTestType(), and TYPE_INITIAL_QUALIFYING_SELECTED.

+ Here is the call graph for this function:

◆ isInitialTestStart()

ilLOSettings::isInitialTestStart ( )

Get initial test start.

Returns
type

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

146 {
147 return $this->it_start;
148 }

References $it_start.

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

+ Here is the caller graph for this function:

◆ isObjectiveTest()

static ilLOSettings::isObjectiveTest (   $a_trst_ref_id)
static

Check if test ref_id is used in an objective course.

Parameters
intref_id

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

197 {
198 global $DIC;
199
200 $ilDB = $DIC['ilDB'];
201
202
203 // Check for direct assignment
204 $query = 'SELECT obj_id FROM loc_settings ' .
205 'WHERE itest = ' . $ilDB->quote($a_trst_ref_id, 'integer') . ' ' .
206 'OR qtest = ' . $ilDB->quote($a_trst_ref_id, 'integer');
207 $res = $ilDB->query($query);
208 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
209 return $row->obj_id;
210 }
211
212 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
213 return ilLOTestAssignments::lookupContainerForTest($a_trst_ref_id);
214 }
static lookupContainerForTest($a_test_ref_id)
$row
foreach($_POST as $key=> $value) $res

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

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

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

◆ isQualifiedTestPerObjectiveVisible()

ilLOSettings::isQualifiedTestPerObjectiveVisible ( )

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

287 {
289 }

References getQualifyingTestType(), and TYPE_QUALIFYING_SELECTED.

+ Here is the call graph for this function:

◆ isQualifyingTestStart()

ilLOSettings::isQualifyingTestStart ( )

Is qt start object.

Returns
type

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

164 {
165 return $this->qt_start;
166 }

References $qt_start.

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

+ Here is the caller graph for this function:

◆ isRandomTestType()

ilLOSettings::isRandomTestType (   $a_type)

Check if test is of type random test.

Parameters
type$a_type
Returns
type
Todo:
refactor

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

380 {
381 $tst = $this->getTestByType($a_type);
382 include_once './Modules/Test/classes/class.ilObjTest.php';
384 }
static _lookupRandomTest($a_obj_id)
Returns the fact wether the test with passed obj id is a random questions test or not.
static _lookupObjId($a_id)

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

+ Here is the call graph for this function:

◆ isResetResultsEnabled()

ilLOSettings::isResetResultsEnabled ( )

check if reset result is enabled

Returns
type

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

440 {
441 return (bool) $this->reset_results;
442 }

References $reset_results.

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

+ Here is the caller graph for this function:

◆ read()

ilLOSettings::read ( )
protected

Read.

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

569 {
570 global $DIC;
571
572 $ilDB = $DIC['ilDB'];
573
574 $query = 'SELECT * FROM loc_settings ' .
575 'WHERE obj_id = ' . $ilDB->quote($this->getObjId(), 'integer');
576 $res = $ilDB->query($query);
577 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
578 $this->entry_exists = true;
579
580 $this->setInitialTestType($row->it_type);
581 $this->setInitialTestAsStart((bool) $row->it_start);
582 $this->setQualifyingTestType($row->qt_type);
583 $this->setQualifyingTestAsStart($row->qt_start);
584
585 #$this->setType($row->type);
586 $this->setInitialTest($row->itest);
587 $this->setQualifiedTest($row->qtest);
588 #$this->setGeneralQualifiedTestVisibility($row->qt_vis_all);
589 #$this->setQualifiedTestPerObjectiveVisibility($row->qt_vis_obj);
590 $this->resetResults($row->reset_results);
591 $this->setPassedObjectiveMode($row->passed_obj_mode);
592 }
593
594 if ($GLOBALS['DIC']['tree']->isDeleted($this->getInitialTest())) {
595 $this->setInitialTest(0);
596 }
597 if ($GLOBALS['DIC']['tree']->isDeleted($this->getQualifiedTest())) {
598 $this->setQualifiedTest(0);
599 }
600 }
setQualifyingTestType($a_type)
Set qualifying test type.
setInitialTestType($a_type)
Set Initial test type.
setInitialTestAsStart($a_type)
setInitialTest($a_id)
set initial test id
resetResults($a_status)
reset results
setPassedObjectiveMode($a_mode)
setQualifyingTestAsStart($a_type)
Set qt as start object.
setQualifiedTest($a_id)
set qualified test

References $DIC, $GLOBALS, $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, getInitialTest(), getObjId(), getQualifiedTest(), 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 (   $a_status)

reset results

Parameters
type$a_status

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

431 {
432 $this->reset_results = $a_status;
433 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setGeneralQualifiedTestVisibility()

ilLOSettings::setGeneralQualifiedTestVisibility (   $a_stat)
Returns
type

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

281 {
282 $this->qt_visible_all = $a_stat;
283 return true;
284 }

◆ setInitialTest()

ilLOSettings::setInitialTest (   $a_id)

set initial test id

Parameters
type$a_id
Todo:
refactor

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

392 {
393 $this->initial_test = $a_id;
394 }

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

+ Here is the caller graph for this function:

◆ setInitialTestAsStart()

ilLOSettings::setInitialTestAsStart (   $a_type)
Parameters
type$a_type

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

137 {
138 $this->it_start = $a_type;
139 }

References $a_type.

Referenced by read().

+ Here is the caller graph for this function:

◆ setInitialTestType()

ilLOSettings::setInitialTestType (   $a_type)

Set Initial test type.

Parameters
type$a_type

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

102 {
103 $this->it_type = $a_type;
104 }

References $a_type.

Referenced by read().

+ Here is the caller graph for this function:

◆ setPassedObjectiveMode()

ilLOSettings::setPassedObjectiveMode (   $a_mode)

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

302 {
303 $this->passed_objective_mode = $a_mode;
304 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setQualifiedTest()

ilLOSettings::setQualifiedTest (   $a_id)

set qualified test

Parameters
type$a_id
Todo:
refactor

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

412 {
413 $this->qualified_test = $a_id;
414 }

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

+ Here is the caller graph for this function:

◆ setQualifiedTestPerObjectiveVisibility()

ilLOSettings::setQualifiedTestPerObjectiveVisibility (   $a_stat)

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

292 {
293 $this->qt_visible_lo = $a_stat;
294 }

◆ setQualifyingTestAsStart()

ilLOSettings::setQualifyingTestAsStart (   $a_type)

Set qt as start object.

Parameters
type$a_type

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

155 {
156 $this->qt_start = $a_type;
157 }

References $a_type.

Referenced by read().

+ Here is the caller graph for this function:

◆ setQualifyingTestType()

ilLOSettings::setQualifyingTestType (   $a_type)

Set qualifying test type.

Parameters
type$a_type

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

128 {
129 $this->qt_type = $a_type;
130 }

References $a_type.

Referenced by read().

+ Here is the caller graph for this function:

◆ settingsExist()

ilLOSettings::settingsExist ( )
Returns
type

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

320 {
321 return $this->entry_exists;
322 }

References $entry_exists.

◆ setType()

ilLOSettings::setType (   $a_type)

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

330 {
331 $this->type = $a_type;
332 }

References $a_type.

◆ toXml()

ilLOSettings::toXml ( ilXmlWriter  $writer)

export to xml

Parameters
ilXmlWriter$writer

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

607 {
608 $writer->xmlElement(
609 'Settings',
610 array(
611 'initialTestType' => (int) $this->getInitialTestType(),
612 'initialTestStart' => (int) $this->isInitialTestStart(),
613 'qualifyingTestType' => (int) $this->getQualifyingTestType(),
614 'qualifyingTestStart' => (int) $this->isQualifyingTestStart(),
615 'resetResults' => (int) $this->isResetResultsEnabled(),
616 'passedObjectivesMode' => (int) $this->getPassedObjectiveMode(),
617 'iTest' => (int) $this->getInitialTest(),
618 'qTest' => (int) $this->getQualifiedTest()
619 )
620 );
621 }
xmlElement($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 ( )

update settings @global type $ilDB

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

476 {
477 global $DIC;
478
479 $ilDB = $DIC['ilDB'];
480
481 if (!$this->entry_exists) {
482 return $this->create();
483 }
484
485 $query = 'UPDATE loc_settings ' . ' ' .
486 'SET it_type = ' . $ilDB->quote($this->getInitialTestType(), 'integer') . ', ' .
487 'itest = ' . $ilDB->quote($this->getInitialTest(), 'integer') . ', ' .
488 'qtest = ' . $ilDB->quote($this->getQualifiedTest(), 'integer') . ', ' .
489 'it_start = ' . $ilDB->quote($this->isInitialTestStart(), 'integer') . ', ' .
490 'qt_type = ' . $ilDB->quote($this->getQualifyingTestType(), 'integer') . ', ' .
491 'qt_start = ' . $ilDB->quote($this->isQualifyingTestStart(), 'integer') . ', ' .
492 'reset_results = ' . $ilDB->quote($this->isResetResultsEnabled(), 'integer') . ', ' .
493 'passed_obj_mode = ' . $ilDB->quote($this->getPassedObjectiveMode(), 'integer') . ' ' .
494 'WHERE obj_id = ' . $ilDB->quote($this->getObjId(), 'integer');
495
496 $ilDB->manipulate($query);
497 }
create()
Create new entry.

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

+ Here is the call graph for this function:

◆ updateStartObjects()

ilLOSettings::updateStartObjects ( ilContainerStartObjects  $start)

Update start objects Depends on course objective settings.

Parameters
ilContainerStartObjects

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

506 {
507 if ($this->getInitialTestType() != self::TYPE_INITIAL_NONE) {
508 if ($start->exists($this->getQualifiedTest())) {
509 $start->deleteItem($this->getQualifiedTest());
510 }
511 }
512
513 switch ($this->getInitialTestType()) {
516
517 if ($this->isInitialTestStart()) {
518 if (!$start->exists($this->getInitialTest())) {
519 $start->add($this->getInitialTest());
520 }
521 } else {
522 if ($start->exists($this->getInitialTest())) {
523 $start->deleteItem($this->getInitialTest());
524 }
525 }
526 break;
527
529
530 if ($start->exists($this->getInitialTest())) {
531 $start->deleteItem($this->getInitialTest());
532 }
533 break;
534
535 default:
536
537 $this->logger->debug('Type initial default');
538 if ($start->exists($this->getInitialTest())) {
539 $this->logger->debug('Old start object exists. Trying to delete');
540 $start->deleteItem($this->getInitialTest());
541 }
542 break;
543 }
544
545 switch ($this->getQualifyingTestType()) {
547
548 if ($this->isQualifyingTestStart()) {
549 if (!$start->exists($this->getQualifiedTest())) {
550 $start->add($this->getQualifiedTest());
551 }
552 }
553 break;
554
555 default:
556 if ($start->exists($this->getQualifiedTest())) {
557 $start->deleteItem($this->getQualifiedTest());
558 }
559 break;
560 }
561 return true;
562 }
const TYPE_INITIAL_PLACEMENT_ALL
$start
Definition: bench.php:8

References $start, ilContainerStartObjects\exists(), getInitialTest(), getInitialTestType(), getQualifiedTest(), getQualifyingTestType(), isInitialTestStart(), isQualifyingTestStart(), 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 263 of file class.ilLOSettings.php.

264 {
266 }

References getInitialTestType(), and TYPE_INITIAL_NONE.

+ Here is the call graph for this function:

◆ worksWithStartObjects()

ilLOSettings::worksWithStartObjects ( )

Check if start objects are enabled.

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

255 {
256 return $this->isInitialTestStart() or $this->isQualifyingTestStart();
257 }

References isInitialTestStart(), and isQualifyingTestStart().

+ Here is the call graph for this function:

Field Documentation

◆ $container_id

ilLOSettings::$container_id = 0
private

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

Referenced by getObjId().

◆ $entry_exists

ilLOSettings::$entry_exists = false
private

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

Referenced by settingsExist().

◆ $initial_test

ilLOSettings::$initial_test = 0
private

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

Referenced by getInitialTest().

◆ $instances

ilLOSettings::$instances = array()
staticprivate

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

◆ $it_start

ilLOSettings::$it_start = false
private

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

Referenced by isInitialTestStart().

◆ $it_type

ilLOSettings::$it_type = self::TYPE_INITIAL_PLACEMENT_ALL
private

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

Referenced by getInitialTestType().

◆ $logger

ilLOSettings::$logger = null
private

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

◆ $passed_obj_mode

ilLOSettings::$passed_obj_mode = self::HIDE_PASSED_OBJECTIVE_QST
private

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

◆ $qt_start

ilLOSettings::$qt_start = false
private

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

Referenced by isQualifyingTestStart().

◆ $qt_type

ilLOSettings::$qt_type = self::TYPE_QUALIFYING_ALL
private

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

Referenced by getQualifyingTestType().

◆ $qualified_test

ilLOSettings::$qualified_test = 0
private

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

Referenced by getQualifiedTest().

◆ $reset_results

ilLOSettings::$reset_results = true
private

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

Referenced by isResetResultsEnabled().

◆ $type

ilLOSettings::$type = 0
private

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

◆ LOC_INITIAL_SEL

const ilLOSettings::LOC_INITIAL_SEL = 2

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

◆ LOC_PRACTISE

const ilLOSettings::LOC_PRACTISE = 4

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

◆ LOC_QUALIFIED

const ilLOSettings::LOC_QUALIFIED = 3

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

◆ QST_PASSED_HIDE

const ilLOSettings::QST_PASSED_HIDE = 2

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

◆ QT_VISIBLE_ALL

const ilLOSettings::QT_VISIBLE_ALL = 0

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

◆ QT_VISIBLE_OBJECTIVE

const ilLOSettings::QT_VISIBLE_OBJECTIVE = 1

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

Referenced by ilContainerObjectiveGUI\addItemDetails(), ilContainerObjectiveGUI\buildObjectiveMap(), ilLOTestQuestionAdapter\buildQuestionRelatedObjectiveList(), ilLOEditorGUI\confirmDeleteTest(), ilLOEditorGUI\confirmDeleteTests(), ilLOEditorGUI\deleteTest(), ilLOEditorGUI\deleteTests(), 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(), ilCourseObjectivesTableGUI\parse(), ilLOMemberTestResultTableGUI\parse(), ilContainerObjectiveGUI\parseLOUserResults(), ilPortfolioPageGUI\parseObjectives(), ilContainerObjectiveGUI\renderObjective(), ilCourseObjectiveResult\reset(), ilCourseObjectivesGUI\saveRandom(), ilCourseObjectivesGUI\selfAssessmentAssignment(), ilLOEditorGUI\setTabs(), ilContainerObjectiveGUI\showObjectives(), ilLOEditorGUI\testAssignment(), ilLOEditorGUI\testOverview(), ilLOEditorGUI\testSettings(), ilLOEditorGUI\testsOverview(), ilLOTestQuestionAdapter\updateRandomQuestions(), and ilLOEditorGUI\updateTestAssignments().

◆ TYPE_TEST_QUALIFIED

◆ TYPE_TEST_UNDEFINED


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