Start only one quiz per day I used quiz module version 7.x-4.0-rc2 and drupal7 to create content in my site. I created student role to access quiz content.

I want each student can start only one quiz per day. Example: Today is 22/04/12, a student can start only one quiz. If they open and start quiz1, they can't start any other quiz until to 23/04/2012.

Please help me, How to do that.
Thank you so much,
Bien Hoang
I have never used the Quiz module myself so I can only give you a generic answer.

What I would do, is to create a custom module which contains a hook implementation and a helper function:


In the helper function, check if the current has the permission to create quiz content and if the user has already posted a quiz today. You may need to write a database query to retrieve this information, but I'm not sure, that depends on the way the quiz module was programmed. Return TRUE if the user is allowed to post a quiz, return FALSE if not.
In a hook_menu_alter implementation, change the access callback property of the quiz creation form, setting it to the helper function you just wrote. This will deny access to the quiz creation page if the use is not allowed to create a new quiz.


Hope that helps.