本文整理汇总了PHP中ExerciseLib::get_exercises_to_be_taken方法的典型用法代码示例。如果您正苦于以下问题:PHP ExerciseLib::get_exercises_to_be_taken方法的具体用法?PHP ExerciseLib::get_exercises_to_be_taken怎么用?PHP ExerciseLib::get_exercises_to_be_taken使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExerciseLib
的用法示例。
在下文中一共展示了ExerciseLib::get_exercises_to_be_taken方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: return_exercise_block
function return_exercise_block($personal_course_list)
{
$exercise_list = array();
if (!empty($personal_course_list)) {
foreach ($personal_course_list as $course_item) {
$course_code = $course_item['c'];
$session_id = $course_item['id_session'];
$exercises = ExerciseLib::get_exercises_to_be_taken($course_code, $session_id);
foreach ($exercises as $exercise_item) {
$exercise_item['course_code'] = $course_code;
$exercise_item['session_id'] = $session_id;
$exercise_item['tms'] = api_strtotime($exercise_item['end_time'], 'UTC');
$exercise_list[] = $exercise_item;
}
}
if (!empty($exercise_list)) {
$exercise_list = ArrayClass::msort($exercise_list, 'tms');
$my_exercise = $exercise_list[0];
$url = Display::url($my_exercise['title'], api_get_path(WEB_CODE_PATH) . 'exercice/overview.php?exerciseId=' . $my_exercise['id'] . '&cidReq=' . $my_exercise['course_code'] . '&id_session=' . $my_exercise['session_id']);
$this->tpl->assign('exercise_url', $url);
$this->tpl->assign('exercise_end_date', api_convert_and_format_date($my_exercise['end_time'], DATE_FORMAT_SHORT));
}
}
}