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


PHP question_engine_data_mapper::load_average_marks方法代码示例

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


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

示例1: dotest_load_average_marks

    protected function dotest_load_average_marks() {
        $averages = $this->dm->load_average_marks($this->bothusages);

        $this->assertEquals(array(
            $this->allslots[0] => (object) array(
                'slot'            => $this->allslots[0],
                'averagefraction' => 0.5,
                'numaveraged'     => 2,
            ),
            $this->allslots[1] => (object) array(
                'slot'            => $this->allslots[1],
                'averagefraction' => 0,
                'numaveraged'     => 1,
            ),
        ), $averages);
    }
开发者ID:verbazend,项目名称:AWFA,代码行数:16,代码来源:question_engine_data_mapper_test.php

示例2: add_average_row

 /**
  * Add an average grade over the attempts of a set of users.
  * @param string $label the title ot use for this row.
  * @param array $users the users to average over.
  */
 protected function add_average_row($label, $users)
 {
     global $DB;
     list($fields, $from, $where, $params) = $this->base_sql($users);
     $record = $DB->get_record_sql("\n                SELECT AVG(quiza.sumgrades) AS grade, COUNT(quiza.sumgrades) AS numaveraged\n                  FROM {$from}\n                 WHERE {$where}", $params);
     $record->grade = quiz_rescale_grade($record->grade, $this->quiz, false);
     if ($this->is_downloading()) {
         $namekey = 'lastname';
     } else {
         $namekey = 'fullname';
     }
     $averagerow = array($namekey => $label, 'sumgrades' => $this->format_average($record), 'feedbacktext' => strip_tags(quiz_report_feedback_for_grade($record->grade, $this->quiz->id, $this->context)));
     if ($this->options->slotmarks) {
         $dm = new question_engine_data_mapper();
         $qubaids = new qubaid_join($from, 'quiza.uniqueid', $where, $params);
         $avggradebyq = $dm->load_average_marks($qubaids, array_keys($this->questions));
         $averagerow += $this->format_average_grade_for_questions($avggradebyq);
     }
     $this->add_data_keyed($averagerow);
 }
开发者ID:MoodleMetaData,项目名称:MoodleMetaData,代码行数:25,代码来源:overview_table.php

示例3: load_average_question_grades

    /**
     * Load the average grade for each question, averaged over particular users.
     * @param array $userids the user ids to average over.
     */
    protected function load_average_question_grades($userids) {
        global $DB;

        $qmfilter = '';
        if ($this->quiz->attempts != 1) {
            $qmfilter = '(' . quiz_report_qm_filter_select($this->quiz, 'quiza') . ') AND ';
        }

        list($usql, $params) = $DB->get_in_or_equal($userids, SQL_PARAMS_NAMED, 'u');
        $params['quizid'] = $this->quiz->id;
        $qubaids = new qubaid_join(
                '{quiz_attempts} quiza',
                'quiza.uniqueid',
                "quiza.userid $usql AND quiza.quiz = :quizid",
                $params);

        $dm = new question_engine_data_mapper();
        return $dm->load_average_marks($qubaids, array_keys($this->questions));
    }
开发者ID:rolandovanegas,项目名称:moodle,代码行数:23,代码来源:overview_table.php


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