Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Linking surveys: start of documentation

  • tammo
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
7 years 1 month ago #148787 by tammo
Replied by tammo on topic Linking surveys: start of documentation
[ironical_filter:ON] I only hope that is was really an error and not intentionale [ironical_filter:OFF]

bugs.limesurvey.org/view.php?id=12133


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
More
7 years 1 month ago - 7 years 1 month ago #148788 by jelo
Replied by jelo on topic Linking surveys: start of documentation
From the linked document

I heard that you can also work with tokenized surveys, as long as the token tables of linked survey are identical. On second thought: I guess you only need a token table for the first survey and just pass the token to the second survey as a variable that is store somewhere. Later you have to combine the results tables based on the tokens. Have you ever used that?

To merge the results of linked surveys the most straight forward method is to use the automatically generated SAVEID of the first survey and transfer it via URL to the following surveys. That way you can use linked surveys even when not using tokens.

SAVEDID is the id assigned to this particular submission,

manual.limesurvey.org/URL_fields/en#Basic_fields

To merge the responses you then start with the last linked survey. That's where the completes (over all linked surveys) can be identified. I usually used SPSS to merge the surveys via the SAVEIDs (from the first survey) saved in the last linked survey.

When using tokens you can have the issue that people use the same token to start again and again till the surveypart is completed. To merge responses via token you would need to clean every incomplete response in every linked survey first. Using the SAVEIDs will save some work and works in every setup.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Last edit: 7 years 1 month ago by jelo. Reason: SAVEID instead of SURVEYID
The topic has been locked.
  • tammo
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
7 years 1 month ago #148790 by tammo
Replied by tammo on topic Linking surveys: start of documentation
The surveyID is always the same when coming from survey1 (it is 111111). Do you mean the response ID, or am I missing something?


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
  • tammo
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
7 years 1 month ago #148791 by tammo
Replied by tammo on topic Linking surveys: start of documentation
But you are right about the token, since people may be able to start over again.


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
More
7 years 1 month ago #148792 by jelo
Replied by jelo on topic Linking surveys: start of documentation

tammo wrote: The surveyID is always the same when coming from survey1 (it is 111111). Do you mean the response ID, or am I missing something?

Sorry for confusion. You're right. I mean the response ID.
But in LS they call the responseID SAVEID. That's what I confused with SurveyID.
I edited my post to correct the names and linked to the documentation of the URL variables.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • tammo
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
7 years 1 month ago #148793 by tammo
Replied by tammo on topic Linking surveys: start of documentation
Sometimes I wish we could start all over again, clean sheet, clean names. But after some time confusion will still creep in I guess.. No irony involved...

Tammo


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
More
7 years 2 weeks ago - 7 years 2 weeks ago #149266 by Liod_DS
Replied by Liod_DS on topic Linking surveys: start of documentation
Hi all!
Finally someone gets a similar problem ;)
I've linked to surveys time ago, and now they are in field every month (like a traking) I've experienced all the issues you guys point there...
it's not a long survey, but I have 2 huge masks (multi questions, 400+ row, used to filter a few singles)..

I even tried to re-build postgree to increment the 1600 column limit (with no success, on test server) since my survey is private (token) and forward only I choose to link the first part with the second... passing some var via URL like you said..

in addition, I've added some script on the template to jump from the part1 to the part2 when the original(part1) link is re-clicked
Code:
/*
*
*TOKEN REDIRECT
*
*/
$(document).ready(function() {
    // Define the new message
  var redirect_text = 'Attendi mentre carichiamo le tue risposte.<br><img src=\"http://www.tbaf.org.tw/event/2016safe/imgs/loader1.gif\">';
  // Insert the new message
  if($('#tokenmessage').length > 0) {
    if($('#tokenform').length > 0) {
    /*token messagge in ingresso, identifica la form dove inserire i numeri*/
        }
    else {
            $('#tokenmessage').html(redirect_text);
            var url = "URL";
            url += findToken(); //helper function to extract the token
            url += "/newtest/Y/lang/it";
            //alert(url);
            window.location.replace(url);
 
    }
  } 
});

Sometimes (I think 1 of 200-300 cases) a user can't get to the part2, and he remains stuck between the two surveys...

I think some URL were lost in the process (I have a script that control if all the cars are set in the url)

did it happen to you too?

keep improving
Last edit: 7 years 2 weeks ago by Liod_DS. Reason: typo
The topic has been locked.
More
7 years 2 weeks ago #149279 by jelo
Replied by jelo on topic Linking surveys: start of documentation

Liod_DS wrote: Sometimes (I think 1 of 200-300 cases) a user can't get to the part2, and he remains stuck between the two surveys...did it happen to you too?

The redirection itself can be seen as an invalid action by security settings in the browser or antimalwaresecurity software. So you never have 100% when using survey redirection.

Your javascript will redirect respondents, which have finished the first survey with their token and get redirected to the second survey?
I'm unused to the content of #tokenmessage and #tokenform.
Since you're only testing for the length, what does it tell us?

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 2 weeks ago #149281 by tpartner
Replied by tpartner on topic Linking surveys: start of documentation
Checking for the length of #tokenmessage and #tokenform tests to see if this is the token entry screen - these are elements found only in that screen.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
7 years 2 weeks ago #149288 by jelo
Replied by jelo on topic Linking surveys: start of documentation

tpartner wrote: Checking for the length of #tokenmessage and #tokenform tests to see if this is the token entry screen - these are elements found only in that screen.

Thanks for the insight. Wonder if this script really copes with all situations then.

Situations:
Token in URL - Token already used >>
Token in URL - Token not used >>
Token Screen - Token already used >>
Token Screen - Token not used >>

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
More
7 years 2 weeks ago - 7 years 2 weeks ago #149294 by Liod_DS
Replied by Liod_DS on topic Linking surveys: start of documentation
sorry, i forgot to translate some comments in Eng !

It's exactly like tPartner said (i have to credit him for a lot of the scripts :D ), the token screen is overwritten, so you have only the URL input method, and:

with the link of "first survey"
IF no token used -> first survey start
IF token survey 1 used -> redirect to survey 2 -> survey 2 start
IF token both used -> redirect to survey 2 -> survey 2 token message (survey 2 HAVE TO use a different template!)

[edit]
with the link of "second survey"
IF no token used -> i check for ALL the URL parameter to be !NULL (so it stop with a warning)
IF token survey 1 used -> survey 2 start
IF token both used -> survey 2 token error or resume

no other scenario revealed until now ...

PS. the token is ported by a little url-parser script
Code:
/* funzione ad hoc per il recupero del token*/
function findToken()
{
   var sPageURL = window.location.href;
 
  // alert(sPageURL);
   var sURLVariables = sPageURL.split('/');
    for (var i = 0; i < sURLVariables.length; i++)
    {
        var sParameterName = sURLVariables[i];
        if (sParameterName == "token")
        {
 
            return sURLVariables[i+1];
        }
    }
}

keep improving
Last edit: 7 years 2 weeks ago by Liod_DS. Reason: added code
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose