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);
 
  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();
 
  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;
 
  303        $this->passed_objective_mode = $a_mode;
 
  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;
 
  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;
 
  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())) {
 
  518                    if (!$start->
exists($this->getInitialTest())) {
 
  522                    if ($start->
exists($this->getInitialTest())) {
 
  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');
 
  549                    if (!$start->
exists($this->getQualifiedTest())) {
 
  556                if ($start->
exists($this->getQualifiedTest())) {
 
  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); 
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
An exception for terminatinating execution or to throw for unit testing.
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)
foreach($_POST as $key=> $value) $res