Current page/step in Expression Manager?

More
1 month 6 days ago #172662 by jkautto
jkautto created the topic: Current page/step in Expression Manager?
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:
<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>
I'm grateful for any input on this. Thanks.

Please Log in or Create an account to join the conversation.

More
1 month 6 days ago #172665 by Joffm
Joffm replied the topic: Current page/step in Expression Manager?


Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: jkautto

Please Log in or Create an account to join the conversation.

More
1 month 6 days ago #172668 by tpartner
tpartner replied the 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

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

Please Log in or Create an account to join the conversation.

More
1 month 5 days ago #172674 by Joffm
Joffm replied the 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==3) OR ...

Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in or Create an account to join the conversation.

More
1 month 1 day ago - 1 month 1 day ago #172977 by jkautto
jkautto replied the 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.
Last Edit: 1 month 1 day ago by jkautto.

Please Log in or Create an account to join the conversation.

More
1 month 23 hours ago #172980 by jelo
jelo replied the 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

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


Are you a student conducting a survey? If yes, tell me why you use LimeSurvey?
www.limesurvey.org/forum/development/116...y-you-use-limesurvey

Please Log in or Create an account to join the conversation.

More
1 month 22 hours ago #172981 by Joffm
Joffm replied the 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


Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!