- Posts: 41
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Ranking question type does not show drag and drop
- LouisGac
- Visitor
6 years 5 months ago #162462
by LouisGac
Replied by LouisGac on topic Ranking question type does not show drag and drop
please provide a link to your survey so we can have a look
The topic has been locked.
- Heinrich
- Topic Author
- Offline
- Senior Member
Less
More
6 years 5 months ago #162465
by Heinrich
Replied by Heinrich on topic Ranking question type does not show drag and drop
Thanks! I've sent you a link.
The topic has been locked.
- LouisGac
- Visitor
6 years 5 months ago #162467
by LouisGac
Replied by LouisGac on topic Ranking question type does not show drag and drop
can you activate debug mode so we see if we can get more infos?
The topic has been locked.
- Heinrich
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 41
- Thank you received: 1
6 years 5 months ago #162468
by Heinrich
Replied by Heinrich on topic Ranking question type does not show drag and drop
Yes sure. I've changed debug=0 to debug=2 in the config.php. Thank you!
The topic has been locked.
- LouisGac
- Visitor
6 years 5 months ago #162469
by LouisGac
Replied by LouisGac on topic Ranking question type does not show drag and drop
it doesn't change anything, it's hard to say what's going on.
If you want to do more testing, normally the list of drop downs is transformed into the drag and drop via the function doDragDropRank() in ranking.js.
Here, it seems it's not applied at all. Could be a server cache issue.
If you want to do more testing, normally the list of drop downs is transformed into the drag and drop via the function doDragDropRank() in ranking.js.
Here, it seems it's not applied at all. Could be a server cache issue.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10148
- Thank you received: 3607
6 years 5 months ago - 6 years 5 months ago #162470
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 question type does not show drag and drop
Try inserting this into the question text:
Code:
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:complete',function() { aRankingTranslations = { choicetitle: 'Ihre Auswahl', ranktitle: 'Ihre Rangfolge', rankhelp: 'Ordnen Sie die Elemente in die rechte Liste ein (höchste Bewertung oben). Die Elemente können mit der Maus verschoben werden. Doppelklick verschiebt ein Element in die andere Liste.' }; doDragDropRank({QID}, 1,1,1); console.log('Ranking applied'); }); </script>
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 6 years 5 months ago by tpartner.
The following user(s) said Thank You: LouisGac
The topic has been locked.
- LouisGac
- Visitor
6 years 5 months ago #162471
by LouisGac
Replied by LouisGac on topic Ranking question type does not show drag and drop
Tony: that's for LS3, he's using 2.70
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10148
- Thank you received: 3607
6 years 5 months ago #162472
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 question type does not show drag and drop
That's what I see in the source.
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: 10148
- Thank you received: 3607
6 years 5 months ago #162474
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 question type does not show drag and drop
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
The topic has been locked.
- Heinrich
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 41
- Thank you received: 1
6 years 5 months ago #162493
by Heinrich
Replied by Heinrich on topic Ranking question type does not show drag and drop
Thank you! Using the code of tpartner, it works!
Do I now always have to implement that source code or is there any other suggestion how to fix this?
Thanks.
Do I now always have to implement that source code or is there any other suggestion how to fix this?
Thanks.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10148
- Thank you received: 3607
6 years 5 months ago #162499
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 question type does not show drag and drop
Try adding this to the end of template.js - it should target all ranking questions.
Code:
$(document).ready(function() { var lang = $('body').attr('class').split(' lang-')[1].split(' ')[0]; // The ranking interface text strings - Add/edit as required rankingTranslations = { en: { choice: 'Your choices', rank: 'Your ranking', help: 'Double-click or drag-and-drop items in the left list to move them to the right - your highest ranking item should be on the top right, moving through to your lowest ranking item.' }, de: { choice: 'Ihre Auswahl', rank: 'Ihre Rangfolge', help: 'Ordnen Sie die Elemente in die rechte Liste ein (höchste Bewertung oben). Die Elemente können mit der Maus verschoben werden. Doppelklick verschiebt ein Element in die andere Liste.' } }; aRankingTranslations = { choicetitle: rankingTranslations[lang]['choice'], ranktitle: rankingTranslations[lang]['rank'], rankhelp: rankingTranslations[lang]['help'] }; // Loop through all ranking questions $('.question-container.ranking').each(function(e) { // Apply the drag-drop ranking interface var thisQID = $(thisQuestion).attr('id').replace(/question/, ''); doDragDropRank(thisQID, 1,1,1); }); });
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- Heinrich
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 41
- Thank you received: 1
6 years 5 months ago #162501
by Heinrich
Replied by Heinrich on topic Ranking question type does not show drag and drop
Thank you. Unfortunately it does not work. I edited the template.js, have chosen the template and removed the code in the question. No luck. Any suggestions about that?
Thanks!
Thanks!
The topic has been locked.