Welcome to the LimeSurvey Community Forum

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

Search Results (Searched for: html)

  • holch
  • holch's Avatar
05 Mar 2024 17:24
Replied by holch on topic Inserting an image using TOKEN:ATTRIBUTE
You did not look at my example in the necessary depth.
Code:
{if(TOKEN:ATTRIBUTE_1=="Y","<img src='yourimageurl' />", "")}

Do you notice something? There is " and there is '. You can't use " in both parts, within the expression and within the HTML code, as the second " will always end this part of the expression. So you need to use ' instead of " for the image source, etc. within the html tags.

Also, your URL is not complete. This might cause another issue later.

Something like this should do the trick:
Code:
{if(TOKEN:ATTRIBUTE_1 == "Y", "<img src=' https://sspgsurveyprd.ethz.ch/upload/surveys/866522/images/BEISPIEL.png ' />", "")}

When you post code, please always try to use the code tags, that makes it easier to read your code.
  • Joffm
  • Joffm's Avatar
05 Mar 2024 13:27
Replied by Joffm on topic input on demand remove line
You can use the "varLengthArray" script.
[
attachment=39611]a2a.PNG[/attachment]
Code:
<script>
$(document).ready(function() {
 
  // A function to add or remove rows of an "multiple short text" question
  function varLengthArray(qID) {
 
    if ($('#question'+qID+'').length > 0) {
 
      // The HTML content of the Add/Remove elements - modify as you wish
      var addContent = '[+] Add row';
      var removeContent = '[-] Remove row';
 
      // Create the Add and Remove elements &amp; insert them
      // Adjust colors by using other bootstrap classes
      // „btn-primary“, „btn-success“, „btn-info“, „btn-warning“, „btn-danger“
      var el1 = document.createElement('div');
      el1.setAttribute('id','addButton'+qID);
      el1.setAttribute('class','btn btn-success');
      document.body.appendChild(el1);
      var el2 = document.createElement('div');
      el2.setAttribute('id','removeButton'+qID);
      el2.setAttribute('class','btn btn-danger');
      document.body.appendChild(el2);
 
      // Move them to after the array
      $( 'div#addButton'+qID ).appendTo($( '#question' + qID + ' ul.ls-answers' ).parent());
      $( 'div#removeButton'+qID ).appendTo($( '#question' + qID + ' ul.ls-answers' ).parent());
 
      // Insert their HTML
      $( 'div#addButton'+qID ).html( addContent );
      $( 'div#removeButton'+qID ).html( removeContent );
 
      // Style the elements - you can modify here if you wish
      $( 'div#addButton'+qID ).css({
        'margin':'10px 0 10px 10px',
        'padding':'1px',
        'text-align':'center',
        'width':'auto',
        'cursor':'pointer',
        'float':'left'
      });
 
      $( 'div#removeButton'+qID ).css({
        'margin':'10px 0 10px 10px',
        'padding':'1px',
        'text-align':'center',
        'width':'auto',
        'cursor':'pointer',
        'float':'left'
      });
 
      // Initially hide the Remove element
      $( 'div#removeButton'+qID ).hide();
 
      // Call the functions below when clicked
      $( 'div#addButton'+qID ).click(function (event) {
        addRow(qID);
      });
      $( 'div#removeButton'+qID ).click(function (event) {
        removeRow(qID);
      });
 
      // Function to add a row, also shows the Remove element and hides the
      //Add element if all rows are shown
      function addRow(qID) {
        var arrayRow = '#question' + qID + ' ul.ls-answers li.answer-item';
        var rowCount = $( arrayRow ).size() - 1;
        $( arrayRow + '[name="hidden"]:first' ).attr('name', 'visible').show();
        $( 'div#removeButton'+qID ).show();
        if ( $( arrayRow + ':eq(' + rowCount + ')' ).attr('name') == 'visible' )  {
          $( 'div#addButton'+qID ).hide();
        }
      }
 
      // Function to remove a row, also clears the contents of the removed row,
      // shows the Add element if the last row is hidden and hides the Remove
      // element if only the first row is shown
      function removeRow(qID) {
        var arrayRow = '#question' + qID + ' ul.ls-answers li.answer-item';
        var rowCount = $( arrayRow ).size() - 1;
        $( arrayRow + '[name="visible"]:last input[type="text"]' ).val('');
        $( arrayRow + '[name="visible"]:last' ).attr('name', 'hidden').hide();
        $( 'div#addButton'+qID ).show();
        if ( $( arrayRow + ':eq(1)' ).attr('name') == 'hidden' )  {
          $( 'div#removeButton'+qID ).hide();
        }
      }
 
      // Just some initialization stuff
      var arrayRow = '#question' + qID + ' ul.ls-answers li.answer-item';
      var rowCount = '';
 
      // Initially hide all except first row or any rows with populated inputs
      $( arrayRow ).each(function(i) {
        if ( i > 0 ) {
          // We also need to give the hidden rows a name cause IE doesn't
          // recognize jQuery :visible selector consistently
          $( this ).attr('name', 'hidden').hide();
 
          $('input[type=text]', this).each(function(i) {
            if ($(this).attr('value') != '') {
              $(this).parents('tbody:eq(0)').attr('name', 'visible').show();
              $( 'div#removeButton'+qID ).show();
            }
          });
          rowCount = i;
        }
      });
    }
  }
  // Call the function with a question ID
  varLengthArray({QID});
});
</script>

Adapt to your needs.

Joffm
  • LGimbel
  • LGimbel's Avatar
04 Mar 2024 18:58
Bitte helfen Sie uns, Ihnen zu helfen und füllen Sie folgende Felder aus:
Ihre LimeSurvey-Version: Version 6.4.1+240108
Eigener Server oder LimeSurvey-Cloud: eigener Server
Genutzte Designvorlage: custom
==================
Liebe Community,

trotz einiger Recherche konnte ich mein Problem leider nicht lösen und hoffe, dass mir hier weitergeholfen werden kann.

Ich möchte bei Mehrfachauswahl mit Kommentar die Hinweise verbergen:
"Kommentieren Sie Ihre Antworten. Bitte wählen Sie mindestens eine Antwort."
 

Leider wird der Kommentar weiterhin angezeigt, obwohl ich in den Einstellungen "Hinweis verstecken" auf "An" gewählt habe.
 
Auch einige Versuche mit html haben (offensichtlich) keinen Erfolg gebracht. U.a. habe ich folgendes versucht:<style type="text/css">
.em_commented_checkbox.emtip.good
{
display:none;
}
</style>

Vielleicht gibt es ja einfach etwas, was ich übersehen habe, oder ihr habt eine andere Idee.

Vielen Dank und mfG, Lasse
 
  • tpartner
  • tpartner's Avatar
04 Mar 2024 18:03 - 04 Mar 2024 18:06
When using autocomplete on a text input, it is tricky to force a selection from the data set.

Given the relatively small data set (145 items), I would be inclined to use drop-downs and add searching with the Select2 platform - select2.org/

So, the modified code:

Code:
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
<script type="text/javascript" data-author="Tony Partner">
 
    $(document).on('ready pjax:scriptcomplete',function(){
 
        // Identify this question
        var thisQuestion = $('#question{QID}');
 
        // Index the array columns
        $('table.subquestion-list tr', thisQuestion).each(function(i) {
            $('> *', this).each(function(i) {
                $(this).attr('data-index', i);
            });
        });
 
        // Define the dropdown
        var select1 = '<select class="form-select form-control list-question-select inserted-select">\
                <option value="">Please choose...</option>\
                <option value="A1">Apples</option>\
                <option value="A2">Bananas</option>\
                <option value="A3">Cherries</option>\
                <option value="A4">Dates</option>\
                <option value="A5">Limes</option>\
                <option value="A6">Nectarines</option>\
                <option value="A7">Plumbs</option>\
                <option value="A8">Elderberries</option>\
                <option value="A9">Lemons</option>\
                <option value="A10">Peaches</option>\
                <option value="A11">Blueberries</option>\
                <option value="A12">Grapes</option>\
            </select>'
 
        // Define the placeholder text for the select2 search input
        var placeholder = 'Type here to search the dropdown';
 
        // Hide the column-1 text inputs
        $('.answer-item[data-index="1"] :text', thisQuestion).addClass('d-none');
 
        // Insert the column-1 dropdowns
        $('.answer-item[data-index="1"]', thisQuestion).append(select1);
 
        // Listener on the dropdowns
        $('.inserted-select', thisQuestion).on('change', function(e) {
            var thisCell = $(this).closest('.answer-item');
            $(':text', thisCell).val($(this).val()).trigger('keyup');
        });
 
        // Returning to the page
        $('.inserted-select', thisQuestion).each(function(i) {
            var thisCell = $(this).closest('.answer-item');
            $(this).val($(':text', thisCell).val());
        }); 
 
        // Initiate the select2 search function
        $('.inserted-select', thisQuestion).select2();
        $('.inserted-select', thisQuestion).on('select2:open', function(e) {
            document.querySelector('.select2-search__field').focus();
            $('input.select2-search__field').prop('placeholder', placeholder);
        });
 
        // A function to add or remove rows of an Array (Multi Flexible)(Text) question
        function varLengthArray(thisQuestion) {
 
            if ($(thisQuestion).length > 0) {
 
                // The HTML content of the Add/Remove elements - modify as you wish
                var addContent = '[+] Add row';
                var removeContent = '[-] Remove row';
 
                // The classes for the Add/Remove elements - modify as you wish
                // See https://getbootstrap.com/docs/5.0/getting-started/introduction/
                var addClasses = 'inserted-button add btn btn-success';
                var removeClasses = 'inserted-button remove btn btn-danger';
 
                // The styles for the Add/Remove elements - modify as you wish
                // These could be placed in your custom.css file.
                var addStyles = 'margin:10px 0 10px 10px; padding:1px 5px; text-align:center; width:auto; cursor:pointer; float:left;';
                var removeStyles = 'margin:10px 0 10px 10px; padding:1px 5px; text-align:center; width:auto; cursor:pointer; float:left;';
 
                // Insert the buttons
                $( 'table.ls-answers', thisQuestion).after('<div class="button-wrapper">\
                        <button type="button" class="'+addClasses+'" style="'+addStyles+'">'+addContent+'</button>\
                        <button type="button" class="'+removeClasses+'" style="display: none; '+removeStyles+'">'+removeContent+'</button>\
                    </div>');
 
                // Listeners on the buttons
                $('.inserted-button.add', thisQuestion).on('click', function (event) {
                    addRow();
                });
                $('.inserted-button.remove', thisQuestion).on('click', function (event) {
                    removeRow();
                });
 
                // Define the relevant rows
                var relevantRows = $('tr.subquestion-list:not(.ls-irrelevant)', thisQuestion);
 
                // Function to add a row, show the "Remove" element and hide the "Add" element if all rows are shown
                function addRow() {
                    $('[data-visible="false"]:first', thisQuestion).attr('data-visible', 'true').show();
                    $('.inserted-button.remove', thisQuestion).show();
                    if ($('[data-visible="false"]', thisQuestion).length == 0)  {
                        $('.inserted-button.add', thisQuestion).hide();
                    }
                    $('.inserted-button.add', thisQuestion).blur();
 
                    handleAddButton();
                }
 
                // Function to remove a row, clear the contents of the removed row,
                // show the "Add" element if the last row is hidden and hide the "Remove" element if only the first row is shown
                function removeRow() {
                    $('[data-visible="true"]:last input:text', thisQuestion).val('').trigger('keyup');
                    $('[data-visible="true"]:last select', thisQuestion).val('');
                    $('[data-visible="true"]:last', thisQuestion).attr('data-visible', 'false').hide();
                    $('.inserted-button.add', thisQuestion).show();
                    if ($('[data-visible="true"]', thisQuestion).length == 0)  {
                        $('.inserted-button.remove', thisQuestion).hide();
                    }
                    $('.inserted-button.remove', thisQuestion).blur();
 
                    handleAddButton();
                }
 
                // Initially hide all except first row or any rows with populated inputs
                $(relevantRows).slice(1).each(function(i) {
                    $( this ).attr('data-visible', 'false').hide();
 
                    $('input[type=text]', this).each(function(i) {
                        if ($.trim($(this).val()) != '') {
                            $(this).closest('tr').attr('data-visible', 'true').show();
                            $('.inserted-button.remove', thisQuestion).show();
                        }
                    });
                });
            }
 
            // Function handle the "Add row" button
            function handleAddButton() {
               var lastRow = $('tr[id^="javatbd"]:visible:last', thisQuestion);
                var emptyInputs = $(':text.form-control', lastRow).filter(function() {
                    return $.trim($(this).val()) == '';
                });
                if(emptyInputs.length > 0) {
                    $('.inserted-button.add', thisQuestion).prop('disabled', true);
                }
                else {
                    $('.inserted-button.add', thisQuestion).prop('disabled', false);
                }
            }
 
            // Initial "Add row" state
            handleAddButton();
 
            // Listeners for the "Add row" state
            $(':text.form-control, .inserted-select', thisQuestion).on('keyup change', function(e) {
                handleAddButton();
            });
        }
 
        // Call the function with a question ID
        varLengthArray(thisQuestion);
 
    });
</script>

 

Sample survey attached:  

File Attachment:

File Name: limesurvey...3981.lss
File Size:43 KB


 
  • tpartner
  • tpartner's Avatar
04 Mar 2024 16:00 - 04 Mar 2024 16:06
Here is a script that, when placed in the source of an array(texts) question, should handle all of your requirements:
- Insert a drop-down in column 1
- Apply the "Variable length array" workaround linked above
- Disable the "Add row" button unless both inputs in the last visible row are populated

Code:
<script type="text/javascript" data-author="Tony Partner">
 
    $(document).on('ready pjax:scriptcomplete',function(){
 
        // Identify this question
        var thisQuestion = $('#question{QID}');
 
        // Index the array columns
        $('table.subquestion-list tr', thisQuestion).each(function(i) {
            $('> *', this).each(function(i) {
                $(this).attr('data-index', i);
            });
        });
 
        // Define the dropdown
        var select1 = '<select class="form-select form-control list-question-select inserted-select">\
                <option value="">Please choose...</option>\
                <option value="A1">Apples</option>\
                <option value="A2">Bananas</option>\
                <option value="A3">Cherries</option>\
                <option value="A4">Dates</option>\
                <option value="A5">Elderberries</option>\
            </select>'
 
        // Hide the column-1 text inputs
        $('.answer-item[data-index="1"] :text', thisQuestion).addClass('d-none');
 
        // Insert the column-1 dropdowns
        $('.answer-item[data-index="1"]', thisQuestion).append(select1);
 
        // Listener on the dropdowns
        $('.inserted-select', thisQuestion).on('change', function(e) {
            var thisCell = $(this).closest('.answer-item');
            $(':text', thisCell).val($(this).val()).trigger('keyup');
        });
 
        // Returning to the page
        $('.inserted-select', thisQuestion).each(function(i) {
            var thisCell = $(this).closest('.answer-item');
            $(this).val($(':text', thisCell).val());
        }); 
 
        // A function to add or remove rows of an Array (Multi Flexible)(Text) question
        function varLengthArray(thisQuestion) {
 
            if ($(thisQuestion).length > 0) {
 
                // The HTML content of the Add/Remove elements - modify as you wish
                var addContent = '[+] Add row';
                var removeContent = '[-] Remove row';
 
                // The classes for the Add/Remove elements - modify as you wish
                // See https://getbootstrap.com/docs/5.0/getting-started/introduction/
                var addClasses = 'inserted-button add btn btn-success';
                var removeClasses = 'inserted-button remove btn btn-danger';
 
                // The styles for the Add/Remove elements - modify as you wish
                // These could be placed in your custom.css file.
                var addStyles = 'margin:10px 0 10px 10px; padding:1px 5px; text-align:center; width:auto; cursor:pointer; float:left;';
                var removeStyles = 'margin:10px 0 10px 10px; padding:1px 5px; text-align:center; width:auto; cursor:pointer; float:left;';
 
                // Insert the buttons
                $( 'table.ls-answers', thisQuestion).after('<div class="button-wrapper">\
                        <button type="button" class="'+addClasses+'" style="'+addStyles+'">'+addContent+'</button>\
                        <button type="button" class="'+removeClasses+'" style="display: none; '+removeStyles+'">'+removeContent+'</button>\
                    </div>');
 
                // Listeners on the buttons
                $('.inserted-button.add', thisQuestion).on('click', function (event) {
                    addRow();
                });
                $('.inserted-button.remove', thisQuestion).on('click', function (event) {
                    removeRow();
                });
 
                // Define the relevant rows
                var relevantRows = $('tr.subquestion-list:not(.ls-irrelevant)', thisQuestion);
 
                // Function to add a row, show the "Remove" element and hide the "Add" element if all rows are shown
                function addRow() {
                    $('[data-visible="false"]:first', thisQuestion).attr('data-visible', 'true').show();
                    $('.inserted-button.remove', thisQuestion).show();
                    if ($('[data-visible="false"]', thisQuestion).length == 0)  {
                        $('.inserted-button.add', thisQuestion).hide();
                    }
                    $('.inserted-button.add', thisQuestion).blur();
 
                    handleAddButton();
                }
 
                // Function to remove a row, clear the contents of the removed row,
                // show the "Add" element if the last row is hidden and hide the "Remove" element if only the first row is shown
                function removeRow() {
                    $('[data-visible="true"]:last input:text', thisQuestion).val('').trigger('keyup');
                    $('[data-visible="true"]:last select', thisQuestion).val('');
                    $('[data-visible="true"]:last', thisQuestion).attr('data-visible', 'false').hide();
                    $('.inserted-button.add', thisQuestion).show();
                    if ($('[data-visible="true"]', thisQuestion).length == 0)  {
                        $('.inserted-button.remove', thisQuestion).hide();
                    }
                    $('.inserted-button.remove', thisQuestion).blur();
 
                    handleAddButton();
                }
 
                // Initially hide all except first row or any rows with populated inputs
                $(relevantRows).slice(1).each(function(i) {
                    $( this ).attr('data-visible', 'false').hide();
 
                    $('input[type=text]', this).each(function(i) {
                        if ($.trim($(this).val()) != '') {
                            $(this).closest('tr').attr('data-visible', 'true').show();
                            $('.inserted-button.remove', thisQuestion).show();
                        }
                    });
                });
            }
 
            // Function handle the "Add row" button
            function handleAddButton() {
               var lastRow = $('tr[id^="javatbd"]:visible:last', thisQuestion);
                var emptyInputs = $(':text.form-control', lastRow).filter(function() {
                    return $.trim($(this).val()) == '';
                });
                if(emptyInputs.length > 0) {
                    $('.inserted-button.add', thisQuestion).prop('disabled', true);
                }
                else {
                    $('.inserted-button.add', thisQuestion).prop('disabled', false);
                }
            }
 
            // Initial "Add row" state
            handleAddButton();
 
            // Listeners for the "Add row" state
            $(':text.form-control, .inserted-select', thisQuestion).on('keyup change', function(e) {
                handleAddButton();
            });
        }
 
        // Apply the variable-length array
        varLengthArray(thisQuestion);
 
    });
</script>

Sample survey attached: 

File Attachment:

File Name: limesurvey...3-04.lss
File Size:42 KB
  • blocka
  • blocka's Avatar
29 Feb 2024 21:08
Please help us help you and fill where relevant:
Your LimeSurvey version: 5.6.56+240227
Own server or LimeSurvey hosting: own
Survey theme/template: Any
==================
I have scheduled the cron job:

php /home/account/public_html/application/commands/console.php plugin cron

This executes fine under PHP 7.4 and PHP 8.0, but when I try to run LS under PHP 8.1 or 8.2, the cron job fails with the error:
PHP Fatal error:  During inheritance of Countable: Uncaught  in /home/account/public_html/vendor/twig/twig/src/Node/Node.php on line 23

I've attached the full error output.

Anyone have any insight into what's up? Is it that LS can't run under PHP 8.1 or 8.2 yet?


 
  • goirigolzarri
  • goirigolzarri's Avatar
28 Feb 2024 15:45
Ayúdenos a ayudarle y rellene los siguientes campos:.
Su versión de LimeSurvey:  [Versión 3.17.17+190918]
Servidor propio o LimeSurvey Cloud: Servidor propio
==================

Estamos intentando añadir un botón en nuestra pregunta para que se abra una ventana emergente. 
Al guardar, no se queda guardado el código de html y se queda como texto. 

 

 


Teníamos otra version de limesurvey en el que si que pudimos añadir la ventana. Pero en esta nos da error.
¿Como podríamos hacer para que se guarde el código y nos deje añadir el botón en la pregunta?

¡Gracias!
  • goirigolzarri
  • goirigolzarri's Avatar
28 Feb 2024 14:53
Please help us help you and fill where relevant:
Your LimeSurvey version: [Versión 3.17.17+190918]
Own server or LimeSurvey hosting: Own server
Survey theme/template:
==================

Estamos intentando añadir un botón en nuestra pregunta para que se abra una ventana emergente. 
Al guardar, no se queda guardado el código de html y se queda como texto. 

 

 

Teniamos otra version de limesurvey en el que si que pudimos añadir la ventana. Pero en esta nos da error.

¿Como podríamos hacer para que se guarde el código y nos deje añadir el botón en la pregunta?

¡Gracias!
  • Anna_K
  • Anna_K's Avatar
27 Feb 2024 22:14
Replied by Anna_K on topic Choice-Based-Conjoint-Analyse
Hallo,

ja, folgend der HTML-Code der Tabelle:

<p><strong><span style="color:#000000;">1. Welchen Stromvertrag würden Sie wählen?</span></strong></p>

<div style="height: 6px; text-align: center;"> </div>

<table border="1" bordercolor="#ccc" cellpadding="5" cellspacing="0" style="border-collapse:collapse;">
    <tbody>
        <tr>
            <td style="text-align: left;" width="0%"> </td>
            <td style="text-align: center;" width="0%"> </td>
            <td bgcolor="#D4D7E4" style="text-align: center;" width="15%"><br /><span style="font-size:14px;"><span style="color:#000000;"><b>Stromvertrag A</b></span></span><br /> </td>
            <td style="text-align: center;" width="0%"> </td>
            <td bgcolor="#D4D7E4" style="text-align: center;" width="15%"><span style="font-size:14px;"><span style="color:#000000;"><strong>Stromvertrag B</strong></span></span></td>
            <td style="text-align: center;" width="0%"> </td>
            <td bgcolor="#D4D7E4" style="text-align: center;" width="15%"><span style="font-size:14px;"><span style="color:#000000;"><b>Stromvertrag C</b></span></span></td>
        </tr>
        <tr>
            <td bgcolor="#f2f2f2" style="text-align: left;">
            <p><span style="font-size:14px;"><span style="color:#000000;">Preis</span></span> </p>
            </td>
            <td style="text-align: center;" width="0%">
            <p> </p>
            </td>
            <td bgcolor="#f2f2f2" style="text-align: center;">
            <p><font color="#000000"><span style="caret-color: rgb(0, 0, 0); font-size: 14px;">55,00 €</span></font></p>
            </td>
            <td style="text-align: center;" width="0%">
            <p> </p>
            </td>
            <td bgcolor="#f2f2f2" style="text-align: center;">
            <p><font color="#000000"><span style="caret-color: rgb(0, 0, 0); font-size: 14px;">55,00 €</span></font></p>
            </td>
            <td style="text-align: center;" width="0%">
            <p> </p>
            </td>
            <td bgcolor="#f2f2f2" style="text-align: center;">
            <p><span style="font-size:14px;"><span style="color:#000000;">55,00 €</span></span></p>
            </td>
        </tr>
        <tr>
            <td bgcolor="#f2f2f2" style="text-align: left;">
            <p><span style="font-size:14px;"><span style="color:#000000;">Preisgarantie</span></span></p>
            </td>
            <td style="text-align: center;" width="0%">
            <p> </p>
            </td>
            <td bgcolor="#f2f2f2" style="text-align: center;">
            <p><span style="font-size:14px;"><span style="color:#000000;">12 Monate</span></span></p>
            </td>
            <td style="text-align: center;" width="0%">
            <p> </p>
            </td>
            <td bgcolor="#f2f2f2" style="text-align: center;">
            <p><span style="font-size:14px;"><span style="color:#000000;">12 Monate</span></span></p>
            </td>
            <td style="text-align: center;" width="0%">
            <p> </p>
            </td>
            <td bgcolor="#f2f2f2" style="text-align: center;">
            <p><span style="font-size:14px;"><span style="color:#000000;">24 Monate</span></span></p>
            </td>
        </tr>
        <tr>
            <td bgcolor="#f2f2f2" style="text-align: left;">
            <p><span style="font-size:14px;"><span style="color:#000000;">Mindestvertragslaufzeit</span></span></p>
            </td>
            <td style="text-align: center;" width="0%">
            <p> </p>
            </td>
            <td bgcolor="#f2f2f2" style="text-align: center;">
            <p><span style="font-size:14px;"><span style="color:#000000;">1 Monat</span></span></p>
            </td>
            <td style="text-align: center;" width="0%">
            <p> </p>
            </td>
            <td bgcolor="#f2f2f2" style="text-align: center;">
            <p><span style="font-size:14px;"><span style="color:#000000;">12 Monate</span></span></p>
            </td>
            <td style="text-align: center;" width="0%">
            <p> </p>
            </td>
            <td bgcolor="#f2f2f2" style="text-align: center;">
            <p><span style="font-size:14px;"><span style="color:#000000;">24 Monate</span></span></p>
            </td>
        </tr>
        <tr>
            <td bgcolor="#f2f2f2" style="text-align: left;">
            <p><span style="font-size:14px;"><span style="color:#000000;">Energiemix</span></span></p>
            </td>
            <td style="text-align: center;" width="0%">
            <p> </p>
            </td>
            <td bgcolor="#f2f2f2" style="text-align: center;">
            <p><font color="#000000"><span style="caret-color: rgb(0, 0, 0); font-size: 14px;">Ökostrom</span></font></p>
            </td>
            <td style="text-align: center;" width="0%">
            <p> </p>
            </td>
            <td bgcolor="#f2f2f2" style="text-align: center;">
            <p><font color="#000000"><span style="caret-color: rgb(0, 0, 0); font-size: 14px;">Strommix</span></font></p>
            </td>
            <td style="text-align: center;" width="0%">
            <p> </p>
            </td>
            <td bgcolor="#f2f2f2" style="text-align: center;">
            <p><font color="#000000"><span style="caret-color: rgb(0, 0, 0); font-size: 14px;">Strommix</span></font></p>
            </td>
        </tr>
        <tr>
            <td bgcolor="#f2f2f2" style="text-align: left;">
            <p><span style="font-size:14px;"><span style="color:#000000;">Service</span></span></p>
            </td>
            <td style="text-align: center;" width="0%">
            <p> </p>
            </td>
            <td bgcolor="#f2f2f2" style="text-align: center;">
            <p><span style="font-size:14px;"><span style="color:#000000;">Online-Kundenportal</span></span></p>
            </td>
            <td style="text-align: center;" width="0%">
            <p> </p>
            </td>
            <td bgcolor="#f2f2f2" style="text-align: center;">
            <p><span style="font-size:14px;"><span style="color:#000000;">Rückmeldung auf Serviceanfragen innerhalb von 48 Stunden</span></span></p>
            </td>
            <td style="text-align: center;" width="0%">
            <p> </p>
            </td>
            <td bgcolor="#f2f2f2" style="text-align: center;">
            <p><span style="font-size:14px;"><span style="color:#000000;">Online-Kundenportal</span></span></p>
            </td>
        </tr>
        <tr style="height: 6px; text-align: center;">
        </tr>
        <tr style="height: 6px; text-align: center;">
        </tr>
        <tr>
            <td bgcolor="#f2f2f2" style="text-align: left;font-size:14px"><span style="color:#000000;">Your choice </span></td>
            <td style="text-align: center;" width="0%"> </td>
            <td bgcolor="#f2f2f2" style="text-align: center;"> </td>
            <td style="text-align: center;" width="0%"> </td>
            <td bgcolor="#f2f2f2" style="text-align: center;"> </td>
            <td style="text-align: center;" width="0%"> </td>
            <td bgcolor="#f2f2f2"> </td>
        </tr>
    </tbody>
</table>
<script type="text/javascript" charset="utf-8">
    
    
    $(document).on('ready pjax:scriptcomplete',function(){
 
        // Identify this question
        var thisQuestion = $('#question{QID}');

        // Move the radios
        $('.question-text table:eq(0) tr:last td:eq(2)', thisQuestion).append($('.subquestion-list .answers-list:eq(0) .answer-item:eq(0) *', thisQuestion));
        $('.question-text table:eq(0) tr:last td:eq(4)', thisQuestion).append($('.subquestion-list .answers-list:eq(0) .answer-item:eq(1) *', thisQuestion));
        $('.question-text table:eq(0) tr:last td:eq(6)', thisQuestion).append($('.subquestion-list .answers-list:eq(0) .answer-item:eq(2) *', thisQuestion));
        
        // Some classes for presentation
        $('.question-text table:eq(0) input:radio', thisQuestion).closest('td').addClass('answer-item radio-item text-center radio');
        $('.question-text table:eq(0) .radio-item label', thisQuestion).show();
        
        // Click event on the table cells
        $('.question-text table:eq(0) .radio-item', thisQuestion).on('click', function(e) {
            $('input:radio', this).trigger('click');
        });
        $('.question-text table:eq(0) input:radio', thisQuestion).on('click', function(e) {
            ();
        });
        
        // Clean-up styles
        $('.answer-container', thisQuestion).hide();
        $('.question-text table:eq(0) .label-text', thisQuestion).remove();
        $('.question-text table:eq(0) .radio-text', thisQuestion).css({
            'cursor': 'pointer'
        });
    });
</script>
 
  • Joffm
  • Joffm's Avatar
27 Feb 2024 22:07
Replied by Joffm on topic Choice-Based-Conjoint-Analyse
Kannst Du denn den Code der HTML-Tabelle einfügen, mit dem Code-Button des Editors?
Das ist der links neben "Size"

Joffm

P.S. Bitte, benutze den Ausdruck "Fragenvorlage" nur, wenn es wirklich eine Fragenvorlage ist.
Diese findest Du unter "Konfiguration / Designvorlagen"
 
Neben den Standard-Fragetypen siehst Du unten ein Benutzerthema.

Das hat aber nichts mit dem Einfügen von HTML-Code im Fragetext zu tun.
  • Joffm
  • Joffm's Avatar
27 Feb 2024 12:38 - 27 Feb 2024 12:39
Replied by Joffm on topic Choice-Based-Conjoint-Analyse
So, jetzt etwas mehr dazu.

Wie @holch schon schrieb: Das Design musst du selbst erstellen.
Aber dies ist im Grunde ist es eine Frage vom Typ "Matrix" mit einer Teilfrage
Dann wird eine HTML-Tabelle in den Fragentext eingefügt. In dieser werden die Attributsausprägungen jeweils mittels ExpressionScript  eingefügt.
Und die radio-buttons werden dann ebenfalls in diese Tabelle verschoben.
Dieser letzte Schritt erfordert die Benutzung von javascript.

