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


PHP question_engine_data_mapper::sum_usage_marks_subquery方法代码示例

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


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

示例1: dotest_sum_usage_marks_subquery

 /**
  * This test is executed by {@link test_reporting_queries()}.
  */
 protected function dotest_sum_usage_marks_subquery()
 {
     global $DB;
     $totals = $DB->get_records_sql_menu("SELECT qu.id, ({$this->dm->sum_usage_marks_subquery('qu.id')}) AS totalmark\n                  FROM {question_usages} qu\n                 WHERE qu.id IN ({$this->usageids[0]}, {$this->usageids[1]})");
     $this->assertNull($totals[$this->usageids[0]]);
     // Since a question requires grading.
     $this->assertNotNull($totals[$this->usageids[1]]);
     // Grrr! PHP null == 0 makes this hard.
     $this->assertEquals(0, $totals[$this->usageids[1]]);
 }
开发者ID:gabrielrosset,项目名称:moodle,代码行数:13,代码来源:datalib_reporting_queries_test.php

示例2: quiz_update_all_attempt_sumgrades

function quiz_update_all_attempt_sumgrades($quiz)
{
    global $DB;
    $dm = new question_engine_data_mapper();
    $timenow = time();
    $sql = "UPDATE {quiz_attempts}\n            SET\n                timemodified = :timenow,\n                sumgrades = (\n                    {$dm->sum_usage_marks_subquery('uniqueid')}\n                )\n            WHERE quiz = :quizid AND timefinish <> 0";
    $DB->execute($sql, array('timenow' => $timenow, 'quizid' => $quiz->id));
}
开发者ID:rosenclever,项目名称:moodle,代码行数:8,代码来源:locallib.php

示例3: quiz_update_all_attempt_sumgrades

/**
 * Update the sumgrades field of the attempts at a quiz.
 *
 * @param object $quiz a quiz.
 */
function quiz_update_all_attempt_sumgrades($quiz) {
    global $DB;
    $dm = new question_engine_data_mapper();
    $timenow = time();

    $sql = "UPDATE {quiz_attempts}
            SET
                timemodified = :timenow,
                sumgrades = (
                    {$dm->sum_usage_marks_subquery('uniqueid')}
                )
            WHERE quiz = :quizid AND state = :finishedstate";
    $DB->execute($sql, array('timenow' => $timenow, 'quizid' => $quiz->id,
            'finishedstate' => quiz_attempt::FINISHED));
}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:20,代码来源:locallib.php

示例4: offlinequiz_update_all_attempt_sumgrades

/**
 * Update the sumgrades field of the results in an offline quiz.
 *
 * @param object $offlinequiz The offlinequiz.
 */
function offlinequiz_update_all_attempt_sumgrades($offlinequiz)
{
    global $DB;
    $dm = new question_engine_data_mapper();
    $timenow = time();
    $sql = "UPDATE {offlinequiz_results}\n               SET timemodified = :timenow,\n                   sumgrades = (\n                                {$dm->sum_usage_marks_subquery('usageid')}\n                               )\n             WHERE offlinequizid = :offlinequizid\n               AND timefinish <> 0";
    $DB->execute($sql, array('timenow' => $timenow, 'offlinequizid' => $offlinequiz->id));
}
开发者ID:frankkoch,项目名称:moodle-mod_offlinequiz,代码行数:13,代码来源:locallib.php


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