Welcome, Guest
Username: Password: Remember me

TOPIC: Frustrating Array Values

Frustrating Array Values 1 year 9 months ago #87295

  • helper
  • helper's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 126
  • Thank you received: 18
  • Karma: 0
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?
The administrator has disabled public write access.

Re: Frustrating Array Values 1 year 9 months ago #87301

  • mdekker
  • mdekker's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 341
  • Thank you received: 68
  • Karma: 38
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
The administrator has disabled public write access.

Re: Frustrating Array Values 1 year 9 months ago #87311

  • helper
  • helper's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 126
  • Thank you received: 18
  • Karma: 0
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: 1 year 9 months ago by helper.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.103 seconds
Donation Image