MDL-18987 fixed broken item editing when only one category present

This commit is contained in:
skodak
2009-04-27 14:26:42 +00:00
parent 50d3981988
commit bd2fb930a2
+5 -1
View File
@@ -268,7 +268,11 @@ class edit_item_form extends moodleform {
} else {
$element =& $mform->createElement('text', 'aggregationcoef', get_string($coefstring, 'grades'));
}
$mform->insertElementBefore($element, 'parentcategory');
if ($mform->elementExists('parentcategory')) {
$mform->insertElementBefore($element, 'parentcategory');
} else {
$mform->insertElementBefore($element, 'id');
}
$mform->setHelpButton('aggregationcoef', array($coefstring, get_string($coefstring, 'grades'), 'grade'), true);
}