Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Ranking with filter -- too much space on the list

  • elissa
  • elissa's Avatar Topic Author
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 6 months ago - 6 years 6 months ago #159977 by elissa
Hello,
I have two steps ranking task:
1. Multiple response question but the items are pictures -- choose 3 out of 7 pictures.
2. Ranking question -- rank the 3 pictures (filtered based on the question 1).

The problem is that the ranking question has too much space below 3 pictures -- probably enough for the 7 original options. Can the question window adjust to the lenght of the filtered options?

Latest version of LS (2.72.3+171020), default template.


Thanks and regards

Elzbieta Lesinska
LS voluntary Polish translator and supervisor
Last edit: 6 years 6 months ago by elissa. Reason: Clearing too many pictures
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 6 months ago - 6 years 6 months ago #159986 by tpartner
Hi Elissa,

The problem is that the irrelevant items are hidden via JavaScript after the jQuery UI Sortable plugin is rendered. (or there is a bug)

Try something like this in the question source:

Code:
<script type="text/javascript" charset="utf-8"> 
  $(document).ready(function() {
 
    // Identify the questions
    var thisQuestion = $('#question{QID}');
 
    // Dynamically adjust list heights
    var listHeight = 0;
    $('li.choice:visible', thisQuestion).each(function(i) {
      listHeight = listHeight + $(this).outerHeight();
    });
 
    setTimeout(function() {
      $('.dragDropTable ul, .dragDropTable ol', thisQuestion).css('min-height', listHeight+50+'px');
    }, 250);
  });
</script>

Sample survey attached:

File Attachment:

File Name: limesurvey...4876.lss
File Size:22 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 6 years 6 months ago by tpartner.
The following user(s) said Thank You: elissa
The topic has been locked.
  • elissa
  • elissa's Avatar Topic Author
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 6 months ago #159996 by elissa
Hi Tony,

It works perfectly. Thanks you very much.
Cheers,

Elzbieta Lesinska
LS voluntary Polish translator and supervisor
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 5 months ago #160086 by DenisChenu
Replied by DenisChenu on topic Ranking with filter -- too much space on the list

tpartner wrote: Hi Elissa,

The problem is that the irrelevant items are hidden via JavaScript after the jQuery UI Sortable plugin is rendered. (or there is a bug)

Not exactly a bug if i remind ?
I just create the manual part about this. manual.limesurvey.org/Question_type_-_Ra....28samelistheight.29

In fact : Same_list_height must use all existing choice, because even if it's array filtered : we don't have the information if this choice are hidden by a question in same page or not …
If expression manager can give this information on the element we can improve the solution.

I think Expression manager (and quanda) must be fixed to adding the html element ONLY if it can be shown in this page :).
1. Test if element is hidden
2. If yes : test if expression can be updated in same page
3. If not : don't add html element, if yes add it with hidden tag.

In 3.0 we use only class : github.com/LimeSurvey/LimeSurvey/blob/de...anda_helper.php#L667
Then maybe we need another function to know if we must add element or not in HTML

Lot of work ;)

Maybe another solution is to update Same_list_height to have 3 option : none / only element at start page / all element ?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 5 months ago #160097 by tpartner
Yes, my solution is only useful if the filtering question is o a previous page.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose