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
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | undefined_index_quiz_update_items-1548344-1.patch | 925 bytes | djroshi |
Comments
Comment #1
bonobo commentedAfter 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.
Comment #2
djroshi commentedSeems 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.Comment #3
falcon commentedThanks, I used value instead of hidden.
Comment #4.0
(not verified) commentedCorrected confusing wording