- Posts: 12
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Current page/step in Expression Manager?
- jkautto
- Topic Author
- Offline
- New Member
Less
More
5 years 8 months ago #172662
by jkautto
Current page/step in Expression Manager? was created by jkautto
Hi! Does the current LimeSurvey 3+ Expression Manager have a variable for the current page or step?
For example, assume I have 10 question groups. All groups are in the same randomization group. I only want to show 5 random groups and hide the remaining 5. Now, if EM has a variable for the current page (e.g., "CURRENT_PAGE"), then I could simply use relevance equation "CURRENT_PAGE<6" and that's it.
As all hidden/skipped pages are at the end, the problem is solvable simply by knowing the current page number.
If this is not (yet) possible, could you help me doing it using JavaScript? On the basis of my previous problem , I assume the code should be something like this:
I'm grateful for any input on this. Thanks.
For example, assume I have 10 question groups. All groups are in the same randomization group. I only want to show 5 random groups and hide the remaining 5. Now, if EM has a variable for the current page (e.g., "CURRENT_PAGE"), then I could simply use relevance equation "CURRENT_PAGE<6" and that's it.
As all hidden/skipped pages are at the end, the problem is solvable simply by knowing the current page number.
If this is not (yet) possible, could you help me doing it using JavaScript? On the basis of my previous problem , I assume the code should be something like this:
Code:
<script type='text/javascript'> $(document).ready(function() { var N_current = $("#thisstep").val(); if (N_current>5) { $(".group-name").??????? <----- How to hide/skip current group? } }); </script>
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12888
- Thank you received: 3965
5 years 8 months ago #172665
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Current page/step in Expression Manager?
Hi,
please read this:
www.limesurvey.org/forum/design-issues/1...zation-groups#136485
You can use "gseq".
Joffm
please read this:
www.limesurvey.org/forum/design-issues/1...zation-groups#136485
You can use "gseq".
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: jkautto
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
5 years 8 months ago #172668
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Current page/step in Expression Manager?
A other option is to use "qCode.relevanceStatus".
- www.limesurvey.org/forum/can-i-do-this-w...-of-questions#104067
- www.limesurvey.org/forum/can-i-do-this-w...-of-questions#104067
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: jkautto
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12888
- Thank you received: 3965
5 years 8 months ago #172674
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Current page/step in Expression Manager?
Hi,
and to add a straightforward solution:
In your scenario of 5 groups out of 10 there are 10 over 5 = 252 different ways to display.
1,2,3,4,5
1,2,3,4,6
...
1,2,3,4,10
1,3,4,5,6
1,3,4,5,7
...
1,3,4,5,10
...
1,7,8,9,10
2,3,4,5,6
...
6,7,8,9,10
So create a random number between 1 and 252 and set the relevance like:
Group1: (random==1) OR (random==2) OR (random=) OR ...
Joffm
and to add a straightforward solution:
In your scenario of 5 groups out of 10 there are 10 over 5 = 252 different ways to display.
1,2,3,4,5
1,2,3,4,6
...
1,2,3,4,10
1,3,4,5,6
1,3,4,5,7
...
1,3,4,5,10
...
1,7,8,9,10
2,3,4,5,6
...
6,7,8,9,10
So create a random number between 1 and 252 and set the relevance like:
Group1: (random==1) OR (random==2) OR (random=) OR ...
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- jkautto
- Topic Author
- Offline
- New Member
Less
More
- Posts: 12
- Thank you received: 0
5 years 7 months ago - 5 years 7 months ago #172977
by jkautto
Replied by jkautto on topic Current page/step in Expression Manager?
Thanks. I added EM command "group1question1.gseq<6", "group2question1.gseq<6",... to group relevance fields of each group and it works.
However, as this approach breaks the progress bar behavior (sudden jump to 100%), I also had to create "text display" questions on top of each group with a description "Page {group1question1.gseq}/10" etc. This serves as a crude substitute for the progress bar.
However, as this approach breaks the progress bar behavior (sudden jump to 100%), I also had to create "text display" questions on top of each group with a description "Page {group1question1.gseq}/10" etc. This serves as a crude substitute for the progress bar.
Last edit: 5 years 7 months ago by jkautto.
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5033
- Thank you received: 1257
5 years 7 months ago #172980
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Current page/step in Expression Manager?
There are some bugreports and feature requests related to the progress bar
Bugreport
bugs.limesurvey.org/view.php?id=14003
Featurerequest
bugs.limesurvey.org/view.php?id=9677
Bugreport
bugs.limesurvey.org/view.php?id=14003
When there are hidden calculation questions (questions that have "Always hide this question" turned on) the progress bar also counts these when indicating the progress.
Featurerequest
bugs.limesurvey.org/view.php?id=9677
B.) Calculation routine based on a) Questions shown or b) Question position in the survey
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12888
- Thank you received: 3965
5 years 7 months ago #172981
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Current page/step in Expression Manager?
Yes, there was a discussion about the progress bar some time ago.
But imagine:
The respondent answers the first 50% of the questions, and then the rest is skipped because of relevance, conditions, etc. (e.g. only female respondents are asked)
So how do you think the progressbar can look into the future, meaning how to know that you are male?
In some commercial tools you have the option to set the percentage of the progressbar manually, but this will not solve the mentioned problem.
Regards
Joffm
But imagine:
The respondent answers the first 50% of the questions, and then the rest is skipped because of relevance, conditions, etc. (e.g. only female respondents are asked)
So how do you think the progressbar can look into the future, meaning how to know that you are male?
In some commercial tools you have the option to set the percentage of the progressbar manually, but this will not solve the mentioned problem.
Regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu
The topic has been locked.