public function getPossibleItems() { if (!isset(self::$possible_items[$this->obj_id])) { include_once './Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php'; $items = array(); switch (ilObjSAHSLearningModule::_lookupSubType($this->obj_id)) { case 'hacp': case 'aicc': include_once './Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php'; foreach (ilObjAICCLearningModule::_getTrackingItems($this->obj_id) as $item) { $items[$item['obj_id']]['title'] = $item['title']; } break; case 'scorm': include_once './Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php'; include_once './Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php'; foreach (ilObjSCORMLearningModule::_getTrackingItems($this->obj_id) as $item) { $items[$item->getId()]['title'] = $item->getTitle(); } break; case 'scorm2004': include_once './Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php'; foreach (ilObjSCORM2004LearningModule::_getTrackingItems($this->obj_id) as $item) { $items[$item['id']]['title'] = $item['title']; } break; } self::$possible_items[$this->obj_id] = $items; } return self::$possible_items[$this->obj_id]; }
function _getStatusInfo($a_obj_id) { // Which sco's determine the status include_once './Services/Object/classes/class.ilObjectLP.php'; $olp = ilObjectLP::getInstance($a_obj_id); $collection = $olp->getCollectionInstance(); if ($collection) { $status_info['scos'] = $collection->getItems(); } else { $status_info['scos'] = array(); } $status_info['num_scos'] = count($status_info['scos']); // Get subtype include_once './Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php'; $status_info['subtype'] = ilObjSAHSLearningModule::_lookupSubType($a_obj_id); switch ($status_info['subtype']) { case 'hacp': case 'aicc': include_once './Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php'; $status_info['num_completed'] = ilObjSCORMTracking::_getCountCompletedPerUser($status_info['scos'], $a_obj_id); include_once './Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php'; foreach (ilObjAICCLearningModule::_getTrackingItems($a_obj_id) as $item) { if (in_array($item['obj_id'], $status_info['scos'])) { $status_info['scos_title']["{$item['obj_id']}"] = $item['title']; } } $info = ilObjSCORMTracking::_getProgressInfo($status_info['scos'], $a_obj_id); break; case 'scorm': include_once './Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php'; $status_info['num_completed'] = ilObjSCORMTracking::_getCountCompletedPerUser($status_info['scos'], $a_obj_id); include_once './Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php'; foreach ($status_info['scos'] as $sco_id) { $status_info['scos_title'][$sco_id] = ilSCORMItem::_lookupTitle($sco_id); } $info = ilObjSCORMTracking::_getProgressInfo($status_info['scos'], $a_obj_id); break; case "scorm2004": include_once './Modules/Scorm2004/classes/class.ilSCORM2004Tracking.php'; $status_info['num_completed'] = ilSCORM2004Tracking::_getCountCompletedPerUser($status_info['scos'], $a_obj_id, true); include_once './Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php'; foreach ($status_info['scos'] as $sco_id) { $status_info['scos_title'][$sco_id] = ilObjSCORM2004LearningModule::_lookupItemTitle($sco_id); } $info = ilSCORM2004Tracking::_getItemProgressInfo($status_info['scos'], $a_obj_id, true); break; } $status_info['completed'] = array(); $status_info['failed'] = array(); $status_info['in_progress'] = array(); foreach ($status_info['scos'] as $sco_id) { $status_info['completed'][$sco_id] = $info['completed'][$sco_id] ? $info['completed'][$sco_id] : array(); $status_info['failed'][$sco_id] = $info['failed'][$sco_id] ? $info['failed'][$sco_id] : array(); $status_info['in_progress'][$sco_id] = $info['in_progress'][$sco_id] ? $info['in_progress'][$sco_id] : array(); } //var_dump($status_info["completed"]); return $status_info; }
/** * get all tracking items of scorm object */ function getTrackingItems() { return ilObjAICCLearningModule::_getTrackingItems($this->getId()); }
/** * get all tracking items of scorm or aicc object */ function _getPossibleSAHSItems($target_id) { include_once './Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php'; switch (ilObjSAHSLearningModule::_lookupSubType($target_id)) { case 'hacp': case 'aicc': include_once './Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php'; foreach (ilObjAICCLearningModule::_getTrackingItems($target_id) as $item) { $items["{$item['obj_id']}"]['title'] = $item['title']; #$items[$item->getId()]['title'] = $item->getTitle(); } return $items ? $items : array(); case 'scorm': include_once './Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php'; include_once './Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php'; foreach (ilObjSCORMLearningModule::_getTrackingItems($target_id) as $item) { $items[$item->getId()]['title'] = $item->getTitle(); } return $items ? $items : array(); case 'scorm2004': include_once './Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php'; foreach (ilObjSCORM2004LearningModule::_getTrackingItems($target_id) as $item) { $items[$item["id"]]['title'] = $item["title"]; } return $items ? $items : array(); } return array(); }