ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 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.

References $GLOBALS, and read().

77  {
78  $this->logger = $GLOBALS['DIC']->logger()->crs();
79 
80  $this->container_id = $a_cont_id;
81  $this->read();
82  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
+ 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.

References $options, and ilCopyWizardOptions\_getInstance().

Referenced by ilObjCourse\cloneDependencies().

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  {
239  $new_settings->setInitialTest($mappings[$settings->getInitialTest()]);
240  $new_settings->setInitialTestAsStart($new_settings->isInitialTestStart());
241  }
242 
243  if($settings->getQualifiedTest() and array_key_exists($settings->getQualifiedTest(), $mappings))
244  {
245  $new_settings->setQualifiedTest($mappings[$settings->getQualifiedTest()]);
246  $new_settings->setQualifyingTestAsStart($settings->isQualifyingTestStart());
247  }
248 
249  // update calls create in case of no entry exists.
250  $new_settings->update();
251  }
static _getInstance($a_copy_id)
Get instance of copy wizard options.
if(!is_array($argv)) $options
+ 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 452 of file class.ilLOSettings.php.

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

Referenced by update().

453  {
454  global $ilDB;
455 
456  $query = 'INSERT INTO loc_settings '.
457  '(obj_id, it_type,itest,qtest,it_start,qt_type,qt_start,reset_results,passed_obj_mode) VALUES ( '.
458  $ilDB->quote($this->getObjId(),'integer').', '.
459  $ilDB->quote($this->getInitialTestType(),'integer').', '.
460  $ilDB->quote($this->getInitialTest(),'integer').', '.
461  $ilDB->quote($this->getQualifiedTest(),'integer').', '.
462  $ilDB->quote($this->isInitialTestStart(),'integer').', '.
463  $ilDB->quote($this->getQualifyingTestType(),'integer').', '.
464  $ilDB->quote($this->isQualifyingTestStart(),'integer').', '.
465  $ilDB->quote($this->isResetResultsEnabled(),'integer').', '.
466  $ilDB->quote($this->getPassedObjectiveMode(),'integer').' '.
467  ') ';
468  $ilDB->manipulate($query);
469 
470  $this->entry_exists = true;
471  }
isQualifyingTestStart()
Is qt start object.
getInitialTestType()
Get initial test type.
isResetResultsEnabled()
check if reset result is enabled
getQualifiedTest()
get qualified test
getQualifyingTestType()
Get qualifying test type.
getInitialTest()
get initial test
global $ilDB
isInitialTestStart()
Get initial test start.
+ 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 406 of file class.ilLOSettings.php.

References $initial_test.

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

407  {
408  return $this->initial_test;
409  }
+ Here is the caller graph for this function:

◆ getInitialTestType()

ilLOSettings::getInitialTestType ( )

Get initial test type.

Returns
type

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

References $it_type.

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

112  {
113  return $this->it_type;
114  }
+ 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.

Referenced by ilLOTestAssignments\__construct(), ilLOMemberTestResultTableGUI\__construct(), ilLOTestAssignmentForm\__construct(), ilLOTestQuestionAdapter\__construct(), ilLOTestAssignmentTableGUI\__construct(), ilLOEditorStatus\__construct(), ilLOEditorGUI\__construct(), ilCourseObjectivesTableGUI\__construct(), ilCourseObjectiveQuestionAssignmentTableGUI\__construct(), ilCourseObjectivesGUI\__construct(), ilContainerObjectiveGUI\buildObjectiveProgressBar(), ilLOEditorGUI\confirmDeleteTest(), ilLOEditorGUI\confirmDeleteTests(), ilLOEditorGUI\deleteTest(), ilLOEditorGUI\deleteTests(), ilLOUserResults\getCompletedObjectiveIds(), ilLOUserResults\getCourseResultsForUserPresentation(), ilLOEditorStatus\getHTML(), ilContainerObjectiveGUI\getMainContent(), 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().

90  {
91  if(self::$instances[$a_obj_id])
92  {
93  return self::$instances[$a_obj_id];
94  }
95  return self::$instances[$a_obj_id] = new ilLOSettings($a_obj_id);
96  }
Settings for LO courses.
+ Here is the caller graph for this function:

◆ getObjId()

ilLOSettings::getObjId ( )

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

References $container_id.

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

327  {
328  return $this->container_id;
329  }
+ Here is the caller graph for this function:

◆ getPassedObjectiveMode()

ilLOSettings::getPassedObjectiveMode ( )

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

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

299  {
300  return $this->passed_objective_mode;
301  }
+ Here is the caller graph for this function:

◆ getQualifiedTest()

ilLOSettings::getQualifiedTest ( )

get qualified test

Returns
type
Todo:
refactor

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

References $qualified_test.

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

427  {
428  return $this->qualified_test;
429  }
+ Here is the caller graph for this function:

◆ getQualifyingTestType()

ilLOSettings::getQualifyingTestType ( )

Get qualifying test type.

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

References $qt_type.

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

120  {
121  return $this->qt_type;
122  }
+ Here is the caller graph for this function:

◆ getTestByType()

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

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

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

Referenced by isRandomTestType().

348  {
349  switch($a_type)
350  {
351  case self::TYPE_TEST_INITIAL:
352  return $this->getInitialTest();
353 
354  case self::TYPE_TEST_QUALIFIED:
355  return $this->getQualifiedTest();
356  }
357  }
$a_type
Definition: workflow.php:93
getQualifiedTest()
get qualified test
getInitialTest()
get initial test
+ 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 364 of file class.ilLOSettings.php.

References array, getInitialTest(), and getQualifiedTest().

365  {
366  $tests = array();
367  if($this->getInitialTest())
368  {
369  $tests[] = $this->getInitialTest();
370  }
371  if($this->getQualifiedTest())
372  {
373  $tests[] = $this->getQualifiedTest();
374  }
375  return $tests;
376  }
getQualifiedTest()
get qualified test
Create styles array
The data for the language used.
getInitialTest()
get initial test
+ Here is the call graph for this function:

◆ getType()

ilLOSettings::getType ( )

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

References $type.

337  {
338  return $this->type;
339  }

◆ hasSeparateInitialTests()

ilLOSettings::hasSeparateInitialTests ( )

Check if separate initial test are configured.

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

References getInitialTestType().

173  {
174  return $this->getInitialTestType() == self::TYPE_INITIAL_PLACEMENT_SELECTED || $this->getInitialTestType() == self::TYPE_INITIAL_QUALIFYING_SELECTED;
175  }
getInitialTestType()
Get initial test type.
+ Here is the call graph for this function:

◆ hasSeparateQualifiedTests()

ilLOSettings::hasSeparateQualifiedTests ( )

Check if separate qualified tests are configured.

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

References getQualifyingTestType().

181  {
182  return $this->getQualifyingTestType() == self::TYPE_QUALIFYING_SELECTED;
183  }
getQualifyingTestType()
Get qualifying test type.
+ 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 312 of file class.ilLOSettings.php.

References getInitialTestType().

313  {
314  return $this->getInitialTestType() == self::TYPE_INITIAL_PLACEMENT_ALL || $this->getInitialTestType() == self::TYPE_INITIAL_QUALIFYING_ALL;
315  }
getInitialTestType()
Get initial test type.
+ 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 274 of file class.ilLOSettings.php.

References getQualifyingTestType().

275  {
276  return $this->getQualifyingTestType() == self::TYPE_QUALIFYING_ALL;
277  }
getQualifyingTestType()
Get qualifying test type.
+ Here is the call graph for this function:

◆ isInitialTestQualifying()

ilLOSettings::isInitialTestQualifying ( )

Check if initial test is qualifying*.

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

References getInitialTestType().

189  {
190  return $this->getInitialTestType() == self::TYPE_INITIAL_QUALIFYING_ALL || $this->getInitialTestType() == self::TYPE_INITIAL_QUALIFYING_SELECTED;
191  }
getInitialTestType()
Get initial test type.
+ Here is the call graph for this function:

◆ isInitialTestStart()

ilLOSettings::isInitialTestStart ( )

Get initial test start.

Returns
type

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

References $it_start.

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

147  {
148  return $this->it_start;
149  }
+ 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 197 of file class.ilLOSettings.php.

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

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

