Check out the LimeSurvey source code on GitHub!

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

3 years 4 months ago #100838 by Tune

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

Please Log in to join the conversation.

3 years 4 months ago #100841 by Tune
I forgot to mention that I'm using Limesurvey hosted by and the version is 2.00+ =)

Please Log in to join the conversation.

3 years 4 months ago - 3 years 4 months ago #100894 by tpartner
self.qseq < 40

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

Tony Partner

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

Please Log in to join the conversation.

3 years 4 months ago #100972 by Tune
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.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form