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


PHP question_engine::questions_in_use方法代码示例

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


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

示例1: questions_in_use

/**
 * @param array $questionids of question ids.
 * @return boolean whether any of these questions are being used by any part of Moodle.
 */
function questions_in_use($questionids)
{
    global $CFG;
    if (question_engine::questions_in_use($questionids)) {
        return true;
    }
    foreach (core_component::get_plugin_list('mod') as $module => $path) {
        $lib = $path . '/lib.php';
        if (is_readable($lib)) {
            include_once $lib;
            $fn = $module . '_questions_in_use';
            if (function_exists($fn)) {
                if ($fn($questionids)) {
                    return true;
                }
            } else {
                // Fallback for legacy modules.
                $fn = $module . '_question_list_instances';
                if (function_exists($fn)) {
                    foreach ($questionids as $questionid) {
                        $instances = $fn($questionid);
                        if (!empty($instances)) {
                            return true;
                        }
                    }
                }
            }
        }
    }
    return false;
}
开发者ID:tyleung,项目名称:CMPUT401MoodleExams,代码行数:35,代码来源:questionlib.php

示例2: quiz_questions_in_use

/**
 * @param array $questionids of question ids.
 * @return bool whether any of these questions are used by any instance of this module.
 */
function quiz_questions_in_use($questionids) {
    global $DB, $CFG;
    require_once($CFG->libdir . '/questionlib.php');
    list($test, $params) = $DB->get_in_or_equal($questionids);
    return $DB->record_exists_select('quiz_question_instances',
            'question ' . $test, $params) || question_engine::questions_in_use(
            $questionids, new qubaid_join('{quiz_attempts} quiza',
            'quiza.uniqueid', 'quiza.preview = 0'));
}
开发者ID:nutanrajmalanai,项目名称:moodle,代码行数:13,代码来源:lib.php


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