45 $this->container_id = $a_cont_id;
56 if(self::$instances[$a_obj_id])
58 return self::$instances[$a_obj_id];
60 return self::$instances[$a_obj_id] =
new ilLOSettings($a_obj_id);
71 $query =
'SELECT obj_id FROM loc_settings '.
72 'WHERE itest = '.$ilDB->quote($a_trst_ref_id,
'integer').
' '.
73 'OR qtest = '.$ilDB->quote($a_trst_ref_id,
'integer');
88 public static function cloneSettings($a_copy_id, $a_container_id, $a_new_container_id)
90 include_once
'./Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
97 $new_settings->setType($settings->getType());
98 $new_settings->setGeneralQualifiedTestVisibility($settings->isGeneralQualifiedTestVisible());
99 $new_settings->setQualifiedTestPerObjectiveVisibility($settings->isQualifiedTestPerObjectiveVisible());
100 $new_settings->resetResults($settings->isResetResultsEnabled());
102 if($settings->getInitialTest() and array_key_exists($settings->getInitialTest(), $mappings))
104 $new_settings->setInitialTest($mappings[$settings->getInitialTest()]);
107 if($settings->getQualifiedTest() and array_key_exists($settings->getQualifiedTest(), $mappings))
109 $new_settings->setQualifiedTest($mappings[$settings->getQualifiedTest()]);
112 $new_settings->create();
122 ($this->
getType() == self::LOC_INITIAL_ALL) or
123 ($this->
getType() == self::LOC_INITIAL_SEL)
142 $this->qt_visible_all = $a_stat;
153 $this->qt_visible_lo = $a_stat;
172 $this->type = $a_type;
185 case self::TYPE_TEST_INITIAL:
188 case self::TYPE_TEST_QUALIFIED:
219 include_once
'./Modules/Test/classes/class.ilObjTest.php';
229 $this->initial_test = $a_id;
239 $this->qualified_test = $a_id;
249 $this->reset_results = $a_status;
264 $query =
'INSERT INTO loc_settings '.
265 '(obj_id, type,itest,qtest,qt_vis_all,qt_vis_obj,reset_results) VALUES ( '.
266 $ilDB->quote($this->
getObjId(),
'integer').
', '.
267 $ilDB->quote($this->
getType(),
'integer').
', '.
274 $ilDB->manipulate(
$query);
286 if(!$this->entry_exists)
291 $query =
'UPDATE loc_settings '.
' '.
292 'SET type = '.$ilDB->quote($this->
getType(),
'integer').
', '.
298 'WHERE obj_id = '.$ilDB->quote($this->
getObjId(),
'integer');
300 $ilDB->manipulate(
$query);
313 case self::LOC_INITIAL_ALL:
314 if($start->
exists($this->getQualifiedTest()))
318 if(!$start->
exists($this->getInitialTest()))
324 case self::LOC_INITIAL_SEL:
325 case self::LOC_PRACTISE:
326 if($start->
exists($this->getQualifiedTest()))
330 if($start->
exists($this->getInitialTest()))
336 case self::LOC_QUALIFIED:
337 if(!$start->
exists($this->getQualifiedTest()))
341 if($start->
exists($this->getInitialTest()))
358 $query =
'SELECT * FROM loc_settings '.
359 'WHERE obj_id = '.$ilDB->quote($this->
getObjId(),
'integer');
363 $this->entry_exists =
true;
367 #$this->setGeneralQualifiedTestVisibility($row->qt_vis_all);