LimeSurvey issue tracker
Registration

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
07011Bug reports[All Projects] Survey designpublic2012-12-04 17:272013-02-23 15:14
Reporterbenjy 
Assigned Tomdekker 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
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.
I will donate to the project if issue is resolved within 48 hrsNo
LimeSurvey build number OR git commit ID121127
Browser
Database & DB-VersionMySQL 5.1.66
Operating System (Server)Linux
Webserver software & versionApache 2.2.15
PHP Version5.3.3
Attached Files? file icon limesurvey_survey_45612.lss [^] (721,539 bytes) 2012-12-04 17:27
? file icon limesurvey_survey_543192.lss [^] (13,655 bytes) 2013-01-24 12:28

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

-  Notes
User avatar (23609)
mobug (reporter)
2013-01-10 15:11
edited on: 2013-01-10 15:18

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

User avatar (23759)
c_schmitz (administrator)
2013-01-22 21:06

Menno, can you take a look at this one as soon as possible, please?
User avatar (23776)
cberghoff (reporter)
2013-01-23 01:28

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!
User avatar (23784)
mdekker (developer)
2013-01-23 21:46

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
User avatar (23786)
mdekker (developer)
2013-01-24 12:17

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=11372 [^]
User avatar (23787)
mdekker (developer)
2013-01-24 12:20

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=11373 [^]
User avatar (23788)
mdekker (developer)
2013-01-24 12:26

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.
User avatar (23789)
mdekker (developer)
2013-01-24 12:28

I think in my export (limesurvey_survey_543192.lss) there is info about randomization and it seems to me it is imported correct.
User avatar (23790)
DenisChenu (developer)
2013-01-24 13:50

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.
User avatar (23791)
DenisChenu (developer)
2013-01-24 13:52

I try to do some test again.
User avatar (23792)
mokoe (reporter)
2013-01-24 13:59

for me it doesn't work, neither for your test survey nor for my survey
User avatar (23793)
mdekker (developer)
2013-01-24 14:52

@mokoe Just to make sure: did you use the updated files attached to this bug or your own unaltered installation?
User avatar (23794)
mokoe (reporter)
2013-01-24 15:21

both. for me it is always g1, g2 and then g3.
User avatar (23795)
DenisChenu (developer)
2013-01-24 18:17

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
User avatar (23814)
mdekker (developer)
2013-01-25 14:25

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=11387 [^]
User avatar (23817)
mokoe (reporter)
2013-01-25 18:37

it's now working for me. thank you very much for the support!
User avatar (23822)
DenisChenu (developer)
2013-01-26 10:38

Menno : great job here :)
User avatar (23825)
DenisChenu (developer)
2013-01-26 12:04

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).
User avatar (23836)
DenisChenu (developer)
2013-01-28 08:31

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

Denis
User avatar (23840)
mdekker (developer)
2013-01-28 11:08

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=11409 [^]
User avatar (23841)
mdekker (developer)
2013-01-28 11:10

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']
User avatar (23845)
DenisChenu (developer)
2013-01-28 11:18

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

Seems better now.
User avatar (23846)
mdekker (developer)
2013-01-28 11:41

and now the hard part, find all relevant changes and port them to 2.1 ;)
User avatar (23907)
DenisChenu (developer)
2013-01-31 09:25

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.
User avatar (24033)
DenisChenu (developer)
2013-02-12 15:58

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
Timestamp: 2013-01-24 11:17:27
Author: mdekker
Committer: Menno Dekker
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
Timestamp: 2013-01-24 11:20:33
Author: mdekker
Committer: Menno Dekker
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
Timestamp: 2013-01-25 13:25:23
Author: mdekker
Committer: Menno Dekker
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
Timestamp: 2013-01-28 10:08:01
Author: mdekker
Committer: Menno Dekker
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
2012-12-11 16:33 benjy Note Added: 23145
2012-12-11 16:34 benjy Note Edited: 23145 View Revisions
2012-12-11 16:35 benjy Note Edited: 23145 View Revisions
2012-12-11 16:36 benjy Note Edited: 23145 View Revisions
2012-12-11 17:43 benjy Note Deleted: 23145
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+


Copyright © 2000 - 2014 MantisBT Team
Powered by Mantis Bugtracker