本文整理匯總了PHP中grading_manager::available_areas方法的典型用法代碼示例。如果您正苦於以下問題:PHP grading_manager::available_areas方法的具體用法?PHP grading_manager::available_areas怎麽用?PHP grading_manager::available_areas使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類grading_manager
的用法示例。
在下文中一共展示了grading_manager::available_areas方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: file_get_submitted_draft_itemid
$data->instance = '';
$data->coursemodule = '';
$data->add = $add;
$data->return = 0;
//must be false if this is an add, go back to course view on cancel
$data->sr = $sectionreturn;
if (plugin_supports('mod', $data->modulename, FEATURE_MOD_INTRO, true)) {
$draftid_editor = file_get_submitted_draft_itemid('introeditor');
file_prepare_draft_area($draftid_editor, null, null, null, null, array('subdirs' => true));
$data->introeditor = array('text' => '', 'format' => FORMAT_HTML, 'itemid' => $draftid_editor);
// TODO: add better default
}
if (plugin_supports('mod', $data->modulename, FEATURE_ADVANCED_GRADING, false) and has_capability('moodle/grade:managegradingforms', $context)) {
require_once $CFG->dirroot . '/grade/grading/lib.php';
$data->_advancedgradingdata['methods'] = grading_manager::available_methods();
$areas = grading_manager::available_areas('mod_' . $module->name);
foreach ($areas as $areaname => $areatitle) {
$data->_advancedgradingdata['areas'][$areaname] = array('title' => $areatitle, 'method' => '');
$formfield = 'advancedgradingmethod_' . $areaname;
$data->{$formfield} = '';
}
}
if (!empty($type)) {
//TODO: hopefully will be removed in 2.0
$data->type = $type;
}
$sectionname = get_section_name($course, $cw);
$fullmodulename = get_string('modulename', $module->name);
if ($data->section && $course->format != 'site') {
$heading = new stdClass();
$heading->what = $fullmodulename;
示例2: prepare_new_moduleinfo_data
/**
* Prepare the standard module information for a new module instance.
*
* @param stdClass $course course object
* @param string $modulename module name
* @param int $section section number
* @return array module information about other required data
* @since Moodle 3.2
*/
function prepare_new_moduleinfo_data($course, $modulename, $section)
{
global $CFG;
list($module, $context, $cw) = can_add_moduleinfo($course, $modulename, $section);
$cm = null;
$data = new stdClass();
$data->section = $section;
// The section number itself - relative!!! (section column in course_sections)
$data->visible = $cw->visible;
$data->course = $course->id;
$data->module = $module->id;
$data->modulename = $module->name;
$data->groupmode = $course->groupmode;
$data->groupingid = $course->defaultgroupingid;
$data->id = '';
$data->instance = '';
$data->coursemodule = '';
if (plugin_supports('mod', $data->modulename, FEATURE_MOD_INTRO, true)) {
$draftid_editor = file_get_submitted_draft_itemid('introeditor');
file_prepare_draft_area($draftid_editor, null, null, null, null, array('subdirs' => true));
$data->introeditor = array('text' => '', 'format' => FORMAT_HTML, 'itemid' => $draftid_editor);
// TODO: add better default
}
if (plugin_supports('mod', $data->modulename, FEATURE_ADVANCED_GRADING, false) and has_capability('moodle/grade:managegradingforms', $context)) {
require_once $CFG->dirroot . '/grade/grading/lib.php';
$data->_advancedgradingdata['methods'] = grading_manager::available_methods();
$areas = grading_manager::available_areas('mod_' . $module->name);
foreach ($areas as $areaname => $areatitle) {
$data->_advancedgradingdata['areas'][$areaname] = array('title' => $areatitle, 'method' => '');
$formfield = 'advancedgradingmethod_' . $areaname;
$data->{$formfield} = '';
}
}
return array($module, $context, $cw, $cm, $data);
}