本文整理汇总了PHP中Exercise::selectAttempts方法的典型用法代码示例。如果您正苦于以下问题:PHP Exercise::selectAttempts方法的具体用法?PHP Exercise::selectAttempts怎么用?PHP Exercise::selectAttempts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Exercise
的用法示例。
在下文中一共展示了Exercise::selectAttempts方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
echo $learnpath_id;
?>
" />
<input type="hidden" name="learnpath_item_id" value="<?php
echo $learnpath_item_id;
?>
" />
<input type="hidden" name="learnpath_item_view_id" value="<?php
echo $learnpath_item_view_id;
?>
" />
<?php
}
$i = $total_score = $max_score = 0;
//We check if the user attempts before sending to the exercise_result.php
if ($objExercise->selectAttempts() > 0) {
$attempt_count = Event::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;
}
}
$total_score = 0;
if (!empty($exercise_stat_info)) {
$total_score = $exercise_stat_info['exe_result'];
}
$max_score = $objExercise->get_max_score();
示例2: foreach
if (!empty($my_attempt_array)) {
foreach ($my_attempt_array as $data) {
$column = 0;
$table->setCellContents($row, $column, $data);
$class = 'class="row_odd"';
if ($row % 2) {
$class = 'class="row_even"';
}
$table->setRowAttributes($row, $class, true);
$column++;
$row++;
}
}
$table_content = $table->toHtml();
}
if ($objExercise->selectAttempts()) {
if ($is_allowed_to_edit) {
//$options.= Display::div(get_lang('ExerciseAttempts').' '.$objExercise->selectAttempts(), array('class'=>'right_option'));
}
$attempt_message = get_lang('Attempts') . ' ' . $counter . ' / ' . $objExercise->selectAttempts();
if ($counter == $objExercise->selectAttempts()) {
$attempt_message = Display::return_message($attempt_message, 'error');
} else {
$attempt_message = Display::return_message($attempt_message, 'info');
}
if ($visible_return['value'] == true) {
$message .= $attempt_message;
}
}
if ($time_control) {
$html .= $objExercise->returnTimeLeftDiv();