Welcome to the LimeSurvey Community Forum

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

Use limesurvey for ticketing systems to submit feedback

More
2 years 3 months ago #243066 by eavenhuang
Dear  Joffm ,

Would you kindly advise? I'm not sure where I can find expression script and I've added my lss file in this thread.

Thanks again for your help.

Please Log in to join the conversation.

More
2 years 3 months ago #243072 by DenisChenu

I've tried to use Equation: statCountIf(TicketID.sgqa, TicketID.NAOK, 0, 1) but seems that's not how it works, I'm attaching my lss file, hope that you could help me on this. Thanks a lot for all the help!! It's really appreciated.
 
Equation part didn't have the { } included (equation can be fixed).

You need to add it {statCountIf(TicketID.sgqa, TicketID.NAOK, 0, 1)} and it work.

For information : it's better to don't include self then you need 0 at this option.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.

Please Log in to join the conversation.

More
2 years 3 months ago #243076 by eavenhuang
Dear Denis,

Thanks for the information. I've tried your suggestion but that didn't work:( I'm wondering if I was using the equation in the wrong place.
What I did was to create a new hidden question after my TicketID question, then add the equation - statCountIf(TicketID.sgqa, TicketID.NAOK, 0, 1)

I tested with the testing url and went back to responses, the same URL I submitted 3 times and I expected there would be only 1 response, but it generated 3 times.
I'm attaching the screenshots for further reference.
 

Please Log in to join the conversation.

More
2 years 3 months ago #243078 by Joffm
Where do you use this equation to screen out the respondents?
This function counts how many times the TicketID was used already.
Display the result of the function by entering it in the question text of the "equation".
Read the manual about the difference if you enter the expression in the question text or in the field "equation".

Anyway:
Now you have to tell LimeSurvey what to do?

Usually you use a quota with limit "0".

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
2 years 3 months ago #243079 by eavenhuang
Dear Joffm,

What I did was to use it in a new hidden question (after my TicketID question, go to Logic >> Equation and just put statCountIf(TicketID.sgqa, TicketID.NAOK, 0, 1)
This didn't work out for me, I will try to find out the differences from the manual at the same time. (I tested this, used same URL to submit 3 times and it generated 3 responses, I expected there should be only one, because the latter 2 are repeating the TicketID in my URL)

If this function is used to only count the used times, I don't understand where I can tell limesurvey to screen out. What I expected is once the TicketID is used for the first time, it can't be submitted for the second time. TicketID is variable in my case, each TicketID will be only used once.

Thanks again for all your unselfish answers.

Please Log in to join the conversation.

More
2 years 3 months ago - 2 years 3 months ago #243081 by DenisChenu

Dear Denis,

Thanks for the information. I've tried your suggestion but that didn't work:( I'm wondering if I was using the equation in the wrong place.
What I did was to create a new hidden question after my TicketID question, then add the equation - statCountIf(TicketID.sgqa, TicketID.NAOK, 0, 1)


 
You STILL don'(t add the { }

You must have the expression activated in quick view

 

(i just talk abouut the valuie set)

After : you can set conditoion to other question with G01Q04 < 2 (but agin : i think best is to use {statCountIf(TicketID.sgqa, TicketID.NAOK, 0, 0)} and G01Q04.NAOK < 1

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
Last edit: 2 years 3 months ago by DenisChenu.

Please Log in to join the conversation.

More
2 years 3 months ago #243083 by eavenhuang
Dear Denis,

I've added the {} for the equation field in my hidden question, but it didn't show {} on the preview page. In quick view, it showed the same:

When you mentioned and G01Q04.NAOK < 1, what do I need to do with this equation, do I need to add one more equation there under logic>> equation, e.g. {statCountIf(TicketID.sgqa, G01Q04.NAOK < 1,, 0, 0)}

Sorry for all the question, I'm still very new to limesurvey and trying to figure out how this works.

Please Log in to join the conversation.

More
2 years 3 months ago #243084 by DenisChenu
then : you do another error

Updated lss included with solution to hide/show other question to ticket id
 

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.

Please Log in to join the conversation.

More
2 years 3 months ago #243087 by eavenhuang
Dear Denis,

Thanks a lot for the lss, it worked!
However, that's not what I was expecting, sorry for the misleading. What I expected is that one TicketID can only be used for one time, but if we have different TicketID in the URL (custom attribute), then the survey should still be opened for others.

For example, this URL can be used once -  limesurvey.local/limesurvey/index.php/14...rachel@custom.edu.cn
If it's used again, then the user will be screened out.
Then if another user used  limesurvey.local/limesurvey/index.php/14...rachel@custom.edu.cn , the survey should be allowed to submit once.

Not sure if this is possible?
Thanks again.

Please Log in to join the conversation.

More
2 years 3 months ago #243088 by DenisChenu
It's what the lss do …
BUT : remind to use Newtest=Y when you test yourself : we don't update current session when prefilling

Start with newtest=Y&TicketID=123 : OK
Start again with newtest=Y&TicketID=123 : KO

I'm tired now … you must try yourself more …

Look at the data in LimeSurvey: you don't have TicketID=0002 data set when you test without newtest=Y

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The following user(s) said Thank You: eavenhuang

Please Log in to join the conversation.

More
2 years 3 months ago #243089 by eavenhuang
Thanks a million Denis, YOU SAVE MY WEEK! this works just like a charm!
I was struggling with this case for the whole week, even after work hours. This forum is also amazing and more than helpful!

Thanks again and I will spend more time to study this amazing limesurvey:)

Please Log in to join the conversation.

More
2 years 3 months ago #243090 by eavenhuang
Dear Joffm,

With the help from Denis, I've solved the issue mentioned in this topic. I didn't think about using a new question to screen out could be a solution:(

Thanks again for all your help, it means a lot! Cheers.

Please Log in to join the conversation.

More
2 years 3 months ago - 2 years 3 months ago #243091 by Joffm
Well, again the workflow:
1. You want to screen out respondents who already submitted the survey with this TicketID
2. Of course you screen out respondents who use a link without these additional parameters (what may give an answer to your other question)

To do this you use "quotas" with limit "0" 
[url] www.limesurvey.org/manual/Survey_quotas/en [/url]

You can set a quota on an equation, but you have to create a well defined value.

To do this you use the IF-function. As you read in the manual
[url] www.limesurvey.org/manual/ExpressionScri...mplemented_functions [/url]
This function works like human language: if(test,result_if_true,result_if_false)
"IF the sun is shining (condition) I jump into the swimmingpool (what happens if the condition is TRUE) otherwise I read a book (what happens if the condition is FALSE)


In your case "IF the function 'statCountif' returns 0, set the value of the equation to 0 ELSE set the value to 1"
Now you have a condition for the quota "if equation==1" --> screenout.

The same to test if there were any additional parameters in the URL.
Here you may use the function "is_empty"
IF the question "TicketID" is empty, set the value of the equation to 1 ELSE set the value to 0"
Again you have a condition for the (second) quota "if equation==1" --> screenout.


So the survey could look like this


Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 2 years 3 months ago by Joffm.
The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

More
2 years 3 months ago #243092 by Joffm
And here the lss
 

File Attachment:

File Name: limesurvey...04-3.lss
File Size:43.78 KB

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: eavenhuang

Please Log in to join the conversation.

More
2 years 3 months ago #243272 by eavenhuang
Thanks a lot our expert! this is brilliant!

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose