Closed (outdated)
Project:
Quiz
Version:
7.x-4.x-dev
Component:
Code - Quiz core
Priority:
Major
Category:
Bug report
Assigned:
Reporter:
Created:
7 Mar 2014 at 10:52 UTC
Updated:
11 Dec 2024 at 21:57 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Jamesap commentedComment #2
Jamesap commentedComment #3
Jamesap commentedAdding patch
Comment #4
Jamesap commentedPushed to opigno_lms
http://drupalcode.org/project/opigno_lms.git/commit/de26cd3
Comment #5
Jamesap commentedWrong patch correct one added
Comment #6
Jamesap commentedReleased in opigno 1.10
Comment #7
Jamesap commentedAdded patch for h5p quiz branch
Comment #8
falcon commentedI think we need to go through this one again and make sure that it also works when the creation form doesn't validate.
Comment #9
da_cloud commentedThe patch from #8 probably has the same result, but it the reason why the form doesn't apply the settings seems to be because the settings get overwritten later on in the flow.
If you look in the quiz_question.module file on line 125 you see the following line
$form = array_merge($quiz_question_form, $form);The issue here is that the $form also has an #attached key to attach some CSS (see screenshot). The way array_merge works is that if both arrays have the same key the later value will overwrite the previous value. In this case the attached js will be overwritten by the attached css.
There are multiple ways to fix the way these array's are merged together, but I assume that simply using the recursive array_merge function would do the trick without messing up the rest of the code.
Comment #10
da_cloud commentedComment #11
da_cloud commentedSeems I was to quick with uploading the above patch as I've forgotten to add one other line to the patch where roughly the same thing happens.
Comment #12
alx_benjamin commentedRecreated patch #11 to be run from within quiz module's directory.
Thank you for the patch.
Comment #13
amermod commentedUpdated the patch. The part that attache the JS file was adding an array inside another array. It's not necessary and creates notices in the log.
Comment #14
smustgrave commentedIf someone can review can include in one of the last few releases of D7 for quiz
Comment #15
smustgrave commented