本文整理汇总了PHP中lti_get_config函数的典型用法代码示例。如果您正苦于以下问题:PHP lti_get_config函数的具体用法?PHP lti_get_config怎么用?PHP lti_get_config使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了lti_get_config函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lti_accepts_grades
function lti_accepts_grades($ltiinstance)
{
global $DB;
$acceptsgrades = true;
$ltitype = $DB->get_record('lti_types', array('id' => $ltiinstance->typeid));
if (empty($ltitype->toolproxyid)) {
$typeconfig = lti_get_config($ltiinstance);
$typeacceptgrades = isset($typeconfig['acceptgrades']) ? $typeconfig['acceptgrades'] : LTI_SETTING_DELEGATE;
if (!($typeacceptgrades == LTI_SETTING_ALWAYS || $typeacceptgrades == LTI_SETTING_DELEGATE && $ltiinstance->instructorchoiceacceptgrades == LTI_SETTING_ALWAYS)) {
$acceptsgrades = false;
}
} else {
$enabledcapabilities = explode("\n", $ltitype->enabledcapability);
$acceptsgrades = in_array('Result.autocreate', $enabledcapabilities);
}
return $acceptsgrades;
}
示例2: lti_get_type_config_from_instance
/**
*
* Generates some of the tool configuration based on the instance details
*
* @param int $id
*
* @return Instance configuration
*
*/
function lti_get_type_config_from_instance($id) {
global $DB;
$instance = $DB->get_record('lti', array('id' => $id));
$config = lti_get_config($instance);
$type = new stdClass();
$type->lti_fix = $id;
if (isset($config['toolurl'])) {
$type->lti_toolurl = $config['toolurl'];
}
if (isset($config['instructorchoicesendname'])) {
$type->lti_sendname = $config['instructorchoicesendname'];
}
if (isset($config['instructorchoicesendemailaddr'])) {
$type->lti_sendemailaddr = $config['instructorchoicesendemailaddr'];
}
if (isset($config['instructorchoiceacceptgrades'])) {
$type->lti_acceptgrades = $config['instructorchoiceacceptgrades'];
}
if (isset($config['instructorchoiceallowroster'])) {
$type->lti_allowroster = $config['instructorchoiceallowroster'];
}
if (isset($config['instructorcustomparameters'])) {
$type->lti_allowsetting = $config['instructorcustomparameters'];
}
return $type;
}
示例3: lti_accepts_grades
function lti_accepts_grades($ltiinstance)
{
$acceptsgrades = true;
$typeconfig = lti_get_config($ltiinstance);
$typeacceptgrades = isset($typeconfig['acceptgrades']) ? $typeconfig['acceptgrades'] : LTI_SETTING_DELEGATE;
if (!($typeacceptgrades == LTI_SETTING_ALWAYS || $typeacceptgrades == LTI_SETTING_DELEGATE && $ltiinstance->instructorchoiceacceptgrades == LTI_SETTING_ALWAYS)) {
$acceptsgrades = false;
}
return $acceptsgrades;
}