warn when leaving unsubmitted changes; review screen shows SUBMITTED answers.

When you try to move away from a question with unsubmitted changes, an alert box appears telling you to check your answers and submit. It won't let you leave until everything is submitted.
If the question hasn't previously been answered, the normal warning message is shown, and if set to "warn if unattempted", the student can leave the question with unsubmitted answers. I left this in because some students like to leave hard questions until last. But they shouldn't be allowed to have unsubmitted changes *after* the first submit.
There's now an "unsubmitted changes (!)" line in the question selector under questions with unsubmitted changes.

On trying to end the exam, the same check is done. The only way you should be able to get the "unsubmitted changes" message here is by changing an answer in the current question before ending the exam. Again, it won't let you finish until you've submitted.

When the exam ends, the default theme now resets all inputs to the last submitted answers. It shouldn't be possible for the review mode to disagree with the normal mode now.

This is for #297
make sure parts aren't dirty immediately after creation

The display code can call storeAnswer, which sets parts as dirty, so undo that after they're created.
nicer spacing on "unsubmitted changes" line
change the way SCORM saving error works

Instead of asking the student to resubmit, just keep resubmitting every time the student acknowledges the warning.
The warning ('scorm.failed save') tells the student that pressing OK will attempt to save again, and reassures them that their previous answers are still saved.

There's a "Saving..." overlay while the request is going, but since Moodle uses synchronous calls, the browser never gets a chance to show it :(
give the "saving..." message half a chance to be shown
make sure setDirty(false) is called on init; restoreAnswer on end

setDirty is called as part of Numbas.display.init, which means that
1) the code responsible for the problem takes care of the problem
2) even resuming from SCORM can't mess it up

restoreAnswer now runs on steps and gaps as well, when the exam is ended.
Merge branch 'master' into dont-let-them-fail
Numbas.jme.texsplit copes with \r characters
Merge branch 'dont-let-them-fail'