View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
03581Bug reportsSurvey takingpublic2009-08-27 16:43
Reporteruser4594Assigned Toc_schmitz  
PrioritynormalSeverityminor 
Status closedResolutionno change required 
Product Version1.85+ 
Summary03581: Minor Issue On Survey Runtime, With Random Questions Ordering Personalization
Description

Here's how to reproduce the issue:

  1. go to this link: http://www.limesurvey.org/es/support/forums/6-development/26728-selective-randomization-groups-and-questions.html

And apply this code to a fresh 1.85+ ls installation.

  1. Create a survey with 3 Groups of questions:

    1.The First Group has one simple question
    2.The Second Group has 3 "Random Orderer" Questions
    3.The Third Group has one simple question

Only the QUESTIONS are random order, AND only the ones, in the second group.


The focal condition to recreate the issue is setting (in the survey settings page) the option "One Question per-page."

The correct structure of the survey should be this:

1.First Group
1.First Question
2.Second Group
2.Second Question
3.Third Question
4.Fourth Question
These three questions should comes out in a randomized order (ex. 4-2-3, 3-2-4, etc...)

3.Third Group
5.Fifth Question


But by setting, (AND ONLY by setting) the "One Question per-page." option,
the survey appair with the SECOND GROUP at first place instead of the FIRST, and the last to follow.

No issue with the questions.
Jus the Group order changes, putting the one with randomized questions always at the first place.

TagsNo tags attached.
Attached Files
limesurvey_survey_43138.csv (4,155 bytes)   
# LimeSurvey Survey Dump
# DBVersion 138
# This is a dumped survey from the LimeSurvey Script
# http://www.limesurvey.org/
# Do not change this header!

#
# SURVEYS TABLE
#
"sid","owner_id","admin","active","expires","startdate","adminemail","private","faxto","format","template","language","additional_languages","datestamp","usecookie","notification","allowregister","allowsave","autonumber_start","autoredirect","allowprev","printanswers","ipaddr","refurl","datecreated","publicstatistics","publicgraphs","listpublic","htmlemail","tokenanswerspersistence","assessments","usecaptcha","usetokens","bounce_email","attributedescriptions","grouprand"
"43138","1","Your Name","Y","","","your@email.org","Y","","S","limespired","it","","N","N","0","N","Y","0","N","N","N","N","N","2009-08-18","N","N","N","Y","N","N","D","Y","your@email.org","","0"

#
# GROUPS TABLE
#
"gid","sid","group_name","group_order","description","language","randquestions"
"1","43138","Gruppo 1","0","1","it","0"
"2","43138","Gruppo 2 ","1","2","it","1"
"3","43138","Gruppo Finale","2","Fine","it","0"

#
# QUESTIONS TABLE
#
"qid","sid","gid","type","title","question","preg","help","other","mandatory","lid","lid1","question_order","language"
"1","43138","1","T","1","Domanda 1??","","1??","N","Y","0","0","0","it"
"2","43138","2","T","2","Domanda 2??","","2","N","Y","0","0","0","it"
"3","43138","2","T","3","Domanda 3??","","3","N","Y","0","0","1","it"
"4","43138","2","T","4","Domanda 4??","","4","N","Y","0","0","2","it"
"5","43138","3","T","5","Domanda 5?? FIne!","","fine","N","Y","0","0","0","it"

#
# ANSWERS TABLE
#

#
# CONDITIONS TABLE
#

#
# LABELSETS TABLE
#

#
# LABELS TABLE
#

#
# QUESTION_ATTRIBUTES TABLE
#

#
# ASSESSMENTS TABLE
#

#
# SURVEYS_LANGUAGESETTINGS TABLE
#
"surveyls_survey_id","surveyls_language","surveyls_title","surveyls_description","surveyls_welcometext","surveyls_endtext","surveyls_url","surveyls_urldescription","surveyls_email_invite_subj","surveyls_email_invite","surveyls_email_remind_subj","surveyls_email_remind","surveyls_email_register_subj","surveyls_email_register","surveyls_email_confirm_subj","surveyls_email_confirm","surveyls_dateformat"
"43138","it","Indagine di prova","prova","Salve!","Arrivederci","","","Invito a partecipare ad una indagine on line","Caro {FIRSTNAME},\n\nsei invitato a partecipare ad una indagine on line.\n\nL'indagine è intitolata:\n""{SURVEYNAME}""\n\n""{SURVEYDESCRIPTION}""\n\nPer partecipare fai clic sul link qui sotto e rispondi alle domande del questionario.\n\nCordiali saluti,{ADMINNAME} ({ADMINEMAIL})\n\n----------------------------------------------\nFai clic qui per accedere al questionario:\n{SURVEYURL}","Sollecito a partecipare all'indagine on line","Caro {FIRSTNAME},n\nRecentemente ti abbiamo invitato  a partecipare ad una indagine on line.\n\nAbbiamo notato che non hai ancora completato il questionario. Con l'occasione ti ricordiamo che il questionario è ancora disponibile.\n\nL'indagine è intitolata:\n""{SURVEYNAME}""\n\n""{SURVEYDESCRIPTION}""\n\nPer partecipare fai clic sul link qui sotto.\n\nCordiali saluti,\n\n{ADMINNAME} ({ADMINEMAIL})\n\n----------------------------------------------\nFai clic qui per accedere all'indagine:\n{SURVEYURL}","Conferma registrazione all'indagine on line","Caro {FIRSTNAME},\n\nTi sei registrato (o qualcuno che ha utilizzato il tuo indirizzo e-mail) per partecipare all'indagine on line intitolata {SURVEYNAME}.\n\nPer completare il questionario fai clic sul seguente indirizzo:\n\n{SURVEYURL}\n\nSe hai qualche domanda, o se non ti sei registrato e ritieni che questa e-mail ti sia pervenuta per errore, ti preghiamo di contattare  {ADMINNAME} all'indirizzo {ADMINEMAIL}.","Conferma del completamento dell'indagine on line","Caro {FIRSTNAME},\n\nQuesta e-mail ti è stata inviata per confermarti che hai completato corretamente il questionario initolato {SURVEYNAME}  e che le tue risposte sono state salvate. Grazie per la partecipazione.\n\nSe hai ulteriori domande circa questo messaggio, contatta {ADMINNAME} all'indirizzo e-mail {ADMINEMAIL}.\n\nCordiali saluti\n\n{ADMINNAME}","1"

