Welcome to the LimeSurvey Community Forum

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

Need a replacement for Ranking Question

  • deliot
  • deliot's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 11 months ago #106697 by deliot
First off, I love LimeSurvey and I'd like to thank all involved for it :cheer:

Second, We have a lot of issues with the LimeSurvey Ranking style question. While the JavaScript drag and drop is pretty, it is error prone. For example, when you first drag a box to the right side, it defaults to going above the last box placed. On the second drag, it defaults to BELOW the previous box. I believe this results in errors in rankings, or at the very least, a higher error rate than normal for this question type. No offense to the developers, it is a slick AJAX setup. But for "web challenged" users, it is problematic and I get a number of emails from survey users about it.

THE QUESTION: Is there a way to mimic the effect of a ranking question, using an Array question? So if the user ranks one particular row choice as #1, none of the other rows have that option available.

This is how SurveyMonkey does it, and I think it's a cleaner, more intuitive way of ranking, and less error prone.

Any advice would be appreciated, and I have coding experience... so if you point me in the right direction, I should be able to use code if necessary.
The topic has been locked.
  • c_schmitz
  • c_schmitz's Avatar
  • Offline
  • LimeSurvey GmbH Employee
  • LimeSurvey GmbH Employee
More
9 years 11 months ago #106699 by c_schmitz
Replied by c_schmitz on topic Need a replacement for Ranking Question
Use the 'Array by Column' question type.

Best regards

Carsten Schmitz
LimeSurvey project leader
The following user(s) said Thank You: deliot
The topic has been locked.
  • deliot
  • deliot's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 11 months ago #106764 by deliot
Replied by deliot on topic Need a replacement for Ranking Question
I don't see how an Array By Column type replaces a Ranking Question. It would work if no two answers are allowed BOTH on the same ROW and COLUMN, but that is not the case. With a standard Array By Column question, I can have multiple items with the same Ranking.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 11 months ago - 9 years 11 months ago #106770 by DenisChenu
Replied by DenisChenu on topic Need a replacement for Ranking Question
Hi,

Take a Array question, put
Code:
unique(self)
in 'Question validation equation'


Example : limesurvey.sondages.pro/survey/index/sid...51/newtest/Y/lang/en

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.
Last edit: 9 years 11 months ago by DenisChenu.
The following user(s) said Thank You: deliot
The topic has been locked.
  • deliot
  • deliot's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 11 months ago #106826 by deliot
Replied by deliot on topic Need a replacement for Ranking Question
Thank you both for your kind responses.

Using unique(self) is a step closer to what I need, thank you, I will try that out.

I was wondering if there was a way to get closer to the SurveyMonkey "forced ranking matrix" seen here:

www.surveymonkey.com/s/3P7NBRG

Note that each row and each column must be unique. This insures that no two items are ranked with the same ranking score.

This is ideally what I am after.

Thanks for any help you can provide.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 11 months ago #106841 by tpartner
Replied by tpartner on topic Need a replacement for Ranking Question
I'm assuming you are using LimeSurvey 2.05.

1) Create a normal array with no question validation.

2) Set up your survey to use JavaScript .

3) Add this script to the source of the array:
Code:
<script type="text/javascript" charset="utf-8">  
 
  $(document).ready(function() {
 
    // Identify this question
    var qID = {QID};
 
    // Answers are exclusive by column
    $('#question'+qID+' input[type="radio"]').click(function(event){
      var thisAnsCode = $(this).attr('id').split('-')[1];
      $('#question'+qID+' input[id$="-'+thisAnsCode+'"]').prop('checked', false);
      $(this).prop('checked', true);
    });
  });
</script>

Here's a working example:

File Attachment:

File Name: limesurvey...3124.lss
File Size:18 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: Sarques, deliot, EnricoCaruso
The topic has been locked.
  • deliot
  • deliot's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 11 months ago #106858 by deliot
Replied by deliot on topic Need a replacement for Ranking Question
Yes, I am using LimeSurvey 2.05...

This is exactly what I need, and I thank you very much for taking the time to create an example.

IMHO, this is a much cleaner way to do a ranking, and I think we will have A LOT less complaints about this type of ranking question in the future.

:cheer: :cheer:

Dan
The topic has been locked.
More
9 years 10 months ago #108053 by Ben_V
Replied by Ben_V on topic Need a replacement for Ranking Question
For ranking question replacement there is another valid solution:

See attached sample "ls2_cascading_array_filter_exclude.lss"
(also available in the precious directory /docs/demosurveys of all LS packages ≥1.92)

File Attachment:

File Name: ls2_cascad...lude.lss
File Size:36 KB

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The topic has been locked.
  • deliot
  • deliot's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 9 months ago #109138 by deliot
Replied by deliot on topic Need a replacement for Ranking Question
Thank you for the assistance, but these examples do not match what I need. The answer provided by tpartner solved the problem for me very well.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 9 months ago #109263 by DenisChenu
Replied by DenisChenu on topic Need a replacement for Ranking Question

tpartner wrote: Create a normal array with no question validation.

Just one complement : here you can use unique(self)

Because we don't control only in javascript, but in PHP too.

For example, surveymonkey can be easily hacked see screen capture)

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.

Lime-years ahead

Online-surveys for every purse and purpose