Anonymous Login
2016-12-04 02:49 CET

View Issue Details Jump to Notes ] Related Changesets ]
IDProjectCategoryView StatusLast Update
08678Bug reports[All Projects] Survey designpublic2016-08-29 12:38
ReporterJondays 
Assigned ToLouisGac 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
Product Version2.06+ 
Target VersionFixed in Version 
Summary08678: Using Expressions as default value for text fields questions when index is activated
DescriptionWhen using expressions as default values for text fields (to populate text box with answers from previous questions in previous groups), the expressions don't get filled.

For example, in question group 1, you answer Q1 to Q5. In Group 2 you have a question with a large text box. You set the default value as {Q1.shown}, {Q2.shown}, {Q3.shown}, {Q4.shown}, {Q5.shown}. When you run the survey, when you answer group 1, and then click next, you will see in text box: , , ,
withouth the expressions being replace by the answers (you get a blank)
Steps To ReproduceSee .lss file for a "working" example of the bug.

Create a group with your questions. In a second group, create a text field question. In the default value text box enter the expression (as above). Try the survey.

In the forum, tpartner suggested that this issue may be happening only one the index feature is enabled: http://www.limesurvey.org/en/forum/design-issues/95939-using-expressions-as-default-value-in-free-text-field#104721
Additional InformationThe attached dummy survey reproduces the error
TagsNo tags attached.
Complete LimeSurvey version number (& build)Version 2.05+ Build 140204
I will donate to the project if issue is resolvedNo
BrowserChrome, IE, Firefox, all of them
Database & DB-VersionMySQL Server 5.1
Operating System (Server)Windows NT 6.1 build 7600 (Windows Server 2008 R2 Standard Edition) i586
Webserver software & versionWindows NT 6.1 build 7600 (Windows Server 2008 R2 Standard Edition) i586
PHP VersionPHP Version 5.4.14
Attached Files

-Relationships
+Relationships

-Notes

~28764

c_schmitz (administrator)

This only happens if the question index is set to full.

~40490

LouisGac (developer)

First impression:

var_dumping the session variable shows that the values of the previous questions are correctly saved (bot in question index full or disabled).

~40493

LouisGac (developer)

In SurveyRuntimeHelper::createFullQuestionIndexByGroup(), this snippet cause the bug:

$stepInfo = LimeExpressionManager::singleton()->_ValidateGroup($key);

~40495

LouisGac (developer)

Last edited: 2016-08-25 14:37

View 2 revisions

after further investigation, the problem is deeper than it seemed:
Deactivating the question index partially solve the problem.

Even with no index:
1. Answer A to the first question on first page
2. Click next
3. In second page, A is shown (ok)
4. Click prev
5. Change your answer from A to B
6. Click next
7. A is still shown as the answer (wrong, should be B).

Maybe we should document about it, saying that for now, using expression should not be done in survey allowing "Previous" or "Index"

~40496

LouisGac (developer)

after a discussion with Carsten, it seems that the wanted behavior (default values is used only the first time)

~40497

LouisGac (developer)

So, here my bet:

the function _ValidateGroup is called at the very start of the survey, to build the menu. Doing it, it's saving the (empty) values of the answer to session, overriding the default values.

Possible solution:
Only apply _ValidateGroup to the previous group.

~40499

LouisGac (developer)

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=20241

~40520

LouisGac (developer)

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=20264

~40529

c_schmitz (administrator)

Version 2.51.0 Build 160829 released
+Notes

+Related Changesets

-Issue History
Date Modified Username Field Change
2014-02-06 22:02 Jondays New Issue
2014-02-06 22:02 Jondays File Added: limesurvey_survey_465241.lss
2014-02-16 17:37 c_schmitz Assigned To => c_schmitz
2014-02-16 17:37 c_schmitz Status new => assigned
2014-02-16 17:40 c_schmitz Assigned To c_schmitz => sammousa
2014-02-16 17:41 c_schmitz Note Added: 28764
2016-01-20 11:00 sammousa Assigned To sammousa =>
2016-01-21 09:09 DenisChenu Status assigned => new
2016-03-15 11:33 LouisGac Product Version => 2.06+
2016-08-25 11:43 LouisGac Sticky Issue No => Yes
2016-08-25 12:13 LouisGac Note Added: 40490
2016-08-25 13:26 LouisGac Note Added: 40493
2016-08-25 14:37 LouisGac Note Added: 40495
2016-08-25 14:37 LouisGac Note Edited: 40495 View Revisions
2016-08-25 14:45 LouisGac Note Added: 40496
2016-08-25 15:15 LouisGac Note Added: 40497
2016-08-25 15:40 LouisGac Changeset attached => LimeSurvey master 44cbdd16
2016-08-25 15:40 LouisGac Note Added: 40499
2016-08-25 15:40 LouisGac Assigned To => LouisGac
2016-08-25 15:40 LouisGac Resolution open => fixed
2016-08-25 16:18 LouisGac Status new => resolved
2016-08-26 13:00 LouisGac Changeset attached => LimeSurvey master 3748d294
2016-08-26 13:00 LouisGac Note Added: 40520
2016-08-29 12:38 c_schmitz Note Added: 40529
2016-08-29 12:38 c_schmitz Status resolved => closed
+Issue History