Welcome to the LimeSurvey Community Forum

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

Randomized questions not showing unless navigating backward

  • madeingenesi
  • madeingenesi's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 7 months ago #189098 by madeingenesi
Hi, I created a survey using an official randomization technique described here . In my case, I extract 2 questions out of 10 times 4 groups, plus 1 question out of 4 in one last group. Therefore each survey instance has 9 questions.
Testing the survey one question per page, questions are not shown navigating forward: the whole question# div gets an element style="display:none;" coming from nowhere. The navigation sections with buttons is shown normally, so you can navigate.
Then, if you go forward and beyond one whole group (the first 2n questions) and you step backward, you can now see the questions that were invisible before.
This weird behavior – invisible > group completed > go backward > visible – happens for each group block.
Notice that if the same survey is tested one group per page, or all on one page, questions are shown normally.
What can this possibly be? I have no clue. Maybe a LimeSurvey bug?
Thanks for any suggestions!
The topic has been locked.
  • holch
  • holch's Avatar
  • Online
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 7 months ago #189099 by holch
This is very confusing. Sometimes it makes sense to add a LSS file for us to understand what you are doing. Also, always mention your LS version that you are using.

So what exactly does "I extract 2 questions out of 10 times 4 groups"??

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • madeingenesi
  • madeingenesi's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 7 months ago #189102 by madeingenesi
Sorry for the confusion: it means that I have 4 groups of 10 questions each, and I have to extract 2 random questions from each group. Plus 1 group of 4 questions, from which I extract 1 random question.
LSS is

File Attachment:

File Name: limesurvey...2594.lss
File Size:147 KB

File Attachment:

File Name: limesurvey...2594.lss
File Size:147 KB

File Attachment:

File Name: limesurvey...2594.lss
File Size:147 KB
attached.
I tested on versions 2.60 and 3.17, and the problem is just the same. It does not go away changing themes.
I just noticed that when the question page is loaded, the question appears for one tiny instant and disappears at once.
Puzzling.
The topic has been locked.
  • holch
  • holch's Avatar
  • Online
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 7 months ago #189106 by holch
I can confirm your problem.

Then I did a quick test to check what the .relevanceStatus for the different questions actually is in order to see what happens.

And voila, it shows just two questions, plus my additional text display that would show the result of the relevance status of the questions in the group.

But it seems it only works in the preview of the group.

And there we go. This is where your problem is. You are showing are the "question by question" display mode.

However, the manual clearly states:

This applies only to all random questions from one group and only if the Group by group or All in one format is used.


manual.limesurvey.org/Expression_Manager..._of_the_questions.29

I switched your example survey to "group by group" and it works like a charm.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: tpartner, madeingenesi
The topic has been locked.
  • madeingenesi
  • madeingenesi's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 7 months ago #189129 by madeingenesi
Well spotted holch! Thanks a lot.
Though, I still wonder why there is this constraint. I can't imagine how come that element style "display:none" is added to the question div _after_ the page is loaded and the question is actually displayed for a moment.
It's a mystery to me.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 7 months ago #189130 by Joffm
Hi,
I could imagine that it is the javascript.
It works after page load "on document ready".

There are more workarounds which use javascript which initially show the original layout and then switch to the changed layout.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • holch
  • holch's Avatar
  • Online
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 7 months ago #189137 by holch

I can't imagine how come that element style "display:none" is added to the question div _after_ the page is loaded and the question is actually displayed for a moment.

I didn't see this phenomena much. But as Joffm said, as this depends on the relevance status of various questions, it might take a couple of milliseconds to check all those statuses in the database and then apply the respective css class.
Especially as these questions are on different pages. When the questions are on the same page it works like a charm.

If you still want the same layout (two questions on separate pages, randomly drawn from a pool of 10 questions) you can do it with a slightly different work around.

For each of these pools of 10 question (e.g. the car one) you create 3 question groups, then you position your questions like this into these 3 groups:
Group 1: 1 question
Group 2: 1 question
Group 3: the 8 questions that are left.

Give all of these questions the same name in "randomization group" as you did already. Then hide group 3.

What will happen? LS will randomly position the 10 questions within the 3 question groups. As group 3 will be hidden, the questions that happen to be randomly in group 1 and 2 are displayed, but those 8 that fall into group 3 will not be shown.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: tpartner
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 6 months ago #189159 by DenisChenu
About relevanceStatus and Question by question survey, i think it can be fixed with some logic …

The reason for this (i think) : checking current relevance at start of PHP : relevanceStatus come from POST data. At end of PHP : relevanceStatuis was updated.

I use another system for question by question mode.

X random question
1 hidden question, equation set to 1.
Y random question

I want to show only X random question, their relevance equation was

!is_empty(self.NAOK) or is_empty(hiddenEquation)

Work only if questions are mandatory …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose