- Posts: 136
- Thank you received: 4
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Partially Randomized Answers - Array questions
- surveySn
- Topic Author
- Offline
- Premium Member
Less
More
3 years 4 months ago #208765
by surveySn
Partially Randomized Answers - Array questions was created by surveySn
Version 3.22.11 + 200330
I use this:
But there is a problem
Each loop title has a fixed answer.
I use this:
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // The subquestion code to place in the last position var fixedCode = 'A1'; // Identify this question var q1ID = {QID}; var thisQuestion = $('#question'+q1ID); // Move the "fixed" row to the end $('table.subquestion-list tbody', thisQuestion).append($('tr[id$="X'+q1ID+fixedCode+'"]')); // Fix up the array row background colours $('tr.answers-list', thisQuestion).each(function(i){ $(this).removeClass('array1 array2').addClass('array'+(2-(i%2))); }); }); </script>
But there is a problem
Each loop title has a fixed answer.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
3 years 4 months ago #208770
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 Partially Randomized Answers - Array questions
Change this:
To this:
Code:
$('table.subquestion-list tbody', thisQuestion).append($('tr[id$="X'+q1ID+fixedCode+'"]'));
To this:
Code:
$('table.subquestion-list tbody:last', thisQuestion).append($('tr[id$="X'+q1ID+fixedCode+'"]'));
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- surveySn
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 136
- Thank you received: 4
3 years 4 months ago #208772
by surveySn
Replied by surveySn on topic Partially Randomized Answers - Array questions
Perfect,
Thank you, Tony,
Thank you, Tony,
The topic has been locked.