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

This patch adds completion options to Quiz similar to what is available in scorm.  One can have the quiz marked
complete when either a passing grade is achieved or all attempts are used up. This will allow a quiz to complete
when the user "passes or fails".  (Where "fail" is defined as using up all attempts without passing.)