Accueil
LimeSurvey Forums
Welcome, Guest
Please Login or Register.    Lost Password?
Re:[done] Condition question using token (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 1
TOPIC: Re:[done] Condition question using token
#13249
rodbro (User)
Junior Lime
Posts: 34
graphgraph
User Offline Click here to see the profile of this user
[done] Condition question using token 1 Month, 3 Weeks ago Karma: 0  
Hey there,

Is it possible to use a token to desired if the questions should be shown like:

if token=1 then show qid=1111

Regards
Kenneth
 
Logged Logged  
 
Last Edit: 2008/05/13 15:22 By Mazi.
  The administrator has disabled public write access.
#13250
Mazi (Moderator)
Moderator
Posts: 1672
graph
User Offline Click here to see the profile of this user
Re:Condition question using token 1 Month, 3 Weeks ago Karma: 12  
No, this is not possible.
 
Beste Grüße/Best regards,
Mazi
______________________
You can help to improve LimeSurvey, too!
 
Logged Logged  
  The administrator has disabled public write access.
#13287
startx25 (User)
Expert Lime
Posts: 90
graphgraph
User Offline Click here to see the profile of this user
Re:[done] Condition question using token 1 Month, 3 Weeks ago Karma: 0  
before the question 1111 your can create a radio list choice question(987). with javascript you can use the token value to auto select a question with list radio hidded.

Then create a condition for show qid 1111 if radio list = 1


here a example of question 987:

script

function Custom_On_Load(){
document.getElementById("question987".style.display='none';
document.getElementById("move2".style.display='none';
setTimeout("Select_route()",100);
}

function Select_route(){
var routeA="{TOKEN}".charAt(0);
switch (routeA) {
case "1":
document.getElementById('answer51965X95X9871'.checked='true';
break;
default:
document.getElementById('answer51965X95X9877'.checked='true';
break;
}

document.limesurvey.move.value = 'movenext';
document.limesurvey.submit();
}

script

the Custom_On_Load function (see workaround) check the first character of token and if == 1 check the first option then submit the question

ps: you need to configure the navigation survey with: question by question.
 
Logged Logged  
 
Last Edit: 2008/05/14 09:40 By startx25.
  The administrator has disabled public write access.
#13347
Mazi (Moderator)
Moderator
Posts: 1672
graph
User Offline Click here to see the profile of this user
Re:[done] Condition question using token 1 Month, 3 Weeks ago Karma: 12  
A very nice solution! Can you add this to the workaround section in the wiki/manual? I think the combination of Custom_on_Load function and tokens (placeholders) isn't mentioned there.
 
Beste Grüße/Best regards,
Mazi
______________________
You can help to improve LimeSurvey, too!
 
Logged Logged  
  The administrator has disabled public write access.
#13373
startx25 (User)
Expert Lime
Posts: 90
graphgraph
User Offline Click here to see the profile of this user
Re:[done] Condition question using token 1 Month, 3 Weeks ago Karma: 0  
done... :o)
 
Logged Logged  
  The administrator has disabled public write access.
#13405
Mazi (Moderator)
Moderator
Posts: 1672
graph
User Offline Click here to see the profile of this user
Re:[done] Condition question using token 1 Month, 3 Weeks ago Karma: 12  
Great! Thanks a lot.
 
Beste Grüße/Best regards,
Mazi
______________________
You can help to improve LimeSurvey, too!
 
Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop