Welcome to the LimeSurvey Community Forum

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

Search Results (Searched for: html)

  • ngolub
  • ngolub's Avatar
23 Feb 2024 10:27
Habe an dieser Frage weitergearbeitet und konnte jetzt den Schieberegler auf einer anderen Art und Weise implementieren:
Code:
<p><strong>10. Wie wichtig sind die nachfolgenden General Management-Kompetenzen <u>bezogen auf Ihre aktuelle Führungsposition?</u></strong></p>
<script type="text/javascript">
  $(document).ready(function() {
    // Identify this question
    var thisQuestion = $('#question1784');
 
    // Define the sub-heading text strings with tooltip text using the title attribute
    var subHeading1 = '<strong title="Your detailed information for Leadership">Leadership</strong>';
    var subHeading2 = '<strong title="Your detailed information for Academic Environment">Handeln im akademischen Umfeld</strong>';
    var subHeading3 = '<strong title="Your detailed information for Political Environment">Handeln im politischen Umfeld</strong>';
    var subHeading4 = '<strong title="Your detailed information for Strategic Design">Strategisches Gestaltungsvermögen</strong>';
    var subHeading5 = '<strong title="Your detailed information for Business Thinking">Betriebswirtschaftliches Denken und Handeln</strong>';
    var subHeading6 = '<strong title="Your detailed information for Organizational Change">Den organisatorischen Wandel gestalten</strong>';
 
    // Find out the number of columns in the question
    var columnsLength = $('tr.answers-list:eq(0) > *', thisQuestion).length;
 
    // Insert the subheadings before the specific subquestions
    $('tr.answers-list:eq(0)', thisQuestion).before('<tr class="sub-header-row"><th colspan="'+columnsLength+'">'+subHeading1+'</th></tr>');
    $('tr.answers-list:eq(5)', thisQuestion).before('<tr class="sub-header-row"><th colspan="'+columnsLength+'">'+subHeading2+'</th></tr>');
    $('tr.answers-list:eq(10)', thisQuestion).before('<tr class="sub-header-row"><th colspan="'+columnsLength+'">'+subHeading3+'</th></tr>');
    $('tr.answers-list:eq(15)', thisQuestion).before('<tr class="sub-header-row"><th colspan="'+columnsLength+'">'+subHeading4+'</th></tr>');
    $('tr.answers-list:eq(19)', thisQuestion).before('<tr class="sub-header-row"><th colspan="'+columnsLength+'">'+subHeading5+'</th></tr>');
    $('tr.answers-list:eq(24)', thisQuestion).before('<tr class="sub-header-row"><th colspan="'+columnsLength+'">'+subHeading6+'</th></tr>');
 
    // Fix the row classes for styling
    var rowClass = 1;
    $('table.subquestion-list tbody tr', thisQuestion).each(function(i) {
      if($(this).hasClass('sub-header-row')) {
        rowClass = 1;
      } else {
        rowClass++;
        $(this).removeClass('array1 array2');
        if(rowClass % 2 == 0) {
          $(this).addClass('array2');
        } else {
          $(this).addClass('array1');
        }
      }
    });
 
    // Initialize Bootstrap tooltips
    $('[data-bs-toggle="tooltip"]').tooltip();
  });
</script><script>
document.addEventListener("DOMContentLoaded", function() {
    // Target the specific question part for future importance with question ID 1903
    var questionBaseId = "866522X20X1784"; // Base ID format in LimeSurvey might include the survey ID and question ID
    var questionPart = "1"; // Part 2 of the dual array, indicating future importance
 
    // Hide existing radio buttons for the second part of the question
    document.querySelectorAll('input[name^="' + questionBaseId + '#"]').forEach(function(radio) {
        radio.closest('td').style.display = 'none'; // Hide the table cell containing the radio button
    });
 
    // Loop through each sub-question to add a slider
    document.querySelectorAll('[id^="javatbd' + questionBaseId + '"]').forEach(function(subQuestionRow) {
        var subQuestionId = subQuestionRow.id.match(/\d+$/)[0]; // Extract the numeric part (sub-question ID)
 
        // Create a new slider input
        var slider = document.createElement("input");
        slider.setAttribute("type", "range");
        slider.setAttribute("min", "-1"); // Assuming scale starts at 1
        slider.setAttribute("max", "1"); // Assuming scale ends at 3, adjust as per your scale
        slider.setAttribute("value", "0"); // Default value, can be adjusted
        slider.setAttribute("step", "0.1"); // Set the step interval to 0.1
        slider.setAttribute("class", "future-importance-slider"); // For styling if needed
        slider.setAttribute("id", questionBaseId + "_" + subQuestionId + "_slider");
 
        // Find the cell where the slider should be placed
        var sliderCell = subQuestionRow.querySelector('td:last-child');
        if (sliderCell) {
            // Clear the cell and append the slider to this cell
            sliderCell.innerHTML = ''; // This removes any existing content, like improperly placed sliders
            sliderCell.appendChild(slider); // Append the slider to the cell
        }
 
        // Update a hidden input or perform other actions when the slider value changes
        slider.addEventListener("input", function() {
            // Example: Update a hidden input field with the slider's value
            var hiddenInput = document.querySelector('input[id="java' + questionBaseId + subQuestionId + '_' + questionPart + '"]');
            if(hiddenInput) {
                hiddenInput.value = this.value;
            }
        });
    });
});
 
</script>
<style type="text/css">.tooltip[data-toggle="tooltip"] {
    cursor: pointer;
  }
 
/* Styles for your .mytooltip1 elements */
.mytooltip1 {
  cursor: pointer;
  font-weight: bold;
  color: #08407E;
}
 
  
.tooltip-inner{
    min-width:500px;
    height:auto;
    padding:3px 8px;
    color:#314A5B;
    text-align:left;
    font-weight:400;
    border-radius:15px;
    border: 1px solid #314A5B;
    background-color:white;
    font-size: 16px;
}
  
 
    .coloured-array.array-flexible-dual-scale .column-1 {    background-color:  rgba(255, 204, 153, 0.3);}
    .coloured-array.array-flexible-dual-scale .column-2 {    background-color:  rgba(255, 204, 153, 0.3);}
    .coloured-array.array-flexible-dual-scale .column-3 {    background-color:  rgba(255, 204, 153, 0.3);}
    .coloured-array.array-flexible-dual-scale .column-4 {    background-color:  rgba(255, 204, 153, 0.3);}
    .coloured-array.array-flexible-dual-scale .column-5 {    background-color:  rgba(255, 204, 153, 0.3);}
    .coloured-array.array-flexible-dual-scale .column-6 {     background-color: rgba(153, 204, 255, 0.3);}
    .coloured-array.array-flexible-dual-scale .column-7 {     background-color: rgba(153, 204, 255, 0.3);}
    .coloured-array.array-flexible-dual-scale .column-8 {     background-color: rgba(153, 204, 255, 0.3);}
    .coloured-array.array-flexible-dual-scale .column-9 {     background-color: rgba(153, 204, 255, 0.3);}
    .coloured-array.array-flexible-dual-scale .column-10 {   background-color: rgba(153, 204, 255, 0.3);}
    th.dsheader:nth-of-type(2) {    background-color:  rgba(255, 204, 153, 0.3);}
    th.dsheader:nth-of-type(3) {    background-color:  rgba(153, 204, 255, 0.3);}
    td.answer_cell_1_1 {    background-color:  rgba(255, 204, 153, 0.3);}
    td.answer_cell_1_2 {    background-color:  rgba(255, 204, 153, 0.3);}
    td.answer_cell_1_3 {    background-color:  rgba(255, 204, 153, 0.3);}
    td.answer_cell_1_4 {    background-color:  rgba(255, 204, 153, 0.3);}
    td.answer_cell_1_5 {    background-color:  rgba(255, 204, 153, 0.3);}
    td.answer_cell_2_1 {    background-color: rgba(153, 204, 255, 0.3);}
    td.answer_cell_2_2 {    background-color: rgba(153, 204, 255, 0.3);}
    td.answer_cell_2_3 {    background-color: rgba(153, 204, 255, 0.3);}
    td.answer_cell_2_4 {    background-color: rgba(153, 204, 255, 0.3);}
    td.answer_cell_2_5 {    background-color: rgba(153, 204, 255, 0.3);}
    th#answer866522X20X1784_0-1 {    background-color: rgba(255, 204, 153, 0.3);}
    th#answer866522X20X1784_0-2 {    background-color: rgba(255, 204, 153, 0.3);}
    th#answer866522X20X1784_0-3 {    background-color: rgba(255, 204, 153, 0.3);}
    th#answer866522X20X1784_0-4 {    background-color: rgba(255, 204, 153, 0.3);}
    th#answer866522X20X1784_0-5 {    background-color: rgba(255, 204, 153, 0.3);}
    th#answer866522X20X1784_1-1 {    background-color: rgba(153, 204, 255, 0.3);}
    th#answer866522X20X1784_1-2 {    background-color: rgba(153, 204, 255, 0.3);}
    th#answer866522X20X1784_1-3 {    background-color: rgba(153, 204, 255, 0.3);}
    th#answer866522X20X1784_1-4 {    background-color: rgba(153, 204, 255, 0.3);}
    th#answer866522X20X1784_1-5 {    background-color: rgba(153, 204, 255, 0.3);}
</style>
<style type="text/css">/* Hide the red warning message for mandatory multiple choice questions */
  div.ls-question-mandatory-multiplechoice,
  div.ls-question-mandatory.ls-question-mandatory-other-text-danger,
  div.ls-question-mandatory.ls-question-mandatory-other,
  /* Add the class for mandatory multiple numerical input questions */
  div.ls-question-mandatory.ls-question-mandatory-array.text-danger {
      display: none;
  }
</style>
<style type="text/css"><style>
    /* Override the width of the columns for the sliders */
    .ls-answers table .group-2 col {
        width: 45% !important; /* This width should match the combined width of the other columns */
    }
    
    /* Ensure the sliders span the full width of the table cell */
    .future-importance-slider {
        width: 100%; /* Make sure the slider takes up the full width */
    }
</style>
<script type="text/javascript" charset="utf-8">
  $(document).on('ready pjax:scriptcomplete',function(){
    var thisQuestion = $('#question1784');
    // Add a question class
    thisQuestion.addClass('custom-array');
 
    // Column-specific classes
    $('table.subquestion-list tr', thisQuestion).each(function(i) {
      $('th, td', this).each(function(i) {
        $(this).addClass('column-'+i);
      });
    });
  });
</script>
<style type="text/css">.custom-array table.subquestion-list col {
    width: auto !important;
  }
 
  .custom-array table.subquestion-list thead .column-0 {  width: 30%; }
  .custom-array table.subquestion-list thead .column-2 {  width: 35%; }
  .custom-array table.subquestion-list thead .column-3 {  width: 5%; }
  .custom-array table.subquestion-list thead .column-5 {  width: 30%; }
</style>

 
  • modernity4r
  • modernity4r's Avatar
22 Feb 2024 05:55 - 22 Feb 2024 12:05
Mathjax in answer options was created by modernity4r
Please help us help you and fill where relevant:
Your LimeSurvey version: 6.4.8+
Own server or LimeSurvey hosting: Both
Survey theme/template: Fruity
==================The questions and answers sometimes contain numbers. To improve the readability of numbers, I have the habit of using Mathjax's number expression uniformly. This does not affect the Mathjax-linked numbers in the questions, but there is a peculiarity with the single choice radio button responses. When one radio button is pressed, the space where the number is expressed is covered in white, obscuring the number.This only happens on iPhones (iOS). It does not occur on Android devices. It is also not related to the browser. On Android, it does not occur in Chrome, Firefox, or Opera.

Mathjax was added to custom.js as follows:
Code:
/******************
    User custom JS
    ---------------
 
   Put JS-functions for your template here.
   If possible use a closure, or add them to the general Template Object "Template"
*/
 
// MathJax 
function loadMathJax() {
  var script = document.createElement('script');
  script.type = 'text/javascript';
  script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js';
  script.async = true;
  document.head.appendChild(script);
}
 
// MathJax 
window.MathJax = {
  tex: {
    inlineMath: [['$', '$'], ['\\(', '\\)']] 
  },
  startup: {
    ready: function() {
      console.log('MathJax is ready');
      MathJax.startup.defaultReady();
    }
  }  
};
 
//  MathJax Excute
document.addEventListener('DOMContentLoaded', function () {
  loadMathJax();
});
 
$(document).on('ready pjax:scriptcomplete', function() {
 
  /**
   * Code included inside this will only run once the page Document Object Model (DOM) is ready for JavaScript code to execute
   * @see https://learn.jquery.com/using-jquery-core/document-ready/
   */
   
  if(localStorage.getItem("lsFontSize") === null) {
    localStorage.setItem('lsFontSize', 110);
  }
 
  $('body').attr('data-ls-font-size', localStorage.getItem('lsFontSize'));
 
  $('.text-size-container button').on('click', function(e) {
    var lsCurrentFontSize = Number(localStorage.getItem('lsFontSize'));
    var sizeIncrement = 10;
    
    if($(this).hasClass('minus')) {
      sizeIncrement = -10
    }
    
    var lsNewFontSize = lsCurrentFontSize+sizeIncrement;
    localStorage.setItem('lsFontSize', lsNewFontSize);
    $('body').attr('data-ls-font-size', localStorage.getItem('lsFontSize'));
  });
 
});
  • DenisChenu
  • DenisChenu's Avatar
21 Feb 2024 12:29
I think the only way is to create a plugin for this (but i don't know how to start).

Else : export 200 by 200 with api.limesurvey.org/classes/remotecontrol...hod_export_responses
  • VictorROYER
  • VictorROYER's Avatar
20 Feb 2024 14:12
Non,

Condition : { 1 }

Si je retire le display None de ma balise html, la Q2 apparaît sous ma Q1

Or ce n'est pas ce que je veux, je veux que ma Q2 soit à côté de ma Q1 pour former un tableau avec des boutons radio (Q1) + une entrée utilisateur (Q2)

Capture d'écran si je retire le display: none
 
  • waaalex
  • waaalex's Avatar
20 Feb 2024 09:48
Replied by waaalex on topic Cexception runtime Path after update
Found the issue.
It was Selinux :

chown -R apache:apache /var/www/html/glpi/limesurvey
chcon -R -t httpd_sys_rw_content_t /var/www/html/limesurvey

It will work.
Thanks.
  • Oterito
  • Oterito's Avatar
19 Feb 2024 18:02
Please help us help you and fill where relevant:
Your LimeSurvey version: 5.6.54
Own server or LimeSurvey hosting: Limesurvey hosting
Survey theme/template: Fruity
==================
Hi! I have some questions (radio and multiple) in a survey with images as subquestions, for example: <div class="img-container"><img alt="Simplicity" src="/upload/surveys/852254/images/Simplicity.png" style="height: 100px" /></div>. 
When you export the answer table for both excel and spss, the subquestion text appears empty. 
Is there any html tag I can include in subquestions for showing text in answer table? I think i saw it in forum but i was searching long and i cound't found it. 

Thanks in advance! 
 
  • VictorROYER
  • VictorROYER's Avatar
19 Feb 2024 16:06
Je viens de comprendre mon problème.
Déjà, l'utilisation de em_validation_q_tip est en effet la meilleure solution pour régler mon problème. j'ai fait un test avec le fichier lss de TMSWhite dans cet exemple :
forums.limesurvey.org/forum/can-i-do-thi...alidate-subquestions

Cependant, le message d'erreur apparaît dans le code html quand je fais inspecter, mais pas sur mon écran ( pas de message ni de contour rouge pour me signaler une erreur)
 

La structure de mon enquête créer peut-être cette erreur :
J'ai un groupe avec 2 questions, la première question Q1 permet d'afficher mon tableau avec mes boutons et la question Q2 me permet de créer mes entrées utilisateurs.

D'ailleurs, je remarque que le nom de ma question Q2 n'apparaît aussi pas sur mon enquête, mais est bien présent dans mon code html.
Il s'agit presque d'un autre problème, l'indication de validation de la question Q2 n'apparaît pas s'il y a plusieurs questions dans le groupe.
Dois-je créer un nouveau topic ?
  • bellagambad
  • bellagambad's Avatar
19 Feb 2024 09:59 - 19 Feb 2024 12:08
LimeSurvey version: 5.4.3.+
Own server or LimeSurvey hosting: own server
Survey theme/template: custom fruity
==================
Hello LS community,

My organization wants to build a dashboard on safety culture (healthcare setting) based on a longitudinal survey. So I need to be able to refresh data directly from databases, as opposed to manual extraction from LimeSurvey. With MySQL queries, I have access to all the tables described here . My problem concerns multiple choice questions and arrays. With the SGQA identifier, I can find the label of the question in the table 'lime_question_l10ns' but I cannot find the labels of multiple choice options or subquestions in other tables. They seem to be in the same table, with a qid that I cannot find in the 'lime_survey_######' table. Here are four headers of a same question (qid 5988) which represent subquestions of an array question, found in the 'lime_survey_822716' table :

822716X468X5988Q7    822716X468X5988Q8    822716X468X5988Q9    822716X468X5988Q10

In the 'lime_question_l10ns' table, I can find the qid 5988, but the Q7, Q8, Q9 and Q10 subquestions are nowhere to be found. There seem to be qid with the correct labels (6260 to 6263) but I cannot find a key to join the tables and decode the subquestions: Q7 isn't 6260, Q8 isn't 6261 and so on.
Does anyone know what I am missing ? Please tell me if I need to provide more information.

Thank you in advance,

David
 
  • ritapas
  • ritapas's Avatar
16 Feb 2024 10:02
Replied by ritapas on topic {TOKEN:VALIDFROM} / {TOKEN:VALIDUNTIL}
Hi,
thank you for your kind reply.
Indeed, our version is still 3.23.5. We plan to switch to LS5 as soon as possible.
However, I made another try and I found out that, though I'd been distracted by the "Validate Expressions", the email message actually contains the desired values.
This is a bit odd but anyway it works.

For reference, this is the HTML mail template text:
Code:
<html>
<head>
    <title></title>
</head>
<body>
<p>Dear {FIRSTNAME},<br /><br />you have been invited to participate in a survey.<br /><br />The survey is titled:<br />"{SURVEYNAME}"<br /><br />"{SURVEYDESCRIPTION}"</p>
 
<p>Token is valid from {VALIDFROM} until {VALIDUNTIL}</p>
 
<p>Uses left: {USESLEFT}</p>
 
<p><br /><br />To participate, please click on the link below.<br /><br />Sincerely,<br /><br />{ADMINNAME} ({ADMINEMAIL})<br /><br />----------------------------------------------<br />Click here to do the survey:<br />{SURVEYURL}<br /><br />If you do not want to participate in this survey and don't want to receive any more invitations please click the following link:<br />{OPTOUTURL}<br /><br />If you are blacklisted but want to participate in this survey and want to receive invitations please click the following link:<br />{OPTINURL}</p>
</body>
</html>

I enclose a screenshot from "Validate Expressions".
 
  • Joffm
  • Joffm's Avatar
15 Feb 2024 09:15
Replied by Joffm on topic Zusammenfassung der Eingaben
Klar geht das.
Nimm eine "Textanzeige" und dann kannst Du Deine Zusammenfassung mit ExpressionScript anzeigen
Außerdem hast Du alle Möglichkeiten von HTML, css, bootstrap und allen implementierten Funktionen, um diese Zusamenfassung optisch ansprechend zu gestalten.

Warum hast Du denn die Fragen am Anfang nicht beantwortet?

Joffm
  • rikeschae
  • rikeschae's Avatar
12 Feb 2024 13:06
I adjusted my previous version with only images inserted via UI and html link. I also disabled "Swipe between pages" in my Mac configuration for the trackpad. I think the replacement of the images did the trick, but maybe this could also play a role.

I am not sure how stable it is working now, but up until the error message did not appear in this version.
Thank you so much for your tips! 
  • DenisChenu
  • DenisChenu's Avatar
11 Feb 2024 11:25 - 11 Feb 2024 11:26

There is probably a CSS workaround but I'm away from a computer today.

 
Maybe check with this solution : github.com/LimeSurvey/LimeSurvey/pull/3038
(i mean : adding a new class and deactivate the core solution)

Else : doing it in HTML before show the question : gitlab.com/SondagesPro/QuestionSettingsType/arrayFilterHtml
  • DenisChenu
  • DenisChenu's Avatar
09 Feb 2024 15:00
Replied by DenisChenu on topic Cexception runtime Path after update
/var/www/html/limesurvey/application/runtime or /var/www/html/limesurvey/tmp/runtime ?

Seems not the good one here ?
  • waaalex
  • waaalex's Avatar
09 Feb 2024 10:06
Cexception runtime Path after update was created by waaalex
Please help us help you and fill where relevant:
Your LimeSurvey version: 6.3.6+231120
Own server or LimeSurvey hosting: Own server
Survey theme/template: no custom theme
==================

After update from 6.3.6 to latest version, we have this eror message.
Code:
CException Application runtime path "/var/www/html/limesurvey/application/runtime" is not valid. Please make sure it is a directory writable by the Web server process.
Folder runtime exists and has correct rights. I do not understand what's happen.
Can you help me?
Thanks.
Regards.
Alex.
  • DenisChenu
  • DenisChenu's Avatar
09 Feb 2024 08:30
I don't see margin on your table here.
Else mpdf.github.io/tables/table-layout.html

About page padding : i didn't update anything default fro mpdf. Maybe yoiu can try to set some @page css : mpdf.github.io/paging/using-page.html
in gitlab.com/SondagesPro/coreAndTools/lime....twig?ref_type=heads
Displaying 61 - 75 out of 4729 results.

Lime-years ahead

Online-surveys for every purse and purpose