- Posts: 193
- Thank you received: 69
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
- Topic Author
- Offline
- LimeSurvey Community Team
Less
More
6 years 6 months ago - 6 years 6 months ago #159977
by elissa
Elzbieta Lesinska
LS voluntary Polish translator and supervisor
Ranking with filter -- too much space on the list was created 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
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
Attachments:
Last edit: 6 years 6 months ago by elissa. Reason: Clearing too many pictures
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
6 years 6 months ago - 6 years 6 months ago #159986
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Ranking with filter -- too much space on the list
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:
Sample survey attached:
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:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
Last edit: 6 years 6 months ago by tpartner.
The following user(s) said Thank You: elissa
The topic has been locked.
- elissa
- Topic Author
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 193
- Thank you received: 69
6 years 6 months ago #159996
by elissa
Elzbieta Lesinska
LS voluntary Polish translator and supervisor
Replied by elissa on topic Ranking with filter -- too much space on the list
Hi Tony,
It works perfectly. Thanks you very much.
Cheers,
It works perfectly. Thanks you very much.
Cheers,
Elzbieta Lesinska
LS voluntary Polish translator and supervisor
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
6 years 5 months ago #160086
by DenisChenu
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.
Replied by DenisChenu on topic Ranking with filter -- too much space on the list
Not exactly a bug if i remind ?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)
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
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
6 years 5 months ago #160097
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Ranking with filter -- too much space on the list
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.