I have re-opened this issue as I have encountered an associated issue.

Now we can have the question in HTML we have the option of adding images which is great. But when you view the results they are not displayed as "Full HTML " but as "Filtered HTML"

The section of multichoice.module that appears to control this is from 994 and namely 1021

  // Add the cell with the question and the answers.
  $q_output = '<div class="quiz_summary_question"><span class="quiz_question_bullet">Q:</span> '. check_markup($question->body) .'</div>';

removal of the check_markup as below will allow display of the Question in Full HTML, but not knowing enough about php, i do not know if this is acceptable or even the right way of doing it

  // Add the cell with the question and the answers.
  $q_output = '<div class="quiz_summary_question"><span class="quiz_question_bullet">Q:</span> '. $question->body .'</div>';

Comments

Anonymous’s picture

Previous issue http://drupal.org/node/363281 that has lead to this becoming apparent

Anonymous’s picture

Title: Feedback not HTML » Quiz results feedback not in HTML, with possible cause and fix

Improved title

grobemo’s picture

I'm not sure about this, since I don't understand the code here all that well. Including $question->body directly seems like a security risk and a violation of the principle that you should never send user input directly to the page.

Going off of the solution to the related issue, what if you changed the check_markup in the existing code to the following?

$q_output = '<div class="quiz_summary_question"><span class="quiz_question_bullet">Q:</span> '. check_markup($question->body, FILTER_FORMAT_DEFAULT, FALSE) .'</div>';

I haven't tested this yet, but I'm not sure when I'll get a chance to do it, so you might want to try it yourself.

Anonymous’s picture

I tried the change you suggest , but it stays as Filtered HTML

Were obviously in the right area, just a case of pinning it down

Anonymous’s picture

Ok , using what you did as a clue, i did a search of DRupal for similar issues of FILTER_FORMAT_DEFAULT

(didnt actually understand what you were doing when i started, but now have a partial solution which may get us to the right one

  $q_output = '<div class="quiz_summary_question"><span class="quiz_question_bullet">Q:</span> '. check_markup($question->body, 3, FALSE) .'</div>';

What i hadn't realised was you were setting to the site default filter, which in my case is "Filtered HTML", so substituting for "format" "3" which in my case if Full HTML, now displays correctly. The problem is different sites may have Full HTML with a different format number. So the code is not universal. Also not sure if this breaks any other rules.

The good thing is I am learning new tricks every day :)

grobemo’s picture

So that's what FILTER_FORMAT_DEFAULT does. Is $question->format defined at this point? Could you use that?

Anonymous’s picture

Now walking a tightrope without a net :)

I had a look for $question->format but it doesn't appear in the module

I did find $quiz->format and $node->format tried them without success

I think i now understand what we need, and that is to know the input format being used by the node, and not the default input format set for the node, if that makes sense.

I am currently searching Drupal for various combinations of these ideas :)

mbutcher’s picture

Version: 6.x-2.1 » 6.x-3.0-alpha1
Status: Active » Postponed (maintainer needs more info)

Is the new setup in Quiz 3 sufficient, or is this still a problem?

(Trying to figure out what still needs fixing for Quiz 3 before beta)

leenwebb’s picture

Version: 6.x-3.0-alpha1 » 6.x-4.0-alpha1

I just encountered this exact problem in 4-alpha -- I had "n/a" in one of my questions (in the results summary at the end of the quiz) and the actual results paragraph displayed as just "n/a" as well.

I ended up changing both the input format of the quiz node itself and the offending question to Filtered HTML and everything worked fine. (But I really want them to be Full HTML!)

I'm not sure what further info you need, but please let me know and I'll try to provide whatever I can!

turadg’s picture

Assigned: Unassigned » turadg
Status: Postponed (maintainer needs more info) » Fixed

I believe this is fixed in 4.x-dev. Look for the next alpha or beta and if it's not, please reopen.

(Fixed on http://drupal.org/node/534716#comment-1912992)

Status: Fixed » Closed (fixed)

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