grade import: MDL-21987 Problem with repeated imports of the same grade.
commit8bf6b5c2c84c1c36b9f0682c236fea0c134d91aa
authorTim Hunt <T.J.Hunt@open.ac.uk>
Wed, 31 Mar 2010 13:50:58 +0000 (31 13:50 +0000)
committerTim Hunt <T.J.Hunt@open.ac.uk>
Wed, 31 Mar 2010 13:50:58 +0000 (31 13:50 +0000)
tree9fd75009117e5920b6937376b887975055a45734
parentdc2c925cc96f943bbf4bbb809b9b689278631f91
grade import: MDL-21987 Problem with repeated imports of the same grade.

The thanks to Petr (skodak).

Here is what I learned while working on this:

1. when explicitly setting the final grade (manual edit or import),
   it is important that ->overridden gets set, and it should get set
   to the time when the override was done.

2. but only on certainly sorts of grade item, and the condition for
   setting the flag is different when it is the feedback being changed
   or the grade being changed, hence the two different tests
   is_overridable_item and is_overridable_item_feedback.

3. but, if the grade and feedback is not actually changed, then the ->overridden
   timestamp should not be changed. (That was the bit that was buggy.)
lib/grade/grade_item.php