Ranking questions in Limesurvey 2

More
3 years 7 months ago #99900 by pksupport
pksupport created the topic: Ranking questions in Limesurvey 2
I have been gradually moving projects to a new install of LS Version 2.00+ Build 130802. I have a registration form with a ranking question - pick ten schools out of 255. Works fine in 1.92; will not work in 2.00 No matter what I do, there is no next button after this question (even though it's not the last question).
Is it just me, or does the ranking in v2 seem slow and clunky compared to v1?

So - is there a limit on the number of choices for a ranking question? So far I have managed to get 160 answers. . .

Please Log in to join the conversation.

More
3 years 7 months ago #99906 by DenisChenu
DenisChenu replied the topic: Ranking questions in Limesurvey 2
Hi,

Can you send the lsg file ? (and tell us the language of the survey).

If you deactivate javascript : did you see the select/option ?

Ranking is now done "no javascript" compatible and use jqueryui.sortable. You can use your own script, but i think there are less PHP operation.

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
3 years 7 months ago #99930 by pksupport
pksupport replied the topic: Ranking questions in Limesurvey 2
Thanks for the reply Denis. Just the question itself ok? (attached)
Survey is English. I can get 160 ranking answers to work and it doesn't seem to matter which answers I choose. I tried various methods of inserting them. Turned off Javascript (lost calendar) actually, no question appears at all. The survey stops at the branch before the ranking question, no Next or Submit. I can send you the whole survey or URL, prefer not to post.

This works in v1.92 (including those handy little red scissors we love ;-)
Attachments:

Please Log in to join the conversation.

More
3 years 7 months ago - 3 years 7 months ago #99967 by DenisChenu
DenisChenu replied the topic: Ranking questions in Limesurvey 2
OK,

Found the problem.
Seems LS 2 don't take into account the "max response" when construction the HTML page.
You have a lot of answers, in 1.92: only 10 input are created. We have to do the same think in LS2.

Please fill a bug report with an lss file
(your lsg file is a pity, because there are condition, filter etc, and need to be fixed before testing ..)

Denis
PS: please put the bug numbre and link here, and knock me by Private Message for the link.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
Last Edit: 3 years 7 months ago by DenisChenu.
The following user(s) said Thank You: pksupport

Please Log in to join the conversation.

More
3 years 6 months ago - 3 years 6 months ago #100049 by pksupport
pksupport replied the topic: Ranking questions in Limesurvey 2
Great thanks Denis. I reset the conditions on the survey before I exported it.
Last Edit: 3 years 6 months ago by pksupport.

Please Log in to join the conversation.

More
3 years 6 months ago #100050 by pksupport
pksupport replied the topic: Ranking questions in Limesurvey 2
The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

More
3 years 6 months ago #100054 by DenisChenu
DenisChenu replied the topic: Ranking questions in Limesurvey 2
Fix is here:
github.com/LimeSurvey/LimeSurvey/commit/...1f225cf4bf97123b873d

And maybe you can update the javascript too, because seems difficult to choose with "sortable" system. Please give ot a try.

Another function can be:
in template.js:
function doDragDropRank(qID, showpopups, samechoiceheight, samelistheight) {
    var hintTextDefault="All your answers must be different.";
    $("#question"+qID+" .questionhelp").not("#vmsg_"+qID).remove();
    $("<div id='vmsg_"+qID+"_alldifferent' class='questionhelp'>"+hintTextDefault+"</div>").prependTo($("#vmsg_"+qID));
    checkAllRankDifferent(qID);
  $('#question'+qID+' .select-item select').change(function(e){
    checkconditions($(this).val(),$(this).attr("name"),'select-one','onchange');
    checkAllRankDifferent(qID);
  });
}
function checkAllRankDifferent(qID){
    var selectedVals = new Array();
    var uniqueVals = new Array();
    $('#question'+qID+' .select-item select').each(function(){
        var selectedvalue=$(this).val()
        if(selectedvalue!=""){
            selectedVals.push(selectedvalue);
            if(jQuery.inArray(selectedvalue,uniqueVals)<0){
                uniqueVals.push(selectedvalue);
                }
            }
    });
    if(selectedVals.length==uniqueVals.length){
        $("#vmsg_"+qID+"_alldifferent").removeClass("error").addClass("good");
    }else{
        $("#vmsg_"+qID+"_alldifferent").removeClass("good").addClass("error");
    }
    //console.log(selectedVals==uniqueVals);
}

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
3 years 6 months ago #100068 by pksupport
pksupport replied the topic: Ranking questions in Limesurvey 2
qanda_helper.php is a winner Denis. Could not get the template.js working will try again tomorrow :-Q

Thank you so much for your time and expertise. Keen to have this going so very happy!

Please Log in to join the conversation.

More
3 years 6 months ago #100070 by DenisChenu
DenisChenu replied the topic: Ranking questions in Limesurvey 2
Yes, but in your survey : it's very difficult to view all avalaible choose.

sortable seems not appropriate here ...

You can use your own function doDragDropRank but have to find the best.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.