embed video into questionnaire

embed video into questionnaire

by Mary Cooch -
Number of replies: 17
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
A colleague has been using a questionnaire in his teaching - and is curious (and so am I) as to why a video (of whatever format) will not show up in a label when it will show up as part of a question? I don't understand as to me it looks like the same html editor in both?  And you can embed videos in labels on courses -is there something different in a questionnaire? ( I don't *think* we are doing it wrong, but happy to find out otherwise!)
Average of ratings: -
In reply to Mary Cooch

Re: embed video into questionnaire

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Possibly related to this discussion.

In reply to Joseph Rézeau

Re: embed video into questionnaire

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
hmm thanks - yes I knew I had seen something along similar lines recently as I mentioned to my colleague. But that's related to i-frames isn't it? I was just (with multimedia plugins enabled) hyperlinking to the video url from the course files in a label. Funny because my problem seems to be the opposite of the iframe one (ie, my videos display in question text but not label; the iframes work in label but not question text) 
In reply to Mary Cooch

Re: embed video into questionnaire

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Mary, what do you call a "label" in Questionnaire questions?

If you mean the "name" field of questions, or course you cannot embed videos there, because that "name" field is used as column name when questionnaire data is exported to text to be viewed in a stats package or a spreadsheet.

If, on the other hand, you mean the "Label" question type, it is perfectly possible to embed videos in them.

Please re-state your question using the current questionnaire terminology.wink

ATB

Joseph

In reply to Mary Cooch

Re: embed video into questionnaire

by Randy Orwin -
Hi Mary,

I think you are referring to a label as in a Questionnaire question type, correct? I have just tried adding a video to a label within a Questionnaire on my site and it works fine using the following methods:
  • Linking directly to an flv file in the files area
  • Linking to a YouTube video by typing in a word, selecting the word and hyperlinking to the YouTube video
  • Copying the embed code from YouTube and pasting into the html source of the editor.
You can view the Questionnaire at http://orwinconsulting.com/moodle/mod/questionnaire/view.php?id=785
In reply to Randy Orwin

Re: embed video into questionnaire

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Hi Joseph - hi Randy. Yes; I am referring to the label as in a questionnaire question type. I haven't  tried youtube as it is banned in my school.

I have tried linking to an flv, a wmv - and just before I came back here now, an mp3 and again they don't display in the label but come up fine in the question text of any of the questions.

Confused (can't see your site as it's blocked!) FYI I am on IE8 on a pc in school (so can't test any other browsers)using 1.9.7 and questionnaire 2008060405

In reply to Mary Cooch

Re: embed video into questionnaire

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Mary,

Upon further testing with the "label" question type in questionnaire, here are my findings:

Any type of media will be displayed when viewing the questions on the "edit questions" page : links to course files mp3, flv, embedded YouTube, etc.

but, when actually viewing the questionnaire itself, only the youTube videos are displayed, not the links to course files mp3, flv!

this is strange, I will look into it and report further findings here

Joseph

In reply to Joseph Rézeau

Re: embed video into questionnaire

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Thanks Joseph; this is appreciated.
In reply to Mary Cooch

Re: embed video into questionnaire

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Bug is fixed. CONTRIB-1925.
Will be available in plugin download area tomorrow. For anyone in a hurry or who wants to know more, here is the patch. File mod/questionnaire/questiontypes/questiontypes.class.php, around line 1320, replace line in red with line in blue:
function sectiontext_survey_display($data) {
echo '
<div class="questioncontainer">
<div class="qnOuter">
<table class="qnInnerTable" style="width:100%" cellpadding="10" cellspacing="1">
<tr>
<td class="qnInnerTd" valign="top">&nbsp;</td>
<td class="qnInner" style="height:35px">' .
$this->content.'
</td>
</tr>
</table>
</div>
</div>
';
}


with
format_text($this->content, FORMAT_HTML).'

Well-spotted, Mary!

In reply to Joseph Rézeau

Re: embed video into questionnaire

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Thanks very much Joseph - and your thanks are not to me but to my boss- I've just emailed him a "well done"smile Pity of it is, our school Moodle is hosted externally by our regional broadband suppliers so we probably won't be able to get the patch until our next upgrade in several months time!
I too am curious as to how come Randy's works??
In reply to Mary Cooch

Re: embed video into questionnaire

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Mary:

Pity of it is, our school Moodle is hosted externally by our regional broadband suppliers so we probably won't be able to get the patch until our next upgrade in several months time!

Oh, so your broadband suppliers get their Moodle patches by stagecoach? horse and cart? clay tablets? Tell them about the instantaneousness of the Internet, they might be interested.big grin

Take heart,

Joseph

In reply to Joseph Rézeau

Re: embed video into questionnaire

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Joseph - to be fair - they host several hundred Moodles and they'd have to apply it to every single one and to do that for every single patch that came out - it would be a nightmare, so I perfectly understand. (Added to which, Dan Poltawski is the Man Who Does All the Work and I appreciate his effortssmile )
In reply to Mary Cooch

Re: embed video into questionnaire

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Mary - pity your own school does not have the resources to host your own moodle site so you could master these upgrade & patch matters yourselves. But, point taken.
In reply to Joseph Rézeau

Re: embed video into questionnaire

by Theron Muller -

I wanted to add that I just visited this thread, applied the update reported in the bug fix CONTRIB-1925, and was still having trouble until I toggled the YouTube embed code to "Use old embed code", so on my site, Moodle 2.02+, the object tages are working in the questionnaire labels but not the iframe tags.

In reply to Joseph Rézeau

Re: embed video into questionnaire

by Randy Orwin -
Hi Joseph,

On my site the links to files in the file area work just fine when viewing the survey as a student. If you click on the link in my previous post to the test Questionnaire you will see that the 3rd video down is a link to a file. I set up the Questionnaire so that guests could actually complete the survey by using the "Override permissions" tab on the editing questionnaire page.
In reply to Randy Orwin

Re: embed video into questionnaire

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
I'm surprised that it should work, since there was a bug, which I have now fixed...
Joseph
In reply to Mary Cooch

Re: embed video into questionnaire

by Randy Orwin -
Wow, my site is blocked! I am assuming it is being blocked by your content filter. That is just wrong since I do mostly educational technology consulting sad. I just tested it on IE 7 on a Windows Vista box and it seems to work just fine.
In reply to Randy Orwin

Re: embed video into questionnaire

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Don't worry Randy - lots of school websites and Moodles are blocked by our county's filter! They have an "uncategorised website" policy which means that if it isn't categorised as "definitely safe" or "definitely bad" they just block it -until we ask for it to be unblockedsmile A couple of my own Moodles were blocked at the start of the year. I am at home now though so can see your site just fine. I can also see the flv that you have linked to from your course files - but which I can't get to work on mine. Hmm...