Home
LimeSurvey Forums
Welcome, Guest
Please Login or Register.    Lost Password?
Re:[done] Condition question using token (1 viewing) (1) Guest
Go to bottom Favoured: 1
TOPIC: Re:[done] Condition question using token
#13249
rodbro (User)
Senior Lime
Posts: 43
graphgraph
User Offline Click here to see the profile of this user
[done] Condition question using token 4 Months, 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 Lime
Posts: 2760
graph
User Offline Click here to see the profile of this user
Re:Condition question using token 4 Months, 3 Weeks ago Karma: 19  
No, this is not possible.
 
Logged Logged  
 
Beste Grüße/Best regards,
Mazi
______________________
You can support Limesurvey, too!
  The administrator has disabled public write access.
#13287
startx25 (User)
Expert Lime
Posts: 94
graphgraph
User Offline Click here to see the profile of this user
Re:[done] Condition question using token 4 Months, 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 Lime
Posts: 2760
graph
User Offline Click here to see the profile of this user
Re:[done] Condition question using token 4 Months, 3 Weeks ago Karma: 19  
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.
 
Logged Logged  
 
Beste Grüße/Best regards,
Mazi
______________________
You can support Limesurvey, too!
  The administrator has disabled public write access.
#13373
startx25 (User)
Expert Lime
Posts: 94
graphgraph
User Offline Click here to see the profile of this user
Re:[done] Condition question using token 4 Months, 3 Weeks ago Karma: 0  
done... :o)
 
Logged Logged  
  The administrator has disabled public write access.
#13405
Mazi (Moderator)
Moderator Lime
Posts: 2760
graph
User Offline Click here to see the profile of this user
Re:[done] Condition question using token 4 Months, 3 Weeks ago Karma: 19  
Great! Thanks a lot.
 
Logged Logged  
 
Beste Grüße/Best regards,
Mazi
______________________
You can support Limesurvey, too!
  The administrator has disabled public write access.
#13412
rodbro (User)
Senior Lime
Posts: 43
graphgraph
User Offline Click here to see the profile of this user
Re:[done] Condition question using token 4 Months, 3 Weeks ago Karma: 0  
Hey there

Thank you very much!

Kenneth Larsen
 
Logged Logged  
  The administrator has disabled public write access.
#19088
sunnyd71 (User)
Fresh Lemon
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
Re:[done] Condition question using token 2 Weeks ago Karma: 0  
Hello,

I have been attempting your workaround with no luck. I made sure to modify these lines with the info for my question.

document.getElementById("question987".style.display='none';
document.getElementById('answer51965X95X9871'.checked='true';
document.getElementById('answer51965X95X9877'.checked='true';

But no luck. I have it set on question by question. Any ideas?


Also, is it only checking the first letter of the "token" or can we set it to check other attributes such as "Attribute 1"?

Thanks.
 
Logged Logged  
  The administrator has disabled public write access.
#19089
ElMatador69 (Moderator)
LimeSurvey Team
Posts: 1536
graphgraph
User Offline Click here to see the profile of this user
Re:[done] Condition question using token 2 Weeks ago Karma: 30  
Did you set the correct SGQA Identifier:
http://docs.limes...g/tiki-index.php?page=SGQA+Identifier
 
Logged Logged  
 
Get in touch with the LimeSurvey Development Team via IRC
If our informations and answers were useful to you, please consider a donation to the LimeSurvey Project!
  The administrator has disabled public write access.
#19091
sunnyd71 (User)
Fresh Lemon
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
Re:[done] Condition question using token 2 Weeks ago Karma: 0  
yes I double checked that. It seems to have worked once, but now it will not let me access the survey at all. I can go to the admin panel but if I open the survey it just says Waiting for response from my domain with a blank screen.

Thanks
 
Logged Logged  
  The administrator has disabled public write access.
Go to top