Refactor quiz attempt

https://github.com/Eduki/eduki/issues/177

And part of: https://github.com/Eduki/eduki/issues/181

@DavidMah @abboudm