Welcome to the LimeSurvey Community Forum

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

Search Results (Searched for: multiple)

  • Jo1010
  • Jo1010's Avatar
Today 11:30 - Today 11:30
Replied by Jo1010 on topic Conditions équation
Merci pour ce retour.

Petite précision qui a son importance : je travaille sur une version serveur mis à disposition par mon institution. Je n'ai donc malheureusement pas la main sur les plugins.

Il me semble toutefois que la fonction statCount (que je ne connaissais pas) pourrait convenir.

Comment puis-je paramétrer une équation avec cette fonction en y liant les effectifs d'une question à choix multiples ? En créant des variables dichotomiques pour chaque modalité ?
  • Jo1010
  • Jo1010's Avatar
Today 10:36 - Today 10:37
Conditions équation was created by Jo1010
Aidez-nous à vous aider et remplissez les cases appropriées :
Votre version de LimeSurvey : Version de votre LimeSurvey : 5.6.58+
Votre propre serveur ou LimeSurvey Cloud : serveur 
Thème :
Bootwatch_2022
==================

Bonjour,

Au début d’un questionnaire, nous interrogeons des enseignants sur leur établissement d’affectation (variable « College » à choix unique) et sur les classes de sixièmes dont ils ont la charge (variable « Classes » à choix multiples avec 9 modalités). Par la suite, nous souhaiterions les interroger uniquement sur une des classes dont ils ont la charge. J’envisage donc une question de type équation qui sera masquée pour « affecter » chaque répondant à une classe dont il aura préalablement indiqué avoir la charge.

J’envisageais initialement que cette affectation soit randomisée parmi les classes sélectionnées. Mais, nous souhaiterions équilibrer au mieux le nombre d’enseignants affectés à chaque classe au sein d’un même établissement et surtout, éviter l’écueil qu’un enseignant ayant préalablement indiqué avoir la 6eB et la 6eD soit affecté à la 6eD alors que plusieurs répondants ont déjà répondu pour cette classe et aucun pour la 6eB.

Auriez-vous une idée de comment paramétrer l’équation « Affectation » pour qu’elle alloue à chaque répondant la classe pour laquelle l’effectif des répondants antérieurs du même collège est le plus faible (affectation par l’équation elle-même) parmi les classes sélectionnées préalablement dans « Classes » ?
Exemple : si l’équation « Affectation » a déjà elle-même alloué, dans le collège X, 4 enseignants à la classe A, 2 à la classe B et 1 à la classe C et, qu’un nouveau répondant choisit les classe A et B à la question « Classe », je voudrais que l’équation affecte ce nouveau répondant à la classe B (minimum des effectifs de A et B ).

Merci par avance.

Bien cordialement.
  • DenisChenu
  • DenisChenu's Avatar
24 Apr 2024 08:19
Hi,

It's really seems to be a bug.  Soft mandatory are surely not tested with Full index.

Globally Soft mandatory can be replaced by
  • An option in multiple choice
  • A checkbox question after text question with «I don't want to answer to this question»
  • rajkumar_dms
  • rajkumar_dms's Avatar
23 Apr 2024 10:44 - 23 Apr 2024 14:21
Please help us help you and fill where relevant:
Your LimeSurvey version: [6.5]
Own server or LimeSurvey hosting:Clould
Survey theme/template:
==================
I would like the below compile the below syntax in lime survey, can i compile it 
<script type="text/javascript">
  $(document).on('ready pjax:scriptcomplete',function(){
function shuffleArray(array) {
    for (let i = array.length - 1; i > 0; i--) {
        const j = Math.floor(Math.random() * (i + 1));
        [array, array[j]] = [array[j], array];
    }
    return array;
}

// Example: Customizing rotation for a multiple choice question
$(document).ready(function() {
    // Identify the question by its ID or class
    var questionId = $('#question{QID}'); // Change to the appropriate ID or class

    // Get the answer choices container
    var answerChoicesContainer = $(questionId).find('.answer-choices');

    // Get the answer choices
    var answerChoices = answerChoicesContainer.children('.answer-item');

    // Array to store fixed elements
    var fixedElements = [2,4,6];

    // Loop through answer choices to find fixed elements
    answerChoices.each(function() {
        if ($(this).hasClass('fixed')) { // Assuming 'fixed' is a class added to fixed elements
            fixedElements.push($(this));
        }
    });

    // Remove fixed elements from the answer choices array
    fixedElements.forEach(function(element) {
        answerChoices = answerChoices.not(element);
    });

    // Shuffle the remaining answer choices
    var shuffledChoices = shuffleArray(answerChoices);

    // Insert fixed elements back into the shuffled choices array
    fixedElements.forEach(function(element) {
        shuffledChoices.splice(element.data('position'), 0, element); // Assuming 'position' is a data attribute indicating the fixed position
    });

    // Append the shuffled choices back to the container
    answerChoicesContainer.empty().append(shuffledChoices);
});
</script>
  • DenisChenu
  • DenisChenu's Avatar
23 Apr 2024 08:32
Replied by DenisChenu on topic Politique de confidentialité et mention légale
Remonter le bogue,

Mais oui : le système de la politique de confidentialité est fait de telle façon. Je le considère clairement comme imparfait de mon côté.

Tu peux le faire à l'ancienne : un groupe avec une seule question  (choix multiple) ou tu expliques la politique de confidentialité et 1 seul choix «Je suis OK».

Ajouter la condition de cette case à cocher à tous les groupes suivants.
 
  • Joffm
  • Joffm's Avatar
22 Apr 2024 18:12
Hi,
1. An online survey is different from a paper-pencil-survey.
Feel free to read this
 

File Attachment:

File Name: surveyfrie...4-22.zip
File Size:977 KB


2. Of course you can do that.
Use the appropiate question type (multiple numerical input)

BUT: You used the wrong type of "bootstrap-buttons"
Use the "single punch" button!
   


And with this correct button the css is like this
Code:
<style type="text/css">
@media (min-width: 769px) {
  .myOther .answer-item { 
      width: 17%; 
      margin-left:83%; 
  }
}
</style>

You see that I used a custom css class "myOther".
This is to not affect other elements on the same page.

Here the survey (only group(s) MODRum and only the first filled.
 

File Attachment:

File Name: limesurvey...7155.lss
File Size:182 KB

The rest - up to you.

Joffm





 
  • Joffm
  • Joffm's Avatar
22 Apr 2024 16:38
What do you mean by "options for 'others'"?
The text?
This you set in "Display".
Or the length of the field?
Investigate with the webdevelopment tool of your browser to find the affected classes (F12)

You can do this with some css
 
 
Code:
<style type="text/css">
@media (min-width: 769px) {
  .other-text-item { 
     width: 17%; 
     margin-left:83%; 
  }
}
</style>


On the other side:
If you allow all numbers - more or less- I think it to be better you use a simple "numerical input" or a "multiple numerical input"
 
  • kirsten.vdz
  • kirsten.vdz's Avatar
22 Apr 2024 13:45
Lost changes to survey was created by kirsten.vdz
Please help us help you and fill where relevant:
Your LimeSurvey version:  LimeSurvey Community Edition  (Version 5.6.10+230313)
Own server or LimeSurvey hosting: LimeSurvey
Survey theme/template: extends_fruity
==================
Hi there,
Hoping someone can please help me understand an issue I am having. I have been working on building a large survey over the past two weeks with no issues and have activated the survey multiple times. On Friday, I made a series of changes, activated it, tested it, filtered responses. This morning, I opened up my laptop and accessed the website, and maybe 3 days of work has just vanished, i.e., settings changes have reverted, questions are gone / unedited, the survey is not activated and all my test responses have vanished too.

Does anyone know what may have caused this - is it possibly the update released today? 
  • AntPIC
  • AntPIC's Avatar
20 Apr 2024 16:09
Replied by AntPIC on topic validation of multiple numeric inputs
Thanks Joffm

/^(195[0-9]|19[6-9][0-9]|20[0-9]{2}|2100)$/
  • Joffm
  • Joffm's Avatar
20 Apr 2024 15:25
Replied by Joffm on topic validation of multiple numeric inputs
You see what I entered to limit from 1950 to 2024.
And you may use
[url] regex101.com/ [/url]
to get more familiar with regular expressiona.
 
  • AntPIC
  • AntPIC's Avatar
20 Apr 2024 11:31
Replied by AntPIC on topic validation of multiple numeric inputs
and if i want a range between 1900-2100? What i have to insert?
  • Joffm
  • Joffm's Avatar
20 Apr 2024 11:15
Replied by Joffm on topic validation of multiple numeric inputs
It is correct syntax, but it allows 
1492
8745
Not very realistic years
  • AntPIC
  • AntPIC's Avatar
20 Apr 2024 09:50
Replied by AntPIC on topic validation of multiple numeric inputs
I just put this
/^([1-9][0-9][0-9][0-9])?$/
is correct?
  • AntPIC
  • AntPIC's Avatar
20 Apr 2024 09:20
Replied by AntPIC on topic validation of multiple numeric inputs
Thank you Joffm,
This work
count(self)<2 or (count(self)==2 AND D1a3_SQ001.NAOK<=D1a3_SQ002.NAOK)

Can I add a limit to the string of numbers which must be equal to 4?
  • Joffm
  • Joffm's Avatar
19 Apr 2024 18:30 - 19 Apr 2024 18:32
Hi,
Let's say the first multiple question is Q1 with subquestion codes 1, 2, 3, ...
To do this I prefer to create a "container" to store interim results
1. Create a question of type "multiple short text" (I called it "RC" like "Result Container") with subquestions
RC_11
RC_12
RC_13
RC_21
RC_22
RC_23
RC_31
RC_32
RC_33
RC_99 (for the final result)
Three subquestions are needed for each element

2. Create a question of type "equation" and enter (only) the equations
First create the base:
{RC_11=join(if(Q1_1=="Y","A",""),if(Q1_2=="Y","B",""),if(Q1_3=="Y","C",""),if(Q1_4=="Y","D",""),if(Q1_5=="Y","E",""),if(Q1_6=="Y","F",""),if(Q1_7=="Y","G",""),if(Q1_8=="Y","H",""),if(Q1_9=="Y","I",""),if(Q1_10=="Y","J",""))}
We get something like "ADEGIJ"
Now the procedure I explained before
Random number from 1 to the length of this string
{RC_12=if(is_empty(RC_12),rand(1,strlen(RC_11)),RC_12)}

Capture the letter at this position
{RC_13=substr(RC_11,RC_12-1,1)}

Remove the letter at this position; this is the base for the next round
{RC_21=str_replace(RC_13,'',RC_11)}
{RC_22=if(is_empty(RC_22),rand(1,strlen(RC_21)),RC_22)}
{RC_23=substr(RC_21,RC_22-1,1)}


{RC_31=str_replace(RC_23,'',RC_21)}
{RC_32=if(is_empty(RC_32),rand(1,strlen(RC_31)),RC_32)}
{RC_33=substr(RC_31,RC_32-1,1)}


Now there are three letters (in RC_13, RC_23 and RC_33)

Joined with a  '#' (important for the function "strpos(x,y)")
{RC_99=join('#',RC_13,RC_23,RC_33)}

Now the conditions of the subquestions in Q2 are (just ask: Does the final strinf contain the letter)
strpos(RC_99,"A")>0
strpos(RC_99,"B")>0
strpos(RC_99,"C")>0

...


And there is this javascript solution.
Create a question of type "short text"
in the default answer enter
{list(if(Q1_1=="Y","A",""),if(Q1_2=="Y","B",""),if(Q1_3=="Y","C",""),if(Q1_4=="Y","D",""),if(Q1_5=="Y","E",""),if(Q1_6=="Y","F",""),if(Q1_7=="Y","G",""),if(Q1_8=="Y","H",""),if(Q1_9=="Y","I",""),if(Q1_10=="Y","J",""))}

and this script
Code:
<script type="text/javascript" charset="utf-8">
 
  function shuffle(array) {
    var currentIndex = array.length, temporaryValue, randomIndex;
    // While there remain elements to shuffle...
    while (0 !== currentIndex) {
      // Pick a remaining element...
      randomIndex = Math.floor(Math.random() * currentIndex);
      currentIndex -= 1;
      // And swap it with the current element.
      temporaryValue = array[currentIndex];
      array[currentIndex] = array[randomIndex];
      array[randomIndex] = temporaryValue;
    }
    return array;
  }
 
$(document).on('ready pjax:scriptcomplete',function(){
  // Fill the array
  var str = $('#question{QID} input[type="text"]').val();
  var arr=str.split(", ");
  arr = shuffle(arr).slice(0,3).join('');
  $('#question{QID} input[type="text"]').val('#' + arr);
});
</script>


Hide the question with css class "d-none"
and use the same subquestion conditions.

Joffm
Displaying 1 - 15 out of 730 results.

Lime-years ahead

Online-surveys for every purse and purpose