本文整理汇总了PHP中assQuestion::_areAnswered方法的典型用法代码示例。如果您正苦于以下问题:PHP assQuestion::_areAnswered方法的具体用法?PHP assQuestion::_areAnswered怎么用?PHP assQuestion::_areAnswered使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类assQuestion
的用法示例。
在下文中一共展示了assQuestion::_areAnswered方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getStatus
function getStatus($a_course_id)
{
include_once './Modules/TestQuestionPool/classes/class.assQuestion.php';
include_once 'Modules/Course/classes/class.ilCourseObjective.php';
// begin-patch lok
$objective_ids = ilCourseObjective::_getObjectiveIds($a_course_id, true);
// end-patch lok
$objectives = ilCourseObjectiveResult::_readAssignedObjectives($objective_ids);
$accomplished = $this->getAccomplished($a_course_id);
$suggested = $this->getSuggested($a_course_id);
if (!count($objective_ids)) {
return IL_OBJECTIVE_STATUS_EMPTY;
}
if (count($accomplished) == count($objective_ids)) {
return IL_OBJECTIVE_STATUS_FINISHED;
}
$all_pretest_answered = false;
$all_final_answered = false;
foreach ($objectives as $data) {
if (assQuestion::_areAnswered($this->getUserId(), $data['questions'])) {
if ($data['tst_status']) {
$all_final_answered = true;
} else {
$all_pretest_answered = true;
}
}
}
if ($all_final_answered) {
return IL_OBJECTIVE_STATUS_FINAL;
}
if ($all_pretest_answered and !count($suggested)) {
return IL_OBJECTIVE_STATUS_PRETEST_NON_SUGGEST;
} elseif ($all_pretest_answered) {
return IL_OBJECTIVE_STATUS_PRETEST;
}
return IL_OBJECTIVE_STATUS_NONE;
}