when question is related to html and having tags in alternatives generating error
Recoverable fatal error: Argument 1 passed to MultichoiceQuestion::shuffle() must be an array, null given, called in /sites/all/modules/quiz/question_types/multichoice/multichoice.classes.inc on line 432 and defined in MultichoiceQuestion->shuffle() (line 469 of /sites/all/modules/quiz/question_types/multichoice/multichoice.classes.inc).

question : Which is the correct tag to display a picture?

options (wrapping in code because it has html tags)

 <imgsrc = “Picture.jpg” > 
 <imgcrs = “Picture.jpg” > 
 <imgscr = “Picture.jpg” > 
 <img source = “Picture.jpg” > 

Ataching the debug info where alternatives and answers are empty(strangely) and also screenshot of question.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nithinkolekar created an issue. See original summary.

nithinkolekar’s picture

Category: Bug report » Task

This could be fixed by exposing individual field settings for multichoice_alternative_correct and multichoice_alternative_incorrect, so that user can set text format like plain text.
Currently it is not editable which makes impossible to use html tags in multiple options.

I tested by creating question manually by setting text format for each options to plain text while node creation.(earlier I was using feeds to import question which doesn't raise any error during import but raises when that node is being loaded during quiz progress)

djdevin’s picture

Hi,

Are you saying that the problem is with qq_import?

nithinkolekar’s picture

not exactly with the qq_import but generally with alternatives field settings, where text format is not configurable in the content type field settings and also in the feeds mapping but available while creating question manually.(screenshot 3)
Attaching the screenshot of the mappings, field settings and question creation page.

Questions are special type where we could have html tags as options(for ex: to test user's html skill) and html itself (to insert picture or formatted text). If text format settings are exposed to feeds we can set it dynamically per question based on the value from csv column using custom code or using feed tamper.

djdevin’s picture

Status: Active » Closed (cannot reproduce)

I'm pretty sure this is an issue with qq_import and the feeds mappings. I'm the maintainer of qq_import now and I recently committed changes that affect the filter format. If you download the 7.x-1.1 version some issues should be fixed.

http://cgit.drupalcode.org/qq_import/commit/?id=7fe8b806ad2f29a0d3288001...

Before it was using "full_html" by default, even if you did not have access to the filter format or if it did not exist. Now, it uses whatever the default is (based on your user). There is also a variable qq_import_multichoice_text_format which you could set to the default input format.

So if you were to re-import these questions I believe they would work. I don't think it's a bug in Quiz.

I can't reproduce this issue normally so my guess is that it's entirely qq_import's fault.

If you can write down steps to reproduce without using qq_import then I can try to reproduce and fix the issue.

nithinkolekar’s picture

Status: Closed (cannot reproduce) » Active

Just checked with updated qq_import 7.x-1.1.

Now, it uses whatever the default is (based on your user)

didn't get that . I am logged in as user 1

There is also a variable qq_import_multichoice_text_format which you could set to the default input format
couldn't find that variable in the mapping section, where/how can I set that format?

will check again with once you share the above info and will reply back.

djdevin’s picture

Category: Task » Bug report
Status: Active » Closed (cannot reproduce)