// Output starts here
echo $OUTPUT->header();
-echo $OUTPUT->heading(get_string('strategy' . $workshop->strategy, 'workshop'));
+echo $OUTPUT->heading(get_string('pluginname', 'workshopgrading_' . $workshop->strategy));
$mform->display();
*/
protected function definition_inner(&$mform) {
- $workshopconfig = get_config('workshop');
+ $plugindefaults = get_config('workshopgrading_noerrors');
$nodimensions = $this->_customdata['nodimensions']; // number of currently filled dimensions
$norepeats = $this->_customdata['norepeats']; // number of dimensions to display
$descriptionopts = $this->_customdata['descriptionopts']; // wysiwyg fields options
$mform->addElement('editor', 'description__idx_'.$i.'_editor',
get_string('dimensiondescription', 'workshopgrading_noerrors'), '', $descriptionopts);
$mform->addElement('text', 'grade0__idx_'.$i, get_string('grade0', 'workshopgrading_noerrors'), array('size'=>'15'));
- $mform->setDefault('grade0__idx_'.$i, $workshopconfig->noerrorsgrade0);
+ $mform->setDefault('grade0__idx_'.$i, $plugindefaults->grade0);
$mform->setType('grade0__idx_'.$i, PARAM_TEXT);
$mform->addElement('text', 'grade1__idx_'.$i, get_string('grade1', 'workshopgrading_noerrors'), array('size'=>'15'));
- $mform->setDefault('grade1__idx_'.$i, $workshopconfig->noerrorsgrade1);
+ $mform->setDefault('grade1__idx_'.$i, $plugindefaults->grade1);
$mform->setType('grade1__idx_'.$i, PARAM_TEXT);
$mform->addElement('select', 'weight__idx_'.$i, get_string('dimensionweight', 'workshopgrading_noerrors'), $weights);
$mform->setDefault('weight__idx_'.$i, 1);
--- /dev/null
+<?php
+
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * The configuration variables for "Number of errors" grading strategy
+ *
+ * The values defined here are often used as defaults for all module instances.
+ *
+ * @package mod-workshop
+ * @copyright 2009 David Mudrak <david.mudrak@gmail.com>
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+$settings->add(new admin_setting_configtext('workshopgrading_noerrors/grade0', get_string('grade0', 'workshopgrading_noerrors'),
+ get_string('configgrade0', 'workshopgrading_noerrors'),
+ get_string('grade0default', 'workshopgrading_noerrors'), $paramtype=PARAM_TEXT, $size=15));
+
+$settings->add(new admin_setting_configtext('workshopgrading_noerrors/grade1', get_string('grade1', 'workshopgrading_noerrors'),
+ get_string('configgrade1', 'workshopgrading_noerrors'),
+ get_string('grade1default', 'workshopgrading_noerrors'), $paramtype=PARAM_TEXT, $size=15));
$settings->add(new admin_setting_configselect('workshop/assessmentcomps', get_string('assessmentcomps', 'workshop'),
get_string('configassessmentcomps', 'workshop'), WORKSHOP_COMPARISON_NORMAL, $levels));
-$settings->add(new admin_setting_configtext('workshop/noerrorsgrade0', get_string('noerrorsgrade0', 'workshop'),
- get_string('confignoerrorsgrade0', 'workshop'), get_string('noerrorsgrade0default', 'workshop'),
- $paramtype=PARAM_TEXT, $size=15));
-
-$settings->add(new admin_setting_configtext('workshop/noerrorsgrade1', get_string('noerrorsgrade1', 'workshop'),
- get_string('confignoerrorsgrade1', 'workshop'), get_string('noerrorsgrade1default', 'workshop'),
- $paramtype=PARAM_TEXT, $size=15));
-
-/*
-$settings->add(new admin_setting_configcheckbox('assignment_showrecentsubmissions', get_string('showrecentsubmissions', 'assignment'),
- get_string('configshowrecentsubmissions', 'assignment'), 1));
-*/
+// include the settings of grading strategy subplugins
+$strategies = get_plugin_list('workshopgrading');
+foreach ($strategies as $strategy => $path) {
+ if (file_exists($settingsfile = $path . '/settings.php')) {
+ $settings->add(new admin_setting_heading('workshopgradingsetting'.$strategy,
+ get_string('pluginname', 'workshopgrading_' . $strategy), ''));
+ include($settingsfile);
+ }
+}