Hi,
For some reason the questionnaire module ignores an iframe tag in the question body.
Is that a bug?
There is no problem using iframe tags in quiz questions.
Even in a questionnaire 'label' it's working.
Apparently there is a differance between the label "question" and all the other questions.
It so happens that the question text is "cleaned", i.e. formatted as HTML before being displayed. I expect the reason for this cleaning is for safety, but I'm not sure.
If you want to change this on your moodle site, just change the line in mod/questionnaire/questiontypes/questiontypes.class.php, around line 800 as shown below. And you can vote for bug report CONTRIB-1769 .
Joseph
Thank you Joseph!
This can't be a security issue since a core module like quiz has no such restriction.
And it's not even consistent in the questionnare module because the 'label' element accepts the iframe tag.
I think it should be changed for consistency with other modules and whithin the questionnaire module itself.
I think I know why the 'format_text' function was in use.
I don't know how this function actually works but disabling it causes the lang tag ( <span class="multilang" lang="XX"> ) to stop working. However, it does not impact other html code I checked (bold, image, etc).
So the solution you suggest Joseph, enables the iframe tag but disables the lang tag and the current situation enables the lang tag but disables the iframe tag.
If I'm right and 'format as html' is not necessary for processing any html code but the lang tag, then it should be removed and a different solution for including the lang tag should be found.
What do you think Joseph?
Yaniv,
Thanks for pointing out the problem, Yaniv. Currently I cannot think of a solution which would allow both lang tags and iframes. I have not idea what proportion of Questionnaire users need one or the other or both.
So, for the time being, and until a satisfactory solution is found, I propose to keep the Questionnaire code as it is (and not enable iframes). If you don't need the multilang facility but need iframes, then you can always make the necessary changes to your Moodle site.
All the best,
Joseph
Hello Joseph
I am using the Questionnaire and I have a problem using an iframe into a question. When I 'm working on the html editor , I can see the iframe but when the question is run, the iframe is removed. I read somewhere that could change something in the code so that this doesn't happen, in the anterior post, you mentioned around the line 800 but in my actual version, the code is different, I need your help with this issue. Thanks very much, the Questionnaire version is 2.6.7 (Build - 2015031901) (2014041804)