ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5
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

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

References read().

72  {
73  $this->container_id = $a_cont_id;
74  $this->read();
75  }
+ 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 215 of file class.ilLOSettings.php.

References $options, and ilCopyWizardOptions\_getInstance().

Referenced by ilObjCourse\cloneDependencies().

216  {
217  include_once './Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
219  $mappings = $options->getMappings();
220 
221  $settings = self::getInstanceByObjId($a_container_id);
222  $new_settings = self::getInstanceByObjId($a_new_container_id);
223 
224  $new_settings->setType($settings->getType());
225  $new_settings->setInitialTestType($settings->getInitialTestType());
226  $new_settings->setQualifyingTestType($settings->getQualifyingTestType());
227  $new_settings->resetResults($settings->isResetResultsEnabled());
228  $new_settings->setPassedObjectiveMode($settings->getPassedObjectiveMode());
229 
230  if($settings->getInitialTest() and array_key_exists($settings->getInitialTest(), $mappings))
231  {
232  $new_settings->setInitialTest($mappings[$settings->getInitialTest()]);
233  $new_settings->setInitialTestAsStart($new_settings->isInitialTestStart());
234  }
235 
236  if($settings->getQualifiedTest() and array_key_exists($settings->getQualifiedTest(), $mappings))
237  {
238  $new_settings->setQualifiedTest($mappings[$settings->getQualifiedTest()]);
239  $new_settings->setQualifyingTestAsStart($settings->isQualifyingTestStart());
240  }
241 
242  // update calls create in case of no entry exists.
243  $new_settings->update();
244  }
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 445 of file class.ilLOSettings.php.

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

Referenced by update().

446  {
447  global $ilDB;
448 
449  $query = 'INSERT INTO loc_settings '.
450  '(obj_id, it_type,itest,qtest,it_start,qt_type,qt_start,reset_results,passed_obj_mode) VALUES ( '.
451  $ilDB->quote($this->getObjId(),'integer').', '.
452  $ilDB->quote($this->getInitialTestType(),'integer').', '.
453  $ilDB->quote($this->getInitialTest(),'integer').', '.
454  $ilDB->quote($this->getQualifiedTest(),'integer').', '.
455  $ilDB->quote($this->isInitialTestStart(),'integer').', '.
456  $ilDB->quote($this->getQualifyingTestType(),'integer').', '.
457  $ilDB->quote($this->isQualifyingTestStart(),'integer').', '.
458  $ilDB->quote($this->isResetResultsEnabled(),'integer').', '.
459  $ilDB->quote($this->getPassedObjectiveMode(),'integer').' '.
460  ') ';
461  $ilDB->manipulate($query);
462  }
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 399 of file class.ilLOSettings.php.

References $initial_test.

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

400  {
401  return $this->initial_test;
402  }
+ Here is the caller graph for this function:

◆ getInitialTestType()

ilLOSettings::getInitialTestType ( )

Get initial test type.

Returns
type

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

References $it_type.

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

105  {
106  return $this->it_type;
107  }
+ 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 82 of file class.ilLOSettings.php.

Referenced by ilLOTestAssignments\__construct(), ilLOMemberTestResultTableGUI\__construct(), ilLOTestQuestionAdapter\__construct(), ilLOTestAssignmentForm\__construct(), ilLOTestAssignmentTableGUI\__construct(), ilLOEditorGUI\__construct(), ilLOEditorStatus\__construct(), ilCourseObjectivesTableGUI\__construct(), ilCourseObjectiveQuestionAssignmentTableGUI\__construct(), ilContainerObjectiveGUI\buildObjectiveProgressBar(), ilLOEditorGUI\confirmDeleteTest(), ilLOEditorGUI\confirmDeleteTests(), ilLOEditorGUI\deleteTest(), ilLOEditorGUI\deleteTests(), ilLOUserResults\getCompletedObjectiveIds(), ilLOEditorStatus\getHTML(), ilContainerObjectiveGUI\getMainContent(), ilLOUserResults\getObjectiveStatusForLP(), ilLOUserResults\getSummarizedObjectiveStatusForLP(), ilTrQuery\getUserObjectiveMatrix(), ilCourseObjectivesGUI\ilCourseObjectivesGUI(), ilTestResultHeaderLabelBuilder\initTestType(), ilLOUtils\isCompleted(), ilLOUtils\lookupMaxAttempts(), 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().

83  {
84  if(self::$instances[$a_obj_id])
85  {
86  return self::$instances[$a_obj_id];
87  }
88  return self::$instances[$a_obj_id] = new ilLOSettings($a_obj_id);
89  }
Settings for LO courses.
+ Here is the caller graph for this function:

◆ getObjId()

