My placement test has a mind-boggling requirement for a Certificate to be printed

My placement test has a mind-boggling requirement for a Certificate to be printed

by Frankie Kam -
Number of replies: 2
Picture of Plugin developers

Hi

WARNING! Brain teaser ahead. Get ready to tie your brain into knots.

I am tasked with creating a placement test from which any one of eight different Moodle Certificate activities can be generated. I am using the Moodle 2.5 quiz for this placement test. My problem is to figure out how to generate a Moodle Cerificate based on this complex structure:

Structure
There are Nine parts to the Placement Test. Each part consists of a Cloze question with multiple input boxes. So the entire quiz has 9 Questions.

Placement
Test Score (%)            Certificate Awarded            Additional Specific criteria (if any)

   0% - 9%     student gets a GE Certificate
   10% - 19% student gets a KE Certificate (minimum of 5 marks in Question1)
   20% - 29% student gets a PE Certificate (minimum of 12 marks in Question1 & Question2 combined)
   30% - 39% student gets a Pre-FC Certificate
   40% - 49% student gets a FC Certificate  (minimum of 7 marks in Question3 & Question4 combined)
   50% - 59% student gets a Pre-CA Certificate
   60% - 69% student gets a CA Certificate  (minimum of 15 marks in Question5 & Question6 combined)
   >70%         student gets a CP Certificate  (minimum of 15 marks in Question7 & Question8 combined)

What I have done, for now, is to create eight certificate activities. Each activity is conditional upon the score of the student in the placement test. So if the student scored 8% on the placement test, the first certificate activity becomes visible, and the student clicks on the activity link to popup the PDF certificate                                                              . And so on. 

See those "minimum of N marks in QuestionM..."? Yikes!!!
The GE, Pre-FC, Pre-CA certificates can be generated easily and straightforward, no sweat, as they are based solely on the % score of the placement test.

The KE Certificate, however, requires me to drill down and see if the student scored at least 5 marks in Question1 of the quiz. How on earth do I check for this?
If the student scored less than 5 marks for Question1, he or she only gets the GE Certificate (one level lower). Ouch!

Even 'worse', is the PE Certificate. I have to ALSO check that the combined score of Question1 and Question2 is at least 12 marks. If the combined score is not 12 marks, then the KE Certificate (one level below) becomes visible. Mama mia!

The programmer in me knows it can be done as Moodle's PHP can be hacked with some (many?) tears shed. It's just that I don't think that Moodle-vanilla-out-of-the-box can handle this stringent and detailed requirement.

regards
Frankie Kam

Average of ratings: -
In reply to Frankie Kam

Re: My placement test has a mind-boggling requirement for a Certificate to be printed

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Right. You can only do this by writing code.

Rough outline: Given a student id and a quiz id, you can get a quiz_attempt id. From there, you can build a quiz_attempt object, (quiz_attempt::create($attemptid) - or something like that). From there, there are methods to get the grade for each question.

One way to handle this would be to make your code set the value of a new column (grade_item) in the gradebook, that is a scale GE, KE, ..., CP, then make the certificates conditional upon that scale.

Yes, make a local add-on, and use the events API. Subscribe to the quiz_sumitted event (or whatever it is called), and when you get that, analyse the attempt, and set the value of the custom grade_item.

In reply to Tim Hunt

Re: My placement test has a mind-boggling requirement for a Certificate to be printed

by Frankie Kam -
Picture of Plugin developers

Hi Tim

Thanks for the algorithm. 

Frankie Kam