MDL-12518 fixed restore of grade calculations; merged from MOODLE_19_STABLE

This commit is contained in:
skodak 2008-02-05 13:11:48 +00:00
parent 76b570d602
commit cba498f090

View 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);
}