ilLOSettings::getObjId ( )

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

References $container_id.

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

320  {
321  return $this->container_id;
322  }
+ Here is the caller graph for this function:

◆ getPassedObjectiveMode()

ilLOSettings::getPassedObjectiveMode ( )

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

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

292  {
293  return $this->passed_objective_mode;
294  }
+ Here is the caller graph for this function:

◆ getQualifiedTest()

ilLOSettings::getQualifiedTest ( )

get qualified test

Returns
type
Todo:
refactor

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

References $qualified_test.

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

420  {
421  return $this->qualified_test;
422  }
+ Here is the caller graph for this function:

◆ getQualifyingTestType()

ilLOSettings::getQualifyingTestType ( )

Get qualifying test type.

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

References $qt_type.

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

113  {
114  return $this->qt_type;
115  }
+ Here is the caller graph for this function:

◆ getTestByType()

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

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

References getInitialTest(), and getQualifiedTest().

Referenced by isRandomTestType().

341  {
342  switch($a_type)
343  {
344  case self::TYPE_TEST_INITIAL:
345  return $this->getInitialTest();
346 
347  case self::TYPE_TEST_QUALIFIED:
348  return $this->getQualifiedTest();
349  }
350  }
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 357 of file class.ilLOSettings.php.

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

358  {
359  $tests = array();
360  if($this->getInitialTest())
361  {
362  $tests[] = $this->getInitialTest();
363  }
364  if($this->getQualifiedTest())
365  {
366  $tests[] = $this->getQualifiedTest();
367  }
368  return $tests;
369  }
getQualifiedTest()
get qualified test
getInitialTest()
get initial test
+ Here is the call graph for this function:

◆ getType()

ilLOSettings::getType ( )

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

References $type.

330  {
331  return $this->type;
332  }

◆ hasSeparateInitialTests()

ilLOSettings::hasSeparateInitialTests ( )

Check if separate initial test are configured.

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

References getInitialTestType().

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

References getQualifyingTestType().

174  {
175  return $this->getQualifyingTestType() == self::TYPE_QUALIFYING_SELECTED;
176  }
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 305 of file class.ilLOSettings.php.

References getInitialTestType().

306  {
307  return $this->getInitialTestType() == self::TYPE_INITIAL_PLACEMENT_ALL || $this->getInitialTestType() == self::TYPE_INITIAL_QUALIFYING_ALL;
308  }
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 267 of file class.ilLOSettings.php.

References getQualifyingTestType().

268  {
269  return $this->getQualifyingTestType() == self::TYPE_QUALIFYING_ALL;
270  }
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 181 of file class.ilLOSettings.php.

References getInitialTestType().

182  {
183  return $this->getInitialTestType() == self::TYPE_INITIAL_QUALIFYING_ALL || $this->getInitialTestType() == self::TYPE_INITIAL_QUALIFYING_SELECTED;
184  }
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 139 of file class.ilLOSettings.php.

References $it_start.

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

140  {
141  return $this->it_start;
142  }
+ 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 190 of file class.ilLOSettings.php.

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

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

191  {
192  global $ilDB;
193 
194 
195  // Check for direct assignment
196  $query = 'SELECT obj_id FROM loc_settings '.
197  'WHERE itest = '.$ilDB->quote($a_trst_ref_id,'integer').' '.
198  'OR qtest = '.$ilDB->quote($a_trst_ref_id,'integer');
199  $res = $ilDB->query($query);
200  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
201  {
202  return $row->obj_id;
203  }
204 
205  include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
206  return ilLOTestAssignments::lookupContainerForTest($a_trst_ref_id);
207  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
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 281 of file class.ilLOSettings.php.

References getQualifyingTestType().

282  {
283  return $this->getQualifyingTestType() == self::TYPE_QUALIFYING_SELECTED;
284  }
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 157 of file class.ilLOSettings.php.

References $qt_start.

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

158  {
159  return $this->qt_start;
160  }
+ 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 377 of file class.ilLOSettings.php.

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

378  {
379  $tst = $this->getTestByType($a_type);
380  include_once './Modules/Test/classes/class.ilObjTest.php';
382  }
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)
+ Here is the call graph for this function:

◆ isResetResultsEnabled()

ilLOSettings::isResetResultsEnabled ( )

check if reset result is enabled

Returns
type

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

References $reset_results.

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

438  {
439  return (bool) $this->reset_results;
440  }
+ Here is the caller graph for this function:

◆ read()

ilLOSettings::read ( )
protected

Read.

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

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

Referenced by __construct().

