Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi:
Would be great that quiz module notificate to the other modules when a user has finished a quiz. I made a simple patch that makes that (with a call to invoke_all).
Comment | File | Size | Author |
---|---|---|---|
#5 | quiz-3.x-dev.patch | 2.23 KB | Sivaji_Ganesh_Jojodae |
invoke_all.patch | 364 bytes | manolopm | |
Comments
Comment #1
mbutcher CreditAttribution: mbutcher commentedIn the 3.x branch, we use triggers/actions to handle this (I think there is an example). The nice thing about this method is that it makes it possible to configure the actions from the admin interface. However, before it is really useful, some actions need to be developed. (I believe sivaji is working on adding mail notification as an action.)
If there is a good argument to be made for adding a hook invocation too, I'm open to considering adding this as well.
Comment #2
manolopm CreditAttribution: manolopm commentedWe think, and we use, for integration with gradebook module. When the quiz is finished the activity can be updated with the grade of the quiz.
Comment #3
mbutcher CreditAttribution: mbutcher commentedThat is a good case for adding a hook there. I'll think about this.
I would probably only add it into Quiz 3, since Quiz 2 is now completely frozen except for bug fixes. However, Quiz 3 is due out soon, so it wouldn't be a long wait.
I'm thinking of maybe adding these new hooks:
hook_quiz_begin()
hook_quiz_finished()
hook_quiz_forward_question() - called when a user advances one question forward.
hook_quiz_back_question() - called when a user goes back a question.
These last two would make finer grained timing possible.
What do you think?
Matt
Comment #4
mbutcher CreditAttribution: mbutcher commentedhook_quiz_finished has been added to the 3.x branch. It will fire *AFTER* the quiz trigger (e.g. after all actions are executed).
hook_quiz_begin() has also been added to the 3.x branch. it will fire immediately before the user sees their first question.
Comment #5
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedHello folks
I have attached a quiz results notification mock-up patch. This patch will send an email containing quiz title, description, number of questions, percentage of marks scored etc at the end of the quiz. I would like to know your suggestions regarding this.
Thanks
Sivaji
Comment #6
mbutcher CreditAttribution: mbutcher commentedBefore I can apply the patch, we need to add a way of turning the feature on and off. That is, not everyone would want to have quiz results automatically emailed -- especially if essay questions were unscored (and hence show up as 0 points).
If Triggers/Actions won't work, then we should at least add an administrative interface for turning this feature on and off. See quiz_admin_settings() for a starting point.
Comment #7
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedThis patch has been committed with on/off feature. I like to extend this to have configurable email body. Changing the status to need review.
Comment #8
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedThere is no bug reported on this, changing the status to fixed.