MDL-50612 grades: do not remove grade box if gradepass field exists

This commit is contained in:
Pierre GUINOISEAU 2015-07-02 02:50:31 +02:00 committed by Marina Glancy
parent 9325cd963f
commit 7dc5dac678

View File

@ -172,7 +172,7 @@ abstract class moodleform_mod extends moodleform {
// TODO: add a "Mixed categories" text instead of removing elements with no explanation
if ($mform->elementExists('gradecat')) {
$mform->removeElement('gradecat');
if ($this->_features->rating) {
if ($this->_features->rating && !$mform->elementExists('gradepass')) {
//if supports ratings then the max grade dropdown wasnt added so the grade box can be removed entirely
$mform->removeElement('modstandardgrade');
}