From d34ea7dc3395bd470e70f17f2e07b18bd8d2ef39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Mudr=C3=A1k?= Date: Wed, 17 Apr 2013 11:18:34 +0200 Subject: [PATCH] MDL-38603 Deprecate usepeerassessment setting in Workshop There was a plan to make use of it initially when Workshop was rewritten for Moodle 2.0. The idea was that the Workshop could be switched into a simplified mode where teachers only make assessments (with all the grading strategies available). But things evolved since then and now we have Advanced grading methods available in the new Assignment module that solves the use case well. So, having this option available is not only confusing but - looking at the code - pretty useless. For now, I am just hiding the setting from the settings form and the code always considers it as if it was enabled. In the future, the field can disappear from the database, too. --- mod/workshop/lib.php | 4 ++-- mod/workshop/locallib.php | 9 ++++----- mod/workshop/mod_form.php | 5 ----- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/mod/workshop/lib.php b/mod/workshop/lib.php index a1c94c018d2..54d74b44881 100644 --- a/mod/workshop/lib.php +++ b/mod/workshop/lib.php @@ -77,7 +77,7 @@ function workshop_add_instance(stdclass $workshop) { $workshop->timecreated = time(); $workshop->timemodified = $workshop->timecreated; $workshop->useexamples = (int)!empty($workshop->useexamples); - $workshop->usepeerassessment = (int)!empty($workshop->usepeerassessment); + $workshop->usepeerassessment = 1; $workshop->useselfassessment = (int)!empty($workshop->useselfassessment); $workshop->latesubmissions = (int)!empty($workshop->latesubmissions); $workshop->phaseswitchassessment = (int)!empty($workshop->phaseswitchassessment); @@ -138,7 +138,7 @@ function workshop_update_instance(stdclass $workshop) { $workshop->timemodified = time(); $workshop->id = $workshop->instance; $workshop->useexamples = (int)!empty($workshop->useexamples); - $workshop->usepeerassessment = (int)!empty($workshop->usepeerassessment); + $workshop->usepeerassessment = 1; $workshop->useselfassessment = (int)!empty($workshop->useselfassessment); $workshop->latesubmissions = (int)!empty($workshop->latesubmissions); $workshop->phaseswitchassessment = (int)!empty($workshop->phaseswitchassessment); diff --git a/mod/workshop/locallib.php b/mod/workshop/locallib.php index cb9bf6d4036..6b143cd8c81 100644 --- a/mod/workshop/locallib.php +++ b/mod/workshop/locallib.php @@ -101,7 +101,7 @@ class workshop { /** @var bool optional feature: students practise evaluating on example submissions from teacher */ public $useexamples; - /** @var bool optional feature: students perform peer assessment of others' work */ + /** @var bool optional feature: students perform peer assessment of others' work (deprecated, consider always enabled) */ public $usepeerassessment; /** @var bool optional feature: students perform self assessment of their own work */ @@ -2284,7 +2284,7 @@ class workshop { } } - if ($this->usepeerassessment and has_capability('mod/workshop:peerassess', $this->context, $userid)) { + if (has_capability('mod/workshop:peerassess', $this->context, $userid)) { if (!empty($gradebook->items[1]->grades)) { $assessmentgrade = reset($gradebook->items[1]->grades); if (!is_null($assessmentgrade->grade)) { @@ -2661,8 +2661,7 @@ class workshop_user_plan implements renderable { $phase = new stdclass(); $phase->title = get_string('phasesubmission', 'workshop'); $phase->tasks = array(); - if (($workshop->usepeerassessment or $workshop->useselfassessment) - and has_capability('moodle/course:manageactivities', $workshop->context, $userid)) { + if (has_capability('moodle/course:manageactivities', $workshop->context, $userid)) { $task = new stdclass(); $task->title = get_string('taskinstructreviewers', 'workshop'); $task->link = $workshop->updatemod_url(); @@ -2844,7 +2843,7 @@ class workshop_user_plan implements renderable { } } unset($a); - if ($workshop->usepeerassessment and $numofpeers) { + if ($numofpeers) { $task = new stdclass(); if ($numofpeerstodo == 0) { $task->completed = true; diff --git a/mod/workshop/mod_form.php b/mod/workshop/mod_form.php index db728d1f6a2..685c6f57f2d 100644 --- a/mod/workshop/mod_form.php +++ b/mod/workshop/mod_form.php @@ -86,11 +86,6 @@ class mod_workshop_mod_form extends moodleform_mod { $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);