Welcome, Guest
Username: Password: Remember me

TOPIC: Token-based responce persistence

Token-based responce persistence 1 year 4 months ago #93056

  • jmarkov
  • jmarkov's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
In the documentation it is stated:
"If you are using tokens and the survey is not anonymous in most cases it is better to activate 'Token-based response persistence' in the token tab."

We have done exactly that - The survey is not anonymous, Token-based response persistence is set to Yes, as well as Allow editing of answers after completion.

The last page the person has seen is loaded, however answers are NOT recorded if the survey is Not submitted.

What is the default behaviour for those options? Our understanding is that 'Token-based response persistence' results in ANY CLICK ON ANY PAGE BEING RECORDED IMMEDIATELY, but it is NOT so.

We have working installations of 1.92+ (Main) and 2.0 (testing) and on both the 'problem' appears.

A clarification would be helpful.

Best,
Yavor
Last Edit: 1 year 4 months ago by jmarkov. Reason: typos
The administrator has disabled public write access.

Token-based responce persistence 1 year 4 months ago #93058

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2549
  • Thank you received: 285
  • Karma: 102
"Our understanding is that 'Token-based response persistence' results in ANY CLICK ON ANY PAGE BEING RECORDED IMMEDIATELY, but it is NOT so."

This perception is wrong.

Responses are only saved, once a page is submitted. If you have all questions on one page, responses can only be saved once the survey is submitted.

If you go group by group, a group is only saved when you proceed to the next group.

In question by question mode, questions are saved when you move to the next page/question.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.
The following user(s) said Thank You: jmarkov

Token-based responce persistence 1 year 4 months ago #93062

  • jmarkov
  • jmarkov's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
Thank you for the answer, it resolves our question.

As a follow up - would you think it valuable for LimeSurvey if we try to develop token based functionality that records every click of a user on a survey? Perhaps, using asynchronous Ajax with jQuery.

Best regards,
Yavor
The administrator has disabled public write access.

Token-based responce persistence 1 year 4 months ago #93065

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2549
  • Thank you received: 285
  • Karma: 102
I think this would be a good question for the developers list. I am not sure what implications this might have on the database connection, etc.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Token-based responce persistence 2 months 3 weeks ago #108055

I interpreted the Token based persistence in the same way you did jmarkov
Did you have any luck implementing the ajax solution or has it been added by any other dev?

I'm looking for exactly the same thing, shouldn't be a problem just listening to on-change events and posting the form as the user goes along.

Please let me know if you have any more info on this, I will look into some hacks to solve it as well.
The administrator has disabled public write access.

Token-based responce persistence 2 months 3 weeks ago #108060

Quick update:
I just tested to mimic the behavior of the save-button through javascript and it worked.
However when finally pressing the submit-button the user gets a warning along the lines of "Please only use the form navigation buttons for navigating in the survey"

How does the system determine this? Could I just regenerate one of the other hidden input-fields to make the system believe that the user reopened the survey?

All input is appreciated!
The administrator has disabled public write access.

Token-based responce persistence 2 months 3 weeks ago #108064

Another update:
I've got the autosaving working now. The solution is more of a hack than anything else but works OK for our needs.

Here's the jQuery needed to get it going, just paste it inside your document ready function. The survey also needs to accept that users save their progress.
   $('#limesurvey input:not(button)').on('change', function() {
 
      //Set up partial data to send, passing along saveall arg.
      var data = $('#limesurvey').serializeArray();
      data.push({name: 'saveall', value: 'saveall'});
 
      $.post($("#limesurvey").attr('action'), $.param(data), function(response) {
         //Update the LEMpostKey to bypass "Only use navigation"-warnings
         $('input[name="LEMpostKey"]').val($('input[name="LEMpostKey"]', $(response)).val());
      });
   });

I haven't tested this thoroughly so I suspect there are bugs but hopefully it points the next person in the right direction.
The administrator has disabled public write access.

Token-based responce persistence 2 months 3 weeks ago #108067

  • duvemyster
  • duvemyster's Avatar
  • OFFLINE
  • Gold Donor
  • Posts: 13
  • Thank you received: 4
  • Karma: 1
Thanks for posting your jQuery script.

In case anyone runs into a need for a "plan-B," I thought I'd mention that took a slightly different approach, and added {SAVE}(Save your work!) to question.pstl in my template, so that the "Resume later" button would appear after each question.

Of course that relies on human behavior, though in realworld use that has also been resulting in the desired outcome on my end.

One question type that presents a particular challenge without some type of autosave or prompting is file-upload, otherwise orphaned files are left on the server when respondents exit before proceeding to the next group.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.148 seconds
Donation Image