MDL-40074 refactoring of quiz code

to reuse code fro quiz attempt walk through
MDL-40074 quiz attempt walk through test