View Issue Details

IDProjectCategoryView StatusLast Update
06451Bug reports[All Projects] Survey designpublic2012-08-16 10:23
Reporterabita1Assigned ToTMSWhite 
Status closedResolutionfixed 
Product Version2.00RC8 
Target Version2.00RC9Fixed in Version2.00RC9 
Summary06451: Missing array filter edit boxes in Ranking Question
DescriptionSee Issues: 6325[open] 6238[closed]

There was a code change in 6238 which added the "R" to array QAttributes, in a few places in the common_helper.php -- which made it to the Yii branch with other changes.

That change is now gone, and RC8 doesn't allow for array filtering for ranking questions. See 6325. I assume, only, that ranking questions are intended to be array filtered in the LS UI.

See 200RC8: common_helper.php @ lines 3220, 3228 and 3236

I broke this one notation on 6325 out to this new issue, for if ranking can be array filtered, the "R"s could be re-added back, simply. I haven't checked to see if any other changes coded with 6238 are relevant.
TagsNo tags attached.
Complete LimeSurvey version number (& build)120803
I will donate to the project if issue is resolvedNo
BrowserFireFox 14
Database & DB-VersionMySQL
Operating System (Server)Win
Webserver software & versionXAMPP
PHP Version5.4?




2012-08-08 16:18

administrator   ~20285

The array filtering for ranking questions in 1.92 was removed again, because there was no reliable cross-browser way to hide option entries in a list box.

However 2.0 uses a different approach to display items so it might work here.
Thomas, can you please have a look if this works with 2.0 if you reapply your patch?


2012-08-09 06:26

reporter   ~20297

I tried array filter for ranking in 2.0 using Chrome, IE, and Firefox. It didn't work for any of them. I did not try to look at how Ranking is implemented in 2.0, just whether the relevance equations would properly control them with the simple fix.


2012-08-09 15:59

reporter   ~20314

Someone who understands the JavaScript doDragDropRank() functions needs to take a look at this.

Uncommenting "case 'R':" in em_manager_helper.php will guarantee that EM generates the correct sub-question relevance equations. From there, someone else needs to figure out how to modify doDragDropRank() to get the visual behavior (having the option become invisible, regardless of whether it is in the selected or unselected lists.

Here is the code fragment from em_manager_helper.php that would need to be uncommented:

case 'P': //Multiple choice with comments checkbox + text
// case 'R': //Ranking
// if ($this->sgqaNaming)
// {
        foreach ($cascadedAF as $_caf)
            $sgq = ((isset($this->qcode2sgq[$_caf])) ? $this->qcode2sgq[$_caf] : $_caf);
            $fqid = explode('X',$sgq);


2012-08-09 18:00

developer   ~20318

Hello Tom,

I rename "li" id for doDragDropRank.

I have to work on EM for this.

I can take it, but when i look the first time, there are some work.

I don't know if i rename doDragDropRank/li for em, or if i adapt em for doDragDropRank/li name.

Another think:
hidden : display: none : it's OK
deactivated : Use : not default EM disable.



2012-08-09 19:30

reporter   ~20320

Can either of the two of you point me towards the JS code which flops display:none to display:list-item for, say, multiple choice answers....

I see where qanda_helper.php creates the html code, but don't understand where the ID/Class is picked up for array swapping, during survey execution



2012-08-09 20:53

reporter   ~20322

Last edited: 2012-08-09 20:58

View 2 revisions


I took a stab at fixing doDragDropRank, but didn't quite get it to work (and don't have any more time this week).

