/** * Update start objects * Depends on course objective settings * * @param ilContainerStartObjects */ public function updateStartObjects(ilContainerStartObjects $start) { if ($this->getInitialTestType() != self::TYPE_INITIAL_NONE) { if ($start->exists($this->getQualifiedTest())) { $start->deleteItem($this->getQualifiedTest()); } } switch ($this->getInitialTestType()) { case self::TYPE_INITIAL_PLACEMENT_ALL: case self::TYPE_INITIAL_QUALIFYING_ALL: if ($this->isInitialTestStart()) { if (!$start->exists($this->getInitialTest())) { $start->add($this->getInitialTest()); } } else { if ($start->exists($this->getInitialTest())) { $start->deleteItem($this->getInitialTest()); } } break; case self::TYPE_INITIAL_NONE: if ($start->exists($this->getInitialTest())) { $start->deleteItem($this->getInitialTest()); } break; default: if ($start->exists($this->getInitialTest())) { $start->deleteItem($this->getInitialTest()); } break; } switch ($this->getQualifyingTestType()) { case self::TYPE_QUALIFYING_ALL: if ($this->isQualifyingTestStart()) { if (!$start->exists($this->getQualifiedTest())) { $start->add($this->getQualifiedTest()); } } break; default: if ($start->exists($this->getQualifiedTest())) { $start->deleteItem($this->getQualifiedTest()); } break; } return TRUE; }
/** * Update start objects * Depends on course objective settings * * @param ilContainerStartObjects */ public function updateStartObjects(ilContainerStartObjects $start) { switch ($this->getType()) { case self::LOC_INITIAL_ALL: if ($start->exists($this->getQualifiedTest())) { $start->deleteItem($this->getQualifiedTest()); } if (!$start->exists($this->getInitialTest())) { $start->add($this->getInitialTest()); } break; case self::LOC_INITIAL_SEL: case self::LOC_PRACTISE: if ($start->exists($this->getQualifiedTest())) { $start->deleteItem($this->getQualifiedTest()); } if ($start->exists($this->getInitialTest())) { $start->deleteItem($this->getInitialTest()); } break; case self::LOC_QUALIFIED: if (!$start->exists($this->getQualifiedTest())) { $start->add($this->getQualifiedTest()); } if ($start->exists($this->getInitialTest())) { $start->deleteItem($this->getInitialTest()); } break; } return true; }