View Issue Details

IDProjectCategoryView StatusLast Update
07011Bug reports[All Projects] Survey designpublic2013-02-23 15:14
ReporterbenjyAssigned Tomdekker 
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.00+ 
Target VersionFixed in Version2.00+ 
Summary07011: It is not possible to randomize the order of groups even when a randomization groupname is set.
DescriptionI recently updated my limesurvey from 1.95 to 2.00+.
One of the new features of 2.00 is the possibility to randomize the order of question groups. I just tested it but it does not work.

It might be possible that I made a mistake but I am not sure about that.

I named the "randomization groupname" for every question group which should be randomized "random". When I test my survey its output is the sorted order not the randomized.
TagsNo tags attached.
Complete LimeSurvey version number (& build)121127
I will donate to the project if issue is resolvedNo
Browser
Database & DB-VersionMySQL 5.1.66
Operating System (Server)Linux
Webserver software & versionApache 2.2.15
PHP Version5.3.3

Relationships

parent of 07222 closedmdekker Bug reports Randomized order of questions within group not working for question by question format 
parent of 07295 new Development  It is not possible to randomize the order of groups even when a randomization groupname is set. 
has duplicate 07024 closedc_schmitz Bug reports Questions Group randomization broken 
has duplicate 07168 closedc_schmitz Bug reports Randomization Group function does not work 
has duplicate 07219 closedc_schmitz Bug reports Randomization of question groups does not work 
Not all the children of this issue are yet resolved or closed.

Activities

benjy

benjy

2012-12-04 17:27

reporter  

limesurvey_survey_45612.lss (721,539 bytes)
mobug

mobug

2013-01-10 15:11

reporter   ~23609

Last edited: 2013-01-10 15:18

View 2 revisions

Bug still exists in Build 130108. I will donate/pay if this is fixed within 24h

c_schmitz

c_schmitz

2013-01-22 21:06

administrator   ~23759

Menno, can you take a look at this one as soon as possible, please?
cberghoff

cberghoff

2013-01-23 01:28

reporter   ~23776

I attempted to export a survey structure that included group randomization to a .txt file, and found that no information regarding the group randomization was exported. Thought this might be related to the general randomization problem rather than representing a new bug. WILL DONATE IF RANDOMIZATION IS FIXED SOON!
mdekker

mdekker

2013-01-23 21:46

developer   ~23784

This won't be an easy fix and will take some time to get it right. It seems to work for all-in-one mode not not in group by group mode
mdekker

mdekker

2013-01-24 12:17

developer   ~23786

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

mdekker

2013-01-24 12:20

developer   ~23787

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

mdekker

2013-01-24 12:26

developer   ~23788

Did not look at export/import yet but this two patches should fix the group randomization problem.

Please test and report if you still have trouble. I tried with a simple survey using three groups that each had just one question to keep it simple. Because it is random sometimes the order can be the normal order. If you clear results and restart the survey you get a fresh randomization.
mdekker

mdekker

2013-01-24 12:28

developer  

limesurvey_survey_543192.lss (13,655 bytes)
mdekker

mdekker

2013-01-24 12:28

developer   ~23789

I think in my export (limesurvey_survey_543192.lss) there is info about randomization and it seems to me it is imported correct.
DenisChenu

DenisChenu

2013-01-24 13:50

developer   ~23790

I do some test: with a group by group survey : i have empty group.

I try some patch in 2.1 for group ranbdomization, never find a good way.

But think we didn't need to unset session group list each time.

Can you have a look at this patch:
https://github.com/LimeSurvey/LimeSurvey/commit/cb4487bc44c11ae7c1238c0a04b2f1783340879b

I don't iunset session group list if is already exist, just update if language is different.

Then it don't break actual group order.
DenisChenu

DenisChenu

2013-01-24 13:52

developer   ~23791

I try to do some test again.
mokoe

mokoe

2013-01-24 13:59

reporter   ~23792

for me it doesn't work, neither for your test survey nor for my survey
mdekker

mdekker

2013-01-24 14:52

developer   ~23793

@mokoe Just to make sure: did you use the updated files attached to this bug or your own unaltered installation?
mokoe

mokoe

2013-01-24 15:21

reporter   ~23794

both. for me it is always g1, g2 and then g3.
DenisChenu

DenisChenu

2013-01-24 18:17

developer   ~23795

Menno : Got it \o/

killsurveysession kill $_SESSION['survey_'.$surveyid]

but seems EM use:
$_SESSION['fieldmap-' . $surveyid . $_SESSION['survey_'.$surveyid]['s_lang']]

For the group order.

This $_SESSION['fieldmap-' . $surveyid . $_SESSION['survey_'.$surveyid]['s_lang']]
MUST be :
- put in $_SESSION['survey_'.$surveyid]

But better : removed (think it's the same than:
$_SESSION['survey_'.$surveyid]['fieldnamesInfo'] )

In 2.1 : there are $_SESSION['survey_'.$surveyid]['question'] object.
Then a lot of change to do ....

Maybe for 2.0 we can test with killing
$_SESSION['fieldmap-' . $surveyid . $_SESSION['survey_'.$surveyid]['s_lang']] too

Denis
mdekker

mdekker

2013-01-25 14:25

developer   ~23814

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

mokoe

2013-01-25 18:37

reporter   ~23817

it's now working for me. thank you very much for the support!
DenisChenu

DenisChenu

2013-01-26 10:38

developer   ~23822

Menno : great job here :)
DenisChenu

DenisChenu

2013-01-26 12:04

developer   ~23825

Menno:
Seems i have some:
PHP notice
 Undefined offset: 0
at /application/helpers/SurveyRuntimeHelper.php
$g = $_SESSION[$LEMsessid]['grouplist'][$gseq];

Strangely, i have again some emty group now. Maybe with token (and no randomized group).
DenisChenu

DenisChenu

2013-01-28 08:31

developer   ~23836

Empty group only with debug=2 (or 1 surely), but error not shown in survey. Hard to debug this one :).

Denis
mdekker

mdekker

2013-01-28 11:08

developer   ~23840

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

mdekker

2013-01-28 11:10

developer   ~23841

Think you found the last problem :) Great job! I made sure the grouplist has index groupseq, so a number starting at 0 (the order).

Also found some places where for the elements of grouplist it was looking at [0][1][2] instead of ['gid']['group_name']['description']
DenisChenu

DenisChenu

2013-01-28 11:18

developer   ~23845

It's allways a bad idea to use [0] [1] ...

Seems better now.
mdekker

mdekker

2013-01-28 11:41

developer   ~23846

and now the hard part, find all relevant changes and port them to 2.1 ;)
DenisChenu

DenisChenu

2013-01-31 09:25

developer   ~23907

I review it after.

Think i use usort and function to sort group_list and not unset/reste his.
Same think for question object, surely the question object is harder to port.
DenisChenu

DenisChenu

2013-02-12 15:58

developer   ~24033

Put http://bugs.limesurvey.org/view.php?id=7295
for 2.1/Plugin

Think this one can be closed, but a lot of code to copy/paste ;)

Related Changesets

LimeSurvey: master 0ed8391c

2013-01-24 11:17:27

mdekker

Details Diff
Fixed 07011: It is not possible to randomize the order of groups even when a randomization groupname is set

dev: ended up doing maybe a little more then needed but basically, the duplicate updatesessiongrouplist was removed since it messed up the order and em sometimes looks at the grouplist for ordering. Also the randmaster is saved to the right place so the fieldmap can pick up on it
mod - application/controllers/survey/index.php Diff File
mod - application/helpers/SurveyRuntimeHelper.php Diff File
mod - application/helpers/common_helper.php Diff File
mod - application/helpers/expressions/em_manager_helper.php Diff File
mod - application/helpers/frontend_helper.php Diff File

LimeSurvey: master f45cd6db

2013-01-24 11:20:33

mdekker

Details Diff
Fixed 07011: It is not possible to randomize the order of groups even when a randomization groupname is set

dev: broke survey admin
mod - application/helpers/expressions/em_manager_helper.php Diff File

