Welcome to the LimeSurvey Community Forum

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

Reset timers cookie on last page

  • Matiasko
  • Matiasko's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 9 months ago - 5 years 9 months ago #170625 by Matiasko
Reset timers cookie on last page was created by Matiasko
Hello,

we're about to run a survey for our research.

The most important part is that we use timers for some of the questions (16 of them). After the survey is completed we expect people to run it again on the same device but as timer values are stored in cookies, they will not have starting value like 30 seconds but the remaining time from the previous session. In worse case scenario the question will be skipped because in the first session the timer has run down to 0.

This is why I would like to reset timers-related cookies. I have checked the site cookies but none of them looks to me like it is storing these times. Yet at the same time, when I reset all site cookies, the timers get reset so this information must be stored somewhere there.

Additional info: we can't ask them to run it in the incognito tab or to delete their cookies. We expect participant to use all types of devices, be it computer or smartphone.

Could you explain to me how exactly are timer values stored in cookies?

Best, could you provide me with the code (JavaScript?) to use at the end of the survey that will clear only timers-related cookies?

Version: 3.13.0

Thank you
Matt
Last edit: 5 years 9 months ago by Matiasko.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 9 months ago #170629 by tpartner
Replied by tpartner on topic Reset timers cookie on last page
If you append a parameter "newtest=Y" to the survey URL the session and timers should be reset.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • Matiasko
  • Matiasko's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 9 months ago #170631 by Matiasko
Replied by Matiasko on topic Reset timers cookie on last page
Thank you for your answer but it doesn't reset timers :(
The topic has been locked.
  • dominikvitt
  • dominikvitt's Avatar
  • Visitor
  • Visitor
5 years 9 months ago #170632 by dominikvitt
Replied by dominikvitt on topic Reset timers cookie on last page
Yes, I also confirm that appening "newtest=Y" parameter doesn't resets the timers.
I'll have a look now and try to fix it.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 9 months ago #170636 by DenisChenu
Replied by DenisChenu on topic Reset timers cookie on last page

dominikvitt wrote: Yes, I also confirm that appening "newtest=Y" parameter doesn't resets the timers.
I'll have a look now and try to fix it.

No, please : it's the needed behaviour …

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 topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 9 months ago #170638 by tpartner
Replied by tpartner on topic Reset timers cookie on last page
Why? A new session is, well, a new session. No?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 9 months ago - 5 years 9 months ago #170639 by DenisChenu
Replied by DenisChenu on topic Reset timers cookie on last page

tpartner wrote: Why? A new session is, well, a new session. No?

If you set a timer : you want the user answer in this time, if he allowed to start and start again : remove this feature …

I see only one time in action : it's done for a quizz, where user can have point at end. The : if user can start, go just before submit, and send again with just a newtest=Y …

PS : i'm sure we have some old issue's about this feature

PS2! It's timer cookies, not timer session

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.
Last edit: 5 years 9 months ago by DenisChenu.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 9 months ago #170640 by tpartner
Replied by tpartner on topic Reset timers cookie on last page
I don't care whether it's controlled by session or cookies. In my opinion it should be reset when the session is. If you don't want them to restart, don't include the newtest param. It's not like it's respondent-proof now if resetting cookies resets the timer.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 9 months ago - 5 years 9 months ago #170642 by DenisChenu
Replied by DenisChenu on topic Reset timers cookie on last page
The issue is : it's like this since implementation.
We already update some part : bugs.limesurvey.org/view.php?id=5370#c15916

But if a user have this in implementation : you can add a settings to disable it, but you can't just disable it in every survey …
See with @jcleeland : he implements the timer feature, and surely/maybe need it in cooàkies not in session …

You ask to don't update HTML in 3.X, then why update a behaviour of question settings (same since 1.91 or before …)

See:
bugs.limesurvey.org/view.php?id=6420#c20118

The cookie setting is meant to be fixed and unchangeable - so that the timer really does lock people out of a question once the time has expired.


PS : my general isea about timer : bugs.limesurvey.org/view.php?id=8750 is "move out from core with current implementation", after : more timer plugins can come. Some with newtest reset, some without, some only in session, some by tokens (i think it's the major part here : in session + saved in DB) etc …

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.
Last edit: 5 years 9 months ago by DenisChenu.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 9 months ago #170643 by tpartner
Replied by tpartner on topic Reset timers cookie on last page
I didn't think that was the behaviour and I still don't agree with it.

Do whatever you want.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 9 months ago #170645 by DenisChenu
Replied by DenisChenu on topic Reset timers cookie on last page

tpartner wrote: I didn't think that was the behaviour …

It was the behaviour since 1.91… i can guarantee …
I make a js hack for this in 1.92, not so difficult …

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 topic has been locked.
  • Matiasko
  • Matiasko's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 9 months ago #170649 by Matiasko
Replied by Matiasko on topic Reset timers cookie on last page
Guys, I'm happy that you have this discussion :) I do agree not to reset it with reloading as we don't want it in our survey. It asks questions with limited time answers so participants don't have time to check answers on the internet (not a quiz though, we don't score the whole thing, just small part). So tbh for me, it would be the best to reset cookies on the end page of the survey or at the welcome screen (but you would need to exclude brand new participants).

I would love to reset cookies with some kind of JS on the last page but as I mentioned, I don't really get which cookie it is and wouldn't like to reset all of them (not to break something).

Anyway I look forward to your answers and discussion :)
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose