by Tim Hunt.
It sounds like http://docs.moodle.org/dev/Quiz_access_rules can do most of what you want.
The one bit that you cannot do without a small core change is to allow your access rule to change the review options based on the current attempt. What you would need to do is to find an appropriate place (search for mod_quiz_display_options::make_from_quiz and back-track) and then add a call like
$options = $quizaccessmanager->udpate_display_options($attempt, $options);
(You would also need to write the udpate_display_options method, which will require a new method on the access rule base class.)
If you do that, create a MDL bug, and submit your core changes as a patch. If adding this extra hook is helpful to you, it may help others in future too.