LimeSurvey: master f0844bac

2013-01-25 13:25:23

mdekker

Details Diff
Fixed 07011: It is not possible to randomize the order of groups even when a randomization groupname is set
mod - application/helpers/SurveyRuntimeHelper.php Diff File
mod - application/helpers/common_helper.php Diff File
mod - application/helpers/expressions/em_manager_helper.php Diff File
mod - application/helpers/frontend_helper.php Diff File

LimeSurvey: master d325df9a

2013-01-28 10:08:01

mdekker

Details Diff
Fixed 07011: It is not possible to randomize the order of groups even when a randomization groupname is set

dev: grouplist needs to have gseq for index, also updated to always use named keys instead of numbers
mod - application/helpers/SurveyRuntimeHelper.php Diff File
mod - application/helpers/expressions/em_manager_helper.php Diff File
mod - application/helpers/frontend_helper.php Diff File

Issue History

Date Modified Username Field Change
2012-12-04 17:27 benjy New Issue
2012-12-04 17:27 benjy File Added: limesurvey_survey_45612.lss
2012-12-05 15:24 mdekker Relationship added related to 07024
2012-12-06 11:22 c_schmitz Assigned To => mdekker
2012-12-06 11:22 c_schmitz Status new => assigned
2012-12-06 11:23 c_schmitz Relationship deleted related to 07024
2012-12-06 11:23 c_schmitz Relationship added has duplicate 07024
2013-01-10 14:03 c_schmitz Relationship added has duplicate 07168
2013-01-10 15:11 mobug Note Added: 23609
2013-01-10 15:18 mobug Note Edited: 23609 View Revisions
2013-01-22 21:05 c_schmitz Relationship added has duplicate 07219
2013-01-22 21:06 c_schmitz Note Added: 23759
2013-01-23 01:28 cberghoff Note Added: 23776
2013-01-23 21:46 mdekker Note Added: 23784
2013-01-24 10:21 c_schmitz Relationship added parent of 07222
2013-01-24 12:17 mdekker Changeset attached => LimeSurvey master 0ed8391c
2013-01-24 12:17 mdekker Note Added: 23786
2013-01-24 12:17 mdekker Resolution open => fixed
2013-01-24 12:20 mdekker Changeset attached => LimeSurvey master f45cd6db
2013-01-24 12:20 mdekker Note Added: 23787
2013-01-24 12:26 mdekker Note Added: 23788
2013-01-24 12:28 mdekker File Added: limesurvey_survey_543192.lss
2013-01-24 12:28 mdekker Note Added: 23789
2013-01-24 13:50 DenisChenu Note Added: 23790
2013-01-24 13:52 DenisChenu Note Added: 23791
2013-01-24 13:59 mokoe Note Added: 23792
2013-01-24 14:52 mdekker Note Added: 23793
2013-01-24 15:21 mokoe Note Added: 23794
2013-01-24 18:17 DenisChenu Note Added: 23795
2013-01-25 14:25 mdekker Changeset attached => LimeSurvey master f0844bac
2013-01-25 14:25 mdekker Note Added: 23814
2013-01-25 18:37 mokoe Note Added: 23817
2013-01-26 10:38 DenisChenu Note Added: 23822
2013-01-26 12:04 DenisChenu Note Added: 23825
2013-01-28 08:31 DenisChenu Note Added: 23836
2013-01-28 11:08 mdekker Changeset attached => LimeSurvey master d325df9a
2013-01-28 11:08 mdekker Note Added: 23840
2013-01-28 11:10 mdekker Note Added: 23841
2013-01-28 11:18 DenisChenu Note Added: 23845
2013-01-28 11:41 mdekker Note Added: 23846
2013-01-31 09:25 DenisChenu Note Added: 23907
2013-02-12 15:57 DenisChenu Relationship added parent of 07295
2013-02-12 15:58 DenisChenu Note Added: 24033
2013-02-23 15:13 c_schmitz Status assigned => closed
2013-02-23 15:14 c_schmitz Fixed in Version => 2.00+