Token-based responce persistence

More
4 years 7 months ago - 4 years 7 months ago #93056 by jmarkov
jmarkov created the topic: Token-based responce persistence
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: 4 years 7 months ago by jmarkov. Reason: typos

Please Log in to join the conversation.

More
4 years 7 months ago #93058 by holch
holch replied the topic: Token-based responce persistence
"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.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds
The following user(s) said Thank You: jmarkov

Please Log in to join the conversation.

More
4 years 7 months ago #93062 by jmarkov
jmarkov replied the topic: Token-based responce persistence
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

Please Log in to join the conversation.

More
4 years 7 months ago #93065 by holch
holch replied the topic: Token-based responce persistence
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.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in to join the conversation.

More
3 years 5 months ago #108055 by svensson_david
svensson_david replied the topic: Token-based responce persistence
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.

Please Log in to join the conversation.

More
3 years 5 months ago #108060 by svensson_david
svensson_david replied the topic: Token-based responce persistence
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!

Please Log in to join the conversation.

More
3 years 5 months ago #108064 by svensson_david
svensson_david replied the topic: Token-based responce persistence
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.

Please Log in to join the conversation.

More
3 years 5 months ago #108067 by duvemyster
duvemyster replied the topic: Token-based responce persistence
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.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now