Welcome to the LimeSurvey Community Forum

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

Questions not shown after equation is in question group

  • larissabruebach
  • larissabruebach's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 4 months ago #191513 by larissabruebach
Hello,

so I'm relatively new to LimeSurvey. I will try to explain the issue as good as possible.

I have 4 different categories of question groups (for 4 emotions: happy, sad, angry, neutral). Each of these categories should consist of 15 question groups. A question group consists of a video and questions about that video that will be displayed after the video is finished.

I do not want to show each participant all 15 question groups of one category. I would like randomly select 4 of each categoery. But I want ALL question groups to be mixed and not show one category after the other.

What I have come up with so far ist the following:
I have an equation "question" that should function as a counter (e.g. happyCounter).
This counter should be incremented by one after a video from the category "happy" is shown.
In the relevance equation I check if this counter is smaller than 4. If this is the case the question group should be shown, if not it will not be shown.

It seems like this is working. BUT I can't see my questions anymore. I know they're there, because I can't continue, when it contains a non-skippable question. It seems like they are just not displayed.

I hope anyone can help with this. Attached you can find a small demo project.

Thanks! :)
The topic has been locked.
More
4 years 4 months ago #191521 by jelo

larissabruebach wrote: I do not want to show each participant all 15 question groups of one category. I would like randomly select 4 of each categoery. But I want ALL question groups to be mixed and not show one category after the other.)


So you have 4 topics. Each topic has 15 Questionsgroups. Each question group consists of a Video and a few questions). You want to show 4 questions groups per topic. And you want the order of topics mixed.

I don't see in your lss export how you randomly select the questionsgroups you want to show.

The first equation, where you want to assign 0 to happy is not assigning 0, but {0}.
If you check happy==0 the result is FALSE cause happy is {0} instead of 0.

An approach which might work would be to assign the 15 questiongroups of one topic to one Randomization group and then try to show only 4 of the 15 via a workaround like this here:
www.limesurvey.org/forum/can-i-do-this-w...lect-question-groups

Randomization group: To start randomizing a question group, enter a string into the field such as randgroup1. You will need to enter that same string in all question groups that you want to randomize and which will then appear in a random order when taking the survey. Only places inside the same group will be randomly switched!


I don't get your approach, but if you fix the first equation to assign 0 to happy instead of {0} you might can show us how your solution is working. Deutsche Elemente in der Umfrage sind kein Problem.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • larissabruebach
  • larissabruebach's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 4 months ago #191532 by larissabruebach
Replied by larissabruebach on topic Questions not shown after equation is in question group

I don't see in your lss export how you randomly select the questionsgroups you want to show.

As for now I only have one group, because the general concept is not working. That's why I only have one for now.

The first equation, where you want to assign 0 to happy is not assigning 0, but {0}.
If you check happy==0 the result is FALSE cause happy is {0} instead of 0.

If I write happy = 0 in the equation nothing happens and I cannot use happy as a variable (e.g. change it) in a later equation. If I just write 0 I can at least use the variable in later equations.
If I put the equations in a seperate question group everything works just fine. But as I want it to be randomized, it needs to be in that questiongroup or else it'll be missing.

I attached a new .lss where my solution works, but ONLY when I increment my counter (happy) in a new questiongroup.

Alternativ question: Is there a way to ensure that one questiongroup comes after a specific other questiongroup?
The topic has been locked.
More
4 years 4 months ago #191533 by jelo

larissabruebach wrote: If I write happy = 0 in the equation nothing happens and I cannot use happy as a variable

I suggested to write 0 instead of {0}. In your new LSSexport you did that and the variable has now a number instead of text assigned as a value.


I still don't get your concept and where you are heading. But I might learn.
Let's say you implement a group randomizing and the groups are then displayed in a random order.

If you then want to increment happy when viewing a group you cannot just assign a value to happy. You need really to increment happy.

When you use
Code:
happy= 1
, you don't increment happy, you assign happy the value 1.

Increment would be:
Code:
happy = happy+1

That would the equation in every question group.

If you then have a relevance to show a question group only when happy is below a threshold you can might continue to develop your concept.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • larissabruebach
  • larissabruebach's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 4 months ago #191536 by larissabruebach
Replied by larissabruebach on topic Questions not shown after equation is in question group

I suggested to write 0 instead of {0}. In your new LSSexport you did that and the variable has now a number instead of text assigned as a value.

Thanks! I now just wrote 0 and it works like before

Increment would be:

happy = happy+1

