mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 16:04:25 +02:00
Remember the recently used grading evaluation settings
This commit is contained in:
parent
f55650e6bc
commit
1372eaa91b
19
mod/workshop/eval/best/db/install.xml
Normal file
19
mod/workshop/eval/best/db/install.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<XMLDB PATH="mod/workshop/eval/best/db" VERSION="20091020" COMMENT="XMLDB file for Moodle mod/workshop/eval/best"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="../../../../../lib/xmldb/xmldb.xsd"
|
||||
>
|
||||
<TABLES>
|
||||
<TABLE NAME="workshopeval_best_settings" COMMENT="Settings for the grading evaluation subplugin Distance from the best assessment.">
|
||||
<FIELDS>
|
||||
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="workshopid"/>
|
||||
<FIELD NAME="workshopid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="id" NEXT="comparison"/>
|
||||
<FIELD NAME="comparison" TYPE="int" LENGTH="3" NOTNULL="false" UNSIGNED="true" DEFAULT="5" SEQUENCE="false" COMMENT="Here we store the recently set factor of comparison of assessment in the given workshop. Reasonable values are from 1 to 10 or so. Default to 5." PREVIOUS="workshopid"/>
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="fkuq_workshop"/>
|
||||
<KEY NAME="fkuq_workshop" TYPE="foreign-unique" FIELDS="workshopid" REFTABLE="workshop" REFFIELDS="id" COMMENT="Every workshop can have only one settings record" PREVIOUS="primary"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
</TABLES>
|
||||
</XMLDB>
|
@ -31,5 +31,6 @@ $string['comparisonlevel3'] = 'strict';
|
||||
$string['comparisonlevel5'] = 'fair';
|
||||
$string['comparisonlevel7'] = 'lax';
|
||||
$string['comparisonlevel9'] = 'very lax';
|
||||
$string['configcomparison'] = 'Default value of the factor that influnce the grading evaluation.';
|
||||
$string['pluginname'] = 'Distance to the best assessment';
|
||||
$string['settings'] = 'Grading evaluation settings';
|
||||
|
@ -37,6 +37,9 @@ class workshop_best_evaluation implements workshop_evaluation {
|
||||
/** @var workshop the parent workshop instance */
|
||||
protected $workshop;
|
||||
|
||||
/** @var the recently used settings in this workshop */
|
||||
protected $settings;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@ -44,7 +47,9 @@ class workshop_best_evaluation implements workshop_evaluation {
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(workshop $workshop) {
|
||||
global $DB;
|
||||
$this->workshop = $workshop;
|
||||
$this->settings = $DB->get_record('workshopeval_best_settings', array('workshopid' => $this->workshop->id));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -53,6 +58,7 @@ class workshop_best_evaluation implements workshop_evaluation {
|
||||
* This function relies on the grading strategy subplugin providing get_assessments_recordset() method.
|
||||
* {@see self::process_assessments()} for the required structure of the recordset.
|
||||
*
|
||||
* @param stdClass $settings The settings for this round of evaluation
|
||||
* @param null|int|array $restrict If null, update all reviewers, otherwise update just grades for the given reviewers(s)
|
||||
*
|
||||
* @return void
|
||||
@ -60,6 +66,18 @@ class workshop_best_evaluation implements workshop_evaluation {
|
||||
public function update_grading_grades(stdClass $settings, $restrict=null) {
|
||||
global $DB;
|
||||
|
||||
// remember the recently used settings for this workshop
|
||||
if (empty($this->settings)) {
|
||||
$record = new stdClass();
|
||||
$record->workshopid = $this->workshop->id;
|
||||
$record->comparison = $settings->comparison;
|
||||
$DB->insert_record('workshopeval_best_settings', $record);
|
||||
} elseif ($this->settings->comparison != $settings->comparison) {
|
||||
$DB->set_field('workshopeval_best_settings', 'comparison', $settings->comparison,
|
||||
array('workshopid' => $this->workshop->id));
|
||||
}
|
||||
|
||||
// get the grading strategy instance
|
||||
$grader = $this->workshop->grading_strategy_instance();
|
||||
|
||||
// get the information about the assessment dimensions
|
||||
@ -96,11 +114,11 @@ class workshop_best_evaluation implements workshop_evaluation {
|
||||
*/
|
||||
public function get_settings_form(moodle_url $actionurl=null) {
|
||||
global $CFG; // needed because the included files use it
|
||||
global $DB;
|
||||
require_once(dirname(__FILE__) . '/settings_form.php');
|
||||
|
||||
$current = null; // the recently used setting - todo where should it be stored?
|
||||
$customdata['current'] = $current;
|
||||
$customdata['workshop'] = $this->workshop;
|
||||
$customdata['current'] = $this->settings;
|
||||
$attributes = array('class' => 'evalsettingsform best');
|
||||
|
||||
return new workshop_best_evaluation_settings_form($actionurl, $customdata, 'post', '', $attributes);
|
||||
|
36
mod/workshop/eval/best/settings.php
Normal file
36
mod/workshop/eval/best/settings.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?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 "Best" grading evaluation
|
||||
*
|
||||
* The values defined here are used as defaults for all module instances.
|
||||
*
|
||||
* @package mod-workshop-eval-best
|
||||
* @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();
|
||||
|
||||
$options = array();
|
||||
for ($i = 9; $i >= 1; $i = $i-2) {
|
||||
$options[$i] = get_string('comparisonlevel' . $i, 'workshopeval_best');
|
||||
}
|
||||
|
||||
$settings->add(new admin_setting_configselect('workshopeval_best/comparison', get_string('comparison', 'workshopeval_best'),
|
||||
get_string('configcomparison', 'workshopeval_best'), 5, $options));
|
@ -32,12 +32,13 @@ class workshop_best_evaluation_settings_form extends moodleform {
|
||||
function definition() {
|
||||
$mform = $this->_form;
|
||||
|
||||
$current = $this->_customdata['current'];
|
||||
$workshop = $this->_customdata['workshop'];
|
||||
$plugindefaults = get_config('workshopeval_best');
|
||||
$current = $this->_customdata['current'];
|
||||
$workshop = $this->_customdata['workshop'];
|
||||
|
||||
$mform->addElement('header', 'general', get_string('settings', 'workshopeval_best'));
|
||||
|
||||
$label = get_string('gradingevaluationmethod', 'workshop');
|
||||
$label = get_string('evaluationmethod', 'workshop');
|
||||
$mform->addElement('static', 'methodname', $label, get_string('pluginname', 'workshopeval_best'));
|
||||
$mform->setHelpButton('methodname', array('method', $label, 'workshopeval_best'));
|
||||
|
||||
@ -48,7 +49,7 @@ class workshop_best_evaluation_settings_form extends moodleform {
|
||||
$label = get_string('comparison', 'workshopeval_best');
|
||||
$mform->addElement('select', 'comparison', $label, $options);
|
||||
$mform->setHelpButton('comparison', array('comparison', $label, 'workshopeval_best'));
|
||||
$mform->setDefault('comparison', 5);
|
||||
$mform->setDefault('comparison', $plugindefaults->comparison);
|
||||
|
||||
$mform->addElement('submit', 'submit', get_string('aggregategrades', 'workshop'));
|
||||
|
||||
|
@ -25,5 +25,5 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2009091100;
|
||||
$plugin->requires = 2009091100; // Requires this Moodle version
|
||||
$plugin->version = 2009102000;
|
||||
$plugin->requires = 2009100605; // Requires this Moodle version
|
||||
|
@ -18,7 +18,7 @@
|
||||
/**
|
||||
* This file defines interface of all grading evaluation classes
|
||||
*
|
||||
* @package mod-workshop
|
||||
* @package mod-workshop-eval
|
||||
* @copyright 2009 David Mudrak <david.mudrak@gmail.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
@ -27,6 +27,8 @@ defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* Defines all methods that grading evaluation subplugins has to implement
|
||||
*
|
||||
* @todo
|
||||
*/
|
||||
interface workshop_evaluation {
|
||||
|
||||
|
@ -87,7 +87,9 @@ $string['editingsubmission'] = 'Editing submission';
|
||||
$string['editsubmission'] = 'Edit submission';
|
||||
$string['err_removegrademappings'] = 'Unable to remove the unused grade mappings';
|
||||
$string['evaluategradeswait'] = 'Please wait until the assessments are evaluated and total grades are calculated';
|
||||
$string['examplesbeforeassessment'] = 'Examples are available after own submission and must be assessed before peer/self assessment phase';
|
||||
$string['evaluation'] = 'Grading evaluation';
|
||||
$string['evaluationmethod'] = 'Grading evaluation method';
|
||||
$string['examplesbeforeassessment'] = 'Examples are available after own submission and must be assessed before assessment phase';
|
||||
$string['examplesbeforesubmission'] = 'Examples must be assessed before own submission';
|
||||
$string['examplesmode'] = 'Mode of examples assessment';
|
||||
$string['examplesvoluntary'] = 'Assessment of example submission is voluntary';
|
||||
@ -100,7 +102,6 @@ $string['givengrades'] = 'Given grades';
|
||||
$string['gradedecimals'] = 'Decimal places in grades';
|
||||
$string['gradegivento'] = ' > ';
|
||||
$string['gradereceivedfrom'] = ' < ';
|
||||
$string['gradingevaluationmethod'] = 'Grading evaluation method';
|
||||
$string['gradinggrade'] = 'Grade for assessment';
|
||||
$string['gradinggradeof'] = 'Grade for assessment (of $a)';
|
||||
$string['gradingsettings'] = 'Grading settings';
|
||||
@ -146,7 +147,6 @@ $string['saveandpreview'] = 'Save and preview';
|
||||
$string['selfassessmentdisabled'] = 'Self-assessment disabled';
|
||||
$string['someuserswosubmission'] = 'There are some users who have not submitted yet';
|
||||
$string['strategyaccumulative'] = 'Accumulative grading';
|
||||
$string['strategydummy'] = 'Dummy strategy';
|
||||
$string['strategy'] = 'Grading strategy';
|
||||
$string['strategyhaschanged'] = 'The workshop grading strategy has changed since the form was opened for editing.';
|
||||
$string['strategynograding'] = 'No grading';
|
||||
|
@ -77,7 +77,17 @@ $strategies = 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('pluginname', 'workshopform_' . $strategy), ''));
|
||||
get_string('strategy', 'workshop') . ' - ' . get_string('pluginname', 'workshopform_' . $strategy), ''));
|
||||
include($settingsfile);
|
||||
}
|
||||
}
|
||||
|
||||
// include the settings of grading evaluation subplugins
|
||||
$evaluations = get_plugin_list('workshopeval');
|
||||
foreach ($evaluations as $evaluation => $path) {
|
||||
if (file_exists($settingsfile = $path . '/settings.php')) {
|
||||
$settings->add(new admin_setting_heading('workshopevalsetting'.$evaluation,
|
||||
get_string('evaluation', 'workshop') . ' - ' . get_string('pluginname', 'workshopeval_' . $evaluation), ''));
|
||||
include($settingsfile);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user