grade import: MDL-21987 Problem with repeated imports of the same grade.
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.)

dilawar/moodle