- Posts: 54
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Slow input for survey users due to array filter
- Liod_DS
- Topic Author
- Offline
- Senior Member
Less
More
7 years 6 months ago #143052
by Liod_DS
keep improving
Slow input for survey users due to array filter was created by Liod_DS
Hi all,
i have a real urgent question, already posted some times ago in this thread:
www.limesurvey.org/community-services/fo...lter?start=15#143034
When i filter an array question (10 answer - 28 subquestion - filter on max 9 elements) with an hidden multi, the user have to wait 2 - 6 second for the red dot to appear...
i don't understand why, when i have already displayed correctly the grid, it takes so long to click the radio... it's like a normal array at this point..
it seems LS do a lot of JS on the click-like events, but the display is already filtred and correct ... i'm ok with a little high pageload due to filter... but it's really impossibile to go live with this delay in the navigation...
Any idead to how we can reduce this time and make the survey-taking possible ?
(sorry for the "double post", even if that one was for a slightly different problem)
i have a real urgent question, already posted some times ago in this thread:
www.limesurvey.org/community-services/fo...lter?start=15#143034
When i filter an array question (10 answer - 28 subquestion - filter on max 9 elements) with an hidden multi, the user have to wait 2 - 6 second for the red dot to appear...
i don't understand why, when i have already displayed correctly the grid, it takes so long to click the radio... it's like a normal array at this point..
it seems LS do a lot of JS on the click-like events, but the display is already filtred and correct ... i'm ok with a little high pageload due to filter... but it's really impossibile to go live with this delay in the navigation...
Any idead to how we can reduce this time and make the survey-taking possible ?
(sorry for the "double post", even if that one was for a slightly different problem)
keep improving
The topic has been locked.
- LouisGac
- Visitor
7 years 6 months ago #143055
by LouisGac
Replied by LouisGac on topic Slow input for survey users due to array filter
It's a very old bug. I've already fixed 50% of it:
bugs.limesurvey.org/view.php?id=08308
github.com/LimeSurvey/LimeSurvey/commit/...12a9f446981b51b7374e
but I have to finish other things first, so I just reverted it... As soon as I come back to LS development, I'll fix it for good. It will be probably released with next major version.
For now, the only way for you to avoid this behavior is to limit the number of questions shown in a single page.
bugs.limesurvey.org/view.php?id=08308
github.com/LimeSurvey/LimeSurvey/commit/...12a9f446981b51b7374e
but I have to finish other things first, so I just reverted it... As soon as I come back to LS development, I'll fix it for good. It will be probably released with next major version.
For now, the only way for you to avoid this behavior is to limit the number of questions shown in a single page.
The topic has been locked.
- Liod_DS
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 54
- Thank you received: 1
7 years 6 months ago #143057
by Liod_DS
keep improving
Replied by Liod_DS on topic Slow input for survey users due to array filter
but it's only "one" question in that page.... just that array :!
keep improving
The topic has been locked.
- LouisGac
- Visitor
7 years 6 months ago #143058
by LouisGac
Replied by LouisGac on topic Slow input for survey users due to array filter
how many rows?
The topic has been locked.
- Liod_DS
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 54
- Thank you received: 1
7 years 6 months ago #143059
by Liod_DS
keep improving
Replied by Liod_DS on topic Slow input for survey users due to array filter
(simple array - 10 response - 27 subquestion - filtred to max 9)
keep improving
The topic has been locked.
- Liod_DS
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 54
- Thank you received: 1
- LouisGac
- Visitor
7 years 6 months ago #143062
by LouisGac
Replied by LouisGac on topic Slow input for survey users due to array filter
Well, it's like 27 questions: if you reduce the screen to the size of a smartphone, you'll see it's visually like 27 questions the one after the others (In a world where small smartphone screens run the world, arrays question type are a little bit outdated... they are broken with no-more-table methodology)
So, for now, to resolve this problem, you should try to redo it with a different logic: for example, 27 individual questions, shown one after the other, with conditions.
So, for now, to resolve this problem, you should try to redo it with a different logic: for example, 27 individual questions, shown one after the other, with conditions.
The topic has been locked.
- Liod_DS
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 54
- Thank you received: 1
7 years 6 months ago #143066
by Liod_DS
keep improving
Replied by Liod_DS on topic Slow input for survey users due to array filter
Yes i already thinked of that... But I have 6 of this questions during the que... 27*6 ... If they're gonna ask me some varitions it's huge.. maybe i can filter the grid manually with some js?
keep improving
The topic has been locked.
- Liod_DS
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 54
- Thank you received: 1
7 years 6 months ago #143077
by Liod_DS
keep improving
Replied by Liod_DS on topic Slow input for survey users due to array filter
No way... i waste 2 day on this prj ... and i have to disappoint my team with a failure ...
I can't insert all the question as singles ( see attachment) ... they are too much for LS...
I can't insert all the question as singles ( see attachment) ... they are too much for LS...
keep improving
Attachments:
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3593
7 years 6 months ago #143085
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 Slow input for survey users due to array filter
Yes, you could probably do that but, since the array is mandatory, you would probably have to add an "N/A" column that would be clicked if a row is hidden;maybe i can filter the grid manually with some js?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3593
7 years 6 months ago - 7 years 6 months ago #143086
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 Slow input for survey users due to array filter
I had a little time and came up with this JavaScript solution (using the sample survey from your other thread) which drastically improves the page-load and control element reaction times.
1) Add an "N/A" answer option to the filtered array (to be hidden with JS).
2) Remove the LimeSurvey filter from the filtered array.
3) Move the hidden multiple-choice and the "maskSetter" questions to the same group as the filtered array - directly preceding it.
4)Add the following script to the source of the filtered array (I think the comments explain what's going on):
Modified sample survey attached:
1) Add an "N/A" answer option to the filtered array (to be hidden with JS).
2) Remove the LimeSurvey filter from the filtered array.
3) Move the hidden multiple-choice and the "maskSetter" questions to the same group as the filtered array - directly preceding it.
4)Add the following script to the source of the filtered array (I think the comments explain what's going on):
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ // Identify the questions var thisQuestion = $('#question{QID}'); var hiddenQuestion = $(thisQuestion).prevAll('.multiple-opt:eq(0)'); var thisQID = $(thisQuestion).attr('id').replace(/question/, ''); var hiddenQID = $(hiddenQuestion).attr('id').replace(/question/, ''); // Hide the filtering question hiddenQuestion.hide(); // Remove extra array headers $('table.subquestion-list tbody:first', thisQuestion).append($('tr.answers-list', thisQuestion)); $('table.subquestion-list tbody:gt(0)', thisQuestion).remove(); // Loop through all answer rows and assign fake "relevance" $('tr.answers-list', thisQuestion).each(function(i) { var thisCode = $(this).attr('id').split('X'+thisQID)[1]; var hiddenValue = $('input.checkbox[id$="X'+hiddenQID+thisCode+'"]', hiddenQuestion).prop('checked'); $(this).attr('data-relevance', hiddenValue); }); // Hide the "N/A" column $('table.subquestion-list tr > *:last-child, col:last', thisQuestion).addClass('na').hide(); var answersWidth = (($('table.subquestion-list', thisQuestion).width()-$('th.answertext:first', thisQuestion).width())/$('table.subquestion-list', thisQuestion).width())*100; var answersCount = $('tr.answers-list:first td.answer-item:not(.na)', thisQuestion).length; var answerColWidth = answersWidth/answersCount; $('col:not(.col-answers):not(.na)', thisQuestion).css('width', answerColWidth+'%'); $('col.na', thisQuestion).css('width', '0%'); // Click "N/A" in all "non-relevant" rows $('tr.answers-list td.na input.radio', thisQuestion).prop('checked', false); $('tr.answers-list[data-relevance="false"] td.na input.radio', thisQuestion).trigger('click'); // Hide all "non-relevant" rows $('tr.answers-list[data-relevance="false"]', thisQuestion).hide(); }); </script>
Modified 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: 7 years 6 months ago by tpartner.
The following user(s) said Thank You: LouisGac, Liod_DS
The topic has been locked.
- Liod_DS
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 54
- Thank you received: 1
6 years 4 months ago #161336
by Liod_DS
keep improving
Replied by Liod_DS on topic Slow input for survey users due to array filter
Today this script come out of nowhere and save my day, i don't know why the built in solution is soo slow (8+ sec on each click) but the one you provide is really fast and reliable.
Thanks a lot.
Thanks a lot.
keep improving
The topic has been locked.