This doesn't work for me. When I use this I just get text and it does not compute anything. When I write {happy = happy +1} in the first equation I get 2 and in the second one 6.

That would the equation in every question group.

The problem is putting this equation in the question group. When it's in a separate question group it works just fine. As soon as it's in the same question group I can't see my questions (e.g. they're not shown, but they're there).

If you then have a relevance to show a question group only when happy is below a threshold you can might continue to develop your concept.

This is what I'm going for actually. Thanks for your help and quick replies! :)
The topic has been locked.
More
4 years 4 months ago #191538 by jelo

larissabruebach wrote: This doesn't work for me. When I use this I just get text and it does not compute anything. When I write {happy = happy +1} in the first equation I get 2 and in the second one 6.


First: I don't write copy and paste code. I just wanted to point out, the difference between increasing a variable by one and assigning a value.


happy=0
Group5 happy=happy+1 (happy has value 1)
Group3 happy=happy+1 (happy has value 2)
Group7 happy=happy+1 (happy has value 3)
etc..

And on all groups you want to have a relevance rule to be only shown when happy is below a threshold.

We ignore the fact that you have four topics.

Please attach your new LSSexport and state what exact version of LimeSurvey you use.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • larissabruebach
  • larissabruebach's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 4 months ago #191539 by larissabruebach
Replied by larissabruebach on topic Questions not shown after equation is in question group

And on all groups you want to have a relevance rule to be only shown when happy is below a threshold.

That's what I have for the important question groups.

We ignore the fact that you have four topics.

That is fine for now as this is not the real issue here.

The issue is that I can't use an equation in a question group. When I use an equation in a question group the question group is shown, but there are no questions. The code hasn't changed from my previous post.
We can also ignore the fact that I'm not incrementing, but assigning the value for now.

I use Version 3.17.2
The topic has been locked.
More
4 years 4 months ago #191543 by jelo

larissabruebach wrote: The issue is that I can't use an equation in a question group. When I use an equation in a question group the question group is shown, but there are no questions.


Create a new survey with just two groups. Try to reproduce the issue there again.
The issue you state is "If you place an equationtype question with other questions inside a group, the questions inside the group are not shown.

If I try your latest LSS-export where do you get the first empty group?

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • larissabruebach
  • larissabruebach's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 4 months ago #191547 by larissabruebach
Replied by larissabruebach on topic Questions not shown after equation is in question group
So I created a test survey.
There are 3 question groups that contain questions.

The first display is the counter. (counter = 1)
Then it should show the first question group with one question and one equation. BUT there is only the button "next", NO question or equation. (relevance equation counter == 1) (sets counter = 2)
The second question group does not contain an equation and the question is shown. (relevance equation counter == 2)
In the next group I set the counter in an equation within a group with no other questions. (counter = 3)
The ThirdQuestionGroup does not contain a counter and is shown as it's supposed to. (relevance equation counter == 3)

This shows that the assigment of the counter variable works.

Does this help with understanding the problem?
The topic has been locked.
More
4 years 4 months ago #191550 by jelo

larissabruebach wrote: Then it should show the first question group with one question and one equation. BUT there is only the button "next", NO question or equation. (relevance equation counter == 1) (sets counter = 2)


The "FirstQuestionGroup" has a relevance "counter == 1"
Inside "FirstQuestionGroup" you set counter=2, which will then hide the group (counter no longer 1).

It's working correctly. You need to take into account that the relevance is checked constantly.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • larissabruebach
  • larissabruebach's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 4 months ago #191555 by larissabruebach
Replied by larissabruebach on topic Questions not shown after equation is in question group

It's working correctly. You need to take into account that the relevance is checked constantly.


In this case shouldn't it work when I set the relevance equation to counter == 1 and then set the counter within the group to 1? As far as I can see it doesn't.

I don't really understand why it comiles the code within first and then checks the relevant equation.
If it checks constantly it should realize that it is now true.

I'm sorry, but this seems really odd to me.
The topic has been locked.
More
4 years 4 months ago #191559 by jelo
Constantly is not the correct term. If you use ExpressionManager code, the code is evaluated via PHP and Javascript.
PHP is serverside. JS is clientside. You expect a pure serverside evaluation which would only be triggered again when going to the next questiongroup. But the revelance is checked browserside too. So when you change the counter inside the questiongroup the relevance of the whole questiongroup gets 0 and the content is hidden via Javascript.

If you think that is a bug or want a different behavior, you can open a bug report or feature request.

If you have the feeling, I got something wrong, let's wait for input from other users.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose