Copy pasted from main.views exercise_handler...