Javascript for automatic page change

Home Forums Support Javascript for automatic page change

This topic contains 0 replies, has 1 voice, and was last updated by  Pedro 3 years, 5 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #8920

    Pedro

    Hi!

    I have a problem concerning Javascript programming in Qualtrics. I would like to automatically send users to the end screen when a fixed time limit of survey completion is reached. I know how to do it with time presented in seconds, as in a code that I paste below:

    var displayTime = 30;
    new PeriodicalExecuter(function(){
    if($(‘NextButton’))$(‘NextButton’).click();
    },displayTime);

    Furthermore, I was able to create an Embeded Data object (I called in TotalTestTime), that measures time from the start of survey. Then I tried to simply put its name in the code, so that when the value of the object reaches 30, it presses NextButton automatically:

    var displayTime = 30-TotalTestTime;
    new PeriodicalExecuter(function(){
    if($(‘NextButton’))$(‘NextButton’).click();
    },displayTime);

    Unfortunately, the code did not work. Is it possible to add reference to the ‘TotalTestTime’ Embeded Data in Javascript code, so that when its value reaches e.g. 30 seconds as in example above, the page would change automatically?

    I would be very grateful for your help.

    Pedro

Viewing 1 post (of 1 total)

The forum ‘Support’ is closed to new topics and replies.