I'm using the 7.5 alpha on a new site. I used to be able to create a Rule (using the rules module) which was triggered when the quiz was completed. Now I cannot seem to get this working. I have tried triggering a rule on 'After saving a new quiz result', but this triggers nothing. If i set a rule to act on 'After saving a new quiz result answer' then this works, but I don't want the rule triggering after every question.

I was sure there was an option in the old quiz module version 7.4 where you could choose what happens on quiz completion. I set this to save content and then created a rule which acted on this saving content.

Can anyone shed any light on this?

Thanks
James

Comments

Jimarick’s picture

Issue summary: View changes
djdevin’s picture

The old action-based behavior was deprecated in favor of Rules, since we moved all CRUD behaviors over to Entity API.

You should however be able to react to the "On quiz result update" trigger, and then check the is_evaluated field to see if the quiz is complete.

There's an entity_save() happening inside of quiz_end_scoring() so I'm not sure why this wouldn't work for you. It may be the Quiz is overriding the redirect as it has to go to the post-quiz feedback page. Try displaying a message instead just for testing.

xjustyx’s picture

I have the same Issue, i made a rule "On quiz result update", then check the is_evaluated field to see if the quiz is complete and as action change the role of the user and redirect to a static web <?php return('google.com');?>
But it only change the role when i finish the quiz, never redirect to any page.

xjustyx’s picture

Version: 7.x-5.0-alpha4 » 7.x-5.0-alpha8
xjustyx’s picture

Solved, when you are redirecting from quiz u must use drupal_goto() u cant use return.

djdevin’s picture

Status: Active » Closed (fixed)
djdevin’s picture

Category: Bug report » Support request
mshaver’s picture

The rule we have setup for sending an email on quiz completion seems to fire before the is_evaluated is set? Is there a way of ensuring is_evaluated is set once a quiz is finished by the user? The example we're trying to account for is to send a message to an admin that a quiz needs to be evaluated when that quiz has a long answer that requires manual scoring.