When self-assessment is disabled for the workshop instance, it should say so on the allocation form: Add self-assessment - Self-assessment disabled. However, once the allocation is created, the text disappears from this static field. See screenshot.
This is because both checkbox and static label share the same id: "addselfassessment". But, once allocation is created, this value is evaluated in instance_from_object function of random allocation lib.php:765. So it's explicitly set to 'false' thus losing the text value.
foreach (array('excludesamegroup', 'removecurrent', 'assesswosubmission', 'addselfassessment') as $k) { |
if (isset($data->$k)) { |
$i->$k = (bool)$data->$k; |
} else { |
$i->$k = false; |
}
|
}
|
A dirty fix would be to simply rename the static filed to something else in settings_form.php of random allocation, so it's different from the checkbox id.
if (empty($workshop->useselfassessment)) { |
$mform->addElement('static', 'noselfassessment', get_string('addselfassessment', 'workshopallocation_random'), |
get_string('selfassessmentdisabled', 'workshop')); |
} else { |
$mform->addElement('checkbox', 'addselfassessment', get_string('addselfassessment', 'workshopallocation_random')); |
}
|
Steps to reproduce:
- Create a workshop with 'Assessment settings: Use self-assessment: No'
- Visit 'Allocate submissions' view from the workshop administration block
- Switch to 'Scheduled allocation'
- Ensure that Add self-assessments has a text value 'Self-assessment disabled'
- Save the form and revisit the scheduled allocation
- Ensure that the text is gone from the static field 'Add self-assessment'