本文整理汇总了PHP中ilChangeEvent::lookupUsersInProgress方法的典型用法代码示例。如果您正苦于以下问题:PHP ilChangeEvent::lookupUsersInProgress方法的具体用法?PHP ilChangeEvent::lookupUsersInProgress怎么用?PHP ilChangeEvent::lookupUsersInProgress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilChangeEvent
的用法示例。
在下文中一共展示了ilChangeEvent::lookupUsersInProgress方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getInProgress
function _getInProgress($a_obj_id)
{
include_once './Services/Tracking/classes/class.ilChangeEvent.php';
$users = ilChangeEvent::lookupUsersInProgress($a_obj_id);
include_once './Services/Object/classes/class.ilObjectLP.php';
$olp = ilObjectLP::getInstance($a_obj_id);
$collection = $olp->getCollectionInstance();
if ($collection) {
foreach ($collection->getItems() as $item_id) {
$item_id = ilObject::_lookupObjId($item_id);
// merge arrays of users with status 'in progress'
$users = array_unique(array_merge((array) $users, ilLPStatusWrapper::_getInProgress($item_id)));
$users = array_unique(array_merge((array) $users, ilLPStatusWrapper::_getCompleted($item_id)));
}
}
// Exclude all users with status completed.
$users = array_diff((array) $users, ilLPStatusWrapper::_getCompleted($a_obj_id));
// Exclude all users with status failed.
$users = array_diff((array) $users, ilLPStatusWrapper::_getFailed($a_obj_id));
if ($users) {
// Exclude all non members
$users = array_intersect(self::getMembers($a_obj_id), (array) $users);
}
return $users;
}
示例2: _getInProgress
function _getInProgress($a_obj_id)
{
include_once './Services/Tracking/classes/class.ilChangeEvent.php';
$users = ilChangeEvent::lookupUsersInProgress($a_obj_id);
// Exclude all users with status completed.
$users = array_diff((array) $users, ilLPStatusWrapper::_getCompleted($a_obj_id));
return $users;
}
示例3: _getInProgress
/**
* get in progress
*
* @access public
* @param int object id
* @return array int Array of user ids
*/
public function _getInProgress($a_obj_id)
{
include_once './Services/Tracking/classes/class.ilChangeEvent.php';
$users = ilChangeEvent::lookupUsersInProgress($a_obj_id);
// Exclude all users with status completed.
$users = array_diff((array) $users, ilLPStatusWrapper::_getCompleted($a_obj_id));
if ($users) {
// Exclude all non members
$users = array_intersect(self::getMembers($a_obj_id), (array) $users);
}
return $users;
}
示例4: _getInProgress
function _getInProgress($a_obj_id)
{
include_once './Modules/Exercise/classes/class.ilExerciseMembers.php';
include_once './Services/Tracking/classes/class.ilChangeEvent.php';
$users = ilExerciseMembers::_getReturned($a_obj_id);
$all = ilChangeEvent::lookupUsersInProgress($a_obj_id);
$users = $users + $all;
$users = array_diff($users, ilLPStatusWrapper::_getCompleted($a_obj_id));
$users = array_diff($users, ilLPStatusWrapper::_getFailed($a_obj_id));
if ($users) {
// Exclude all non members
$users = array_intersect(self::getMembers($a_obj_id), (array) $users);
}
return $users;
}
示例5: _getCompleted
function _getCompleted($a_obj_id)
{
$usr_ids = array();
include_once './Services/Tracking/classes/class.ilChangeEvent.php';
$users = ilChangeEvent::lookupUsersInProgress($a_obj_id);
include_once "Modules/LearningModule/classes/class.ilLMTracker.php";
foreach ($users as $user_id) {
// :TODO: this ought to be optimized
$tracker = ilLMTracker::getInstanceByObjId($a_obj_id, $user_id);
if ($tracker->getAllQuestionsCorrect()) {
$usr_ids[] = $user_id;
}
}
return $usr_ids;
}
示例6: _getStatusInfo
function _getStatusInfo($a_obj_id)
{
global $ilDB;
include_once 'Modules/Course/classes/class.ilCourseObjective.php';
$status_info = array();
$status_info['user_status'] = array();
$status_info['objectives'] = ilCourseObjective::_getObjectiveIds($a_obj_id, true);
$status_info['num_objectives'] = count($status_info['objectives']);
if ($status_info['num_objectives']) {
$in = $ilDB->in('objective_id', $status_info['objectives'], false, 'integer');
include_once "Modules/Course/classes/Objectives/class.ilLOUserResults.php";
foreach (ilLOUserResults::getSummarizedObjectiveStatusForLP($a_obj_id, $status_info['objectives']) as $user_id => $user_status) {
$status_info['user_status'][$user_status][] = $user_id;
}
// change event should lead to "in progress" - see determineStatus()
include_once "./Services/Tracking/classes/class.ilChangeEvent.php";
foreach (ilChangeEvent::lookupUsersInProgress($a_obj_id) as $user_id) {
if (!is_array($status_info['user_status'][ilLPStatus::LP_STATUS_IN_PROGRESS_NUM]) || !in_array($user_id, $status_info['user_status'][ilLPStatus::LP_STATUS_IN_PROGRESS_NUM])) {
$status_info['user_status'][ilLPStatus::LP_STATUS_IN_PROGRESS_NUM][] = $user_id;
}
}
// Read title/description
$query = "SELECT * FROM crs_objectives WHERE " . $in;
$res = $ilDB->query($query);
while ($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) {
$status_info['objective_title'][$row->objective_id] = $row->title;
$status_info['objective_description'][$row->objective_id] = $row->description;
}
}
return $status_info;
}