574  {
575  global $ilDB;
576 
577  $query = 'SELECT * FROM loc_settings '.
578  'WHERE obj_id = '.$ilDB->quote($this->getObjId(),'integer');
579  $res = $ilDB->query($query);
580  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
581  {
582  $this->entry_exists = true;
583 
584  $this->setInitialTestType($row->it_type);
585  $this->setInitialTestAsStart((bool) $row->it_start);
586  $this->setQualifyingTestType($row->qt_type);
587  $this->setQualifyingTestAsStart($row->qt_start);
588 
589  #$this->setType($row->type);
590  $this->setInitialTest($row->itest);
591  $this->setQualifiedTest($row->qtest);
592  #$this->setGeneralQualifiedTestVisibility($row->qt_vis_all);
593  #$this->setQualifiedTestPerObjectiveVisibility($row->qt_vis_obj);
594  $this->resetResults($row->reset_results);
595  $this->setPassedObjectiveMode($row->passed_obj_mode);
596  }
597 
598  if($GLOBALS['tree']->isDeleted($this->getInitialTest()))
599  {
600  $this->setInitialTest(0);
601  }
602  if($GLOBALS['tree']->isDeleted($this->getQualifiedTest()))
603  {
604  $this->setQualifiedTest(0);
605  }
606  }
setInitialTest($a_id)
set initial test id
setPassedObjectiveMode($a_mode)
setQualifiedTest($a_id)
set qualified test
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
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.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276
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 428 of file class.ilLOSettings.php.

Referenced by read().

429  {
430  $this->reset_results = $a_status;
431  }
+ Here is the caller graph for this function:

◆ setGeneralQualifiedTestVisibility()

ilLOSettings::setGeneralQualifiedTestVisibility (   $a_stat)
Returns
type

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

276  {
277  $this->qt_visible_all = $a_stat;
278  return true;
279  }

◆ setInitialTest()

ilLOSettings::setInitialTest (   $a_id)

set initial test id

Parameters
type$a_id
Todo:
refactor

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

Referenced by read().

390  {
391  $this->initial_test = $a_id;
392  }
+ Here is the caller graph for this function:

◆ setInitialTestAsStart()

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

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

Referenced by read().

131  {
132  $this->it_start = $a_type;
133  }
+ Here is the caller graph for this function:

◆ setInitialTestType()

ilLOSettings::setInitialTestType (   $a_type)

Set Initial test type.

Parameters
type$a_type

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

Referenced by read().

96  {
97  $this->it_type = $a_type;
98  }
+ Here is the caller graph for this function:

◆ setPassedObjectiveMode()

ilLOSettings::setPassedObjectiveMode (   $a_mode)

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

Referenced by read().

297  {
298  $this->passed_objective_mode = $a_mode;
299  }
+ 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 409 of file class.ilLOSettings.php.

Referenced by read().

410  {
411  $this->qualified_test = $a_id;
412  }
+ Here is the caller graph for this function:

◆ setQualifiedTestPerObjectiveVisibility()

ilLOSettings::setQualifiedTestPerObjectiveVisibility (   $a_stat)

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

287  {
288  $this->qt_visible_lo = $a_stat;
289  }

◆ setQualifyingTestAsStart()

ilLOSettings::setQualifyingTestAsStart (   $a_type)

Set qt as start object.

Parameters
type$a_type

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

Referenced by read().

149  {
150  $this->qt_start = $a_type;
151  }
+ Here is the caller graph for this function:

◆ setQualifyingTestType()

ilLOSettings::setQualifyingTestType (   $a_type)

Set qualifying test type.

Parameters
type$a_type

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

Referenced by read().

122  {
123  $this->qt_type = $a_type;
124  }
+ Here is the caller graph for this function:

◆ settingsExist()

ilLOSettings::settingsExist ( )
Returns
type

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

References $entry_exists.

315  {
316  return $this->entry_exists;
317  }

◆ setType()

ilLOSettings::setType (   $a_type)

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

325  {
326  $this->type = $a_type;
327  }

◆ toXml()

ilLOSettings::toXml ( ilXmlWriter  $writer)

export to xml

Parameters
ilXmlWriter$writer

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

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

613  {
614  $writer->xmlElement(
615  'Settings',
616  array(
617  'initialTestType' => (int) $this->getInitialTestType(),
618  'initialTestStart' => (int) $this->isInitialTestStart(),
619  'qualifyingTestType' => (int) $this->getQualifyingTestType(),
620  'qualifyingTestStart' => (int) $this->isQualifyingTestStart(),
621  'resetResults' => (int) $this->isResetResultsEnabled(),
622  'passedObjectivesMode' => (int) $this->getPassedObjectiveMode(),
623  'iTest' => (int) $this->getInitialTest(),
624  'qTest' => (int) $this->getQualifiedTest()
625  )
626  );
627 
628  }
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
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 469 of file class.ilLOSettings.php.

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

