MDL-43338 quiz statistics : refactoring question statistics code

to improve readability and maintainability.
Spreadsheet calculations for variant's stats.