#
# QUOTA TABLE
#

#
# QUOTA_MEMBERS TABLE
#

limesurvey_survey_43138.csv (4,155 bytes)   
Bug heat8
Complete LimeSurvey version number (& build)
I will donate to the project if issue is resolved
BrowserIE7 - IE8 - Firefox - Safari
Database type & versionMySQL (latest XAMPP Package)
Server OS (if known)WindowsXP SP3
Webserver software & version (if known)Apache/2.2.11 (Win32) (latest XAMPP Package)
PHP VersionPHP/5.2.9 Server (latest XAMPP Package)

Users monitoring this issue

stryker

Activities

user372

2009-08-25 08:06

  ~09205

Last edited: 2009-08-25 08:10

@ c_schmitz: I can't import the attached survey structure, because I get the following error:

Import dieser Umfrage-Datei fehlgeschlagen.
[INSERT INTO lime_surveys (sid,owner_id,admin,active,adminemail,private,faxto,format,template,language,additional_languages,datestamp,usecookie,notification,allowregister,allowsave,autonumber_start,autoredirect,allowprev,printanswers,ipaddr,refurl,datecreated,publicstatistics,publicgraphs,listpublic,htmlemail,tokenanswerspersistence,assessments,usecaptcha,usetokens,bounce_email,attributedescriptions,grouprand) VALUES ('43138','1','Your Name','N','your@email.org','Y','','S','limespired','it','','N','N','0','N','Y','0','N','N','N','N','N','2009-08-18','N','N','N','Y','N','N','D','Y','your@email.org','','0')]
"sid","owner_id","admin","active","expires","startdate","adminemail","private","faxto","format","template","language","additional_languages","datestamp","usecookie","notification","allowregister","allowsave","autonumber_start","autoredirect","allowprev","printanswers","ipaddr","refurl","datecreated","publicstatistics","publicgraphs","listpublic","htmlemail","tokenanswerspersistence","assessments","usecaptcha","usetokens","bounce_email","attributedescriptions","grouprand"

Unbekanntes Tabellenfeld 'grouprand' in field list

EDIT: I just noticed that this survey is based on an unsupported workaround by a LimeSurvey user called "stryker" ==> sorry, we don't give any (free) support for workarounds! ==> I can only suggest to contact "stryker" to update his workaround to the latest stable version!

user372

2009-08-25 08:28

  ~09206

Reminder sent to: stryker

Please have a look at your workaround and this ticket - Thx!

stryker

stryker

2009-08-25 21:12

reporter   ~09216

Hi,
I was able to reproduce your issue, and managed to fix it by changing the RandomizeGroupList function in the index.php file.

I changed it so that it does not use the built in PHP shuffle function to randomize groups.

Here is the fix.

function RandomizeGroupList($language='')
{
if( isset($_SESSION['grouplist']) )
{
$grpCount = count($_SESSION['grouplist']);
$i = 0;
$newList = array();
$grouplist = $_SESSION['grouplist'];

    while( $i !== $grpCount )
    {
        $grp_i = rand(0, ($grpCount - 1));

        if( !in_array($grouplist[$grp_i], $newList) )
        {

            $newList[] = $grouplist[$grp_i];
            $i++;
        }
    }
    $_SESSION['grouplist'] = $newList;
}

}

@ ElMatador69: You will get that error because you did not update your DB to facilitate the randomization of groups and questions. I added fields in the groups and surveys tables to allow for randomization.

c_schmitz

c_schmitz

2009-08-27 16:42

administrator   ~09238

Please refer to #3106

Issue History

Date Modified Username Field Change
2009-08-18 13:24 user4594 New Issue
2009-08-18 13:24 user4594 Status new => assigned
2009-08-18 13:24 user4594 Assigned To => user372
2009-08-18 13:24 user4594 File Added: limesurvey_survey_43138.csv
2009-08-18 13:24 user4594 Browser => IE7 - IE8 - Firefox - Safari
2009-08-18 13:24 user4594 Database & DB-Version => MySQL (latest XAMPP Package)
2009-08-18 13:24 user4594 Operating System (Server) => WindowsXP SP3
2009-08-18 13:24 user4594 Webserver => Apache/2.2.11 (Win32) (latest XAMPP Package)
2009-08-18 13:24 user4594 PHP Version => PHP/5.2.9 Server (latest XAMPP Package)
2009-08-25 08:06 user372 Note Added: 09205
2009-08-25 08:10 user372 Note Edited: 09205
2009-08-25 08:11 user372 Assigned To user372 => c_schmitz
2009-08-25 08:28 user372 Issue Monitored: stryker
2009-08-25 08:28 user372 Note Added: 09206
2009-08-25 21:12 stryker Note Added: 09216
2009-08-27 16:42 c_schmitz Note Added: 09238
2009-08-27 16:42 c_schmitz Status assigned => resolved
2009-08-27 16:42 c_schmitz Resolution open => no change required
2009-08-27 16:43 c_schmitz Status resolved => closed
2010-10-25 00:18 c_schmitz Category Survey at Runtime => Survey taking
2021-08-31 17:33 guest Bug heat 6 => 8