Welcome to the LimeSurvey Community Forum

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

Search Results (Searched for: multiple)

  • Joffm
  • Joffm's Avatar
29 Mar 2024 18:41
Hi,
beware that this
   // Handle "Other"
    if(otherFixed == true && $('#question'+qID+' input[type="text"]').length > 0) {


is not changed to
   // Handle "Other"
    if(otherFixed == true && $('#question'+qID+' input[type="text"]').length > 0) {

as in your sample.

And change the exclusive option to the correct value.
 
  • evhenii_access
  • evhenii_access's Avatar
29 Mar 2024 18:23
Sure,  here is the lss export with the suggested code, which does not seem to be working.    Thank you! 
  • evhenii_access
  • evhenii_access's Avatar
29 Mar 2024 18:19
Thank you very much! This worked for me
  • Joffm
  • Joffm's Avatar
29 Mar 2024 18:15
Send the lss export of your try.
I do not see an issue.


Joffm
  • evhenii_access
  • evhenii_access's Avatar
29 Mar 2024 17:55
This code pasted above (from Partially Randomized Answers - Multiple Options & List (radio) questions (Enhanced),   LimeSurvey version 3.x)   is not working for me at all - neither for 1 column, not for 2 or 3 columns display:  the last answer 'None' appears in a totally random position in the middle of the list.      

I've also tried other variants of code in this section Partially Randomized Answers - Multiple Options & List (radio) questions (Enhanced)  - these two - LimeSurvey version 2.06 and LimeSurvey version 2.73.0.  For 1 column they work fine, but for 3 columns they fail - they put 'None' in end position in some random column (1st or 2nd or 3rd).  
  • Joffm
  • Joffm's Avatar
29 Mar 2024 17:18 - 29 Mar 2024 17:18
You are right, the link is broken. It leads to the wrong script

Use this script in
Partially Randomized Answers - Multiple Options & List (radio) questions (Enhanced)
LimeSurvey version 3.x:

Code:
<script type="text/javascript" charset="utf-8">
 
$(document).on('ready pjax:scriptcomplete',function(){
 
// The number of answers to be fixed at the end of the list
var fixedAnswers = 1;
 
// Set this to "true" if you want "Other" to be fixed in the last position
var otherFixed = false;
 
// Identify this question
var qID = {QID};
 
// Find the number of answers
var ansCount = $('#question'+qID+' .answer-item').length;
if($('#question'+qID+' input[type="text"]').length > 0) {
ansCount = ansCount -1
}
console.log(ansCount);
 
// Place the last n answers created at the end of the list
var fixedIndex = fixedAnswers - 1;
for (var i=0; i<fixedAnswers; i++) {
var answer = $('input[id^="answer"][id$="X'+qID+(ansCount-fixedIndex)+'"]');
var answerItem = $(answer).closest('.answer-item');
var answersList = $(answer).closest('ul');
$(answersList).append(answerItem);
fixedIndex--;
}
 
// Handle "Other"
if(otherFixed == true &amp;&amp; $('#question'+qID+' input[type="text"]').length > 0) {
var otherAnswer = $('#question'+qID+' input[type="text"]');
var otherAnswerItem = $(otherAnswer ).closest('.answer-item');
var otherAnswersList = $(otherAnswer ).closest('ul');
$(otherAnswersList).append(otherAnswerItem);
}
});
</script>
 
  • evhenii_access
  • evhenii_access's Avatar
29 Mar 2024 15:45
Hi, many thanks for referring me to the right source of workarounds. However, I still wasn’t able to fix the issue, as there are multiple pieces of code which could do the job, but none of them works properly for 3 columns.I want ‘None’ to be placed in the end of last column, but it’s randomly placed in the end of 1st or 2nd or 3rd column.   If I try to have 2 variants in the end – they are placed in the end of some random column or columns.I’ve tried these 4 variands of code -  -  Partially Randomized Answers - Multiple Options & List (radio) questions-  Partially Randomized Answers - Multiple Options & List (radio) questions (Enhanced) - LimeSurvey version 2.06,    LimeSurvey version 2.73.0,     LimeSurvey version 3.xCould you please point out or paste here the specific piece of code that you were able to use successfully in your example?  Does it work properly in every run, with None always placed in last column?   Many thanks again 
  • Joffm
  • Joffm's Avatar
29 Mar 2024 13:41
Hi,
here you find a working script.
[url] manual.limesurvey.org/Workarounds:_Manip...meSurvey_version_3.x :[/url]

And don't miss this
Create a Multiple Options or List (radio) question with sequential response codes.
 
Where did you find your script. I did not find the source of it, only citations.

Joffm
  • Headway-Advisory
  • Headway-Advisory's Avatar
29 Mar 2024 12:45 - 29 Mar 2024 16:12
Bonjour à tous ;)

Je débute sur LimeSurvey, et voici l'obstacle que je rencontre :
1/ J'ai une première question (Q1) qui demande à mes répondants de sélectionner les formations auxquelles ils ont postulé (réponses à choix multiple)
2/ J'ai une deuxième question (Q2) qui leur demande de classer ces formations sélectionnées. J'ai donc utilisé le code .shown pour reprendre les réponses de ma Q1. 
3/ Pour la question 3 (Q3) je veux construire une question Tableau, avec en lignes les formations les mieux classées (TOP 4 de la Q2), et en colonnes des indicateurs de performance. 
--> Je ne vois pas comment construire cette question, d'autant plus qu'il y a beaucoup d'options de formations possibles (au moins 40). J'avais testé une autre méthode en ajoutant une question intermédiaire entre Q1 et Q2. Je demandais "Parmi ces voeux, sélectionne tes 4 préférés.". Je voulais me référer à cette question, à l'aide d'un code shown à nouveau, mais les modalités qui s'affichaient en testant mon questionnaire étaient le texte du code (ex : G01Q01_SQ001.shown) et non pas ma réponse en soi (ex : "Formation en sport"). La mécanique fonctionnait bien, mais ça ne m'affichait pas le bon contenu. 

Merci d'avance pour votre aide :)

Blanche 
  • evhenii_access
  • evhenii_access's Avatar
29 Mar 2024 12:24
Please help us help you and fill where relevant:
Your LimeSurvey version: [ LimeSurvey Cloud Version 6.4.12]
Own server or LimeSurvey hosting:  LimeSurvey hosting
Survey theme/template: Fruity TwentyThree
==================
 Hi, I would appreciate some help with javascript code forcing an answer option (like ‘None’) to be always show in the end of randomized list with multiple columns.I’ve been using this javascript code below (found on this forum) placed in ‘question text’ section – it works just fine, but only for a 1-column display.  However, for 2-column or 3-column display, this code makes ‘None’ to be shown on the page 2 or 3 times – in the end of each column.  I’m attaching the lss archive  

File Attachment:

File Name: limesurvey...3333.lss
File Size:86 KB
with example of 3-column and 1-column design.Could anyone help me please to adjust this code for 2-column and 3-column list, so that ‘None’ is shown just once, in the end of last column?  <script type='text/javascript'>/* Place option at the end of the randomized list */$(document).ready(function() {var move_element="C701";/* Please do NOT change the lines below */var move_element="javatbd{SGQ}"+move_element;$("#"+move_element).insertAfter("#question{QID} .answers-list .answer-item:last-child");});</script>     
  • tpartner
  • tpartner's Avatar
28 Mar 2024 17:53

By the way, is there a way to avoid that with the editor? Does using the source code editor help or does LimeSurvey add extra HTML afterwards?
LimeSurvey adds nothing, it is a "feature" of the editor. I suggest setting your editor preferences to "Popup".

 
  • phylll
  • phylll's Avatar
28 Mar 2024 17:44
Many thanks for picking this up, Tony. Unfortunately, that is not the problem (since my python script strips all HTML from the equation question already, and I just accidentally readded it using the LimeSurvey web WYSIWIG editor for anonymizing my LSS).

By the way, is there a way to avoid that with the editor? Does using the source code editor help or does LimeSurvey add extra HTML afterwards?
  • tpartner
  • tpartner's Avatar
28 Mar 2024 16:57
I would start with removing the unnecessary HTML from your equation question.

 
  • Joffm
  • Joffm's Avatar
28 Mar 2024 16:48 - 28 Mar 2024 16:49

 How to count the number selected answer in the mutiple choice questions is there is any function for this

Yes, please, read the manual
[url] manual.limesurvey.org/ExpressionScript_-...mplemented_functions [/url]
Displaying 106 - 120 out of 748 results.

Lime-years ahead

Online-surveys for every purse and purpose