Welcome, Guest
Username: Password: Remember me

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

Not able to use question variable "qseq" in relevance equation 11 months 2 weeks ago #100838

  • Tune
  • Tune's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 12
  • Karma: 0
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
The administrator has disabled public write access.

Not able to use question variable "qseq" in relevance equation 11 months 2 weeks ago #100841

  • Tune
  • Tune's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 12
  • Karma: 0
I forgot to mention that I'm using Limesurvey hosted by LimeService.com and the version is 2.00+ =)
The administrator has disabled public write access.

Not able to use question variable "qseq" in relevance equation 11 months 1 week ago #100894

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4207
  • Thank you received: 791
  • Karma: 360
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Last Edit: 11 months 1 week ago by tpartner.
The administrator has disabled public write access.

Not able to use question variable "qseq" in relevance equation 11 months 1 week ago #100972

  • Tune
  • Tune's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 12
  • Karma: 0
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?
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.139 seconds
Donation Image