當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。