- Posts: 10
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Exit, clear and restart survey after x-minutes on the one page
- joebloggs1987
- Topic Author
- Offline
- New Member
Less
More
5 years 4 months ago #178308
by joebloggs1987
Exit, clear and restart survey after x-minutes on the one page was created by joebloggs1987
I'm wanting to find a way to clear and restart a survey if the user spends more than a certain amount of time on the one page (i.e. if the question group time exceeds x-minutes, to exit and clear responses and restart the survey from the first question group).
This will be an open survey, not token based.
Is there any way to do this in Limesurvey?
Thanks in advance.
This will be an open survey, not token based.
Is there any way to do this in Limesurvey?
Thanks in advance.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
5 years 4 months ago #178309
by DenisChenu
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.
Replied by DenisChenu on topic Exit, clear and restart survey after x-minutes on the one page
I do a js system to autosave survey after X minutes (here 10).
You can easily replace action to reset the survey here ( window.location.href = "/index.php/sid/1234?newtest=Y " )
Code:
var outTimer; var alertTimer; var countTimer; var idleTime = 0; var surveyTimeOut = 10; $(document).ready(function() { var idleInterval = setInterval(timerIncrement, 60 * 1000); // One minute 60 * 1000 }); $(document).on('click keypress mousemove scroll',function(){ idleTime = 0; }); function timerIncrement() { idleTime = idleTime + 1; if(surveyTimeOut && surveyTimeOut <= idleTime) { $("form#limesurvey [name='saveall']").click(); } }
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.
The following user(s) said Thank You: joebloggs1987
The topic has been locked.
- joebloggs1987
- Topic Author
- Offline
- New Member
Less
More
- Posts: 10
- Thank you received: 1
5 years 4 months ago #178419
by joebloggs1987
Replied by joebloggs1987 on topic Exit, clear and restart survey after x-minutes on the one page
Perfect! Exactly what I needed!
Cheers mate.
Cheers mate.
The topic has been locked.