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,
When a user hits the maximum number of times a quiz can be taken, I want to perform some sort of action to redirect the user somewhere.
With the way the hooks and drupal_alters are setup, it looks like the only way to do this is if I implement drupal_alter('quiz_take'). In that function, I will have to simulate my own quiz_start_check and do any redirect there.
I don't know doing redirects inside drupal_alter is a good practice.
Is there another way to do what I want above?
Comment | File | Size | Author |
---|---|---|---|
#2 | quiz.897700.patch | 627 bytes | baldwinlouie |
Comments
Comment #1
baldwinlouie CreditAttribution: baldwinlouie commentedChanging to version 4.0
Comment #2
baldwinlouie CreditAttribution: baldwinlouie commenteddrupal_alter doesn't look like a good place for this. By doing it there, you basically bypassed a lot of conditions and logic checks.
I added a hook called called 'quiz_already_taken' when the $taken >= $quiz->takes
Attached is a patch for the hook.
Is this something that can get committed?
Comment #3
baldwinlouie CreditAttribution: baldwinlouie commentedChanging status to needs review.
Comment #4
djdevinThis issue is being closed because it was filed against a version that is no longer supported. If the issue still persists in the latest version of Quiz, please open a new issue.