Restoring code to a previous state when taking an assessment