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


PHP Tracking::count_student_exercise_attempts方法代码示例

本文整理汇总了PHP中Tracking::count_student_exercise_attempts方法的典型用法代码示例。如果您正苦于以下问题:PHP Tracking::count_student_exercise_attempts方法的具体用法?PHP Tracking::count_student_exercise_attempts怎么用?PHP Tracking::count_student_exercise_attempts使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tracking的用法示例。


在下文中一共展示了Tracking::count_student_exercise_attempts方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_lang

            <th><?php 
            echo get_lang('AllAttempts');
            ?>
</th>
        </tr>
        <?php 
            $csv_content[] = array();
            $csv_content[] = array(get_lang('Exercises'), get_lang('LearningPath'), get_lang('AvgCourseScore'), get_lang('Attempts'));
            $t_quiz = Database::get_course_table(TABLE_QUIZ_TEST);
            $sql = "SELECT quiz.title, id FROM " . $t_quiz . " AS quiz\n                WHERE\n                    quiz.c_id =  " . $info_course['real_id'] . " AND\n                    (quiz.session_id = {$sessionId} OR quiz.session_id = 0) AND\n                    active IN (0, 1)\n                ORDER BY quiz.title ASC ";
            $result_exercices = Database::query($sql);
            $i = 0;
            if (Database::num_rows($result_exercices) > 0) {
                while ($exercices = Database::fetch_array($result_exercices)) {
                    $exercise_id = intval($exercices['id']);
                    $count_attempts = Tracking::count_student_exercise_attempts($student_id, $courseInfo['real_id'], $exercise_id, 0, 0, $sessionId, 2);
                    $score_percentage = Tracking::get_avg_student_exercise_score($student_id, $course_code, $exercise_id, $sessionId, 1, 0);
                    if (!isset($score_percentage) && $count_attempts > 0) {
                        $scores_lp = Tracking::get_avg_student_exercise_score($student_id, $course_code, $exercise_id, $sessionId, 2, 1);
                        $score_percentage = $scores_lp[0];
                        $lp_name = $scores_lp[1];
                    } else {
                        $lp_name = '-';
                    }
                    $lp_name = !empty($lp_name) ? $lp_name : get_lang('NoLearnpath');
                    if ($i % 2) {
                        $css_class = 'row_odd';
                    } else {
                        $css_class = 'row_even';
                    }
                    echo '<tr class="' . $css_class . '"><td>' . $exercices['title'] . '</td>';
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:myStudents.php

示例2: get_lang

            <th><?php 
        echo get_lang('AllAttempts');
        ?>
</th>
        </tr>
		<?php 
        $csv_content[] = array();
        $csv_content[] = array(get_lang('Exercices'), get_lang('Score'), get_lang('Attempts'));
        $t_quiz = Database::get_course_table(TABLE_QUIZ_TEST);
        $sql_exercices = "SELECT quiz.title, iid FROM " . $t_quiz . " AS quiz\n\t\t\t\t\t\t  WHERE quiz.c_id =  " . $courseId . " AND\n\t\t\t\t\t\t  \t\tactive='1' AND\n\t\t\t\t\t\t\t\t(quiz.session_id = {$session_id} OR quiz.session_id = 0)\n                          ORDER BY quiz.title ASC ";
        $result_exercices = Database::query($sql_exercices);
        $i = 0;
        if (Database::num_rows($result_exercices) > 0) {
            while ($exercices = Database::fetch_array($result_exercices)) {
                $exercise_id = intval($exercices['iid']);
                $count_attempts = Tracking::count_student_exercise_attempts($student_id, $courseId, $exercise_id, 0, 0, $session_id);
                $score_percentage = Tracking::get_avg_student_exercise_score($student_id, $courseId, $exercise_id, $session_id);
                $csv_content[] = array($exercices['title'], $score_percentage . '%', $count_attempts);
                if ($i % 2) {
                    $css_class = 'row_odd';
                } else {
                    $css_class = 'row_even';
                }
                echo '<tr class="' . $css_class . '"><td>' . $exercices['title'] . '</td>';
                echo '<td>';
                if ($count_attempts > 0) {
                    echo $score_percentage . '%';
                } else {
                    echo '-';
                    $score_percentage = 0;
                }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:myStudents.php


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