当前位置: 首页>>代码示例>>PHP>>正文


PHP Exercise::selectAttempts方法代码示例

本文整理汇总了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();
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:exercise_result.php

示例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();
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:overview.php


注:本文中的Exercise::selectAttempts方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。