Here's what I think needs to be done:
(1) Make the IDs for ranking questions unique. Currently, they are 'choice_sq1', 'choice_sq2', etc. (assuming the sub-questions are sq1, sq2, etc. So, if you have ore than one ranking on the same page, the only way to access the right sub-question is via a compound jQuery selector (that selects the right question then the right sub-question). No other feature works that way, so I'd give the unique SGQA code names
(2) If you want to avoid having to change EM at all, name them 'javatbdSGQsq' where SGQ is the normal prefix (e.g. 111X22X33), and sq is the sub-question code (e.g. 'javatbd111X22X33sq4'). That is how all of the rest of the selectors are named.

I tried this. The drag and drop worked fine, but it didn't save its value or trigger any changed filtering (probably because it expects the current 'choice_sq' naming).

If you can safely change those li names, EM should make it work just fine (if you use .hide() - you may need to detect Ranking questions and use the sortable/#method-disable if authors want to disable rather than hide the option)



2012-08-13 19:07

developer   ~20395

Done for id of the choice and rank list element.

Did you take EM ?


2012-08-14 00:44

reporter   ~20399

This doesn't quite work. One can use a ranking question to array_filter other questions; but ranking questions themselves are not array filtered.

Here is a sample survey letting you test the behavior.


2012-08-14 00:45


limesurvey_survey_472317.lss (469,090 bytes)


2012-08-14 01:42

developer   ~20405

Like i said : i put the same id than em used, not working on EM actually.

I ask if you want to work on EM or not.


2012-08-14 06:09

reporter   ~20408

Fix committed to Yii branch:


2012-08-14 10:06

developer   ~20416

Oups, sorry for javatb*d*SGQsq


2012-08-16 10:23

administrator   ~20460

Version 2.00 RC 9 released.

Related Changesets

LimeSurvey: Yii 3dfb41f4

2012-08-13 21:07:32


Details Diff
Fixed issue 06451: Missing array filter edit boxes in Ranking Question
Dev confirmed works with IE, Chrome, and Mozilla
mod - application/helpers/common_helper.php Diff File
mod - application/helpers/expressions/em_manager_helper.php Diff File
mod - application/helpers/qanda_helper.php Diff File

Issue History

Date Modified Username Field Change
2012-08-08 16:01 abita1 New Issue
2012-08-08 16:16 c_schmitz Assigned To => TMSWhite
2012-08-08 16:16 c_schmitz Status new => assigned
2012-08-08 16:18 c_schmitz Note Added: 20285
2012-08-09 06:26 TMSWhite Note Added: 20297
2012-08-09 15:59 TMSWhite Note Added: 20314
2012-08-09 15:59 TMSWhite Assigned To TMSWhite =>
2012-08-09 15:59 TMSWhite Status assigned => new
2012-08-09 18:00 DenisChenu Note Added: 20318
2012-08-09 18:02 c_schmitz Assigned To => DenisChenu
2012-08-09 18:02 c_schmitz Status new => assigned
2012-08-09 19:30 abita1 Note Added: 20320
2012-08-09 20:53 TMSWhite Note Added: 20322
2012-08-09 20:58 TMSWhite Note Edited: 20322 View Revisions
2012-08-13 19:07 DenisChenu Note Added: 20395
2012-08-13 19:07 DenisChenu Assigned To DenisChenu => TMSWhite
2012-08-13 19:07 DenisChenu Status assigned => feedback
2012-08-14 00:44 TMSWhite Note Added: 20399
2012-08-14 00:45 TMSWhite File Added: limesurvey_survey_472317.lss
2012-08-14 01:42 DenisChenu Note Added: 20405
2012-08-14 06:09 TMSWhite Changeset attached => LimeSurvey Yii 3dfb41f4
2012-08-14 06:09 TMSWhite Note Added: 20408
2012-08-14 06:09 TMSWhite Resolution open => fixed
2012-08-14 06:09 TMSWhite Status feedback => resolved
2012-08-14 06:09 TMSWhite Fixed in Version => 2.00RC9
2012-08-14 10:06 DenisChenu Note Added: 20416
2012-08-15 00:22 c_schmitz Target Version => 2.00RC9
2012-08-16 10:23 c_schmitz Note Added: 20460
2012-08-16 10:23 c_schmitz Status resolved => closed