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]) {
92 return self::$instances[$a_obj_id];
94 return self::$instances[$a_obj_id] =
new ilLOSettings($a_obj_id);
200 $ilDB = $DIC[
'ilDB'];
204 $query =
'SELECT obj_id FROM loc_settings ' .
205 'WHERE itest = ' .
$ilDB->quote($a_trst_ref_id,
'integer') .
' ' .
206 '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)) {
238 $new_settings->setInitialTest($mappings[$settings->getInitialTest()]);
239 $new_settings->setInitialTestAsStart($new_settings->isInitialTestStart());
242 if ($settings->getQualifiedTest()
and array_key_exists($settings->getQualifiedTest(), $mappings)) {
243 $new_settings->setQualifiedTest($mappings[$settings->getQualifiedTest()]);
244 $new_settings->setQualifyingTestAsStart($settings->isQualifyingTestStart());
248 $new_settings->update();
282 $this->qt_visible_all = $a_stat;
293 $this->qt_visible_lo = $a_stat;
298 return $this->passed_objective_mode;
303 $this->passed_objective_mode = $a_mode;
348 case self::TYPE_TEST_INITIAL:
351 case self::TYPE_TEST_QUALIFIED:
382 include_once
'./Modules/Test/classes/class.ilObjTest.php';
393 $this->initial_test = $a_id;
413 $this->qualified_test = $a_id;
432 $this->reset_results = $a_status;
451 $ilDB = $DIC[
'ilDB'];
453 $query =
'INSERT INTO loc_settings ' .
454 '(obj_id, it_type,itest,qtest,it_start,qt_type,qt_start,reset_results,passed_obj_mode) VALUES ( ' .
467 $this->entry_exists =
true;
479 $ilDB = $DIC[
'ilDB'];
481 if (!$this->entry_exists) {
485 $query =
'UPDATE loc_settings ' .
' ' .
494 'WHERE obj_id = ' .
$ilDB->quote($this->
getObjId(),
'integer');
508 if ($start->
exists($this->getQualifiedTest())) {
514 case self::TYPE_INITIAL_PLACEMENT_ALL:
515 case self::TYPE_INITIAL_QUALIFYING_ALL:
518 if (!$start->
exists($this->getInitialTest())) {
522 if ($start->
exists($this->getInitialTest())) {
528 case self::TYPE_INITIAL_NONE:
530 if ($start->
exists($this->getInitialTest())) {
537 $this->logger->debug(
'Type initial default');
538 if ($start->
exists($this->getInitialTest())) {
539 $this->logger->debug(
'Old start object exists. Trying to delete');
546 case self::TYPE_QUALIFYING_ALL:
549 if (!$start->
exists($this->getQualifiedTest())) {
556 if ($start->
exists($this->getQualifiedTest())) {
572 $ilDB = $DIC[
'ilDB'];
574 $query =
'SELECT * FROM loc_settings ' .
575 'WHERE obj_id = ' .
$ilDB->quote($this->
getObjId(),
'integer');
578 $this->entry_exists =
true;
585 #$this->setType($row->type); 588 #$this->setGeneralQualifiedTestVisibility($row->qt_vis_all); 589 #$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.
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
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.
foreach($_POST as $key=> $value) $res
hasSeparateInitialTests()
Check if separate initial test are configured.
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
const QT_VISIBLE_OBJECTIVE
static lookupContainerForTest($a_test_ref_id)
xmlElement($tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
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)
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
isRandomTestType($a_type)
Check if test is of type random test.
resetResults($a_status)
reset results
const TYPE_INITIAL_PLACEMENT_SELECTED