]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-12518 fixed restore of grade calculations; merged from MOODLE_19_STABLE
authorskodak <skodak>
Tue, 5 Feb 2008 13:11:48 +0000 (13:11 +0000)
committerskodak <skodak>
Tue, 5 Feb 2008 13:11:48 +0000 (13:11 +0000)
lib/grade/grade_item.php

index 9f94529c3fd2c1051264e7d3e8be564079372f32..f4f47ddfa13bb5046b20f5ee66ea9449bf495294 100644 (file)
@@ -964,7 +964,7 @@ class grade_item extends grade_object {
          */
 
         // first detect if we need to change calculation formula from [[idnumber]] to ##giXXX## (after backup, etc.)
-        if (!$this->calculation_normalized and preg_match('/##gi\d+##/', $this->calculation)) {
+        if (!$this->calculation_normalized and strpos('[[', $this->calculation) !== 0) {
             $this->set_calculation($this->calculation);
         }