Skip to content

Commit

Permalink
MDL-38603 Deprecate usepeerassessment setting in Workshop
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mudrd8mz committed Apr 18, 2013
1 parent 3a8c438 commit d34ea7d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
4 changes: 2 additions & 2 deletions mod/workshop/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
9 changes: 4 additions & 5 deletions mod/workshop/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -2284,7 +2284,7 @@ public function get_gradebook_grades($userid) {
}
}

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)) {
Expand Down Expand Up @@ -2661,8 +2661,7 @@ public function __construct(workshop $workshop, $userid) {
$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();
Expand Down Expand Up @@ -2844,7 +2843,7 @@ public function __construct(workshop $workshop, $userid) {
}
}
unset($a);
if ($workshop->usepeerassessment and $numofpeers) {
if ($numofpeers) {
$task = new stdclass();
if ($numofpeerstodo == 0) {
$task->completed = true;
Expand Down
5 changes: 0 additions & 5 deletions mod/workshop/mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,6 @@ public function definition() {
$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);
Expand Down

0 comments on commit d34ea7d

Please sign in to comment.