Welcome to the LimeSurvey Community Forum

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

Boilerplate text displayed for some time, without opportunity to click continue

  • max12
  • max12's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
8 years 10 months ago #121749 by max12
In an experiment I want subjects to solve a real effort task. If they make a mistake they receive feedback on a boilerplate screen. I want to define how long this screen is visible without the subjects having the opportunity to click to the next screen. So I want to have a timelimit and once it is running out a new screen is displayed. Yet I want to achieve that subjects can not shorten the display time by clicking on a continue button. So I want to have a display screen that is shown for some time conditioned on a mistake by the subjects adn then automatically a new screen is shown. Do you know how this cna be done? Thanks!
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 10 months ago #121766 by tpartner
The easiest solution would be to place the boilerplate question in it's own group and use JavaScript to hide the "Next" button in that group and automatically submit after an interval.

1) Set up your survey to use JavaScript .

2) Add the following script to the source of the boilerplate question. Adjust "navigationDelay" as necessary.

Code:
<script type="text/javascript" charset="utf-8">  
  $(document).ready(function(){
 
    // Navigation delay in seconds
    var navigationDelay = 5; 
 
    // Hide the "Next" button
    $('#movenextbtn, #moveprevbtn, #movesubmitbtn').hide();
 
    // Move to next group after delay
    setTimeout(function () {
      $('#movenextbtn').trigger('click');
    }, navigationDelay*1000);
  });
</script>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • max12
  • max12's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
8 years 10 months ago #121768 by max12
Just tried it out. The code like a charm :). Thank you very much for your help !!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose