本文整理汇总了PHP中Exercise::displayQuestionListByAttempt方法的典型用法代码示例。如果您正苦于以下问题:PHP Exercise::displayQuestionListByAttempt方法的具体用法?PHP Exercise::displayQuestionListByAttempt怎么用?PHP Exercise::displayQuestionListByAttempt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Exercise
的用法示例。
在下文中一共展示了Exercise::displayQuestionListByAttempt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
$i = $total_score = $total_weight = 0;
//We check if the user attempts before sending to the exercise_result.php
if ($objExercise->selectAttempts() > 0) {
$attempt_count = get_attempt_count(api_get_user_id(), $objExercise->id, $learnpath_id, $learnpath_item_id, $learnpath_item_view_id);
if ($attempt_count >= $objExercise->selectAttempts()) {
Display::display_warning_message(sprintf(get_lang('ReachedMaxAttempts'), $objExercise->selectTitle(), $objExercise->selectAttempts()), false);
if ($origin != 'learnpath') {
// We are not in learnpath tool
Display::display_footer();
}
exit;
}
}
Display::display_normal_message(get_lang('Saved') . '<br />', false);
// Display questions.
$objExercise->displayQuestionListByAttempt($exe_id, true);
// If is not valid.
/*
$session_control_key = ExerciseLib::get_session_time_control_key($objExercise->id, $learnpath_id, $learnpath_item_id);
if (isset($session_control_key) && !ExerciseLib::exercise_time_control_is_valid($objExercise->id, $learnpath_id, $learnpath_item_id)) {
$TBL_TRACK_ATTEMPT = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
$sql_fraud = "UPDATE $TBL_TRACK_ATTEMPT SET answer = 0, marks = 0, position = 0 WHERE exe_id = $exe_id ";
Database::query($sql_fraud);
}*/
// Unset session for clock time.
ExerciseLib::exercise_time_control_delete($objExercise->id, $learnpath_id, $learnpath_item_id);
ExerciseLib::delete_chat_exercise_session($exe_id);
if ($origin != 'learnpath') {
echo '<hr>';
echo $objExercise->returnEndButtonHTML();
if (api_is_allowed_to_session_edit()) {
示例2: Exercise
}
$is_allowedToEdit = api_is_allowed_to_edit(null, true) || $is_courseTutor;
//Getting results from the exe_id. This variable also contain all the information about the exercise
$track_exercise_info = ExerciseLib::get_exercise_track_exercise_info($id);
//No track info
if (empty($track_exercise_info)) {
api_not_allowed($show_headers);
}
$exercise_id = $track_exercise_info['exe_exo_id'];
$student_id = $track_exercise_info['exe_user_id'];
$current_user_id = api_get_user_id();
$objExercise = new Exercise();
if (!empty($exercise_id)) {
$objExercise->read($exercise_id);
}
//Only users can see their own results
if (!$is_allowedToEdit) {
if ($student_id != $current_user_id) {
api_not_allowed($show_headers);
}
}
if ($show_headers) {
$interbreadcrumb[] = array("url" => "exercice.php", "name" => get_lang('Exercices'));
$interbreadcrumb[] = array("url" => "#", "name" => get_lang('Result'));
$this_section = SECTION_COURSES;
Display::display_header();
} else {
Display::display_reduced_header();
}
$objExercise->displayQuestionListByAttempt($id, false);
Display::display_footer();