73 $this->container_id = $a_cont_id;
84 if(self::$instances[$a_obj_id])
86 return self::$instances[$a_obj_id];
88 return self::$instances[$a_obj_id] =
new ilLOSettings($a_obj_id);
97 $this->it_type = $a_type;
123 $this->qt_type = $a_type;
132 $this->it_start = $a_type;
150 $this->qt_start = $a_type;
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');
205 include_once
'./Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
215 public static function cloneSettings($a_copy_id, $a_container_id, $a_new_container_id)
217 include_once
'./Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
219 $mappings =
$options->getMappings();
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());
230 if($settings->getInitialTest() and array_key_exists($settings->getInitialTest(), $mappings))
232 $new_settings->setInitialTest($mappings[$settings->getInitialTest()]);
233 $new_settings->setInitialTestAsStart($new_settings->isInitialTestStart());
236 if($settings->getQualifiedTest() and array_key_exists($settings->getQualifiedTest(), $mappings))
238 $new_settings->setQualifiedTest($mappings[$settings->getQualifiedTest()]);
239 $new_settings->setQualifyingTestAsStart($settings->isQualifyingTestStart());
243 $new_settings->update();
277 $this->qt_visible_all = $a_stat;
288 $this->qt_visible_lo = $a_stat;
293 return $this->passed_objective_mode;
298 $this->passed_objective_mode = $a_mode;
326 $this->type = $a_type;
380 include_once
'./Modules/Test/classes/class.ilObjTest.php';
391 $this->initial_test = $a_id;
411 $this->qualified_test = $a_id;
430 $this->reset_results = $a_status;
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 ( '.
461 $ilDB->manipulate(
$query);
473 if(!$this->entry_exists)
478 $query =
'UPDATE loc_settings '.
' '.
487 'WHERE obj_id = '.$ilDB->quote($this->
getObjId(),
'integer');
489 $ilDB->manipulate(
$query);
502 if($start->
exists($this->getQualifiedTest()))
515 if(!$start->
exists($this->getInitialTest()))
522 if($start->
exists($this->getInitialTest()))
531 if($start->
exists($this->getInitialTest()))
539 if($start->
exists($this->getInitialTest()))
552 if(!$start->
exists($this->getQualifiedTest()))
560 if($start->
exists($this->getQualifiedTest()))
577 $query =
'SELECT * FROM loc_settings '.
578 'WHERE obj_id = '.$ilDB->quote($this->
getObjId(),
'integer');
582 $this->entry_exists =
true;
589 #$this->setType($row->type);
592 #$this->setGeneralQualifiedTestVisibility($row->qt_vis_all);
593 #$this->setQualifiedTestPerObjectiveVisibility($row->qt_vis_obj);
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.
getTests()
Get assigned tests.
const TYPE_INITIAL_QUALIFYING_ALL
setQualifiedTestPerObjectiveVisibility($a_stat)
update()
update settings @global type $ilDB
setQualifyingTestType($a_type)
Set qualifying test type.
const TYPE_TEST_QUALIFIED
isQualifiedTestPerObjectiveVisible()
const QT_VISIBLE_OBJECTIVE
const TYPE_INITIAL_PLACEMENT_SELECTED
hasSeparateQualifiedTests()
Check if separate qualified tests are configured.
getInitialTestType()
Get initial test type.
const HIDE_PASSED_OBJECTIVE_QST
isInitialTestQualifying()
Check if initial test is qualifying*.
isInitialTestStart()
Get initial test start.
const TYPE_QUALIFYING_ALL
const TYPE_INITIAL_PLACEMENT_ALL
setGeneralQualifiedTestVisibility($a_stat)
worksWithStartObjects()
Check if start objects are enabled.
isRandomTestType($a_type)
Check if test is of type random test.
setInitialTestType($a_type)
Set Initial test type.
getInitialTest()
get initial test
setInitialTestAsStart($a_type)
const MARK_PASSED_OBJECTIVE_QST
setInitialTest($a_id)
set initial test id
updateStartObjects(ilContainerStartObjects $start)
Update start objects Depends on course objective settings.
resetResults($a_status)
reset results
worksWithInitialTest()
Check if the loc is configured for initial tests.
setPassedObjectiveMode($a_mode)
__construct($a_cont_id)
Constructor.
const TYPE_QUALIFYING_SELECTED
static cloneSettings($a_copy_id, $a_container_id, $a_new_container_id)
Clone settings.
const TYPE_TEST_UNDEFINED
const TYPE_INITIAL_QUALIFYING_SELECTED
isGeneralInitialTestVisible()
Check if initial test for all objectives is visible.
static isObjectiveTest($a_trst_ref_id)
Check if test ref_id is used in an objective course.
isResetResultsEnabled()
check if reset result is enabled
setQualifyingTestAsStart($a_type)
Set qt as start object.
static getInstanceByObjId($a_obj_id)
get singleton instance
isQualifyingTestStart()
Is qt start object.
create()
Create new entry.
hasSeparateInitialTests()
Check if separate initial test are configured.
toXml(ilXmlWriter $writer)
export to xml
setQualifiedTest($a_id)
set qualified test
isGeneralQualifiedTestVisible()
Check if qualified test for all objectives is visible.
getQualifiedTest()
get qualified test
getQualifyingTestType()
Get qualifying test type.
static lookupContainerForTest($a_test_ref_id)
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)
xmlElement($tag, $attrs=NULL, $data=Null, $encode=TRUE, $escape=TRUE)
Writes a basic element (no children, just textual content)
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
if(!is_array($argv)) $options