View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
04776Bug reportsSurvey takingpublic2010-12-04 01:30
Reporteruser9586Assigned Toc_schmitz  
PrioritynormalSeveritypartial_block 
Status closedResolutionfixed 
Product Version1.90+ 
Summary04776: Question appearing in random order in group-by-group mode
Description

Simply create a new survey, with the default options, with the following structure:

group 1: q1 q2 q3 q4
group 2: q5

The questions appear in random order (differing at every "preview"), including swapping questions between pages.

Is that expected?

TagsNo tags attached.
Attached Files
svn-patch.diff (865 bytes)   
Index: index.php
===================================================================
--- index.php	(revision 9572)
+++ index.php	(working copy)
@@ -2665,7 +2665,7 @@
     
     // Find all defined randomization groups through question attribute values
     $randomGroups=array();
-    $rgquery = "SELECT attr.qid,value FROM ".db_table_name('question_attributes')." as attr right join ".db_table_name('questions')." as quests on attr.qid=quests.qid WHERE attribute='random_group' and sid=$surveyid GROUP BY attr.qid";
+    $rgquery = "SELECT attr.qid,value FROM ".db_table_name('question_attributes')." as attr right join ".db_table_name('questions')." as quests on attr.qid=quests.qid WHERE attribute='random_group' and value <> '' and sid=$surveyid GROUP BY attr.qid";
     $rgresult = db_execute_assoc($rgquery);
     while($rgrow = $rgresult->FetchRow())
     {
svn-patch.diff (865 bytes)   
Bug heat4
Complete LimeSurvey version number (& build)9572
I will donate to the project if issue is resolvedNo
Browser
Database type & version-
Server OS (if known)-
Webserver software & version (if known)-
PHP Version-

Users monitoring this issue

There are no users monitoring this issue.

Activities

user9586

2010-12-02 15:58

  ~13678

After further investigation, it seems that an empty 'random_group' attribute is still counted as a valid group, meaning that all questions with an empty 'random_group' are scrambled.

It is my understanding that an empty random_group is no group.
The attached patch fixes this case by adding a "value <> ''" when checking for the question attribute.

c_schmitz

c_schmitz

2010-12-04 01:30

administrator   ~13684

Thank you!

Issue History

Date Modified Username Field Change
2010-12-02 15:33 user9586 New Issue
2010-12-02 15:54 user9586 File Added: svn-patch.diff
2010-12-02 15:58 user9586 Note Added: 13678
2010-12-04 01:30 c_schmitz Note Added: 13684
2010-12-04 01:30 c_schmitz Status new => closed
2010-12-04 01:30 c_schmitz Assigned To => c_schmitz
2010-12-04 01:30 c_schmitz Resolution open => fixed