Wenn ich "Masterarbeit" lese, vermute ich, Du benutzt eine Installation der Uni.
Oftmals verbieten hier die admins die Benutzung von javascript.
Im schon erwähnten Tutorial wird ja am Anfang ein kleiner Test gezeigt, wie Du dies testen kannst.

Gut jetzt hast Du das Gerüst.
Jetzt kommen wir zum Modell.
Wenn Du bei allen Teilnehmer 12 identische Vergleiche abfragen willst, ist es trivial.
Oder ist es ein Modell, in dem Du mit irgendeinem Tool für jeden Teilnehmer die entsprechenden "Karten" berechnet hast?
Egal, das ist alles nur ein bisschen ExpressionScript.

Jetzt solltest Du mitteilen, 
  • welche Version Du benutzt; wenn es nicht rechts unten steht, weil der admin dies entfernt hat, genügt auch ein screenshot der Seite beim Bearbeiten einer Frage ("Matrix" ist am besten)
  • kannst Du javascript benutzen? (Den kleinen Test kannst Du ja machen)

Und dann kannst Du einmal herangehen, uns zu zeigen, wie Du Dir die Frage vom Aussehen her vorstellst.
Hier ist ein Beispiel (nicht Conjoint und noch ohne Text in den einzelnen Zellen, aber von der Tabellenstruktur gleich)
 

Bis dann

Joffm

P.S. Und es soll "keine Angabe" geben?
Ich dachte immer, Conjoint ist etwas wie "unter den Blinden ist der Einäugige König"


 
  • DenisChenu
  • DenisChenu's Avatar
27 Feb 2024 11:08
Replied by DenisChenu on topic Datepicker et jquery
Tu as essayé d'utiliser le date min directement ?

Les dates précédentes permettent d'être sélectionnées, mais restent invalide.
Par contre : ça créé un champs (caché) avec la date min, à utiliser dans la suite (a voir)

Pour empêcher la sélection : va falloir travailler avec l’événement javascript html:updated (spécifique LimeSurvey).
  • BIFI_research
  • BIFI_research's Avatar
26 Feb 2024 16:08
Replied by BIFI_research on topic Changing the font-weight in custom.css
Hi joffm,

No,I do not see that button. I was confused about that, since I remembered it from last time I posted. 

I tried it with 2 different browsers, Firefox and Brave. In both cases no "Add file"-Button :(

I then tried to upload an share the pictures on a drive folder, add a picture via the HTML-Menu and enter the link to the shared file. Did not work, as we can see.

Im not sure if I am stupid or something is broken.

I would provide a screenshot of how the forum-form looks, but ... well I can't :D
  • Joffm
  • Joffm's Avatar
26 Feb 2024 15:45
Replied by Joffm on topic Unvollständige Antwortenausgabe
Hallo,

er lässt mich schlichtweg einfach keine Dateien hinzufügen. Mehr kann ich dir leider auch nicht sagen.

Also: Du klickst auf den Button "Add Files"; und dann passiert gar nichts?

Naja, der Code.

Der Code den mir eine Kollegin dafür geschrieben hat wäre dann folgender( wenn ich mich nicht irre):

Das ist ja gar nichts, nur die HTML-Darstellung eines selects.
Du brauchst doch nur in der Frage nachzuschauen, wie er wirklich aussieht.

Und benutze für Code-Einfügung bitte den entsprechenden Button (ist einfach besser zu lesen)

Der screenshot, den ich gezeigt habe, stammt ja aus meinem "Tutorial 2: Mehrfachnennungen"
Dort kannst Du ja sehen, was alles noch dazugehört; und dann ist immer noch kein Dropdown darin.


Bis dann
Joffm

 
  • Finn Marten
  • Finn Marten's Avatar
23 Feb 2024 11:19
Hello,I am encountering an issue while setting up a conjoint experiment. I have successfully defined and randomized the information required to present different scenarios in a matrix question. However, although my code effectively draws information for presenting scenarios from this table-like matrix question in subsequent queries, I wish to conceal the table from my participants.Utilizing the "hide this question" option doesn't seem to work. It appears that, in doing so, the scenarios in follow-up questions cannot extract the necessary information (or so I suspect, considering my beginner status). Following extensive research on how to hide LimeSurvey objects and questions through HTML and CSS classes, I'm hopeful that someone in the community can guide me in the right direction.Any assistance would be greatly appreciated. I am utilizing the free version of LimeSurvey without any plugins or special templates.
Displaying 46 - 60 out of 4729 results.

Lime-years ahead

Online-surveys for every purse and purpose