Check out the LimeSurvey source code on GitHub!

Frustrating Array Values

More
4 years 2 months ago #87295 by helper
I have a three question survey. The first two questions are in a separate group (G-0) from the third (G-1).

The first two questions have the same array answers, but what I would like to do is to add the value of each of the two questions to determine whether or not to display the next group. So... from my limited understanding of the conditionals, I want to ADD the values of question one and two - VALUES (not the textual aspect). If their totals are greater than or equal to a numeric value of 3 then display the next group - otherwise quit.

In most cases, for most of my surveys, I am not really interested in the textual aspect of any of the answers; rather I need to be able to work with their position in an array.

Example:

A[0]-1 A1 [VALUE: 0] Not at all
A[0]-2 A2 [VALUE: 1] Several days
A[0]-3 A3 [VALUE: 2] More than half the days
A[0]-4 A4 [VALUE: 3] Nearly every day

My questions:

1. Is there any method to dump out of a survey at the end of a group when a condition is met?

2. Can conditionals be set at the group level?

3. How do I set a conditional for a question for the sum of values of a previous group?

Please Log in to join the conversation.

More
4 years 2 months ago #87301 by mdekker
Check out Expression Manager in the online docs. You can set group level relevance equations. There are some samples in the documentation. Not sure if you can work with assessment values in relevance so i would advice to set the answercode to the value you would like to use.

---
Menno Dekker

Please Log in to join the conversation.

More
4 years 2 months ago - 4 years 2 months ago #87311 by helper
Thus the frustration... Here is what works (only at the question level at the second group):

sum(766173X18X201SQ001.valueNAOK,766173X18X202SQ001.valueNAOK) >= 3

This fails at the group level -- I will go ahead and put in a bug (06768 -- bugs.limesurvey.org/view.php?id=6768 ).

Thanks mdekker!
Last Edit: 4 years 2 months ago by helper.

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form