In question tables (i.e. what you see when you click on the 'Manage questions' tab of a quiz), the body of quiz questions is run through check_markup() twice, once with the correct format specified, and once without. The first time is quiz_node_map() (called from _quiz_get_questions()) and the second is in theme_quiz_question_table().

The second call to check_markup() (from within theme_quiz_question_table()) does not include a format option, whereas the first does, so it may strip out things that were allowed by the format chosen for the question body. In my case, the questions contained images that were being stripped out by this second call to check_markup().

I believe the solution is simply to remove this second call to check_markup(), and I've included a patch to do this. Is there any reason why this solution is a bad idea?

Ben

CommentFileSizeAuthor
#2 quiz_markup.patch632 byteswestwesterson
quiz_check_markup.patch462 bytesbenwei

Comments

westwesterson’s picture

Version: 5.x-1.x-dev » 6.x-2.x-dev
Category: bug » feature

this is a feature request, direct feature requests to head version

westwesterson’s picture

StatusFileSize
new632 bytes

Have reviewed this patch and code wise it seems sound, since this potentially has security ramnifications, i think this should be looked over by someone else as well. I include the rerolled patch, the only difference in this is the line number. I think it would be great to allow questions with filtered content on the admin pages. This creates a better interface for audio and image questions.

kylebrowning’s picture

Status: Needs review » Reviewed & tested by the community

This patch is WAI

westwesterson’s picture

Status: Reviewed & tested by the community » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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

  • Commit 64321c8 on 5.x-2.x, 6.x-2.x, 6.x-3.x, 6.x-4.x, 6.x-5.x, 6.x-6.x, 7.x-4.x, master, 7.x-5.x by westwesterson:
    Questions in admin no longer checked twice. Issue #186154 by myself
    
    

  • Commit 64321c8 on 5.x-2.x, 6.x-2.x, 6.x-3.x, 6.x-4.x, 6.x-5.x, 6.x-6.x, 7.x-4.x, master, 7.x-5.x, quiz-pages by westwesterson:
    Questions in admin no longer checked twice. Issue #186154 by myself
    
    

  • Commit 64321c8 on 5.x-2.x, 6.x-2.x, 6.x-3.x, 6.x-4.x, 6.x-5.x, 6.x-6.x, 7.x-4.x, master, 7.x-5.x, quiz-pages, 2269219 by westwesterson:
    Questions in admin no longer checked twice. Issue #186154 by myself
    
    

  • Commit 64321c8 on 5.x-2.x, 6.x-2.x, 6.x-3.x, 6.x-4.x, 6.x-5.x, 6.x-6.x, 7.x-4.x, master, 7.x-5.x, 2269219 by westwesterson:
    Questions in admin no longer checked twice. Issue #186154 by myself