Relationship Graph View Issue Dependency Graph
related to child of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
15501Bug reports[All Projects] Expression Managerpublic2019-11-08 15:54
ReporterAlbanCatry Assigned To 
PrioritynoneSeverityminor 
Status newResolutionopen 
Product Version3.19.2 
Target VersionFixed in Version 
Summary15501: relevanceStatus : different evaluation in JS and PHP
Description

When comparing SomeQuestion.relevanceStatus to an integer (eg SomeQuestion.relevanceStatus == 0 or SomeQuestion.relevanceStatus == 1) and use it in a future relevance equation, the answers may be displayed and not be saved.

Steps To Reproduce

An example .lss file is here : https://www.limesurvey.org/forum/can-i-do-this-with-limesurvey/119540-using-relevancestatus-in-relevance-equations-of-further-questions

Additional Information

I am using LimeSurvey Professional and I don't know how to get Database and PHP version

TagsNo tags attached.
Complete LimeSurvey version number (& build)3.9.3
I will donate to the project if issue is resolvedNo
Browser
Database & DB-Versionunknown
Server OS (if known)
Webserver software & version (if known)
PHP Versionunknown

Activities

DenisChenu

DenisChenu

2019-10-31 10:19

developer   ~54296

Here the 2 surveys ,

@ollehar : The issue is (again) a compare difference between JS and PHP
BUT : this time with == false == 0 in js but not with PHP ?



limesurvey_survey_relevanceStatusCompareFixedOK.lss (29,558 bytes)
limesurvey_survey_relevanceStatusCompareKO.lss (29,565 bytes)
ollehar

ollehar

2019-11-01 10:03

administrator   ~54307

Thanks, have to make another test for this.

DenisChenu

DenisChenu

2019-11-01 10:52

developer   ~54314

Remind NAOK >= " " is near not fixable …

ollehar

ollehar

2019-11-01 12:58

administrator   ~54317

Why would you use ">=" in such a case? Should be == or !=

ollehar

ollehar

2019-11-01 12:58

administrator   ~54318

But again: Using >, <, ... on string should give warning.

DenisChenu

DenisChenu

2019-11-01 13:02

developer   ~54319

@ollehar : using ! is OK here. It's not the point on the way to fix … see the limesurvey_survey_relevanceStatusCompareFixedOK.lss file
(!Q2_SQ001.relevanceStatus and !Q2_SQ002.relevanceStatus) is the best way ( relevanceStatus is a boolean)

The point is : it must be same in PHP and JS :).
With >= etc … we already try fixing it. But not with == :)

ollehar

ollehar

2019-11-01 13:08

administrator   ~54320

The point is : it must be same in PHP and JS :).

Impossible without a virtual machine, and NOT enough! Feel free to try, though. But personally I feel more motivated to do a warning system.

Will check the surveys.

ollehar

ollehar

2019-11-01 13:19

administrator   ~54321

PS. A virtual machine can be a very small piece of code: https://github.com/GedRap/xs-vm

Instead of generating JS, the EM could pass tokens to the browser which are then evaluated the same way as in PHP. DS.

Issue History

Date Modified Username Field Change
2019-10-31 09:57 AlbanCatry New Issue
2019-10-31 10:19 DenisChenu File Added: limesurvey_survey_relevanceStatusCompareFixedOK.lss
2019-10-31 10:19 DenisChenu File Added: limesurvey_survey_relevanceStatusCompareKO.lss
2019-10-31 10:19 DenisChenu Note Added: 54296
2019-10-31 10:20 DenisChenu Relationship added related to 15405
2019-10-31 10:21 DenisChenu Relationship added related to 07805
2019-10-31 10:21 DenisChenu Relationship added related to 12613
2019-11-01 10:03 ollehar Note Added: 54307
2019-11-01 10:52 DenisChenu Note Added: 54314
2019-11-01 12:58 ollehar Note Added: 54317
2019-11-01 12:58 ollehar Note Added: 54318
2019-11-01 13:02 DenisChenu Note Added: 54319
2019-11-01 13:08 ollehar Note Added: 54320
2019-11-01 13:19 ollehar Note Added: 54321
2019-11-08 15:54 DenisChenu Relationship added related to 15532