本文整理汇总了PHP中ilLPStatusWrapper::_getNotAttempted方法的典型用法代码示例。如果您正苦于以下问题:PHP ilLPStatusWrapper::_getNotAttempted方法的具体用法?PHP ilLPStatusWrapper::_getNotAttempted怎么用?PHP ilLPStatusWrapper::_getNotAttempted使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilLPStatusWrapper
的用法示例。
在下文中一共展示了ilLPStatusWrapper::_getNotAttempted方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getInProgress
function _getInProgress($a_obj_id)
{
global $ilDB;
global $ilBench;
$ilBench->start('LearningProgress', '9182_LPStatusTestPassed_inProgress');
include_once './Modules/Test/classes/class.ilObjTestAccess.php';
$query = "SELECT DISTINCT(user_fi) FROM tst_active " . "WHERE test_fi = '" . ilObjTestAccess::_getTestIDFromObjectID($a_obj_id) . "'";
$res = $ilDB->query($query);
while ($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) {
$user_ids[] = $row->user_fi;
}
$users = array_diff((array) $user_ids, ilLPStatusWrapper::_getCompleted($a_obj_id));
$users = array_diff((array) $users, ilLPStatusWrapper::_getFailed($a_obj_id));
$users = array_diff((array) $users, ilLPStatusWrapper::_getNotAttempted($a_obj_id));
$ilBench->stop('LearningProgress', '9182_LPStatusTestPassed_inProgress');
return $users ? $users : array();
}
示例2: _getCountNotAttempted
/**
* Static function to read the number of user who have the status 'not_attempted'
*/
function _getCountNotAttempted($a_obj_id)
{
return count(ilLPStatusWrapper::_getNotAttempted($a_obj_id));
}
示例3: refreshStatus
/**
* Refresh status
*
* @param
* @return
*/
function refreshStatus($a_obj_id, $a_users = null)
{
include_once "./Services/Tracking/classes/class.ilLPStatusWrapper.php";
$not_attempted = ilLPStatusWrapper::_getNotAttempted($a_obj_id);
foreach ($not_attempted as $user_id) {
$percentage = $this->determinePercentage($a_obj_id, $user_id);
if (self::writeStatus($a_obj_id, $user_id, self::LP_STATUS_NOT_ATTEMPTED_NUM, $percentage, true)) {
self::raiseEvent($a_obj_id, $user_id, self::LP_STATUS_NOT_ATTEMPTED_NUM, $percentage);
}
}
$in_progress = ilLPStatusWrapper::_getInProgress($a_obj_id);
foreach ($in_progress as $user_id) {
$percentage = $this->determinePercentage($a_obj_id, $user_id);
if (self::writeStatus($a_obj_id, $user_id, self::LP_STATUS_IN_PROGRESS_NUM, $percentage, true)) {
self::raiseEvent($a_obj_id, $user_id, self::LP_STATUS_IN_PROGRESS_NUM, $percentage);
}
}
$completed = ilLPStatusWrapper::_getCompleted($a_obj_id);
foreach ($completed as $user_id) {
$percentage = $this->determinePercentage($a_obj_id, $user_id);
if (self::writeStatus($a_obj_id, $user_id, self::LP_STATUS_COMPLETED_NUM, $percentage, true)) {
self::raiseEvent($a_obj_id, $user_id, self::LP_STATUS_COMPLETED_NUM, $percentage);
}
}
$failed = ilLPStatusWrapper::_getFailed($a_obj_id);
foreach ($failed as $user_id) {
$percentage = $this->determinePercentage($a_obj_id, $user_id);
if (self::writeStatus($a_obj_id, $user_id, self::LP_STATUS_FAILED_NUM, $percentage, true)) {
self::raiseEvent($a_obj_id, $user_id, self::LP_STATUS_FAILED_NUM, $percentage);
}
}
if ($a_users) {
$missing_users = array_diff($a_users, $not_attempted + $in_progress + $completed + $failed);
if ($missing_users) {
foreach ($missing_users as $user_id) {
ilLPStatusWrapper::_updateStatus($a_obj_id, $user_id);
}
}
}
}