MDL-37993 Quiz: add module specific completion options - complete on all attempts exhausted, specific grade

This patch, which borrows heavily from mod/scorm/, adds completion options to Quiz similar to what is available
in scorm.  One can have the quiz marked complete when all attempts are exhausted or when a specified score is achieved.

In combination with MDL-37899, this will allow a quiz to complete when the user "passes or fails".
(Where "fail" is defined as using up all attempts without passing.)
MDL-37993 adjustments as suggested by Tim
Set group attribute on checkboxes to avoud superfluous warning.