Thanks to Brandon Browning for identifying the problem. It is quite subtle why this typo would have this effect. You need to look at the implementation of the preventDefault method in lib/yui/3.4.1/build/event-base/event-base.js.
This achieves a massive clean-up. It simplifies comples code in a number
of places. It allows some methods and functions to be moved to a more
appropriate home (for example cannot_review_message to the quiz class).
It moves more logic out of the renderer.
The problem was when output was being started in relation to when the fake block was added.
Took the opportunity to clean up the quiz renderer API a bit.
Note that this breaks the attempt.php page; there are a lot of methods that are missing PHPdoc comment; there are probably now some unused methods that could be deleted; and there are a couple of places which could be handled a bit better.
But, overall, I think this way makes sense.
That bit of JavaScript from mod/quiz/attempt.php is needed in question preview too, so refactor a bit.
I was disappointed to find that the
$PAGE->requires->js_module('core_question_engine');
line was needed in quiz_get_js_module, but it seems to be.
Also change non-Moodle-y string "End test..." to "Finish attempt..."