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?

CommentFileSizeAuthor
#2 quiz.897700.patch627 bytesbaldwinlouie
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

baldwinlouie’s picture

Version: 6.x-3.0 » 6.x-4.0-beta8

Changing to version 4.0

baldwinlouie’s picture

Category: support » task
FileSize
627 bytes

drupal_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?

baldwinlouie’s picture

Status: Active » Needs review

Changing status to needs review.

djdevin’s picture

Component: Code - Quiz module » Code - Quiz core
Issue summary: View changes
Status: Needs review » Closed (outdated)

This 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.