View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|16452||Bug reports||Survey taking||public||2020-07-02 17:43||2020-07-13 12:35|
|Summary||16452: When admin previews surveys timer is not reset in between runs|
|Description||When admin previews surveys timer is not reset in between runs. |
This happens with active surveys as well.
|Steps To Reproduce||1 - Create a 1 question survey with a 20 secs timer|
2 - Preview as admin. Run.
3 - Preview as admin. The timer will not be reset
|Tags||No tags attached.|
|Complete LimeSurvey version number (& build)||4.3.2|
|I will donate to the project if issue is resolved||No|
|Database & DB-Version||Mysql|
|Server OS (if known)|
|Webserver software & version (if known)|
|timing-related cookies should be cleared when starting a survey|
> timing-related cookies should be cleared when starting a survey
It's really a point of view …
If you have a quiz with timing enable and offer 10€ if user answer in correct time … you are unhappy if he can launch survey one time : see the question, and restart survey to answer …
Else : don't save in cookie … just show a timer in page …
My opinion : survey timers MUST move to an external plugin : then can be adapted to any situation.
> My opinion : survey timers MUST move to an external plugin : then can be adapted to any situation.
I agree that's something to explore.
Still right now, as this is a bug, please, allow me to focus on a solution to the current problem without a full reingeneering.
I will review the situation and will update with a suggested solution that can take in consideration the situations you comment.
Maybe don't set cookie for admin, but then you have forum post "Timing cookes allow to restart survey again and again"
Best solution : add a button somewhere only for admin user with good Permission and delete cookies according ?
|This seems to happen with active surveys, so want to make sure this is not happening for logged out cases|
But logged out : **IT MUST HAPPEN**
Cookies are done for this : disallow user to see question and take time to search on the net.
If you allow to reset timer (public) : it's too easy to see whole survey, search on web , on document etc … and start again.
Honestly, don't recall the specifics on how is working now. I need to check.
Still, assuming that for LOGGED OUT cases timer is not reset in between survey runs, people that share a computer also share their timer?
Maybe we should keep allowing that as to allow backward compatibility and don't change behaviour.
So, as far as now, suggested solution would be:
1- On killSurveySession, if user is admin, register a new JS script which sets a flag.
2 - On timer.js, if that flag is ON, timer would be reset.
Later (in the future and another ticket) we could add a new setting: "Reset timer in between survey runs for the same computer", so people can choose the desired behaviour.
What do you think?
I lnow only one clients who use it : and it use it for final quizz after or between formation : he **NEED** the cookies …
Else: this attribute is not used.
Why did you use such attribute ?
> Later (in the future and another ticket) we could add a new setting: "Reset timer in between survey runs for the same computer", so people can choose the desired behaviour.
We **MUST** move this settings in a plugin
1. Can really be improved
2. Not a lot used
3. Only JS script : nothing other
4. Issue in core with it
It's really a great candidate for plugins.
I think we should decide which is the expected behaviour when two persons share the computer:
a) Tokens are used
b) Tokens are not used.
Should the timer be reset when survey starts or not for each situation.
If it is decided the current behaviour shuldn't be changed (no mater it differs from expectations), I will only apply the fix for the case where a preview is being done, leaving active surveys untouched.
What do you think?
Currently : timer are not related to token.
> Should the timer be reset when survey starts
Current behaviour : timer are not resetted since 1.81 and surely before.
> Currently : timer are not related to token.
No, I know, but I believe behaviour could be different for timer when using tokens or not tokens, in the context of sharing a computer.
Let's leave it for other tickets
I will just reset timer if previewing.
It's a really good idea :)
Or to SEED ?
> Or to SEED ?
What do you mean?
On preview mode, set the 'resetQuestionTimers' js flag from server side, so timer.js can pick it and unset the localstorage (so, timer gets reset).
To compile timer.min.js we did as follows on the `assets/packages/questions/timer`directory:
NODE_ENV=production npx webpack
That will generate 'timer.min.js'.
|Seems great !|
Last edited: 2020-07-13 10:15
Tested following issues by pulling the PR:
1. Timer expiration-Page expires immediately after the set time is over and displays a message saying page expired.
2. Timer is reset in between runs when the survey is viewed in Preview mode and in Active mode the timer does not reset.
3. Tested Timer by Previewing and Activating the survey.
Seems to work fine in all cases.
|Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=30275|
|Fixed in Release 4.3.4+200713|
LimeSurvey: master 6e447fe7
Committer: GitHub Details Diff
|Fixed issue 16452: When admin previews surveys timer is not reset in between runs (#1476)
On preview mode, set the 'resetQuestionTimers' js flag from server side, so timer.js can pick it and unset the localstorage (so, timer gets reset)
|mod - application/controllers/survey/index.php||Diff File|
|mod - application/helpers/frontend_helper.php||Diff File|
|mod - assets/packages/questions/timer/src/timeclass.js||Diff File|
|mod - assets/packages/questions/timer/timer.js||Diff File|
|mod - assets/packages/questions/timer/timer.min.js||Diff File|
|2020-07-02 17:43||gabrieljenik||New Issue|
|2020-07-02 17:43||gabrieljenik||Issue generated from: 16451|
|2020-07-02 17:44||gabrieljenik||Relationship added||related to 16451|
|2020-07-02 18:02||gabrieljenik||Description Updated||View Revisions|
|2020-07-02 18:08||gabrieljenik||Note Added: 58662|
|2020-07-02 18:16||DenisChenu||Note Added: 58664|
|2020-07-03 15:31||gabrieljenik||Note Added: 58679|
|2020-07-03 15:58||DenisChenu||Note Added: 58680|
|2020-07-03 16:00||gabrieljenik||Note Added: 58681|
|2020-07-03 16:33||DenisChenu||Note Added: 58683|
|2020-07-03 19:31||gabrieljenik||Note Added: 58686|
|2020-07-03 19:51||DenisChenu||Note Added: 58688|
|2020-07-06 11:55||cdorin||Priority||none => normal|
|2020-07-06 11:55||cdorin||Status||new => confirmed|
|2020-07-06 11:55||cdorin||Zoho Sprints||=> |Yes||
||Zoho Sprints ID||=> 14469000000167013|
|2020-07-07 02:35||gabrieljenik||Note Added: 58728|
|2020-07-07 08:02||DenisChenu||Note Added: 58729|
|2020-07-07 14:49||gabrieljenik||Note Added: 58744|
|2020-07-07 15:51||DenisChenu||Note Added: 58750|
|2020-07-07 16:17||gabrieljenik||Note Added: 58753|
|2020-07-08 19:32||gabrieljenik||Note Added: 58811|
|2020-07-09 08:45||DenisChenu||Note Added: 58820|
||Note Added: 58901|
|2020-07-11 09:42||gabrieljenik||Changeset attached||=> LimeSurvey master 6e447fe7|
|2020-07-11 09:42||guest||Note Added: 58908|
||Zoho Sprints||Yes => |Yes||
||Status||confirmed => resolved|
||Zoho Sprints||Yes => |Yes||
|2020-07-13 12:35||lime_release_bot||Zoho Sprints||Yes => |Yes||
|2020-07-13 12:35||lime_release_bot||Note Added: 58918|
|2020-07-13 12:35||lime_release_bot||Status||resolved => closed|
|2020-07-13 12:35||lime_release_bot||Resolution||open => fixed|