Moodle

gradebook restore breaks category grades

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Cannot Reproduce
  • Affects Version/s: 1.9, 2.0
  • Fix Version/s: None
  • Component/s: Gradebook
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE, MOODLE_20_STABLE

Description

I found this bug when restoring a backup from MDL-12436

The grades went into db ok, I checked it immediately after the restore. However grade_regrade_final_grades() seem to have cleaned the grade_grades in category and course gradeitem. Then I got ERROR in all categories and course gradeitem. I did a bit of look up and found a few things

1) When looping the gradeitems, some gradeitem in dependson array is referencing itself
2) Categories with forumla do not include related gradeitems
3) Categories with forumla are getting invalid token '[' from EvalMath

Can you please take a look? If you don't have time I will look at it next week.

Cheers, Yu

Activity

Hide
Petr Škoda (skodak) added a comment -

I need a sample data to diagnose this

Show
Petr Škoda (skodak) added a comment - I need a sample data to diagnose this
Hide
Yu Zhang added a comment -

Hi Petr, this is the one I used.

Show
Yu Zhang added a comment - Hi Petr, this is the one I used.
Hide
Eloy Lafuente (stronk7) added a comment -

Is this fixed with latest backup & restore improvements, Petr?

Show
Eloy Lafuente (stronk7) added a comment - Is this fixed with latest backup & restore improvements, Petr?
Hide
Michael Blake added a comment -

Petr,
A MP is being affected by this - can you have a look at it? Seems it's been sidelined.

Show
Michael Blake added a comment - Petr, A MP is being affected by this - can you have a look at it? Seems it's been sidelined.
Hide
Petr Škoda (skodak) added a comment -

oh, this info in attached backup file is:
<MOODLE_RELEASE>2.0 dev</MOODLE_RELEASE>
<BACKUP_VERSION>2007101000</BACKUP_VERSION>
<BACKUP_RELEASE>1.9 beta 2</BACKUP_RELEASE>

There is no way this could work - the backup in 1.9.0 and 1.9.1 worked only partially it did not work at all in 1.9beta, sorry. Please upgrade to 1.9.3 and do not try to restore backups from older 1.9.x versions.

Show
Petr Škoda (skodak) added a comment - oh, this info in attached backup file is: <MOODLE_RELEASE>2.0 dev</MOODLE_RELEASE> <BACKUP_VERSION>2007101000</BACKUP_VERSION> <BACKUP_RELEASE>1.9 beta 2</BACKUP_RELEASE> There is no way this could work - the backup in 1.9.0 and 1.9.1 worked only partially it did not work at all in 1.9beta, sorry. Please upgrade to 1.9.3 and do not try to restore backups from older 1.9.x versions.
Hide
Tom Murdock added a comment -

Thanks for looking at this Petr. We created a new course in 1.9.3. this week with course categories and calculations, created a backup, then restored. The grade category calculations were not restored.

Show
Tom Murdock added a comment - Thanks for looking at this Petr. We created a new course in 1.9.3. this week with course categories and calculations, created a backup, then restored. The grade category calculations were not restored.
Hide
Petr Škoda (skodak) added a comment -

I need more information in order to replicate this problem, could you mail me some sample backup file that fails during restore? (skodak at moodle dot org)

Show
Petr Škoda (skodak) added a comment - I need more information in order to replicate this problem, could you mail me some sample backup file that fails during restore? (skodak at moodle dot org)
Hide
Tom Murdock added a comment -

Hi Petr,
My mistake, after the fix, I hadn't updated the settings to allow this. Thanks for your help. Working for us now. -Tom

Show
Tom Murdock added a comment - Hi Petr, My mistake, after the fix, I hadn't updated the settings to allow this. Thanks for your help. Working for us now. -Tom
Hide
Norm Wood added a comment -

Hi, Tom and Petr:
I appreciate your efforts to provide this fix in 1.9.3. My Moodle focus has been on gradebook and evaluating for some time now, and not having to manually fix the "Error" message, for new course gradebooks, will make life much easier! --Norm

Show
Norm Wood added a comment - Hi, Tom and Petr: I appreciate your efforts to provide this fix in 1.9.3. My Moodle focus has been on gradebook and evaluating for some time now, and not having to manually fix the "Error" message, for new course gradebooks, will make life much easier! --Norm
Hide
Helen Foster added a comment -

From comments, it seems like this issue has been fixed. If not, please reopen.

Show
Helen Foster added a comment - From comments, it seems like this issue has been fixed. If not, please reopen.
Hide
Tim Hunt added a comment -

Reopening, in order to change resolution. I think it is more accurate to say that this issue could not be reproduced, rather than we knowingly did something to fix it.

Show
Tim Hunt added a comment - Reopening, in order to change resolution. I think it is more accurate to say that this issue could not be reproduced, rather than we knowingly did something to fix it.

Dates

  • Created:
    Updated:
    Resolved: