Welcome to the LimeSurvey Community Forum

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

Linking surveys: start of documentation

More
8 years 6 months ago #148791 by tammo
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
8 years 6 months ago #148792 by jelo

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.
More
8 years 6 months ago #148793 by tammo
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
8 years 6 months ago - 8 years 6 months ago #149266 by Liod_DS
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=\"https://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: 8 years 6 months ago by Liod_DS. Reason: typo
The topic has been locked.
More
8 years 6 months ago #149279 by jelo

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.
More
8 years 6 months ago #149281 by tpartner
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
8 years 6 months ago #149288 by jelo

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
8 years 6 months ago - 8 years 6 months ago #149294 by Liod_DS
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: 8 years 6 months ago by Liod_DS. Reason: added code
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose