26        $this->container_id = $a_container_id;
 
   28        include_once 
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
 
   40        if (self::$instances[$a_container_id]) {
 
   41            return self::$instances[$a_container_id];
 
   43        return self::$instances[$a_container_id] = 
new self($a_container_id);
 
   56        $query = 
'SELECT container_id FROM loc_tst_assignments ' .
 
   57                'WHERE tst_ref_id = ' . 
$ilDB->quote($a_test_ref_id, 
'integer');
 
   60            return $row->container_id;
 
   99        $query = 
'DELETE FROM loc_tst_assignments ' .
 
  100                'WHERE container_id = ' . 
$ilDB->quote($a_container_id, 
'integer');
 
  107        foreach ($this->assignments as $assignment) {
 
  108            if ($assignment->getAssignmentType() == 
$a_type) {
 
  109                $by_type[] = $assignment;
 
  126            $tests[] = $this->
getSettings()->getQualifiedTest();
 
  128        foreach ($this->assignments as $assignment) {
 
  129            $tests[] = $assignment->getTestRefId();
 
  144                if (!$this->
getSettings()->hasSeparateInitialTests()) {
 
  150                if (!$this->
getSettings()->hasSeparateQualifiedTests()) {
 
  158            return $assignment->getTestRefId();
 
  165        if (!$this->
getSettings()->hasSeparateInitialTests()) {
 
  166            if ($this->
getSettings()->getInitialTest() == $a_test_ref_id) {
 
  170        if (!$this->
getSettings()->hasSeparateQualifiedTests()) {
 
  171            if ($this->
getSettings()->getQualifiedTest() == $a_test_ref_id) {
 
  185            if ($this->
getSettings()->getInitialTest() == $a_test_ref_id) {
 
  188        } elseif ($this->
getSettings()->worksWithInitialTest()) {
 
  189            foreach ($this->assignments as $assignment) {
 
  190                if ($assignment->getTestRefId() == $a_test_ref_id) {
 
  195        if (!$this->
getSettings()->hasSeparateQualifiedTests()) {
 
  196            if ($this->
getSettings()->getQualifiedTest() == $a_test_ref_id) {
 
  200            foreach ($this->assignments as $assignment) {
 
  201                if ($assignment->getTestRefId() == $a_test_ref_id) {
 
  218        foreach ($this->assignments as $assignment) {
 
  220                ($assignment->getObjectiveId() == $a_objective_id) &&
 
  221                ($assignment->getAssignmentType() == 
$a_type)
 
  239        $query = 
'SELECT assignment_id FROM loc_tst_assignments ' .
 
  243            include_once 
'./Modules/Course/classes/Objectives/class.ilLOTestAssignment.php';
 
  246            $this->assignments[] = $assignment;
 
  257            if ($assignment->getObjectiveId() != $a_objective_id) {
 
  261            include_once 
'./Modules/Course/classes/Objectives/class.ilLOXmlWriter.php';
 
  266                    'refId' => $assignment->getTestRefId(),
 
  267                    'testType' => $assignment->getAssignmentType()
 
  285        $objectives = array();
 
  287        $query = 
'SELECT objective_id FROM loc_tst_assignments ' .
 
  288                'WHERE tst_ref_id = ' . 
$ilDB->quote($a_test_ref_id, 
'integer');
 
  291            $objectives[] = $row->objective_id;
 
An exception for terminatinating execution or to throw for unit testing.
const TYPE_TEST_QUALIFIED
const TYPE_TEST_UNDEFINED
static getInstanceByObjId($a_obj_id)
get singleton instance
static getInstance($a_container_id)
Get instance by container id.
isSeparateTest($a_test_ref_id)
getAssignmentsByType($a_type)
getTypeByTest($a_test_ref_id)
Get test type by test id.
__construct($a_container_id)
Constructor.
getTestByObjective($a_objective_id, $a_type)
static deleteByContainer($a_container_id)
Delete assignments by container id (obj_id of course) @global type $ilDB.
toXml(ilXmlWriter $writer, $a_objective_id)
to xml
getTests()
Get all assigned tests.
static lookupObjectivesForTest($a_test_ref_id)
Get all objectives that are assigned to given test.
getAssignmentByObjective($a_objective_id, $a_type)
Get assignment by objective.
getSettings()
get objective settings
getAssignments()
Get assignments.
readTestAssignments()
Read assignments @global type $ilDB.
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)
foreach($_POST as $key=> $value) $res