function &getTypicalAgeRangeIds() { include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDTypicalAgeRange.php'; return ilMDTypicalAgeRange::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_educational'); }
/** * test MetaData * @group IL_Init * @return */ public function testTypicalAgeRange() { include_once './Services/MetaData/classes/class.ilMDTypicalAgeRange.php'; include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php'; $con = new ilMDTypicalAgeRange(1, 2, 'xxx'); $con->setTypicalAgeRange('12-22'); $ret = $con->save(); $this->assertGreaterThan(0, $ret); $con->setTypicalAgeRange('12-14'); $con->update(); $con->read(); $desc = $con->getTypicalAgeRange(); $this->assertEquals('12-14', $desc); $con->delete(); }
function toXML(&$writer) { $writer->xmlStartTag('Educational', array('InteractivityType' => $this->getInteractivityType() ? $this->getInteractivityType() : 'Active', 'LearningResourceType' => $this->getLearningResourceType() ? $this->getLearningResourceType() : 'Exercise', 'InteractivityLevel' => $this->getInteractivityLevel() ? $this->getInteractivityLevel() : 'Medium', 'SemanticDensity' => $this->getSemanticDensity() ? $this->getSemanticDensity() : 'Medium', 'IntendedEndUserRole' => $this->getIntendedEndUserRole() ? $this->getIntendedEndUserRole() : 'Learner', 'Context' => $this->getContext() ? $this->getContext() : 'Other', 'Difficulty' => $this->getDifficulty() ? $this->getDifficulty() : 'Medium')); // TypicalAgeRange $typ_ages = $this->getTypicalAgeRangeIds(); foreach ($typ_ages as $id) { $key =& $this->getTypicalAgeRange($id); // extra test due to bug 5316 (may be due to eLaix import) if (is_object($key)) { $key->toXML($writer); } } if (!count($typ_ages)) { include_once 'Services/MetaData/classes/class.ilMDTypicalAgeRange.php'; $typ = new ilMDTypicalAgeRange($this->getRBACId(), $this->getObjId()); $typ->toXML($writer); } // TypicalLearningTime $writer->xmlElement('TypicalLearningTime', null, $this->getTypicalLearningTime()); // Description foreach ($this->getDescriptionIds() as $id) { $key =& $this->getDescription($id); $key->toXML($writer); } // Language foreach ($this->getLanguageIds() as $id) { $lang =& $this->getLanguage($id); $lang->toXML($writer); } $writer->xmlEndTag('Educational'); }