Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Ranking questions in Limesurvey 2

Ranking questions in Limesurvey 2 2 years 10 months ago #99900

  • pksupport
  • pksupport's Avatar
  • Offline
  • Senior Lime
  • Posts: 46
  • Thank you received: 1
  • Karma: 0
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. . .
The administrator has disabled public write access.

Ranking questions in Limesurvey 2 2 years 10 months ago #99906

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9290
  • Thank you received: 1325
  • Karma: 384
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 developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
The administrator has disabled public write access.

Ranking questions in Limesurvey 2 2 years 10 months ago #99930

  • pksupport
  • pksupport's Avatar
  • Offline
  • Senior Lime
  • Posts: 46
  • Thank you received: 1
  • Karma: 0
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:
The administrator has disabled public write access.

Ranking questions in Limesurvey 2 2 years 10 months ago #99967

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9290
  • Thank you received: 1325
  • Karma: 384
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 developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
Last Edit: 2 years 10 months ago by DenisChenu.
The administrator has disabled public write access.
The following user(s) said Thank You: pksupport

Ranking questions in Limesurvey 2 2 years 10 months ago #100049

  • pksupport
  • pksupport's Avatar
  • Offline
  • Senior Lime
  • Posts: 46
  • Thank you received: 1
  • Karma: 0
Great thanks Denis. I reset the conditions on the survey before I exported it.
Last Edit: 2 years 10 months ago by pksupport.
The administrator has disabled public write access.

Ranking questions in Limesurvey 2 2 years 10 months ago #100050

  • pksupport
  • pksupport's Avatar
  • Offline
  • Senior Lime
  • Posts: 46
  • Thank you received: 1
  • Karma: 0
The administrator has disabled public write access.
The following user(s) said Thank You: DenisChenu

Ranking questions in Limesurvey 2 2 years 10 months ago #100054

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9290
  • Thank you received: 1325
  • Karma: 384
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 developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
The administrator has disabled public write access.

Ranking questions in Limesurvey 2 2 years 10 months ago #100068

  • pksupport
  • pksupport's Avatar
  • Offline
  • Senior Lime
  • Posts: 46
  • Thank you received: 1
  • Karma: 0
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!
The administrator has disabled public write access.

Ranking questions in Limesurvey 2 2 years 10 months ago #100070

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9290
  • Thank you received: 1325
  • Karma: 384
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 developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.232 seconds
Imprint                   Data Protection Statement                  Revocation information and revocation form