53 private $it_type = self::TYPE_INITIAL_PLACEMENT_ALL;
78 $this->logger =
$GLOBALS[
'DIC']->logger()->crs();
80 $this->container_id = $a_cont_id;
91 if(self::$instances[$a_obj_id])
93 return self::$instances[$a_obj_id];
95 return self::$instances[$a_obj_id] =
new ilLOSettings($a_obj_id);
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');
212 include_once
'./Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
222 public static function cloneSettings($a_copy_id, $a_container_id, $a_new_container_id)
224 include_once
'./Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
226 $mappings =
$options->getMappings();
228 $settings = self::getInstanceByObjId($a_container_id);
229 $new_settings = self::getInstanceByObjId($a_new_container_id);
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());
237 if($settings->getInitialTest()
and array_key_exists($settings->getInitialTest(), $mappings))
239 $new_settings->setInitialTest($mappings[$settings->getInitialTest()]);
240 $new_settings->setInitialTestAsStart($new_settings->isInitialTestStart());
243 if($settings->getQualifiedTest()
and array_key_exists($settings->getQualifiedTest(), $mappings))
245 $new_settings->setQualifiedTest($mappings[$settings->getQualifiedTest()]);
246 $new_settings->setQualifyingTestAsStart($settings->isQualifyingTestStart());
250 $new_settings->update();
284 $this->qt_visible_all = $a_stat;
295 $this->qt_visible_lo = $a_stat;
300 return $this->passed_objective_mode;
305 $this->passed_objective_mode = $a_mode;
351 case self::TYPE_TEST_INITIAL:
354 case self::TYPE_TEST_QUALIFIED:
387 include_once
'./Modules/Test/classes/class.ilObjTest.php';
398 $this->initial_test = $a_id;
418 $this->qualified_test = $a_id;
437 $this->reset_results = $a_status;
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').
', '.
468 $ilDB->manipulate(
$query);
470 $this->entry_exists =
true;
482 if(!$this->entry_exists)
487 $query =
'UPDATE loc_settings '.
' '.
496 'WHERE obj_id = '.$ilDB->quote($this->
getObjId(),
'integer');
498 $ilDB->manipulate(
$query);
511 if($start->
exists($this->getQualifiedTest()))
519 case self::TYPE_INITIAL_PLACEMENT_ALL:
520 case self::TYPE_INITIAL_QUALIFYING_ALL:
524 if(!$start->
exists($this->getInitialTest()))
531 if($start->
exists($this->getInitialTest()))
538 case self::TYPE_INITIAL_NONE:
540 if($start->
exists($this->getInitialTest()))
548 $this->logger->debug(
'Type initial default');
549 if($start->
exists($this->getInitialTest()))
551 $this->logger->debug(
'Old start object exists. Trying to delete');
559 case self::TYPE_QUALIFYING_ALL:
563 if(!$start->
exists($this->getQualifiedTest()))
571 if($start->
exists($this->getQualifiedTest()))
588 $query =
'SELECT * FROM loc_settings '.
589 'WHERE obj_id = '.$ilDB->quote($this->
getObjId(),
'integer');
593 $this->entry_exists =
true;
600 #$this->setType($row->type); 603 #$this->setGeneralQualifiedTestVisibility($row->qt_vis_all); 604 #$this->setQualifiedTestPerObjectiveVisibility($row->qt_vis_obj);
static getInstanceByObjId($a_obj_id)
get singleton instance
update()
update settings type $ilDB
toXml(ilXmlWriter $writer)
export to xml
worksWithInitialTest()
Check if the loc is configured for initial tests.
getTests()
Get assigned tests.
const TYPE_INITIAL_QUALIFYING_SELECTED
static cloneSettings($a_copy_id, $a_container_id, $a_new_container_id)
Clone settings.
isGeneralQualifiedTestVisible()
Check if qualified test for all objectives is visible.
static _lookupRandomTest($a_obj_id)
Returns the fact wether the test with passed obj id is a random questions test or not...
setInitialTest($a_id)
set initial test id
isQualifyingTestStart()
Is qt start object.
getInitialTestType()
Get initial test type.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
updateStartObjects(ilContainerStartObjects $start)
Update start objects Depends on course objective settings.
static isObjectiveTest($a_trst_ref_id)
Check if test ref_id is used in an objective course.
const TYPE_QUALIFYING_ALL
xmlElement($tag, $attrs=NULL, $data=Null, $encode=TRUE, $escape=TRUE)
Writes a basic element (no children, just textual content)
setQualifiedTestPerObjectiveVisibility($a_stat)
create()
Create new entry.
setPassedObjectiveMode($a_mode)
isResetResultsEnabled()
check if reset result is enabled
setQualifiedTest($a_id)
set qualified test
const HIDE_PASSED_OBJECTIVE_QST
deleteItem($a_item_ref_id)
Delete item by ref_id.
isGeneralInitialTestVisible()
Check if initial test for all objectives is visible.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
__construct($a_cont_id)
Constructor.
hasSeparateInitialTests()
Check if separate initial test are configured.
if(!is_array($argv)) $options
setQualifyingTestType($a_type)
Set qualifying test type.
isQualifiedTestPerObjectiveVisible()
static _lookupObjId($a_id)
const MARK_PASSED_OBJECTIVE_QST
isInitialTestQualifying()
Check if initial test is qualifying*.
setInitialTestType($a_type)
Set Initial test type.
setGeneralQualifiedTestVisibility($a_stat)
getQualifiedTest()
get qualified test
Create styles array
The data for the language used.
const QT_VISIBLE_OBJECTIVE
static lookupContainerForTest($a_test_ref_id)
getQualifyingTestType()
Get qualifying test type.
getInitialTest()
get initial test
hasSeparateQualifiedTests()
Check if separate qualified tests are configured.
isInitialTestStart()
Get initial test start.
setQualifyingTestAsStart($a_type)
Set qt as start object.
const TYPE_INITIAL_QUALIFYING_ALL
const TYPE_TEST_QUALIFIED
const TYPE_INITIAL_PLACEMENT_ALL
const TYPE_QUALIFYING_SELECTED
worksWithStartObjects()
Check if start objects are enabled.
const TYPE_TEST_UNDEFINED
setInitialTestAsStart($a_type)
isRandomTestType($a_type)
Check if test is of type random test.
resetResults($a_status)
reset results
const TYPE_INITIAL_PLACEMENT_SELECTED