MDL-38603 Deprecate usepeerassessment setting in Workshop
authorDavid Mudrák <david@moodle.com>
Wed, 17 Apr 2013 09:18:34 +0000 (11:18 +0200)
committerDavid Mudrák <david@moodle.com>
Thu, 18 Apr 2013 21:10:10 +0000 (23:10 +0200)
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
mod/workshop/locallib.php
mod/workshop/mod_form.php

index a1c94c0..54d74b4 100644 (file)
@@ -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);
index cb9bf6d..6b143cd 100644 (file)
@@ -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;
index db728d1..685c6f5 100644 (file)
@@ -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);