View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
20315Bug reportsSurvey editingpublic2025-10-22 12:19
ReporterJmantysalo Assigned Totibor.pacalat  
PrioritynoneSeveritytext 
Status closedResolutionwon't fix 
Product Version6.6.x 
Summary20315: Terminology: 'Condition' vs. 'Relevance equation'
Description

A question and a question group have 'condition'. Subquestions should have that too instead of 'relevance equation'.

TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build) 6.15.12+250916
I will donate to the project if issue is resolvedNo
Browser
Database type & versionN/A
Server OS (if known)
Webserver software & version (if known)
PHP VersionN/A

Users monitoring this issue

There are no users monitoring this issue.

Activities

lajosarpad

lajosarpad

2025-10-22 11:12

developer   ~83635

The {questions} table has a relevance field. This field contains the actual script that will determine relevancy, i.e., whether the current entity is to be hidden (not relevant) or shown (relevant).

There is a {conditions} tables too, where you can create/update/delete/view conditions. A condition is an atomic entity that you can define and whenever you do a write operation on a condition, then the question it refers to will re-generate its relevance script based on the conditions that you have.

So the condition is an atomic expression that can be created/updated/deleted/viewed in a user-friendly manner via the condition designer and the conditions are aggregated into an expression in the question's relevance field. You can also directly edit the relevance of a question which will automatically remove all conditions.

Hence, the relevance script is the end result of a script that determine relevancy, whilst conditions are a way to generate this script by defining individual conditions, but can be directly edited by power-users.

Jmantysalo

Jmantysalo

2025-10-22 11:28

reporter   ~83637

Ok, might be that I understood -- but where I can set up conditions? There is Tools > Reset conditions, but I see no way to add a condition. Is it still available on a now 6.x installation? I am testing as a superadmin.

tibor.pacalat

tibor.pacalat

2025-10-22 11:39

administrator   ~83638

If you want to set condition for a specific question, it is under General Settings -> Condition.
If you want to set condition for a question group, this is under Edit group.

tibor.pacalat

tibor.pacalat

2025-10-22 11:58

administrator   ~83640

From Arpad:

On the question page you have the ... menu at the left-hand sidebar and then click on Condition designer. This will redirect you to the condition designer where you can define your conditions. Please, be aware the mechanism that re-generates the relevance script when you save/remove a condition, so if you have a carefully written relevance script and you want to keep it, then you might want to save it someplace. If you just want to generate the script with conditions, then the conditions designer is the exact place you need to be at.

The condition designer has this URL pattern:

http://ls-ce-6x/index.php/admin/conditions/sa/index/subaction/editconditionsform/surveyid/396954/gid/770/qid/7741

where you can of course replace the protocol, the domain as well as the values. But the numeric values, notably 396954, 770 and 7741 specify the survey id, the group id and the question id.

The algebra of the condition designer works like this:

  1. Conditions can be grouped by scenarios and the logical expression that ends up being evaluated is:

Scenario1 OR ... OR Scenarion

where each scenario above represents the logical evaluation of the conditions inside the scenario.

  1. A scenario is evaluated via

Condition1 AND ... AND Conditionn

as long as the conditions are not referring the same thing. So if your first condition is that question1 was answered by a1 as value and the second condition is that question2 was answered by a2 as value, then both conditions need to be true at the same time in order for the scenario to be evaluated as true

  1. If inside a scenario you have multiple conditions referring to the same value, then they are ORed

So if condition1 and condition2 are inside the same scenario, but both of them depend on the value of the LASTNAME, for example, then they are ORed.

Example:

Scenario1:

  • q1's answer is 'foo'
    Scenario2:
  • q1's answer is not 'foo'
  • q2's answer is 'bar'
    Scenario3:
  • LastName is 'Doe'
  • LastName contains 'son'
  • FirstName is not 'John'

Then the expression will be this:

(q1's answer is 'foo') OR (q1's answer is not 'foo' AND q2's answer is 'bar') OR ((LastName is 'Doe' OR LastName contains 'son') AND FirstName is not 'John')

I hope this clarifies the matter.

Jmantysalo

Jmantysalo

2025-10-22 12:19

reporter   ~83641

Ok, this clarifies it, kind of. But still: I can use the Condition designer for a question. I can not use it for a question group, nor for a subquestion. But the term 'condition' is used for a question group too.

And for a normal user it is anyways strange to have two terms for one thing.

Issue History

Date Modified Username Field Change
2025-10-22 10:08 Jmantysalo New Issue
2025-10-22 11:12 lajosarpad Note Added: 83635
2025-10-22 11:12 lajosarpad Bug heat 0 => 2
2025-10-22 11:28 Jmantysalo Note Added: 83637
2025-10-22 11:28 Jmantysalo Bug heat 2 => 4
2025-10-22 11:39 tibor.pacalat Note Added: 83638
2025-10-22 11:39 tibor.pacalat Bug heat 4 => 6
2025-10-22 11:39 tibor.pacalat Assigned To => tibor.pacalat
2025-10-22 11:39 tibor.pacalat Status new => closed
2025-10-22 11:39 tibor.pacalat Resolution open => won't fix
2025-10-22 11:58 tibor.pacalat Note Added: 83640
2025-10-22 12:19 Jmantysalo Note Added: 83641