Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Apr 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question I am a newbie and need some help with Javascript please. :-)

    Hello guys -

    I need some help with Javascript in Qualtrics...I need to do the following:

    Ideally, I want to have 2 videos on the same screen and participants will be able to start and watch any video they want; I should be able to capture the time that they spend on watching each video; participants will have a count-down timer on the top of the screen and they will be automatically redirected to the next page as soon as the 5 mins are over.

    Alternatively, two videos can be on two different screens – so they see one video first and then they can decide when to proceed to the second video which will be on the next screen. They should have a total time of 5 minutes to spend on both screens and will be given a count-down timer on the top of the screen. Participants will be automatically redirected to the next page as soon as the 5 mins are over. I again need to capture the time that they spend on each video.

    Do you have any idea how this could be done? If you could help me with the code, that would be great. I just have almost never used javascript so far...

    Thanks a lot in advance!

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,079
    Thanks
    203
    Thanked 2,542 Times in 2,520 Posts
    This forum is not a free coding service. As a general rule, the people helping out in this forum don't write code for others, but try to help with fixing code that doesn't work. You may perhaps get someone to write this script for you, but you'll be far more likely to get help if you have made a substantial effort and written some code yourself. Then someone here will almost certainly help you correct/improve your work.

    You will need server-side code and a database if you wish "to capture the time that they spend on each video." Any time restriction applied by Javascript is easily overcome simply by reloading the page.


    It is your responsibility to die() if necessary….. - PHP Manual
    Last edited by Philip M; 04-24-2013 at 05:06 PM.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #3
    New to the CF scene
    Join Date
    Apr 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks a lot for the clarification. I wish I knew how to even start the code...Thanks a lot anyways.

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,015
    Thanks
    79
    Thanked 4,436 Times in 4,401 Posts
    Quote Originally Posted by Philip M View Post
    You will need server-side code and a database if you wish "to capture the time that they spend on each video." Any time restriction applied by Javascript is easily overcome simply by reloading the page.
    While this is true, if you aren't worried about people "cheating" on you then you can indeed do the timing in JavaScript alone. That is, if this is just for training or entertainment, then who cares if somebody decides to restart by reloading the page? But if it's for important testing purposes, Philip is spot on.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •