本文整理汇总了PHP中workshop::available_strategies_list方法的典型用法代码示例。如果您正苦于以下问题:PHP workshop::available_strategies_list方法的具体用法?PHP workshop::available_strategies_list怎么用?PHP workshop::available_strategies_list使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类workshop
的用法示例。
在下文中一共展示了workshop::available_strategies_list方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: definition
/**
* Defines the workshop instance configuration form
*
* @return void
*/
public function definition()
{
global $CFG;
$workshopconfig = get_config('workshop');
$mform = $this->_form;
// General --------------------------------------------------------------------
$mform->addElement('header', 'general', get_string('general', 'form'));
// Workshop name
$label = get_string('workshopname', 'workshop');
$mform->addElement('text', 'name', $label, array('size' => '64'));
if (!empty($CFG->formatstringstriptags)) {
$mform->setType('name', PARAM_TEXT);
} else {
$mform->setType('name', PARAM_CLEANHTML);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
// Introduction
$this->standard_intro_elements(get_string('introduction', 'workshop'));
// Grading settings -----------------------------------------------------------
$mform->addElement('header', 'gradingsettings', get_string('gradingsettings', 'workshop'));
$mform->setExpanded('gradingsettings');
$label = get_string('strategy', 'workshop');
$mform->addElement('select', 'strategy', $label, workshop::available_strategies_list());
$mform->setDefault('strategy', $workshopconfig->strategy);
$mform->addHelpButton('strategy', 'strategy', 'workshop');
$grades = workshop::available_maxgrades_list();
$gradecategories = grade_get_categories_menu($this->course->id);
$label = get_string('submissiongrade', 'workshop');
$mform->addGroup(array($mform->createElement('select', 'grade', '', $grades), $mform->createElement('select', 'gradecategory', '', $gradecategories)), 'submissiongradegroup', $label, ' ', false);
$mform->setDefault('grade', $workshopconfig->grade);
$mform->addHelpButton('submissiongradegroup', 'submissiongrade', 'workshop');
$mform->addElement('text', 'submissiongradepass', get_string('gradetopasssubmission', 'workshop'));
$mform->addHelpButton('submissiongradepass', 'gradepass', 'grades');
$mform->setDefault('submissiongradepass', '');
$mform->setType('submissiongradepass', PARAM_RAW);
$label = get_string('gradinggrade', 'workshop');
$mform->addGroup(array($mform->createElement('select', 'gradinggrade', '', $grades), $mform->createElement('select', 'gradinggradecategory', '', $gradecategories)), 'gradinggradegroup', $label, ' ', false);
$mform->setDefault('gradinggrade', $workshopconfig->gradinggrade);
$mform->addHelpButton('gradinggradegroup', 'gradinggrade', 'workshop');
$mform->addElement('text', 'gradinggradepass', get_string('gradetopassgrading', 'workshop'));
$mform->addHelpButton('gradinggradepass', 'gradepass', 'grades');
$mform->setDefault('gradinggradepass', '');
$mform->setType('gradinggradepass', PARAM_RAW);
$options = array();
for ($i = 5; $i >= 0; $i--) {
$options[$i] = $i;
}
$label = get_string('gradedecimals', 'workshop');
$mform->addElement('select', 'gradedecimals', $label, $options);
$mform->setDefault('gradedecimals', $workshopconfig->gradedecimals);
// Submission settings --------------------------------------------------------
$mform->addElement('header', 'submissionsettings', get_string('submissionsettings', 'workshop'));
$label = get_string('instructauthors', 'workshop');
$mform->addElement('editor', 'instructauthorseditor', $label, null, workshop::instruction_editors_options($this->context));
$options = array();
for ($i = 7; $i >= 0; $i--) {
$options[$i] = $i;
}
$label = get_string('nattachments', 'workshop');
$mform->addElement('select', 'nattachments', $label, $options);
$mform->setDefault('nattachments', 1);
$label = get_string('allowedfiletypesforsubmission', 'workshop');
$mform->addElement('text', 'submissionfiletypes', $label, array('maxlength' => 255, 'size' => 64));
$mform->addHelpButton('submissionfiletypes', 'allowedfiletypesforsubmission', 'workshop');
$mform->setType('submissionfiletypes', PARAM_TEXT);
$mform->addRule('submissionfiletypes', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
$mform->disabledIf('submissionfiletypes', 'nattachments', 'eq', 0);
$options = get_max_upload_sizes($CFG->maxbytes, $this->course->maxbytes, 0, $workshopconfig->maxbytes);
$mform->addElement('select', 'maxbytes', get_string('maxbytes', 'workshop'), $options);
$mform->setDefault('maxbytes', $workshopconfig->maxbytes);
$mform->disabledIf('maxbytes', 'nattachments', 'eq', 0);
$label = get_string('latesubmissions', 'workshop');
$text = get_string('latesubmissions_desc', 'workshop');
$mform->addElement('checkbox', 'latesubmissions', $label, $text);
$mform->addHelpButton('latesubmissions', 'latesubmissions', 'workshop');
// Assessment settings --------------------------------------------------------
$mform->addElement('header', 'assessmentsettings', get_string('assessmentsettings', 'workshop'));
$label = get_string('instructreviewers', 'workshop');
$mform->addElement('editor', 'instructreviewerseditor', $label, null, workshop::instruction_editors_options($this->context));
$label = get_string('useselfassessment', 'workshop');
$text = get_string('useselfassessment_desc', 'workshop');
$mform->addElement('checkbox', 'useselfassessment', $label, $text);
$mform->addHelpButton('useselfassessment', 'useselfassessment', 'workshop');
// Feedback -------------------------------------------------------------------
$mform->addElement('header', 'feedbacksettings', get_string('feedbacksettings', 'workshop'));
$mform->addElement('select', 'overallfeedbackmode', get_string('overallfeedbackmode', 'mod_workshop'), array(0 => get_string('overallfeedbackmode_0', 'mod_workshop'), 1 => get_string('overallfeedbackmode_1', 'mod_workshop'), 2 => get_string('overallfeedbackmode_2', 'mod_workshop')));
$mform->addHelpButton('overallfeedbackmode', 'overallfeedbackmode', 'mod_workshop');
$mform->setDefault('overallfeedbackmode', 1);
$options = array();
for ($i = 7; $i >= 0; $i--) {
$options[$i] = $i;
}
$mform->addElement('select', 'overallfeedbackfiles', get_string('overallfeedbackfiles', 'workshop'), $options);
$mform->setDefault('overallfeedbackfiles', 0);
//.........这里部分代码省略.........
示例2: definition
/**
* Defines the workshop instance configuration form
*
* @return void
*/
public function definition()
{
global $CFG;
$workshopconfig = get_config('workshop');
$mform = $this->_form;
// General --------------------------------------------------------------------
$mform->addElement('header', 'general', get_string('general', 'form'));
// Workshop name
$label = get_string('workshopname', 'workshop');
$mform->addElement('text', 'name', $label, array('size' => '64'));
if (!empty($CFG->formatstringstriptags)) {
$mform->setType('name', PARAM_TEXT);
} else {
$mform->setType('name', PARAM_CLEANHTML);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
// Introduction
$this->add_intro_editor(false, get_string('introduction', 'workshop'));
// Workshop features ----------------------------------------------------------
$mform->addElement('header', 'workshopfeatures', get_string('workshopfeatures', 'workshop'));
$label = get_string('useexamples', 'workshop');
$text = get_string('useexamples_desc', 'workshop');
$mform->addElement('checkbox', 'useexamples', $label, $text);
$mform->addHelpButton('useexamples', 'useexamples', 'workshop');
$label = get_string('usepeerassessment', 'workshop');
$text = get_string('usepeerassessment_desc', 'workshop');
$mform->addElement('checkbox', 'usepeerassessment', $label, $text);
$mform->addHelpButton('usepeerassessment', 'usepeerassessment', 'workshop');
$label = get_string('useselfassessment', 'workshop');
$text = get_string('useselfassessment_desc', 'workshop');
$mform->addElement('checkbox', 'useselfassessment', $label, $text);
$mform->addHelpButton('useselfassessment', 'useselfassessment', 'workshop');
// Grading settings -----------------------------------------------------------
$mform->addElement('header', 'gradingsettings', get_string('gradingsettings', 'workshop'));
$grades = workshop::available_maxgrades_list();
$gradecategories = grade_get_categories_menu($this->course->id);
$label = get_string('submissiongrade', 'workshop');
$mform->addGroup(array($mform->createElement('select', 'grade', '', $grades), $mform->createElement('select', 'gradecategory', '', $gradecategories)), 'submissiongradegroup', $label, ' ', false);
$mform->setDefault('grade', $workshopconfig->grade);
$mform->addHelpButton('submissiongradegroup', 'submissiongrade', 'workshop');
$label = get_string('gradinggrade', 'workshop');
$mform->addGroup(array($mform->createElement('select', 'gradinggrade', '', $grades), $mform->createElement('select', 'gradinggradecategory', '', $gradecategories)), 'gradinggradegroup', $label, ' ', false);
$mform->setDefault('gradinggrade', $workshopconfig->gradinggrade);
$mform->addHelpButton('gradinggradegroup', 'gradinggrade', 'workshop');
$label = get_string('strategy', 'workshop');
$mform->addElement('select', 'strategy', $label, workshop::available_strategies_list());
$mform->setDefault('strategy', $workshopconfig->strategy);
$mform->addHelpButton('strategy', 'strategy', 'workshop');
$options = array();
for ($i = 5; $i >= 0; $i--) {
$options[$i] = $i;
}
$label = get_string('gradedecimals', 'workshop');
$mform->addElement('select', 'gradedecimals', $label, $options);
$mform->setAdvanced('gradedecimals');
$mform->setDefault('gradedecimals', $workshopconfig->gradedecimals);
// Submission settings --------------------------------------------------------
$mform->addElement('header', 'submissionsettings', get_string('submissionsettings', 'workshop'));
$label = get_string('instructauthors', 'workshop');
$mform->addElement('editor', 'instructauthorseditor', $label, null, workshop::instruction_editors_options($this->context));
$options = array();
for ($i = 7; $i >= 0; $i--) {
$options[$i] = $i;
}
$label = get_string('nattachments', 'workshop');
$mform->addElement('select', 'nattachments', $label, $options);
$mform->setDefault('nattachments', 1);
$options = get_max_upload_sizes($CFG->maxbytes, $this->course->maxbytes);
$options[0] = get_string('courseuploadlimit') . ' (' . display_size($this->course->maxbytes) . ')';
$mform->addElement('select', 'maxbytes', get_string('maxbytes', 'workshop'), $options);
$mform->setDefault('maxbytes', $workshopconfig->maxbytes);
$label = get_string('latesubmissions', 'workshop');
$text = get_string('latesubmissions_desc', 'workshop');
$mform->addElement('checkbox', 'latesubmissions', $label, $text);
$mform->addHelpButton('latesubmissions', 'latesubmissions', 'workshop');
$mform->setAdvanced('latesubmissions');
// Assessment settings --------------------------------------------------------
$mform->addElement('header', 'assessmentsettings', get_string('assessmentsettings', 'workshop'));
$label = get_string('instructreviewers', 'workshop');
$mform->addElement('editor', 'instructreviewerseditor', $label, null, workshop::instruction_editors_options($this->context));
$label = get_string('examplesmode', 'workshop');
$options = workshop::available_example_modes_list();
$mform->addElement('select', 'examplesmode', $label, $options);
$mform->setDefault('examplesmode', $workshopconfig->examplesmode);
$mform->disabledIf('examplesmode', 'useexamples');
$mform->setAdvanced('examplesmode');
// Access control -------------------------------------------------------------
$mform->addElement('header', 'accesscontrol', get_string('accesscontrol', 'workshop'));
$label = get_string('submissionstart', 'workshop');
$mform->addElement('date_time_selector', 'submissionstart', $label, array('optional' => true));
$mform->setAdvanced('submissionstart');
$label = get_string('submissionend', 'workshop');
$mform->addElement('date_time_selector', 'submissionend', $label, array('optional' => true));
$mform->setAdvanced('submissionend');
//.........这里部分代码省略.........
示例3: array
$options = array();
for ($i = 5; $i >= 0; $i--) {
$options[$i] = $i;
}
$settings->add(new admin_setting_configselect('workshop/gradedecimals', get_string('gradedecimals', 'workshop'),
get_string('configgradedecimals', 'workshop'), 0, $options));
if (isset($CFG->maxbytes)) {
$options = get_max_upload_sizes($CFG->maxbytes);
$settings->add(new admin_setting_configselect('workshop/maxbytes', get_string('maxbytes', 'workshop'),
get_string('configmaxbytes', 'workshop'), 0, $options));
}
$settings->add(new admin_setting_configselect('workshop/strategy', get_string('strategy', 'workshop'),
get_string('configstrategy', 'workshop'), 'accumulative', workshop::available_strategies_list()));
$options = workshop::available_example_modes_list();
$settings->add(new admin_setting_configselect('workshop/examplesmode', get_string('examplesmode', 'workshop'),
get_string('configexamplesmode', 'workshop'), workshop::EXAMPLES_VOLUNTARY, $options));
// include the settings of allocation subplugins
$allocators = get_plugin_list('workshopallocation');
foreach ($allocators as $allocator => $path) {
if (file_exists($settingsfile = $path . '/settings.php')) {
$settings->add(new admin_setting_heading('workshopallocationsetting'.$allocator,
get_string('allocation', 'workshop') . ' - ' . get_string('pluginname', 'workshopallocation_' . $allocator), ''));
include($settingsfile);
}
}
示例4: admin_setting_configselect
if ($ADMIN->fulltree) {
require_once $CFG->dirroot . '/mod/workshop/locallib.php';
$grades = workshop::available_maxgrades_list();
$settings->add(new admin_setting_configselect('workshop/grade', get_string('submissiongrade', 'workshop'), get_string('configgrade', 'workshop'), 80, $grades));
$settings->add(new admin_setting_configselect('workshop/gradinggrade', get_string('gradinggrade', 'workshop'), get_string('configgradinggrade', 'workshop'), 20, $grades));
$options = array();
for ($i = 5; $i >= 0; $i--) {
$options[$i] = $i;
}
$settings->add(new admin_setting_configselect('workshop/gradedecimals', get_string('gradedecimals', 'workshop'), get_string('configgradedecimals', 'workshop'), 0, $options));
if (isset($CFG->maxbytes)) {
$maxbytes = get_config('workshop', 'maxbytes');
$options = get_max_upload_sizes($CFG->maxbytes, 0, 0, $maxbytes);
$settings->add(new admin_setting_configselect('workshop/maxbytes', get_string('maxbytes', 'workshop'), get_string('configmaxbytes', 'workshop'), 0, $options));
}
$settings->add(new admin_setting_configselect('workshop/strategy', get_string('strategy', 'workshop'), get_string('configstrategy', 'workshop'), 'accumulative', workshop::available_strategies_list()));
$options = workshop::available_example_modes_list();
$settings->add(new admin_setting_configselect('workshop/examplesmode', get_string('examplesmode', 'workshop'), get_string('configexamplesmode', 'workshop'), workshop::EXAMPLES_VOLUNTARY, $options));
// include the settings of allocation subplugins
$allocators = core_component::get_plugin_list('workshopallocation');
foreach ($allocators as $allocator => $path) {
if (file_exists($settingsfile = $path . '/settings.php')) {
$settings->add(new admin_setting_heading('workshopallocationsetting' . $allocator, get_string('allocation', 'workshop') . ' - ' . get_string('pluginname', 'workshopallocation_' . $allocator), ''));
include $settingsfile;
}
}
// include the settings of grading strategy subplugins
$strategies = core_component::get_plugin_list('workshopform');
foreach ($strategies as $strategy => $path) {
if (file_exists($settingsfile = $path . '/settings.php')) {
$settings->add(new admin_setting_heading('workshopformsetting' . $strategy, get_string('strategy', 'workshop') . ' - ' . get_string('pluginname', 'workshopform_' . $strategy), ''));