MDL-41757 quiz statistics : limit subq and variant stat rows

and print min, median and max.
MDL-43338 quiz statistics : refactoring question statistics code

to improve readability and maintainability.