Welcome to the LimeSurvey Community Forum

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

Implementation eines Sliders in der 2ten Skala eines Dual Arrays.

  • ngolub
  • ngolub's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
1 month 2 weeks ago #258467 by ngolub
Hallo Joffm,

mir ist noch etwas aufgefallen.

Wenn man den Slider bewegt, bevor man die Checkboxen auswählt und anschließend auf "Weiter" klickt, wird der Slider zurückgesetzt. Der Wert des Sliders wird nicht gespeichert, und man muss ihn erneut verschieben.

Weißt du, woran das liegen könnte?

Hier ist die Umfrage 

File Attachment:

File Name: limesurvey...5223.lss
File Size:1,058 KB

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 2 weeks ago #258479 by Joffm
Ja, wenn man darauf gestoßen wird, kommt gleich die Erleuchtung.
Das Ganze stammt ja aus diesem Beispiel
 
Hier waren die exclusiven Checkboxen ja wirklich dazu da, auch die Textfelder zu löschen.
Wir haben aber den Slider im Textfeld, der nun nicht gelöscht werden sollte.

Also kommentiere diese Zeilen aus - oder lösche sie!
Code:
    // Listeners for exclusive items
    $('.non-exclusive-item input:checkbox', thisQuestion).on('change', function(e) {
      if($(this).is(':checked')) {
        $(this).closest('tr.subquestion-list').find('.exclusive-item input:checkbox').prop('checked', false);
      }
    });
// Dies könnte man gesamt löschen
//    $('.non-exclusive-item input:text', thisQuestion).on('keyup change', function(e) {
//      if($.trim($(this).val()) != '') {
//        $(this).closest('tr.subquestion-list').find('.exclusive-item input:checkbox').prop('checked', false);
//      }
//    });
 
    $('.exclusive-item input:checkbox', thisQuestion).on('change', function(e) {
      if($(this).is(':checked')) {
        var thisItem = $(this).closest('.answer-item');
        $(this).closest('tr.subquestion-list').find('.answer-item').not(thisItem).find('input:checkbox').prop('checked', false);
//        $(this).closest('tr.subquestion-list').find('input:text').val('');
      }
    });

Sorry

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: ngolub

Please Log in to join the conversation.

  • ngolub
  • ngolub's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
1 month 2 weeks ago #258486 by ngolub
Danke dir für die schnelle Antwort.

Habe diese Zeilen gelöscht, aber der Sliderwert wird trotzdem nicht gespeichert, wenn ich es vor dem anklicken der Checkboxes verschiebe.

Das habe ich gelöscht:
Code:
// Dies könnte man gesamt löschen
//    $('.non-exclusive-item input:text', thisQuestion).on('keyup change', function(e) {
//      if($.trim($(this).val()) != '') {
//        $(this).closest('tr.subquestion-list').find('.exclusive-item input:checkbox').prop('checked', false);
//      }
//    });

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 2 weeks ago - 1 month 2 weeks ago #258488 by Joffm
Und die Zeile unten auch auskommentiert?

//        $(this).closest('tr.subquestion-list').find('input:text').val('');

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 month 2 weeks ago by Joffm.

Please Log in to join the conversation.

  • ngolub
  • ngolub's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
1 month 2 weeks ago #258492 by ngolub
Ja, das habe ich auch gemacht.

Der erste Script sieht so aus:
Code:
<script type="text/javascript" charset="utf-8">
 
// Script zuum Einfügen der Checkboxen anstelle der Textfelder und Einstellen der Exclusivität
 
  $(document).on('ready pjax:scriptcomplete',function(){
 
    // Identify this question
    var thisQuestion = $('#question{QID}');
 
    // Column-specific classes
    $('tr.subquestion-list', thisQuestion).each(function(i) {
      $('th, td', this).each(function(i) {
        $(this).addClass('column-'+i);
      });
    });
 
    // Insert checkboxes
    $('.answer-item.column-1, .answer-item.column-2, .answer-item.column-3, .answer-item.column-4, .answer-item.column-5', thisQuestion).addClass('custom-checkbox-item');
    $('.custom-checkbox-item', thisQuestion).each(function(i) {
      var thisID = $('input:text:eq(0)', this).attr('id');
      $('label', this).before('<input class="" id="'+thisID+'" value="Y" type="checkbox" name="'+thisID.replace(/answer/, '')+'" />');
      if($('input:text:eq(0)', this).val() == 'Y') {
        $('input:checkbox:eq(0)', this).prop('checked', true);
      }
      $(this).removeClass('text-item').addClass('checkbox-item');
      $('input:text:eq(0)', this).remove();
    });
 
    // Identify exclusive items
    $('.answer-item.column-1, .answer-item.column-2, .answer-item.column-3, .answer-item.column-4, .answer-item.column-5', thisQuestion).addClass('exclusive-item');
 
    // Listeners for exclusive items
    $('.non-exclusive-item input:checkbox', thisQuestion).on('change', function(e) {
      if($(this).is(':checked')) {
        $(this).closest('tr.subquestion-list').find('.exclusive-item input:checkbox').prop('checked', false);
      }
    });
// Dies könnte man gesamt löschen
//    $('.non-exclusive-item input:text', thisQuestion).on('keyup change', function(e) {
//      if($.trim($(this).val()) != '') {
//        $(this).closest('tr.subquestion-list').find('.exclusive-item input:checkbox').prop('checked', false);
//      }
//    });
 
    $('.exclusive-item input:checkbox', thisQuestion).on('change', function(e) {
      if($(this).is(':checked')) {
        var thisItem = $(this).closest('.answer-item');
        $(this).closest('tr.subquestion-list').find('.answer-item').not(thisItem).find('input:checkbox').prop('checked', false);
//        $(this).closest('tr.subquestion-list').find('input:text').val('');
      }
    });
 
</script>

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 2 weeks ago #258494 by Joffm
Gut, ich muss natürlich sagen, dass ich dies in meinem Kurzbeispiel gemacht habe, und das läuft.
Vorher eben nicht.
 

File Attachment:

File Name: limesurvey...3-12.lss
File Size:58 KB

Dann muss ich mir wohl doch Deine lss mal ansehen.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: ngolub

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 2 weeks ago #258498 by Joffm
Okay, letzte Meldung,
auch in Deiner letzten lss.
sehe ich kein Problem, egal wo ich zuerst eintrage.

Mehr kann ich dazu jetzt nicht sagen; wenn es hier nicht reproduzierbar ist, ist es eben schwierig, 

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: ngolub

Please Log in to join the conversation.

  • ngolub
  • ngolub's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
1 month 2 weeks ago #258510 by ngolub
Alles klar, danke dir vielmals für deine Bemühungen!

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 1 week ago #258600 by Joffm
Noch eine Idee.
Es ist ja verwunderlich, dass es bei mir funktioniert, bei Dir anscheinend nicht.

Hast Du das kleine Beispiel, welches ich als Letztes geschickt habe, einmal importiert.
Wie sieht es damit aus?

Und hast Du Deine Gesamtstudie schon einmal exportiert und dann wieder importiert?
Manchmal gibt es einen Schluckauf in der Datenbank, der nie wieder herausgeht; es sei denn man erzeugt eine neue Studie.

Solche Dinge wie "Asset-Cache" leeren, allgemein Cache leeren, ist auch immer einen Versuch wert.

Es wäre ja echt blöd, wenn Du so viel Energie und Zeit investiert hättest, und es würde dann nicht laufen.

Bis dann
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: ngolub

Please Log in to join the conversation.

  • ngolub
  • ngolub's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
1 month 1 week ago #258707 by ngolub
Danke für die Tipps, Joffm!Dein Beispiel habe ich importiert, und damit hat es funktioniert.Ich werde mal versuchen, die Gesamtstudie zu exportieren und dann wieder zu importieren + den Cache zu leeren.Naja, auch wenn es nicht funktioniert, war es nicht alles umsonst. Das ist die erste Umfrage, die ich in LimeSurvey erstellt habe, und ich konnte echt viel dabei lernen.Bis dann und vielen Dank für all die Hilfe!

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 1 week ago #258728 by Joffm
Eine weitere Möglichkeit wäre:
Mein kleines Beispiel läuft.
Erweitere es zunächst auf die volle Länge.
Exportiere die einzelnen Gruppen aus Deiner Gesamtumfrage und importiere sie eine nach der anderen in die andere Umfrage.
Teste nach jedem Import, ob es immer noch funktioniert.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

Moderators: Joffm

Lime-years ahead

Online-surveys for every purse and purpose