LimeSurvey issue tracker
Registration

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
06451Bug reports[All Projects] Survey designpublic2012-08-08 16:012012-08-16 10:23
Reporterabita1 
Assigned ToTMSWhite 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
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.
I will donate to the project if issue is resolved within 48 hrsNo
LimeSurvey build number OR git commit ID120803
BrowserFireFox 14
Database & DB-VersionMySQL
Operating System (Server)Win
Webserver software & versionXAMPP
PHP Version5.4?
Attached Files? file icon limesurvey_survey_472317.lss [^] (469,090 bytes) 2012-08-14 00:45

- Relationships

-  Notes
User avatar (20285)
c_schmitz (administrator)
2012-08-08 16:18

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?
User avatar (20297)
TMSWhite (reporter)
2012-08-09 06:26

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.
User avatar (20314)
TMSWhite (reporter)
2012-08-09 15:59

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 'K': //MULTIPLE NUMERICAL QUESTION
case 'Q': //MULTIPLE SHORT TEXT
// case 'R': //Ranking
// if ($this->sgqaNaming)
// {
        foreach ($cascadedAF as $_caf)
        {
            $sgq = ((isset($this->qcode2sgq[$_caf])) ? $this->qcode2sgq[$_caf] : $_caf);
            $fqid = explode('X',$sgq);
User avatar (20318)
DenisChenu (developer)
2012-08-09 18:00

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 : http://jqueryui.com/demos/sortable/#method-disable [^] not default EM disable.

:)
User avatar (20320)
abita1 (reporter)
2012-08-09 19:30

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

thanks...
User avatar (20322)
TMSWhite (reporter)
2012-08-09 20:53
edited on: 2012-08-09 20:58

Denis-

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)

User avatar (20395)
DenisChenu (developer)
2012-08-13 19:07

Done for id of the choice and rank list element.
https://github.com/LimeSurvey/LimeSurvey/commit/231e2a161d44a5ab0a2a3cb5068aeecacbfed4a7 [^]

Did you take EM ?
User avatar (20399)
TMSWhite (reporter)
2012-08-14 00:44

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.
User avatar (20405)
DenisChenu (developer)
2012-08-14 01:42

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.
User avatar (20408)
TMSWhite (reporter)
2012-08-14 06:09

Fix committed to Yii branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=9350 [^]
User avatar (20416)
DenisChenu (developer)
2012-08-14 10:06

Oups, sorry for javatb*d*SGQsq
User avatar (20460)
c_schmitz (administrator)
2012-08-16 10:23

Version 2.00 RC 9 released.

- Related Changesets
LimeSurvey: Yii 3dfb41f4
Timestamp: 2012-08-13 21:07:32
Author: TMSWhite
Committer: Thomas White
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


Copyright © 2000 - 2014 MantisBT Team
Powered by Mantis Bugtracker