If the multichoice question field is set to Full HTML and user is not logged in when taking the quiz, the question appears as "n/a"

If the field is set to Filtered HTML all works OK, and question is displayed

CommentFileSizeAuthor
#1 multichoice_input_filter.patch613 bytesgrobemo

Comments

grobemo’s picture

Status: Active » Needs review
StatusFileSize
new613 bytes

Found it. The bug is in multichoice.module. (There may be similar problems in other question type modules.)

The question is rendered in multichoice_render_question_form at line 591 in the 6.x-2.1. It calls check_markup(), but it's checking the current user's permissions for the input filter, which is why Full HTML causes problems.

The fix is simple (probably easier than applying the patch). Change this:

  $form['question'] = array('#type' => 'markup', '#value' => check_markup($node->body, $node->format));

to this:

  $form['question'] = array('#type' => 'markup', '#value' => check_markup($node->body, $node->format, FALSE));

By adding a third parameter (FALSE), you're telling check_markup not to check whether the current user has permission to access the filter with which the question was created.

Anonymous’s picture

Status: Needs review » Reviewed & tested by the community

Just implimented the fix, works like a dream

Testing logic

Changed question field to Full HTML and tested Question Missing

made code change

Question visible

Many thanks for such a simple fix. Now quetsions can be more than just text :)

mbutcher’s picture

Excellent! Thanks! This will go into 2.2.

I really appreciate the work each of you did. Thanks.

Matt

Anonymous’s picture

opening new issue and re- closing this one

summit’s picture

Status: Reviewed & tested by the community » Active

subscribing, greetings, Martijn

Anonymous’s picture

Status: Active » Reviewed & tested by the community

Associated Issue opened http://drupal.org/node/371730

jhood’s picture

Thanks! Wish I found this sooner!

-John Hood

mbutcher’s picture

Version: 6.x-2.1 » 6.x-3.x-dev
Status: Reviewed & tested by the community » Fixed

This is fixed in Quiz 3 dev, and will be in Alpha 2.

Status: Fixed » Closed (fixed)

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

quinns’s picture

Version: 6.x-3.x-dev » 6.x-4.3
Component: Code » Code - Multichoice
Status: Closed (fixed) » Active

We are still experiencing this issue using Drupal 6.22 and Quiz 6.x-4.3. Users who do not have access to "Full HTML" input format are not able to see the Quiz questions. These are Multiple Choice questions.

robbm’s picture

Component: Code - Multichoice » Code - Quiz core

Same problem here. And with truefalse questions too - suggesting it's a core issue.

rurri’s picture

I'm experiencing this issue as well and am using Short Answer Questions.

Anonymous’s picture

I have in the last 2 days updated from an early Quiz 2 through 3 and currently latest 4. Also updated core to latest. Logged out and as a visitor can see the questions, logged in as user 1 can see the questions.

regi.bradley’s picture

I'm experiencing the same issue on my Drupal 6.22 site after updating to Quiz 6.x-4.3. Is there a fix out there for this yet?

criznach’s picture

subscribing

matdab’s picture

subscribing

PhillyDave’s picture

Same here using 6.X-4.3

falcon’s picture

Status: Active » Closed (fixed)

Thansk for reporting