Dependency Graph

Dependency Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
16452Bug reportsSurvey takingpublic2020-07-13 12:35
Reportergabrieljenik Assigned To 
PrioritynormalSeveritypartial_block 
Status closedResolutionfixed 
Product Version4.3.2 
Summary16452: 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

TagsNo tags attached.
Complete LimeSurvey version number (& build)4.3.2
I will donate to the project if issue is resolvedNo
Browser
Database & DB-VersionMysql
Server OS (if known)
Webserver software & version (if known)
PHP Version7

Relationships

related to 16451 closed When admin previews surveys timer is not reset in between runs 

Activities

gabrieljenik

gabrieljenik

2020-07-02 18:08

developer   ~58662

timing-related cookies should be cleared when starting a survey

DenisChenu

DenisChenu

2020-07-02 18:16

developer   ~58664

Last edited: 2020-07-13 10:15

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.

gabrieljenik

gabrieljenik

2020-07-03 15:31

developer   ~58679

Last edited: 2020-07-13 10:15

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.

DenisChenu

DenisChenu

2020-07-03 15:58

developer   ~58680

Last edited: 2020-07-13 10:15

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 ?

gabrieljenik

gabrieljenik

2020-07-03 16:00

developer   ~58681

Last edited: 2020-07-13 10:15

This seems to happen with active surveys, so want to make sure this is not happening for logged out cases

DenisChenu

DenisChenu

2020-07-03 16:33

developer   ~58683

Last edited: 2020-07-13 10:15

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.

gabrieljenik

gabrieljenik

2020-07-03 19:31

developer   ~58686

Last edited: 2020-07-13 10:15

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?

DenisChenu

DenisChenu

2020-07-03 19:51

developer   ~58688

Last edited: 2020-07-13 10:15

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.

gabrieljenik

gabrieljenik

2020-07-07 02:35

developer   ~58728

Last edited: 2020-07-13 10:15

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?

DenisChenu

DenisChenu

2020-07-07 08:02

developer   ~58729

Last edited: 2020-07-13 10:15

tokens ?

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.

gabrieljenik

gabrieljenik

2020-07-07 14:49

developer   ~58744

Last edited: 2020-07-13 10:15

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.

DenisChenu

DenisChenu

2020-07-07 15:51

developer   ~58750

Last edited: 2020-07-13 10:15

It's a really good idea :)

Or to SEED ?

gabrieljenik

gabrieljenik

2020-07-07 16:17

developer   ~58753

Last edited: 2020-07-13 10:15

Or to SEED ?

What do you mean?

gabrieljenik

gabrieljenik

2020-07-08 19:32

developer   ~58811

Last edited: 2020-07-13 10:15

PR: https://github.com/LimeSurvey/LimeSurvey/pull/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).

To compile timer.min.js we did as follows on the assets/packages/questions/timerdirectory:

npm install
npx webpack
NODE_ENV=production npx webpack

That will generate 'timer.min.js'.

DenisChenu

DenisChenu

2020-07-09 08:45

developer   ~58820

Last edited: 2020-07-13 10:15

Seems great !

user225042

2020-07-10 17:27

  ~58901

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.
guest

guest

2020-07-11 09:42

viewer   ~58908

Last edited: 2020-07-13 10:15

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=30275

lime_release_bot

lime_release_bot

2020-07-13 12:35

administrator   ~58918

Fixed in Release 4.3.4+200713

Related Changesets

LimeSurvey: master 6e447fe7

2020-07-11 09:42:52

gabrieljenik


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)
Affected Issues
16452
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

Issue History

Date Modified Username Field Change
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-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
2020-07-10 17:27 user225042 Note Added: 58901
2020-07-11 09:42 gabrieljenik Changeset attached => LimeSurvey master 6e447fe7
2020-07-11 09:42 guest Note Added: 58908
2020-07-13 10:15 swendrich Status confirmed => resolved
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