470  {
471  global $ilDB;
472 
473  if(!$this->entry_exists)
474  {
475  return $this->create();
476  }
477 
478  $query = 'UPDATE loc_settings '.' '.
479  'SET it_type = '.$ilDB->quote($this->getInitialTestType(),'integer').', '.
480  'itest = '.$ilDB->quote($this->getInitialTest(),'integer').', '.
481  'qtest = '.$ilDB->quote($this->getQualifiedTest(),'integer').', '.
482  'it_start = '.$ilDB->quote($this->isInitialTestStart(),'integer').', '.
483  'qt_type = '.$ilDB->quote($this->getQualifyingTestType(),'integer').', '.
484  'qt_start = '.$ilDB->quote($this->isQualifyingTestStart(),'integer').', '.
485  'reset_results = '.$ilDB->quote($this->isResetResultsEnabled(),'integer').', '.
486  'passed_obj_mode = '.$ilDB->quote($this->getPassedObjectiveMode(),'integer').' '.
487  'WHERE obj_id = '.$ilDB->quote($this->getObjId(),'integer');
488 
489  $ilDB->manipulate($query);
490  }
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:

◆ updateStartObjects()

ilLOSettings::updateStartObjects ( ilContainerStartObjects  $start)

Update start objects Depends on course objective settings.

Parameters
ilContainerStartObjects

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

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

499  {
500  if($this->getInitialTestType() != self::TYPE_INITIAL_NONE)
501  {
502  if($start->exists($this->getQualifiedTest()))
503  {
504  $start->deleteItem($this->getQualifiedTest());
505  }
506  }
507 
508  switch($this->getInitialTestType())
509  {
510  case self::TYPE_INITIAL_PLACEMENT_ALL:
511  case self::TYPE_INITIAL_QUALIFYING_ALL:
512 
513  if($this->isInitialTestStart())
514  {
515  if(!$start->exists($this->getInitialTest()))
516  {
517  $start->add($this->getInitialTest());
518  }
519  }
520  else
521  {
522  if($start->exists($this->getInitialTest()))
523  {
524  $start->deleteItem($this->getInitialTest());
525  }
526  }
527  break;
528 
529  case self::TYPE_INITIAL_NONE:
530 
531  if($start->exists($this->getInitialTest()))
532  {
533  $start->deleteItem($this->getInitialTest());
534  }
535  break;
536 
537  default:
538 
539  if($start->exists($this->getInitialTest()))
540  {
541  $start->deleteItem($this->getInitialTest());
542  }
543  break;
544  }
545 
546  switch($this->getQualifyingTestType())
547  {
548  case self::TYPE_QUALIFYING_ALL:
549 
550  if($this->isQualifyingTestStart())
551  {
552  if(!$start->exists($this->getQualifiedTest()))
553  {
554  $start->add($this->getQualifiedTest());
555  }
556  }
557  break;
558 
559  default:
560  if($start->exists($this->getQualifiedTest()))
561  {
562  $start->deleteItem($this->getQualifiedTest());
563  }
564  break;
565  }
566  return TRUE;
567  }
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 258 of file class.ilLOSettings.php.

References getInitialTestType().

259  {
260  return $this->getInitialTestType() != self::TYPE_INITIAL_NONE;
261  }
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 249 of file class.ilLOSettings.php.

References isInitialTestStart(), and isQualifyingTestStart().

250  {
251  return $this->isInitialTestStart() or $this->isQualifyingTestStart();
252  }
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 56 of file class.ilLOSettings.php.

Referenced by getObjId().

◆ $entry_exists

ilLOSettings::$entry_exists = false
private

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

Referenced by settingsExist().

◆ $initial_test

ilLOSettings::$initial_test = 0
private

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

Referenced by isInitialTestStart().

◆ $it_type

ilLOSettings::$it_type = self::TYPE_INITIAL_PLACEMENT_ALL
private

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

Referenced by getInitialTestType().

◆ $passed_obj_mode

ilLOSettings::$passed_obj_mode = self::HIDE_PASSED_OBJECTIVE_QST
private

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

◆ $qt_start

ilLOSettings::$qt_start = FALSE
private

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

Referenced by isQualifyingTestStart().

◆ $qt_type

ilLOSettings::$qt_type = self::TYPE_QUALIFYING_ALL
private

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

Referenced by getQualifyingTestType().

◆ $qualified_test

ilLOSettings::$qualified_test = 0
private

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

Referenced by getQualifiedTest().

◆ $reset_results

ilLOSettings::$reset_results = true
private

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

Referenced by isResetResultsEnabled().

◆ $type

ilLOSettings::$type = 0
private

Definition at line 57 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: