MDL-32062 question engine: fix re-grading attempts from 2.0
MDL-32062 question engine: fix re-grading attempts from 2.0

The code to upgrade attempts from before Moodle 2.0 to 2.1 created
attempt data that was not exactly the same as a new attempt created in
2.1+. This did not matter very much - revew and the quiz reports all
worked OK - but it broke on re-grade.

These changes detect the problem data in the re-grade code, an apply a
work-around so that the re-grade gives the correct result.

dilawar/moodle