Bienvenue, Invité
Nom d'utilisateur : Mot de passe : Se souvenir de moi

SUJET : Token-based responce persistence

Token-based responce persistence il y a 1 an 7 mois #93056

  • jmarkov
  • Portrait de jmarkov
  • Hors ligne
  • Fresh Lemon
  • Messages : 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
Dernière édition: il y a 1 an 7 mois par jmarkov. Raison: typos
L'administrateur a désactivé l'accès en écriture pour le public.

Token-based responce persistence il y a 1 an 7 mois #93058

  • holch
  • Portrait de holch
  • Hors ligne
  • LimeSurvey Team
  • Messages : 2852
  • Remerciements reçus 359
  • Karma: 124
"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!
L'administrateur a désactivé l'accès en écriture pour le public.
Cet utilisateur a été remercié pour son message par: jmarkov

Token-based responce persistence il y a 1 an 7 mois #93062

  • jmarkov
  • Portrait de jmarkov
  • Hors ligne
  • Fresh Lemon
  • Messages : 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
L'administrateur a désactivé l'accès en écriture pour le public.

Token-based responce persistence il y a 1 an 7 mois #93065

  • holch
  • Portrait de holch
  • Hors ligne
  • LimeSurvey Team
  • Messages : 2852
  • Remerciements reçus 359
  • Karma: 124
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!
L'administrateur a désactivé l'accès en écriture pour le public.

Token-based responce persistence il y a 5 mois 3 semaines #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.
L'administrateur a désactivé l'accès en écriture pour le public.

Token-based responce persistence il y a 5 mois 3 semaines #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!
L'administrateur a désactivé l'accès en écriture pour le public.

Token-based responce persistence il y a 5 mois 3 semaines #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.
L'administrateur a désactivé l'accès en écriture pour le public.

Token-based responce persistence il y a 5 mois 3 semaines #108067

  • duvemyster
  • Portrait de duvemyster
  • Hors ligne
  • Gold Donor
  • Messages : 17
  • Remerciements reçus 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.
L'administrateur a désactivé l'accès en écriture pour le public.
Modérateurs: ITEd
Temps de génération de la page : 0.131 secondes
Donation Image