198  {
199  global $ilDB;
200 
201 
202  // Check for direct assignment
203  $query = 'SELECT obj_id FROM loc_settings '.
204  'WHERE itest = '.$ilDB->quote($a_trst_ref_id,'integer').' '.
205  'OR qtest = '.$ilDB->quote($a_trst_ref_id,'integer');
206  $res = $ilDB->query($query);
207  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
208  {
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)
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isQualifiedTestPerObjectiveVisible()

ilLOSettings::isQualifiedTestPerObjectiveVisible ( )

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

References getQualifyingTestType().

289  {
290  return $this->getQualifyingTestType() == self::TYPE_QUALIFYING_SELECTED;
291  }
getQualifyingTestType()
Get qualifying test type.
+ Here is the call graph for this function:

◆ isQualifyingTestStart()

ilLOSettings::isQualifyingTestStart ( )

Is qt start object.

Returns
type

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

References $qt_start.

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

165  {
166  return $this->qt_start;
167  }
+ 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 384 of file class.ilLOSettings.php.

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

385  {
386  $tst = $this->getTestByType($a_type);
387  include_once './Modules/Test/classes/class.ilObjTest.php';
389  }
static _lookupRandomTest($a_obj_id)
Returns the fact wether the test with passed obj id is a random questions test or not...
$a_type
Definition: workflow.php:93
static _lookupObjId($a_id)
+ Here is the call graph for this function:

◆ isResetResultsEnabled()

ilLOSettings::isResetResultsEnabled ( )

check if reset result is enabled

Returns
type

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

References $reset_results.

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

445  {
446  return (bool) $this->reset_results;
447  }
+ Here is the caller graph for this function:

◆ read()

ilLOSettings::read ( )
protected

Read.

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

References $GLOBALS, $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, getInitialTest(), getObjId(), getQualifiedTest(), resetResults(), setInitialTest(), setInitialTestAsStart(), setInitialTestType(), setPassedObjectiveMode(), setQualifiedTest(), setQualifyingTestAsStart(), and setQualifyingTestType().

Referenced by __construct().

585  {
586  global $ilDB;
587 
588  $query = 'SELECT * FROM loc_settings '.
589  'WHERE obj_id = '.$ilDB->quote($this->getObjId(),'integer');
590  $res = $ilDB->query($query);
591  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
592  {
593  $this->entry_exists = true;
594 
595  $this->setInitialTestType($row->it_type);
596  $this->setInitialTestAsStart((bool) $row->it_start);
597  $this->setQualifyingTestType($row->qt_type);
598  $this->setQualifyingTestAsStart($row->qt_start);
599 
600  #$this->setType($row->type);
601  $this->setInitialTest($row->itest);
602  $this->setQualifiedTest($row->qtest);
603  #$this->setGeneralQualifiedTestVisibility($row->qt_vis_all);
604  #$this->setQualifiedTestPerObjectiveVisibility($row->qt_vis_obj);
605  $this->resetResults($row->reset_results);
606  $this->setPassedObjectiveMode($row->passed_obj_mode);
607  }
608 
609  if($GLOBALS['tree']->isDeleted($this->getInitialTest()))
610  {
611  $this->setInitialTest(0);
612  }
613  if($GLOBALS['tree']->isDeleted($this->getQualifiedTest()))
614  {
615  $this->setQualifiedTest(0);
616  }
617  }
setInitialTest($a_id)
set initial test id
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
setPassedObjectiveMode($a_mode)
setQualifiedTest($a_id)
set qualified test
setQualifyingTestType($a_type)
Set qualifying test type.
setInitialTestType($a_type)
Set Initial test type.
getQualifiedTest()
get qualified test
getInitialTest()
get initial test
global $ilDB
setQualifyingTestAsStart($a_type)
Set qt as start object.
setInitialTestAsStart($a_type)
resetResults($a_status)
reset results
+ 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 435 of file class.ilLOSettings.php.

Referenced by read().

436  {
437  $this->reset_results = $a_status;
438  }
+ Here is the caller graph for this function:

◆ setGeneralQualifiedTestVisibility()

ilLOSettings::setGeneralQualifiedTestVisibility (   $a_stat)
Returns
type

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

283  {
284  $this->qt_visible_all = $a_stat;
285  return true;
286  }

◆ setInitialTest()

ilLOSettings::setInitialTest (   $a_id)

set initial test id

Parameters
type$a_id
Todo:
refactor

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

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

397  {
398  $this->initial_test = $a_id;
399  }
+ Here is the caller graph for this function:

◆ setInitialTestAsStart()

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

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

References $a_type.

Referenced by read().

138  {
139  $this->it_start = $a_type;
140  }
$a_type
Definition: workflow.php:93
+ Here is the caller graph for this function:

◆ setInitialTestType()

ilLOSettings::setInitialTestType (   $a_type)

Set Initial test type.

Parameters
type$a_type

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

References $a_type.

Referenced by read().

103  {
104  $this->it_type = $a_type;
105  }
$a_type
Definition: workflow.php:93
+ Here is the caller graph for this function:

◆ setPassedObjectiveMode()

ilLOSettings::setPassedObjectiveMode (   $a_mode)

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

Referenced by read().

304  {
305  $this->passed_objective_mode = $a_mode;
306  }
+ 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 416 of file class.ilLOSettings.php.

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

417  {
418  $this->qualified_test = $a_id;
419  }
+ Here is the caller graph for this function:

◆ setQualifiedTestPerObjectiveVisibility()

ilLOSettings::setQualifiedTestPerObjectiveVisibility (   $a_stat)

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

294  {
295  $this->qt_visible_lo = $a_stat;
296  }

◆ setQualifyingTestAsStart()

ilLOSettings::setQualifyingTestAsStart (   $a_type)

Set qt as start object.

Parameters
type$a_type

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

References $a_type.

Referenced by read().

156  {
157  $this->qt_start = $a_type;
158  }
$a_type
Definition: workflow.php:93
+ Here is the caller graph for this function:

◆ setQualifyingTestType()

ilLOSettings::setQualifyingTestType (   $a_type)

Set qualifying test type.

Parameters
type$a_type

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

References $a_type.

Referenced by read().

129  {
130  $this->qt_type = $a_type;
131  }
$a_type
Definition: workflow.php:93
+ Here is the caller graph for this function:

◆ settingsExist()

ilLOSettings::settingsExist ( )
Returns
type

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

References $entry_exists.

322  {
323  return $this->entry_exists;
324  }

◆ setType()

ilLOSettings::setType (   $a_type)

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

References $a_type.

332  {
333  $this->type = $a_type;
334  }
$a_type
Definition: workflow.php:93

◆ toXml()

ilLOSettings::toXml ( ilXmlWriter  $writer)

export to xml

Parameters
ilXmlWriter$writer

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

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

624  {
625  $writer->xmlElement(
626  'Settings',
627  array(
628  'initialTestType' => (int) $this->getInitialTestType(),
629  'initialTestStart' => (int) $this->isInitialTestStart(),
630  'qualifyingTestType' => (int) $this->getQualifyingTestType(),
631  'qualifyingTestStart' => (int) $this->isQualifyingTestStart(),
632  'resetResults' => (int) $this->isResetResultsEnabled(),
633  'passedObjectivesMode' => (int) $this->getPassedObjectiveMode(),
634  'iTest' => (int) $this->getInitialTest(),
635  'qTest' => (int) $this->getQualifiedTest()
636  )
637  );
638 
639  }
isQualifyingTestStart()
Is qt start object.
getInitialTestType()
Get initial test type.
xmlElement($tag, $attrs=NULL, $data=Null, $encode=TRUE, $escape=TRUE)
Writes a basic element (no children, just textual content)
isResetResultsEnabled()
check if reset result is enabled
getQualifiedTest()
get qualified test
Create styles array
The data for the language used.
getQualifyingTestType()
Get qualifying test type.
getInitialTest()
get initial test
isInitialTestStart()
Get initial test start.
+ Here is the call graph for this function:

◆ update()

ilLOSettings::update ( )

update settings type $ilDB

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

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

Referenced by ilLOEditorGUI\updateTestAssignments().

479  {
480  global $ilDB;
481 
482  if(!$this->entry_exists)
483  {
484  return $this->create();
485  }
486 
487  $query = 'UPDATE loc_settings '.' '.
488  'SET it_type = '.$ilDB->quote($this->getInitialTestType(),'integer').', '.
489  'itest = '.$ilDB->quote($this->getInitialTest(),'integer').', '.
490  'qtest = '.$ilDB->quote($this->getQualifiedTest(),'integer').', '.
491  'it_start = '.$ilDB->quote($this->isInitialTestStart(),'integer').', '.
492  'qt_type = '.$ilDB->quote($this->getQualifyingTestType(),'integer').', '.
493  'qt_start = '.$ilDB->quote($this->isQualifyingTestStart(),'integer').', '.
494  'reset_results = '.$ilDB->quote($this->isResetResultsEnabled(),'integer').', '.
495  'passed_obj_mode = '.$ilDB->quote($this->getPassedObjectiveMode(),'integer').' '.
496  'WHERE obj_id = '.$ilDB->quote($this->getObjId(),'integer');
497 
498  $ilDB->manipulate($query);
499  }
isQualifyingTestStart()
Is qt start object.
getInitialTestType()
Get initial test type.
create()
Create new entry.
isResetResultsEnabled()
check if reset result is enabled
getQualifiedTest()
get qualified test
getQualifyingTestType()
Get qualifying test type.
getInitialTest()
get initial test
global $ilDB
isInitialTestStart()
Get initial test start.
+ 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 507 of file class.ilLOSettings.php.

References ilContainerStartObjects\add(), ilContainerStartObjects\deleteItem(), ilContainerStartObjects\exists(), getInitialTest(), getInitialTestType(), getQualifiedTest(), getQualifyingTestType(), isInitialTestStart(), and isQualifyingTestStart().

508  {
509  if($this->getInitialTestType() != self::TYPE_INITIAL_NONE)
510  {
511  if($start->exists($this->getQualifiedTest()))
512  {
513  $start->deleteItem($this->getQualifiedTest());
514  }
515  }
516 
517  switch($this->getInitialTestType())
518  {
519  case self::TYPE_INITIAL_PLACEMENT_ALL:
520  case self::TYPE_INITIAL_QUALIFYING_ALL:
521 
522  if($this->isInitialTestStart())
523  {
524  if(!$start->exists($this->getInitialTest()))
525  {
526  $start->add($this->getInitialTest());
527  }
528  }
529  else
530  {
531  if($start->exists($this->getInitialTest()))
532  {
533  $start->deleteItem($this->getInitialTest());
534  }
535  }
536  break;
537 
538  case self::TYPE_INITIAL_NONE:
539 
540  if($start->exists($this->getInitialTest()))
541  {
542  $start->deleteItem($this->getInitialTest());
543  }
544  break;
545 
546  default:
547 
548  $this->logger->debug('Type initial default');
549  if($start->exists($this->getInitialTest()))
550  {
551  $this->logger->debug('Old start object exists. Trying to delete');
552  $start->deleteItem($this->getInitialTest());
553  }
554  break;
555  }
556 
557  switch($this->getQualifyingTestType())
558  {
559  case self::TYPE_QUALIFYING_ALL:
560 
561  if($this->isQualifyingTestStart())
562  {
563  if(!$start->exists($this->getQualifiedTest()))
564  {
565  $start->add($this->getQualifiedTest());
566  }
567  }
568  break;
569 
570  default:
571  if($start->exists($this->getQualifiedTest()))
572  {
573  $start->deleteItem($this->getQualifiedTest());
574  }
575  break;
576  }
577  return TRUE;
578  }
isQualifyingTestStart()
Is qt start object.
getInitialTestType()
Get initial test type.
deleteItem($a_item_ref_id)
Delete item by ref_id.
getQualifiedTest()
get qualified test
getQualifyingTestType()
Get qualifying test type.
getInitialTest()
get initial test
isInitialTestStart()
Get initial test start.
+ Here is the call graph for this function:

◆ worksWithInitialTest()

ilLOSettings::worksWithInitialTest ( )

Check if the loc is configured for initial tests.

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

References getInitialTestType().

266  {
267  return $this->getInitialTestType() != self::TYPE_INITIAL_NONE;
268  }
getInitialTestType()
Get initial test type.
+ Here is the call graph for this function:

◆ worksWithStartObjects()

ilLOSettings::worksWithStartObjects ( )

Check if start objects are enabled.

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

References isInitialTestStart(), and isQualifyingTestStart().

257  {
258  return $this->isInitialTestStart() or $this->isQualifyingTestStart();
259  }
isQualifyingTestStart()
Is qt start object.
isInitialTestStart()
Get initial test start.
+ 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

const ilLOSettings::TYPE_INITIAL_NONE = 5

◆ 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

const ilLOSettings::TYPE_INITIAL_QUALIFYING_ALL = 3

◆ TYPE_INITIAL_QUALIFYING_SELECTED

const ilLOSettings::TYPE_INITIAL_QUALIFYING_SELECTED = 4

◆ TYPE_QUALIFYING_ALL

const ilLOSettings::TYPE_QUALIFYING_ALL = 1

◆ TYPE_QUALIFYING_SELECTED

◆ TYPE_TEST_INITIAL

const ilLOSettings::TYPE_TEST_INITIAL = 1

◆ TYPE_TEST_QUALIFIED

◆ TYPE_TEST_UNDEFINED


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