Welcome to the LimeSurvey Community Forum

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

Participant-specific Timer

  • kitestsup
  • kitestsup's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 2 months ago #210794 by kitestsup
Participant-specific Timer was created by kitestsup
Hello,

I'm facing the challenge that I need to adjust the time-limit for a certain question on a participant level.
This individual limit is based on a previous assessment and could be stored as an attribute within the tokens table.
However, it doesn't seem to be possible to access attributes within the timer-logic.

I tried to find an answer in the forum but didn't find a suitable article.
Is there a way (maybe using JS) to set the timer according to some parameter?
Any help is highly appreciated!

Thank you in advance.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 2 months ago #210801 by Joffm
Replied by Joffm on topic Participant-specific Timer
You can use the "timeout"-function.
Put this javascript snippet into the sourcecode of the question.
Code:
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
    setTimeout(function () {
          $('#ls-button-submit').trigger('click');
    }, {TOKEN:ATTRIBUTE_1});
});
</script>

This will trigger the "Next" button.
Remember: This function expects the time in milliseconds.

I think this is sufficient, if you only want proceed to the next question.
And you may include something like this in the text
Your maximum time to answer is: {TOKEN:ATTRIBUTE_1/1000} sec
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: kitestsup
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose