Some countries do not exist any more, some currencies do not exist. Some countries (and currencies) started to exist recently. Some currency codes are changed (mistype or result of denomination).
Also I tried to keep the moodle formation of the name of the currencies. The first word is not the country name but the 'belonging-to-country', i.e. not 'Sweden Krona' but 'Swedish Krona'. For some countries it was not so easy to find the correct spelling.
And finally there were some mistakes in the list, like 'Schilling' instead of 'Shilling', 'Riyal' instead of 'Rial', etc. I used currencies spelling from ISO.
The problem was mostly that, in the past, we did not worry if
question_attempt_step.id changed during regrade (because we deleted the
old step row and inserted a new one). However, now that steps can have
associated files, we can't be that slack, becuase the step id is used as
the file itemid.
So, now, we have to update the existing rows during a regrade. We do
this by having the question engine tell the question_engine_unit_of_work
that the step has first been deleted, and then added back. Then we make
the unit-of-work spot that delete + add = update.
This also means that during regrading, we have to pass around some extra
ids so that new steps know the id of the step they are replacing.
Naturally, this requires some quite trickly logic, so I finally got
around to writing unit tests for question_engine_unit_of_work, which is
a good thing.
Along the way I also got around to renaming
question_attempt->set_number_in_usage, which got missed out when
everthing else was renamed to slot ages ago.
Finally, while working on this code, I noticed and fixed some PHPdoc
comments.
This was one of those innocent seeming issues where, once you start
digging, you find a mess. In this case, the code that is now in
question_wizard_form::add_hidden_fields used to exist in four different
places, in four inconsistent versions. This is now all nicely
re-factored, and that solves the problem.
Along the way, I found and fixed some wrong string references in
qtype_random, and stripped out some unnecessary &s in function
declarations.
Without this, restoring backups made with the OU's custom 'restore from
1.9' feature, and possibly other people's custom converstion code, does
not work properly.
Also, fix poor recordset code.