I am trying to figure out if that is how this is supposed to work, or if I am missing something somewhere. Basically, I have an action set up to assign a user_badge to a user upon completion of the quiz, but the badge should only be awarded if the quiz is PASSED. I don't see that as an option when adding an action. Am I missing something?
Comments
Comment #1
mbutcher commentedThe action should have a score attached. Can you use that to determine whether the badge is added?
So in your action handler, you should be able to do something like this (dependent on your hook_action_info() implementation):
I also added score to $context because it is not entirely clear what the preferred method for passing data in is. So you could do $context['score'] instead of $score.
Comment #2
mbutcher commentedComment #3
AlanT commentedI'm looking at using this module, and I'm also looking to assign an action only when the quiz has been passed. I do not understand the above, as I am not a PHP programmer.
Is this something that will be made possible to us non-programmers at some time?
I understand the need to trigger an action when the quiz is submitted, although ideally, a separate action would be triggered when the pass/fail/pending state of the quiz changes to 'pass'.