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';
94 $settings = self::getInstanceByObjId($a_container_id);
95 $new_settings = self::getInstanceByObjId($a_new_container_id);
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);
static getInstanceByObjId($a_obj_id)
get singleton instance
update()
update settings type $ilDB
worksWithInitialTest()
Check if the loc is configured for initial tests.
getTests()
Get assigned tests.
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
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.
setQualifiedTestPerObjectiveVisibility($a_stat)
create()
Create new entry.
const DB_FETCHMODE_OBJECT
deleteItem($a_item_ref_id)
Delete item by ref_id.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
__construct($a_cont_id)
Constructor.
if(!is_array($argv)) $options
isQualifiedTestPerObjectiveVisible()
static _lookupObjId($a_id)
setGeneralQualifiedTestVisibility($a_stat)
Check if qualified test for all objectives is visible.
const QT_VISIBLE_OBJECTIVE
const TYPE_TEST_QUALIFIED
isRandomTestType($a_type)
Check if test is of type random test.