Not able to use question variable "qseq" in relevance equation

More
4 years 6 days ago #100838 by Tune
Tune created the topic: Not able to use question variable "qseq" in relevance equation
Hi!

I'm trying to use the question variable "qseq" (question sequential number) in some relevance equations. But I've not been able to get it to work properly.

What I want to do is present the user with 40 questions randomly chosen from a larger set of ~200. And the way I thought to do this was to hide the last x number of questions in the survey after they all have been randomised.

So I first put all questions in the same randomisation group, and this part works fine. But the problem comes when I want to use the relevance equation in order to hide the x last questions. I used the equation: "Q1.qseq < 40" where Q1 is a question code. But it doesn't work. I've tried just entering "{Q1.qseq}" in the description of a question and the value shown is correct but for some reason it doesn't work to use it in the relevance equation. Is it not supposed to work?

Please help
/Mikael

Please Log in to join the conversation.

More
4 years 6 days ago #100841 by Tune
Tune replied the topic: Not able to use question variable "qseq" in relevance equation
I forgot to mention that I'm using Limesurvey hosted by LimeSurvey Professional (previously LimeService).com and the version is 2.00+ =)

Please Log in to join the conversation.

More
4 years 3 days ago - 4 years 3 days ago #100894 by tpartner
tpartner replied the topic: Not able to use question variable "qseq" in relevance equation
Try:
self.qseq < 40


Note that the qseq indexing starts at 0, so the 40th question actually has a self.qseq = 39.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 4 years 3 days ago by tpartner.

Please Log in to join the conversation.

More
4 years 3 hours ago #100972 by Tune
Tune replied the topic: Not able to use question variable "qseq" in relevance equation
Hi, sorry for the late reply. I've been on vacation.
I've tried using "self.qseq" and the result is the same, it doesn't seem to work.

If you do a simple test with just two questions and no randomisation, then use the relevance equation "self.qseq <= 0" for both of them. I would expect that the first question would show and the other would be hidden but the reality is that none of them will show. So maybe something is wrong with the qseq attribute?

I saw someone mention that qseq was a "dynamic variable" and that it wasn't evaluated before display and that this was the problem.

Do you know any other solution to my original problem? maybe use an extra equation question that takes the value of the previous questions's qseq?

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now