Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Triggering launch of questions when video is paused

  • JenniWatson
  • JenniWatson's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 3 months ago #239660 by JenniWatson
Please help us help you and fill where relevant:
Your LimeSurvey version: [see right hand bottom of your LimeSurvey admin screen]
Own server or LimeSurvey hosting:
Survey theme/template:
==================
Hi, I am trying to create a survey where participants view a video and make comments as they go along, ideally they would watch the video and then at relevant points to them they can stop the video and this will trigger a set series of questions. Is this possible?

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 2 months ago #239661 by tpartner
Use JavaScript pause event for an HTML video element to trigger showing question(s)

- www.w3schools.com/tags/av_event_pause.asp

So, for example, some HTML like this in the source of a text-display question:

Code:
<div class="video-wrapper">
   <video id="myVideo" width="320" height="240" controls>
      <source src="path/to/your/video.mp4" type="video/mp4">
      Your browser does not support the video tag.
  </video>
</div>

And, this script (using jQuery) also in that question source:

Code:
<script type="text/javascript" data-author="Tony Partner">
 
  $(document).on('ready pjax:scriptcomplete',function(){
 
    // Identify this question
    var thisQuestion = $('#question{QID}');
     
    // Hide all other questions
    $('.question-container').not(thisQuestion).hide();
 
    // Listener on the video
    $('#myVideo').on('pause', function(e) {
      $('.question-container').not(thisQuestion).fadeIn(500);
    });
  });
</script>

Sample survey for LS 5.x attached:  

File Attachment:

File Name: limesurvey...9551.lss
File Size:45 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

  • JenniWatson
  • JenniWatson's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 2 months ago #239737 by JenniWatson
Replied by JenniWatson on topic Triggering launch of questions when video is paused
Many thanks, I think that’s a bit beyond my level of skill but I appreciate your advice!

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 2 months ago #239740 by holch
It is all provided by Tpartner, he even attached an example survey (LSS) that you can import and see for your self.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Please Log in to join the conversation.

  • JenniWatson
  • JenniWatson's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 2 months ago #239741 by JenniWatson
Replied by JenniWatson on topic Triggering launch of questions when video is paused
I think my total beginner status is tripping me up - when I tried to use the example survey nothing played at all.
I have spent hours on the forum etc but can’t get it to work, I have tried to work around with if statement etc but still stuck.

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 2 months ago #239743 by holch
Where is your LS hosted? If it is a university or big organisation, there is a good chance that the XSS filter is on and the Javascript required for Tpartner's solution is most probably filtered out.

Therefore, it is very important to that when you ask about things like that, to mention the LS Version you are using, the Theme/Template as well as where it is hosted.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 1 month ago #241373 by tpartner
Brilliant! Suggest using Google Forms, SurveyMonkey, or Typeform in a LimeSurvey forum!

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 1 month ago #241374 by holch
@Tpartner: I thought the same. :-)

But to be honest, I think this is just the start of a spam attack.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 1 month ago #241417 by DenisChenu
No interest, didn't answer to question : deleted (then we don't have to track if there are hidden link …)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.

Please Log in to join the conversation.

  • JenniWatson
  • JenniWatson's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 1 month ago #241422 by JenniWatson
Replied by JenniWatson on topic Triggering launch of questions when video is paused
Apologies, I have been unwell so haven’t been following the thread. If the suggestion is that I am a spam attack then that’s a bit sad. I’m not, I’m just a confused newbie trying to work out LS.

Thanks for all of the suggestions, the LS is hosted by a university so maybe that is why the initial suggestion didn’t work (although I suspect it’s a me thing really).

My solution had actually been to use two surveys - one with the video and be with the questionnaire. That’s the closest I think I can get whilst staying within my study ethics and copyright rules.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 1 month ago #241425 by Joffm
Hi,
as @Denis wrote, the probable spam attack was deleted.
So you obviously didn't see it.
It's not related to you.

Joffm 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 1 month ago - 1 year 1 month ago #241426 by DenisChenu
Sorry @JenniWatson : not you another user.
I delete the post.

Your question and your answers are cool

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 1 year 1 month ago by DenisChenu.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose