This issue is possibly related to #1535396: All Questions unassigned when updating Quiz Node

As in #1535396: All Questions unassigned when updating Quiz Node, you can cause this issue by:

1. Create a new quiz
2. Add some questions to the quiz and save
3. Take the quiz.
4. Edit the quiz and add a new question (in this example, I added directions)

In the manage questions screen, the only assigned question is the new question. All earlier questions have been unassigned.

Attempting to add the questions back into the quiz results in this error:

Notice: Undefined index: 12-14 in _quiz_update_items() (line 1519 of /path/to/drupal/install/sites/all/modules/quiz/quiz.admin.inc).

Additionally, the re-added questions do not save, and are not visible when you go to take the quiz.

However, when you go the results page and delete all results, and then go back to the manage questions page, you will then be able to have your results save, and show up when you try and take the quiz. However, you still get the error message listed above.

This was with quiz version 7.x-4.0-alpha4, a vanilla Drupal install, on Ubuntu Linux running PHP 5.3.2

Comments

bonobo’s picture

Version: 7.x-4.0-alpha4 » 7.x-4.x-dev

After seeing this commit on the 4.x-dev branch I tested that branch.

The issue at #1535396: All Questions unassigned when updating Quiz Node appeared to be gone, but this issue still was present.

djroshi’s picture

Status: Active » Needs review
StatusFileSize
new925 bytes

Seems to be caused by the form, as quiz directions don't have a 'max score' form field, therefore, at line 1519 $question->max_score = $max_scores[$id]; is undefined. Resolved in patch by using a hidden form field for quiz directions.

falcon’s picture

Status: Needs review » Fixed

Thanks, I used value instead of hidden.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Corrected confusing wording

  • Commit f3a994d on 7.x-4.x, 7.x-5.x by falcon:
    Issue #1548344 reported by bonobo: Fixed problem resulting in 'undefined...

  • Commit f3a994d on 7.x-4.x, 7.x-5.x, quiz-pages by falcon:
    Issue #1548344 reported by bonobo: Fixed problem resulting in 'undefined...

  • Commit f3a994d on 7.x-4.x, 7.x-5.x, quiz-pages, 2269219 by falcon:
    Issue #1548344 reported by bonobo: Fixed problem resulting in 'undefined...

  • Commit f3a994d on 7.x-4.x, 7.x-5.x, 2269219 by falcon:
    Issue #1548344 reported by bonobo: Fixed problem resulting in 'undefined...