本文整理汇总了PHP中ilLPStatusWrapper::_getStatusInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP ilLPStatusWrapper::_getStatusInfo方法的具体用法?PHP ilLPStatusWrapper::_getStatusInfo怎么用?PHP ilLPStatusWrapper::_getStatusInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilLPStatusWrapper
的用法示例。
在下文中一共展示了ilLPStatusWrapper::_getStatusInfo方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getFailed
function _getFailed($a_obj_id)
{
$status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
if (!count($status_info['scos'])) {
return array();
}
$users = array();
foreach ($status_info['scos'] as $sco_id) {
// max attempts vs. failed
if (sizeof($status_info['in_progress'][$sco_id])) {
foreach ($status_info['in_progress'][$sco_id] as $user_id) {
if (!in_array($user_id, $status_info['failed'][$sco_id])) {
switch ($status_info["subtype"]) {
case 'hacp':
case 'aicc':
case 'scorm':
include_once './Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php';
$has_max_attempts = ilObjSCORMTracking::_hasMaxAttempts($a_obj_id, $user_id);
break;
case 'scorm2004':
include_once "./Modules/Scorm2004/classes/class.ilSCORM2004Tracking.php";
$has_max_attempts = ilSCORM2004Tracking::_hasMaxAttempts($a_obj_id, $user_id);
break;
}
if ($has_max_attempts) {
$status_info['failed'][$sco_id][] = $user_id;
}
}
}
}
$users = array_merge($users, (array) $status_info['failed'][$sco_id]);
}
return array_unique($users);
}
示例2: _getFailed
function _getFailed($a_obj_id)
{
$status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
foreach ($status_info['results'] as $user_data) {
if ($user_data['failed']) {
$user_ids[] = $user_data['user_id'];
}
}
return $user_ids ? $user_ids : array();
}
示例3: _getFailed
function _getFailed($a_obj_id)
{
$objective_results = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
$usr_ids = (array) $objective_results['user_status'][self::LP_STATUS_FAILED_NUM];
if ($usr_ids) {
// Exclude all non members
$usr_ids = array_intersect(self::getMembers($a_obj_id), (array) $usr_ids);
}
return $usr_ids ? $usr_ids : array();
}
示例4: _getCompleted
function _getCompleted($a_obj_id)
{
$usr_ids = array();
$status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
foreach ($status_info['objective_result'] as $user_id => $completed) {
if (count($completed) == $status_info['num_objectives']) {
$usr_ids[] = $user_id;
}
}
if ($usr_ids) {
// Exclude all non members
$usr_ids = array_intersect(self::getMembers($a_obj_id), (array) $usr_ids);
}
return $usr_ids ? $usr_ids : array();
}
示例5: _getCompleted
function _getCompleted($a_obj_id)
{
$status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
$counter = 0;
$users = array();
foreach ($status_info['items'] as $item_id) {
$tmp_users = $status_info['completed'][$item_id];
if (!$counter++) {
$users = $tmp_users;
} else {
$users = array_intersect($users, $tmp_users);
}
}
$users = array_unique($users);
return $users;
}
示例6: determineStatus
/**
* Determine status
*
* @param integer object id
* @param integer user id
* @param object object (optional depends on object type)
* @return integer status
*/
function determineStatus($a_obj_id, $a_user_id, $a_obj = null)
{
global $ilObjDataCache, $ilDB;
$status = LP_STATUS_NOT_ATTEMPTED_NUM;
switch ($ilObjDataCache->lookupType($a_obj_id)) {
case 'lm':
if (ilChangeEvent::hasAccessed($a_obj_id, $a_user_id)) {
$status = LP_STATUS_IN_PROGRESS_NUM;
// completed?
$status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
$tlt = $status_info['tlt'];
include_once './Services/Tracking/classes/class.ilChangeEvent.php';
$re = ilChangeEvent::_lookupReadEvents($a_obj_id, $a_user_id);
if ($re[0]['spent_seconds'] >= $tlt) {
$status = LP_STATUS_COMPLETED_NUM;
}
}
break;
}
return $status;
}
示例7: _getCompleted
function _getCompleted($a_obj_id)
{
$status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
return $status_info['participated_users'] ? $status_info['participated_users'] : array();
}
示例8: getSCOsStatusForUser
function getSCOsStatusForUser($a_user_id, $a_parent_obj_id, array $a_sco_ids)
{
self::refreshObjectsStatus(array($a_parent_obj_id), array($a_user_id));
// import score from tracking data
$scores_raw = $scores = array();
include_once './Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
$subtype = ilObjSAHSLearningModule::_lookupSubType($a_parent_obj_id);
switch ($subtype) {
case 'hacp':
case 'aicc':
case 'scorm':
include_once './Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php';
$module = new ilObjSCORMLearningModule($a_parent_obj_id, false);
$scores_raw = $module->getTrackingDataAgg($a_user_id);
break;
case 'scorm2004':
include_once './Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php';
$module = new ilObjSCORM2004LearningModule($a_parent_obj_id, false);
$scores_raw = $module->getTrackingDataAgg($a_user_id);
break;
}
if ($scores_raw) {
foreach ($scores_raw as $item) {
$scores[$item["sco_id"]] = $item["score"];
}
unset($module);
unset($scores_raw);
}
include_once 'Services/Tracking/classes/class.ilLPStatusWrapper.php';
$status_info = ilLPStatusWrapper::_getStatusInfo($a_parent_obj_id);
$items = array();
foreach ($a_sco_ids as $sco_id) {
// #9719 - can have in_progress AND failed/completed
if (in_array($a_user_id, $status_info["failed"][$sco_id])) {
$status = LP_STATUS_FAILED;
} elseif (in_array($a_user_id, $status_info["completed"][$sco_id])) {
$status = LP_STATUS_COMPLETED;
} elseif (in_array($a_user_id, $status_info["in_progress"][$sco_id])) {
$status = LP_STATUS_IN_PROGRESS;
} else {
$status = LP_STATUS_NOT_ATTEMPTED;
}
$items[$sco_id] = array("title" => $status_info["scos_title"][$sco_id], "status" => $status, "type" => "sahs", "score" => (int) $scores[$sco_id]);
}
return $items;
}
示例9: _getFailed
function _getFailed($a_obj_id)
{
$status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
$users = $status_info['failed'];
return array_unique($users);
}
示例10: _getTypicalLearningTime
function _getTypicalLearningTime($a_obj_id)
{
global $ilObjDataCache;
if ($ilObjDataCache->lookupType($a_obj_id) == 'sahs') {
return parent::_getTypicalLearningTime($a_obj_id);
}
$tlt = 0;
$status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
foreach ($status_info['collections'] as $item) {
$tlt += ilLPStatusWrapper::_getTypicalLearningTime($ilObjDataCache->lookupObjId($item));
}
return $tlt;
}
示例11: getSubItemsStatusForUser
function getSubItemsStatusForUser($a_user_id, $a_parent_obj_id, array $a_item_ids)
{
self::refreshObjectsStatus(array($a_parent_obj_id), array($a_user_id));
switch (ilObject::_lookupType($a_parent_obj_id)) {
case "lm":
include_once './Services/Object/classes/class.ilObjectLP.php';
$olp = ilObjectLP::getInstance($a_parent_obj_id);
$collection = $olp->getCollectionInstance();
if ($collection) {
$item_data = $collection->getPossibleItems();
}
break;
default:
return array();
}
include_once 'Services/Tracking/classes/class.ilLPStatusWrapper.php';
$status_info = ilLPStatusWrapper::_getStatusInfo($a_parent_obj_id);
$items = array();
foreach ($a_item_ids as $item_id) {
if (!isset($item_data[$item_id])) {
continue;
}
if (in_array($a_user_id, $status_info["completed"][$item_id])) {
$status = ilLPStatus::LP_STATUS_COMPLETED;
} elseif (in_array($a_user_id, $status_info["in_progress"][$item_id])) {
$status = ilLPStatus::LP_STATUS_IN_PROGRESS;
} else {
$status = ilLPStatus::LP_STATUS_NOT_ATTEMPTED;
}
$items[$item_id] = array("title" => $item_data[$item_id]["title"], "status" => $status, "type" => "st");
}
return $items;
}