Thanks Aaron,
I haven't had a chance to get back to it, but I hope I can get that to work.

The form is used elsewhere (and works fine), and so has been created separately 
and as  a late requirement, needs to be called at the end of the quiz. Hence 
the setup.

I'll have to get my head around multi-page forms in drupal, something I have 
been avoiding! What I found rather odd was that the offending form isn't being 
rendered on the quiz summary page, but the $_post data is adding fields to my 
custom form, which overwrites the default behavior (_validate and _submit are 
not being called). Anyway, hope to work it out later.

Thanks again
Dave T

From: [email protected] [mailto:[email protected]] On Behalf Of 
Aaron Fulton
Sent: Friday, 15 April 2011 1:49 p.m.
To: [email protected]
Subject: Re: [phpug] Drupal quiz form

Hi David,

The quiz is its probably set up as a multi-step form.  So you will need to 
unset($form_state['storage']) and set $form['#rebuild'] = FALSE to make the 
form behave like you expect.

>From memory, the quiz module does have a number of hooks build into it that 
>you may be able to use instead of creating a seperate form.

regards
Aaron

On 15/04/2011 10:32 a.m., David.Turton wrote:
I am using the quiz module and have written a custom module to allow users (at 
the end of the quiz) to record how long it took them to read content/do 
associated quiz.

At the end of the quiz, on the summary screen, I present the "Save hours" form, 
which works standalone (on page nodes), but is being influenced by the quiz 
module which is adding parameters.

Instead of following the Saving hours form directives, quiz module causes the 
form to go to the "next" question (there isn't a next question, so it goes back 
to 1st question).

Firebug for drupal has identified the code below as part of the form array 
which is causing the issue.

     [#parameters] => array (
         [0] => [logbook_enter_hours]
         [1] => array (
             [storage] => []
             [submitted] => []
             [post] => array (
                 [op] => [Next]
                 [form_build_id] => [form-df28e61863d8a872cc2bded4f90a61a7]
                 [form_token] => [a6802f0c565f06e98b840e9fbd81272c]
                 [form_id] => [multichoice_render_question_form]
             )
         )
     )

I've tried overwriting in the Save hours form, and overwriting the $_POST 
(which is the origin of this information), but to no avail.

Any drupal form guru who has a pointer?

Thanks for any help.
Cheers
Dave T

________________________________
Warning: This email contains information which is CONFIDENTIAL and may also be 
LEGALLY PRIVILEGED. If you are not the intended recipient you must not peruse, 
use, disseminate, distribute or copy this email or attachments. If you have 
received this in error, please notify us immediately by return email and delete 
this email.
Thank you.
________________________________

Scanned by MailMarshal - M86 Security's comprehensive email content security 
solution. Download a free evaluation of MailMarshal at 
www.m86security.com<http://www.m86security.com>
________________________________
--
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]<mailto:[email protected]>
To unsubscribe, send email to
[email protected]<mailto:[email protected]>
--
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]

________________________________
Warning: This email contains information which is CONFIDENTIAL and may also be 
LEGALLY PRIVILEGED. If you are not the intended recipient you must not peruse, 
use, disseminate, distribute or copy this email or attachments. If you have 
received this in error, please notify us immediately by return email and delete 
this email.
Thank you.

#####################################################################################
Scanned by MailMarshal - M86 Security's comprehensive email content security 
solution. 
Download a free evaluation of MailMarshal at www.m86security.com
#####################################################################################

-- 
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]

Reply via email to