View Issue Details

IDProjectCategoryView StatusLast Update
13001Bug reports[All Projects] Expression Managerpublic2018-04-27 17:42
Reporteroc25Assigned ToDenisChenu 
PriorityhighSeveritymajor 
Status assignedResolutionopen 
Product Version2.7x.x 
Target VersionFixed in Version 
Summary13001: Expression Manager evaluates answers to free text questions enclosed by "{" and "}"
DescriptionI created 3 questions with Short free text, Long free text and Huge free text.

If I enter {1+2+3+4} as answers, the answers become 10 when the page is displayed again due to some validation errors.
Steps To Reproduce1. import the attached survey
2. execute the survey
3. put "{1+2+3+4}" as the answers to the first 3 questions and do not answer the yes / no question
4. click "submit" and system will prompt for missing mandatory answers
5. all answers become "10"
TagsNo tags attached.
Complete LimeSurvey version number (& build)Version 2.72.6+171207
I will donate to the project if issue is resolvedNo
BrowserChrome 62.0.3202.94
Database & DB-VersionMySql
Operating System (Server)Windows 2012 Server
Webserver software & versionApache 2.4.12
PHP Version5.5.25

Activities

oc25

oc25

2017-12-09 20:11

reporter  

limesurvey_survey_322944.lss (14,168 bytes)
oc25

oc25

2017-12-09 20:15

reporter  

1.PNG (20,252 bytes)
1.PNG (20,252 bytes)
2.PNG (27,213 bytes)
2.PNG (27,213 bytes)
oc25

oc25

2017-12-09 20:28

reporter   ~45272

Maybe we can escape the "{" and "}" characters again in the return value of $this->GetResult() ?

em_core_helper.php - Line 1944:
$resolvedPart = $this->GetResult();
DenisChenu

DenisChenu

2017-12-16 11:44

developer   ~45314

2.6lts have the same issue, the real issue is EM core didn't know what he receive at this time (he receive EXPRESSION, not a variable)

Hard to fix but must find a way …
DenisChenu

DenisChenu

2017-12-16 12:10

developer   ~45315

Potential fix : https://github.com/LimeSurvey/LimeSurvey/pull/899
olle

olle

2018-02-20 15:03

administrator   ~46617

We need unit-tests for this. I can make them when I have time, or you can make them, Denis?
olle

olle

2018-02-20 15:07

administrator   ~46618

Just to outline, the unit tests need to:

1. Test expression in default value.
2. Test normal non-expression default value.
3. Test expression in text question.
4. Test normal non-expression in text question.
5. Test normal expression in expression question to make sure it's not broken by other changes/fixes.
DenisChenu

DenisChenu

2018-02-20 15:18

developer   ~46620

Maye be test to : EM contain value entered by user (example with strpos { or } ?)
DenisChenu

DenisChenu

2018-04-03 13:38

developer   ~47313

Issue was here : https://github.com/LimeSurvey/LimeSurvey/blob/58bcd794fef429fcf5c3a2fc3dbc07400c067ec5/application/helpers/SurveyRuntimeHelper.php#L390

We need EM only for subquestion text and answer text (static for dropdown) not for whole ANSWERS
DenisChenu

DenisChenu

2018-04-11 12:07

developer   ~47399

Can not fix it in 3.X, target version 4.X

Issue History

Date Modified Username Field Change
2017-12-09 20:11 oc25 New Issue
2017-12-09 20:11 oc25 File Added: limesurvey_survey_322944.lss
2017-12-09 20:15 oc25 File Added: 1.PNG
2017-12-09 20:15 oc25 File Added: 2.PNG
2017-12-09 20:28 oc25 Note Added: 45272
2017-12-11 15:55 DenisChenu Severity minor => major
2017-12-16 11:44 DenisChenu Note Added: 45314
2017-12-16 12:10 DenisChenu Assigned To => DenisChenu
2017-12-16 12:10 DenisChenu Status new => assigned
2017-12-16 12:10 DenisChenu Note Added: 45315
2017-12-20 21:31 DenisChenu Target Version => 3.0.x
2018-01-16 15:11 DenisChenu Priority none => high
2018-02-20 15:03 olle Note Added: 46617
2018-02-20 15:07 olle Note Added: 46618
2018-02-20 15:18 DenisChenu Note Added: 46620
2018-04-03 13:38 DenisChenu Note Added: 47313
2018-04-11 12:07 DenisChenu Target Version 3.0.x =>
2018-04-11 12:07 DenisChenu Note Added: 47399