本文整理汇总了PHP中completion_info::get_user_completion方法的典型用法代码示例。如果您正苦于以下问题:PHP completion_info::get_user_completion方法的具体用法?PHP completion_info::get_user_completion怎么用?PHP completion_info::get_user_completion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类completion_info
的用法示例。
在下文中一共展示了completion_info::get_user_completion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
// Handle activity completion differently
if ($criterion->criteriatype == COMPLETION_CRITERIA_TYPE_ACTIVITY) {
// Load activity
$mod = $criterion->get_mod_instance();
$activity = $DB->get_record('course_modules', array('id' => $criterion->moduleinstance));
$activity->name = $mod->name;
// Get progress information and state
if (array_key_exists($activity->id, $user->progress)) {
$thisprogress = $user->progress[$activity->id];
$state = $thisprogress->completionstate;
$date = userdate($thisprogress->timemodified);
} else {
$state = COMPLETION_INCOMPLETE;
$date = '';
}
$criteria_completion = $completion->get_user_completion($user->id, $criterion);
// Work out how it corresponds to an icon
switch ($state) {
case COMPLETION_INCOMPLETE:
$completiontype = 'n';
break;
case COMPLETION_COMPLETE:
$completiontype = 'y';
break;
case COMPLETION_COMPLETE_PASS:
$completiontype = 'pass';
break;
case COMPLETION_COMPLETE_FAIL:
$completiontype = 'fail';
break;
}