MDL-13863 detect missing idnumbers in formulas after restore; merged from MOODLE_19_STABLE

This commit is contained in:
skodak 2008-03-10 09:35:42 +00:00
parent 67881aa801
commit 9c9a3259ee

View File

@ -1589,6 +1589,10 @@ class grade_item extends grade_object {
// prepare formula and init maths library
$formula = preg_replace('/##(gi\d+)##/', '\1', $this->calculation);
if (strpos($formula, '[[') !== false) {
// missing item
return false;
}
$this->formula = new calc_formula($formula);
// where to look for final grades?