When i open the quiz in multiple choice answer and i jump into the last question i get this error

Notice: Undefined index: #type in ajax_quiz_form_alter() (line 51 of /Applications/XAMPP/xamppfiles/htdocs/quiz7/sites/all/modules/quiz/modules/ajax_quiz/ajax_quiz.module

and this is the code line 51 which get error

if ($form['navigation'][$nav_child]['#type'] == 'submit') {
        $form['navigation'][$nav_child]['#ajax'] = $ajax;
      }

how to solve it?

thanks

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

imunklovarian created an issue. See original summary.

imunklovarian’s picture

Issue summary: View changes
daiwik.addweb’s picture

Status: Active » Needs review
FileSize
684 bytes

@imunklovarian, Here's the patch for the same, In the log I get this error & to resolve the error I've added isset condition.

Hope this will helps!

Thanks

djdevin’s picture

Version: 7.x-5.4 » 7.x-5.6
Status: Needs review » Fixed

Thanks, this works and fixes the notice on the last page because there is another non-submit element on the page (markup text).

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.