View Issue Details

IDProjectCategoryView StatusLast Update
05086User patchesOtherpublic2011-06-07 03:17
Reporteruser10291Assigned Tojcleeland  
Status closedResolutionfixed 
Product Version1.91RC5 
Target VersionFixed in Version1.91RC5 
Summary05086: Prevents un-viewable questions in group preview

In a group-by-group survey, a question whose visibility depends on an answer from an earlier page will currently never be visible in group preview. This patch changes it so the part of the condition that depends on the earlier answer will be treated as "true".

Additional Information

jasebo said he'd handle this. He also said he would add a config option to turn this behavior off. I personally think that's a mistake, just for the record. If you are nervous, you could add an undocumented config option for one release and see if anyone complains before taking it out ;-)

TagsNo tags attached.
Complete LimeSurvey version number (& build)0


has duplicate 05084 closed Bug reports "Preview Question Group" inaccessible questions 



2011-04-06 07:18


group.patch (1,187 bytes)
--- group.php.bak	2011-04-06 04:25:38.000000000 +0100
+++ group.php	2011-04-06 05:38:44.000000000 +0100
@@ -735,6 +735,9 @@
         elseif (preg_match("/[0-9]+X([0-9]+)X.*/",$cd[2],$sourceQuestionGid))
+            $localEvaluationPossible = false;
+            unset($localEvaluation);
             // If the Gid of the question used for the condition is on the same group,
             // the set the runconce flag to False, because we'll need to evaluate this condition
             //each time another question in this page is modified
@@ -746,10 +749,13 @@
                 $conditionSourceOnPreviousPage = true; // this param is specific to this basic condition
+                if ($previewgrp)
+                {
+                    $localEvaluationPossible = true;
+                    $localEvaluation = true;
+                }
-            $localEvaluationPossible = false;
-            unset($localEvaluation);
             $JSsourceElt = "document.getElementById('$idname')";
             $JSsourceVal = "document.getElementById('$idname').value";
group.patch (1,187 bytes)


2011-04-06 07:22


One further note: if you don't add a documented configuration option, you can treat this as a bug fix rather than a feature and it could go in 1.91. And I've already reached my smiley quota for today so I won't burden you with another



2011-04-12 08:08

reporter   ~14785

This took me much longer than I anticipated, to get a chance to look. Having done so, and having had a week to think about it, I have come to agree entirely with @dabrahams, that this is a bugfix, and that the behaviour expected when previewing a group is more likely to align with this. So rather than add a config option, I'm inclined to leave this as standard. That is, that when previewing a group, it will be assumed that all conditions set upon questions within that group have been met and are treated as true.



2011-04-12 08:15

reporter   ~14786

Updated in 1.91 and dev branches


2011-04-12 17:39


when previewing a group, it will be assumed that all conditions set upon questions within that group have been met and are treated as true.

Just for the record, that's not what my patch implements. What I implemented was: "it will be assumed that all conditions set outside that group upon questions within that group have been met and are treated as true." Conditions that can be set within the group will still have an effect.

It's not clear from the ticket whether you accepted my patch or reimplemented a different behavior.



2011-04-13 00:05

reporter   ~14803

Hi dabrahams, I implemented your patch exactly as you provided, and I should have been clearer in that it treats any condition upon a question within a group that was based on a question withinin a prior group as if that condition had been met, and does not affect the operation of any other condition, which otherwise behave normally.

Issue History

Date Modified Username Field Change
2011-04-06 07:18 user10291 New Issue
2011-04-06 07:18 user10291 File Added: group.patch
2011-04-06 07:22 user10291 Note Added: 14681
2011-04-06 07:49 jcleeland Assigned To => jcleeland
2011-04-06 07:49 jcleeland Status new => assigned
2011-04-12 08:08 jcleeland Note Added: 14785
2011-04-12 08:15 jcleeland Note Added: 14786
2011-04-12 08:15 jcleeland Status assigned => resolved
2011-04-12 08:15 jcleeland Fixed in Version => 1.91RC5
2011-04-12 08:15 jcleeland Resolution open => fixed
2011-04-12 17:11 c_schmitz Relationship added has duplicate 05084
2011-04-12 17:39 user10291 Note Added: 14802
2011-04-12 17:39 user10291 Status resolved => feedback
2011-04-12 17:39 user10291 Resolution fixed => reopened
2011-04-13 00:05 jcleeland Note Added: 14803
2011-06-07 03:17 jcleeland Status feedback => closed
2011-06-07 03:17 jcleeland Resolution reopened => fixed