Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Search Results (Searched for: test)
- Joffm
03 May 2023 15:39 - 03 May 2023 15:41
Replied by Joffm on topic Customizing questions randomly and systematically
As promised a sample survey.
In group "GPool" I created a question (Q0) of type array(text) with two columns (X & Y) and 17 rows (16 for the randomly chosen X- and Y-values, 1 for the constant Z-value)
In this question I inserted this script
You will get this
Now you pipe the values into your questions, like
{Q0_Y001_X001} dislikes members of the {Q0_Y001_X002} minority, although he has had little personal experience interacting with them. Moreover, he believes that they {Q0_Z001_X001}
{Q0_Y002_X001} dislikes members of the {Q0_Y002_X002} minority, although he has had little personal experience interacting with them. Moreover, he believes that they {Q0_Z001_X001}
and so on.
The lss
And remember: SAVEDID is only available in active surveys.
Generally I do not see any advantage of this cyclic selection (remember: drop-outs) over a simple selection by random number.
Joffm
Joffm
In group "GPool" I created a question (Q0) of type array(text) with two columns (X & Y) and 17 rows (16 for the randomly chosen X- and Y-values, 1 for the constant Z-value)
In this question I inserted 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 arrays var arrX = ["Adam", "Bert", "Carol", "Deborah", "Esther", "Frank", "George", "Henry", "Iris", "Jacob", "Ken", "Larry", "Michael", "Noemi", "Ottilie", "Paula" ]; var arrY = ["Y1", "Y2", "Y3", "Y4", "Y5", "Y6", "Y7", "Y8", "Y9", "Y10", "Y11", "Y12", "Y13", "Y14", "Y15", "Y16" ]; var arrZ = ["Z1", "Z2", "Z3", "Z4", "Z5", "Z6", "Z7", "Z8", "Z9", "Z10", "Z11", "Z12", "Z13", "Z14", "Z15", "Z16" ]; //Shuffle arrays X and Y arrX = shuffle(arrX); arrY = shuffle(arrY); //Fill the LimeSurvey array $('#question{QID} tr[id^="javatbd"]:eq(0) input[type="text"]:eq(0)').val(arrX[0]); $('#question{QID} tr[id^="javatbd"]:eq(1) input[type="text"]:eq(0)').val(arrX[1]); $('#question{QID} tr[id^="javatbd"]:eq(2) input[type="text"]:eq(0)').val(arrX[2]); $('#question{QID} tr[id^="javatbd"]:eq(3) input[type="text"]:eq(0)').val(arrX[3]); $('#question{QID} tr[id^="javatbd"]:eq(4) input[type="text"]:eq(0)').val(arrX[4]); $('#question{QID} tr[id^="javatbd"]:eq(5) input[type="text"]:eq(0)').val(arrX[5]); $('#question{QID} tr[id^="javatbd"]:eq(6) input[type="text"]:eq(0)').val(arrX[6]); $('#question{QID} tr[id^="javatbd"]:eq(7) input[type="text"]:eq(0)').val(arrX[7]); $('#question{QID} tr[id^="javatbd"]:eq(8) input[type="text"]:eq(0)').val(arrX[8]); $('#question{QID} tr[id^="javatbd"]:eq(9) input[type="text"]:eq(0)').val(arrX[9]); $('#question{QID} tr[id^="javatbd"]:eq(10) input[type="text"]:eq(0)').val(arrX[10]); $('#question{QID} tr[id^="javatbd"]:eq(11) input[type="text"]:eq(0)').val(arrX[11]); $('#question{QID} tr[id^="javatbd"]:eq(12) input[type="text"]:eq(0)').val(arrX[12]); $('#question{QID} tr[id^="javatbd"]:eq(13) input[type="text"]:eq(0)').val(arrX[13]); $('#question{QID} tr[id^="javatbd"]:eq(14) input[type="text"]:eq(0)').val(arrX[14]); $('#question{QID} tr[id^="javatbd"]:eq(15) input[type="text"]:eq(0)').val(arrX[15]); $('#question{QID} tr[id^="javatbd"]:eq(0) input[type="text"]:eq(1)').val(arrY[0]); $('#question{QID} tr[id^="javatbd"]:eq(1) input[type="text"]:eq(1)').val(arrY[1]); $('#question{QID} tr[id^="javatbd"]:eq(2) input[type="text"]:eq(1)').val(arrY[2]); $('#question{QID} tr[id^="javatbd"]:eq(3) input[type="text"]:eq(1)').val(arrY[3]); $('#question{QID} tr[id^="javatbd"]:eq(4) input[type="text"]:eq(1)').val(arrY[4]); $('#question{QID} tr[id^="javatbd"]:eq(5) input[type="text"]:eq(1)').val(arrY[5]); $('#question{QID} tr[id^="javatbd"]:eq(6) input[type="text"]:eq(1)').val(arrY[6]); $('#question{QID} tr[id^="javatbd"]:eq(7) input[type="text"]:eq(1)').val(arrY[7]); $('#question{QID} tr[id^="javatbd"]:eq(8) input[type="text"]:eq(1)').val(arrY[8]); $('#question{QID} tr[id^="javatbd"]:eq(9) input[type="text"]:eq(1)').val(arrY[9]); $('#question{QID} tr[id^="javatbd"]:eq(10) input[type="text"]:eq(1)').val(arrY[10]); $('#question{QID} tr[id^="javatbd"]:eq(11) input[type="text"]:eq(1)').val(arrY[11]); $('#question{QID} tr[id^="javatbd"]:eq(12) input[type="text"]:eq(1)').val(arrY[12]); $('#question{QID} tr[id^="javatbd"]:eq(13) input[type="text"]:eq(1)').val(arrY[13]); $('#question{QID} tr[id^="javatbd"]:eq(14) input[type="text"]:eq(1)').val(arrY[14]); $('#question{QID} tr[id^="javatbd"]:eq(15) input[type="text"]:eq(1)').val(arrY[15]); // Capture the SAVEDID var id={SAVEDID}; id=(id-1) % 16; // Fill the last field of the LimeSurvey array with the calculated index $('#question{QID} tr[id^="javatbd"]:eq(16) input[type="text"]:eq(0)').val(arrZ[id]); // Remove the slashes to hilde the question after test // $('#question{QID}').hide(); }); </script>
You will get this
Now you pipe the values into your questions, like
{Q0_Y001_X001} dislikes members of the {Q0_Y001_X002} minority, although he has had little personal experience interacting with them. Moreover, he believes that they {Q0_Z001_X001}
{Q0_Y002_X001} dislikes members of the {Q0_Y002_X002} minority, although he has had little personal experience interacting with them. Moreover, he believes that they {Q0_Z001_X001}
and so on.
The lss
And remember: SAVEDID is only available in active surveys.
Generally I do not see any advantage of this cyclic selection (remember: drop-outs) over a simple selection by random number.
Joffm
Joffm
- Joffm
03 May 2023 11:07
Replied by Joffm on topic Matrix Zahlen - nur eine Option pro Zeile
count(self.sq_Y001)<2 and count(self.sq_Y002)<2...
Bei "==1" bekommst Du ja auch direkt am Anfang eine Fehlermeldung.
Es wäre zu überlegen, ob Du nicht zusätzlich erzwingen willst, dass nur eine Spalte benutzt wird, also nicht wie in meinen Beispielen.
Z.B. nicht getestet - vom Smartphone
sum(count(self.sq_X1)>0,count(self.sq_X2)>0)<2
Joffm
Bei "==1" bekommst Du ja auch direkt am Anfang eine Fehlermeldung.
Es wäre zu überlegen, ob Du nicht zusätzlich erzwingen willst, dass nur eine Spalte benutzt wird, also nicht wie in meinen Beispielen.
Z.B. nicht getestet - vom Smartphone
sum(count(self.sq_X1)>0,count(self.sq_X2)>0)<2
Joffm
- DenisChenu
03 May 2023 08:07
You need a non admin user with XSS activated to test.
I check with 3.X , 5.X and current master before reporting.
Replied by DenisChenu on topic Using html entities such as greater than or less than <> not parsing as text
You can not use < or > in text if XSS is activated.However, if I use > in the answer option, it just shows > like normal.
You need a non admin user with XSS activated to test.
I check with 3.X , 5.X and current master before reporting.
- holch
02 May 2023 19:13
Replied by holch on topic Using html entities such as greater than or less than <> not parsing as text
- f.caldura
02 May 2023 18:05
Unsaved answear when adding dropdown menu into array number question was created by f.caldura
Please help us help you and fill where relevant:
Your LimeSurvey version: Version 3.27.31+220104
Own server or LimeSurvey hosting: hosting
==================
Hello everyone,
i have a tricky question,
i found this code for adding dropdown menu in array number question, and it worked!
My concern is that:
if for some reason the respondent shifts to another page of the questionary or forgots to answear some question and moves forward. all the selection in the dropdown menus he made are lost. Even if he save the answers, the selection he made are lost. This doesn't happen in the same question when the respondent write some numbers,
Is there any solution?
I attach lss file
down here the code I found:
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
var thisQuestion = $('#question{QID}');
// Insert selects
$('.answer-item.answer_cell_EDGEN', thisQuestion).addClass('with-select').append('<select class="inserted-select form-control list-question-select">\
<option value="">...</option>\
<option value="1">Femmina</option>\
<option value="2">Maschio</option>\
</select>');
$('.answer-item.answer_cell_EDRLAV', thisQuestion).addClass('with-select').append('<select class="inserted-select form-control list-question-select">\
<option value="">...</option>\
<option value="1">A tempo indeterminato </option>\
<option value="2">A tempo determinato </option>\
<option value="3">Contratto di collaborazione professionale (partita Iva)</option>\
<option value="4">Co.Co.Co./a progetto</option>\
<option value="5">Somministrati,agenzie interinali,accordi con cooperative</option>\
<option value="6">Educatore-socio/Educatore-titolare</option>\
<option value="6">Altro rapporto di lavoro</option>\
</select>');
$('.answer-item.answer_cell_EDSTUD', thisQuestion).addClass('with-select').append('<select class="inserted-select form-control list-question-select">\
<option value="">...</option>\
<option value="1">Attestato di qualifica rilasciato dal sistema della formazione professionale</option>\
<option value="2">Diploma di scuola superiore afferente all’area psico-pedagogica</option>\
<option value="3">Laurea (di I livello o II livello) afferente all’area psico-pedagogica</option>\
<option value="4">Laurea umanistica o sociale e master avente oggetto la formazione per la prima infanzia</option>\
<option value="5">Altri titoli di studio (Laurea, Diploma, ecc.) non afferenti all’area psico-pedagogica</option>\
<option value="6">Altro titolo di studio</option>\
</select>');
$('.answer-item.answer_cell_EDEXP', thisQuestion).addClass('with-select').append('<select class="inserted-select form-control list-question-select">\
<option value="">...</option>\
<option value="1">Fino a 2 anni</option>\
<option value="2">3-5 anni</option>\
<option value="3">Oltre 5 anni</option>\
</select>');
$('.answer-item.answer_cell_EDANZ', thisQuestion).addClass('with-select').append('<select class="inserted-select form-control list-question-select">\
<option value="">...</option>\
<option value="1">Fino a 3 mesi</option>\
<option value="2">3-6 mesi</option>\
<option value="3">7-12 mesi</option>\
<option value="4">Da 1 a 2 anni</option>\
<option value="5">Da 2 a 5 anni</option>\
<option value="6">Oltre 5 anni</option>\
</select>');
// Listeners
$('.inserted-select', thisQuestion).on('change', function(i) {
if($(this).val() != '') {
$(this).closest('.answer-item').find('input:text').val($('option:selected', this).val()).trigger('change');
}
else {
$(this).closest('.answer-item').find('input:text').val('').trigger('change');
}
});
$('.with-select input:text', thisQuestion).css({
'position': 'absolute',
'left': '-9999em'
});
});
</script>
Your LimeSurvey version: Version 3.27.31+220104
Own server or LimeSurvey hosting: hosting
==================
Hello everyone,
i have a tricky question,
i found this code for adding dropdown menu in array number question, and it worked!
My concern is that:
if for some reason the respondent shifts to another page of the questionary or forgots to answear some question and moves forward. all the selection in the dropdown menus he made are lost. Even if he save the answers, the selection he made are lost. This doesn't happen in the same question when the respondent write some numbers,
Is there any solution?
I attach lss file
down here the code I found:
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
var thisQuestion = $('#question{QID}');
// Insert selects
$('.answer-item.answer_cell_EDGEN', thisQuestion).addClass('with-select').append('<select class="inserted-select form-control list-question-select">\
<option value="">...</option>\
<option value="1">Femmina</option>\
<option value="2">Maschio</option>\
</select>');
$('.answer-item.answer_cell_EDRLAV', thisQuestion).addClass('with-select').append('<select class="inserted-select form-control list-question-select">\
<option value="">...</option>\
<option value="1">A tempo indeterminato </option>\
<option value="2">A tempo determinato </option>\
<option value="3">Contratto di collaborazione professionale (partita Iva)</option>\
<option value="4">Co.Co.Co./a progetto</option>\
<option value="5">Somministrati,agenzie interinali,accordi con cooperative</option>\
<option value="6">Educatore-socio/Educatore-titolare</option>\
<option value="6">Altro rapporto di lavoro</option>\
</select>');
$('.answer-item.answer_cell_EDSTUD', thisQuestion).addClass('with-select').append('<select class="inserted-select form-control list-question-select">\
<option value="">...</option>\
<option value="1">Attestato di qualifica rilasciato dal sistema della formazione professionale</option>\
<option value="2">Diploma di scuola superiore afferente all’area psico-pedagogica</option>\
<option value="3">Laurea (di I livello o II livello) afferente all’area psico-pedagogica</option>\
<option value="4">Laurea umanistica o sociale e master avente oggetto la formazione per la prima infanzia</option>\
<option value="5">Altri titoli di studio (Laurea, Diploma, ecc.) non afferenti all’area psico-pedagogica</option>\
<option value="6">Altro titolo di studio</option>\
</select>');
$('.answer-item.answer_cell_EDEXP', thisQuestion).addClass('with-select').append('<select class="inserted-select form-control list-question-select">\
<option value="">...</option>\
<option value="1">Fino a 2 anni</option>\
<option value="2">3-5 anni</option>\
<option value="3">Oltre 5 anni</option>\
</select>');
$('.answer-item.answer_cell_EDANZ', thisQuestion).addClass('with-select').append('<select class="inserted-select form-control list-question-select">\
<option value="">...</option>\
<option value="1">Fino a 3 mesi</option>\
<option value="2">3-6 mesi</option>\
<option value="3">7-12 mesi</option>\
<option value="4">Da 1 a 2 anni</option>\
<option value="5">Da 2 a 5 anni</option>\
<option value="6">Oltre 5 anni</option>\
</select>');
// Listeners
$('.inserted-select', thisQuestion).on('change', function(i) {
if($(this).val() != '') {
$(this).closest('.answer-item').find('input:text').val($('option:selected', this).val()).trigger('change');
}
else {
$(this).closest('.answer-item').find('input:text').val('').trigger('change');
}
});
$('.with-select input:text', thisQuestion).css({
'position': 'absolute',
'left': '-9999em'
});
});
</script>
- holch
02 May 2023 16:57
Your version of Limesurvey is from 30/01/2019. Só "pre-pandemic". This is ancient in terms of web applications. Not sure if this has anything to do with your issue, but your installation has not received any updates, bug fixes or security patches for over 4 years now. You should really consider to update to the latest version of the LS 3 branch.
Replied by holch on topic plugin pdfReport does not display answers to matrix questions
3.15.8+190130
Your version of Limesurvey is from 30/01/2019. Só "pre-pandemic". This is ancient in terms of web applications. Not sure if this has anything to do with your issue, but your installation has not received any updates, bug fixes or security patches for over 4 years now. You should really consider to update to the latest version of the LS 3 branch.
- DenisChenu
02 May 2023 15:07
Replied by DenisChenu on topic Using html entities such as greater than or less than <> not parsing as text
Can you send me the simple lss file with just one Single choice dropdown question ?
You use 3.X before ? I like to test fi it's OK in 3.X or not.
You use 3.X before ? I like to test fi it's OK in 3.X or not.
- Joffm
02 May 2023 10:50 - 02 May 2023 11:05
Replied by Joffm on topic plugin pdfReport does not display answers to matrix questions
Please, provide a lss export.
The only thing I see is, that you used alphanumerical codes in a scale.
Probably not related to your issue, but how do you calcualate a mean or other statistical tests.
And I do not see any issue.
Here an example in 3.28.26.
1. The scale
2. The preview in LimeSurvey
3. The pdf (with some strange colors)
Joffm
P.S.
Muss ich wieder unnötigerweise Englisch schreiben?
The only thing I see is, that you used alphanumerical codes in a scale.
Probably not related to your issue, but how do you calcualate a mean or other statistical tests.
And I do not see any issue.
Here an example in 3.28.26.
1. The scale
2. The preview in LimeSurvey
3. The pdf (with some strange colors)
Joffm
P.S.
Muss ich wieder unnötigerweise Englisch schreiben?
- eavenhuang
01 May 2023 18:27
Replied by eavenhuang on topic Use limesurvey for ticketing systems to submit feedback
I'm sorry for all the questions but I'm kind of lost, I'm quite new to limesurvey but not knowing all the options (where they are and how to use them).
Here is my test case, in my screenshot I created two hidden questions, one to store the value of custom attribute called Email and the other one to store TicketID (I will include that from my ticketing system). The 3rd question is the real open one for the customer, where he/she submits the feedback.
I tried to create one more question using equation type to check the count of ticketID, but that didn't work.
I'm kind of lost where I can find these functions in ExpressionScript where is ExpressionScript. I saw the examples in the manual but honestly, I don't know what it talks about, I can use statCount(TicketID.sgqa[, submitted = 1][, self = true]) in a new question where it's equation type and put this expression in the Equation option field? (TicketID is my question code of the custom attribute.
Sorry again for all the questions, I'm still getting used to limesurvey and this has taken me days to figure out:(
Here is my test case, in my screenshot I created two hidden questions, one to store the value of custom attribute called Email and the other one to store TicketID (I will include that from my ticketing system). The 3rd question is the real open one for the customer, where he/she submits the feedback.
I tried to create one more question using equation type to check the count of ticketID, but that didn't work.
I'm kind of lost where I can find these functions in ExpressionScript where is ExpressionScript. I saw the examples in the manual but honestly, I don't know what it talks about, I can use statCount(TicketID.sgqa[, submitted = 1][, self = true]) in a new question where it's equation type and put this expression in the Equation option field? (TicketID is my question code of the custom attribute.
Sorry again for all the questions, I'm still getting used to limesurvey and this has taken me days to figure out:(
- Joffm
01 May 2023 13:36
Replied by Joffm on topic DRINGEND Hilfe für Erstellung einer randomisierten Umfrage gesucht!!
Hallo,
wie @jelo,
wenn Du schon ein bisschen im Forum gestöbert hast, weißt Du, dass die freiwilligen Helfer hier in der Community sich oft sehr viel Mühe geben, bei Lösungen behilflich zu sein.
Allerdings muss ich auch sagen, dass ich auf eine solche "Stellenanzeige" nicht reagieren möchte, ohne irgendetwas über das Design der Umfrage und die spezielle Schwierigkeit zu wissen.
Mir ist auch noch nicht ganz klar, was Du möchtest.
Benötigst Du Hilfe beim Design eines solchen Fragebogens?
Benötigst Du Hilfe beim "Reinklimpern" der Fragen?
Benötigst Du Hilfe bei einem ganz speziellen Problem, dass Du bisher selbst nicht lösen kannst?
Denn gerade das Thema "randomisierte Umfrage" wird ja im Forum "rauf und runter" behandelt.
Vielleicht hast Du mein - noch im Aufbau befindliches - "Tutorial 4: Gleichungen, Zu- und andere Fälle" noch nicht gelesen.
Du findest es hier im deutschen Teil auf einer der folgenden Seite, wahrscheinlich 4 oder 5.
Dann kannst Du ja entscheiden, ob Du einen unserer Partner (für einen kleinen Obulus) einschaltest, oder die "Schwarmintelligenz" des Forums nutzen möchtest. Hier werden die Lösungen meist als "beer-ware" oder "coffee-ware" (und das auch nur symbolisch) gehandelt.
Bis dann
Joffm
wie @jelo,
wenn Du schon ein bisschen im Forum gestöbert hast, weißt Du, dass die freiwilligen Helfer hier in der Community sich oft sehr viel Mühe geben, bei Lösungen behilflich zu sein.
Allerdings muss ich auch sagen, dass ich auf eine solche "Stellenanzeige" nicht reagieren möchte, ohne irgendetwas über das Design der Umfrage und die spezielle Schwierigkeit zu wissen.
Mir ist auch noch nicht ganz klar, was Du möchtest.
Benötigst Du Hilfe beim Design eines solchen Fragebogens?
Benötigst Du Hilfe beim "Reinklimpern" der Fragen?
Benötigst Du Hilfe bei einem ganz speziellen Problem, dass Du bisher selbst nicht lösen kannst?
Denn gerade das Thema "randomisierte Umfrage" wird ja im Forum "rauf und runter" behandelt.
Vielleicht hast Du mein - noch im Aufbau befindliches - "Tutorial 4: Gleichungen, Zu- und andere Fälle" noch nicht gelesen.
Du findest es hier im deutschen Teil auf einer der folgenden Seite, wahrscheinlich 4 oder 5.
Dann kannst Du ja entscheiden, ob Du einen unserer Partner (für einen kleinen Obulus) einschaltest, oder die "Schwarmintelligenz" des Forums nutzen möchtest. Hier werden die Lösungen meist als "beer-ware" oder "coffee-ware" (und das auch nur symbolisch) gehandelt.
Bis dann
Joffm
- Joffm
01 May 2023 13:18
Replied by Joffm on topic Use limesurvey for ticketing systems to submit feedback
Hi,
And to prevent repeated submissions?
In your version there is included the plugin "statFunctions".
Just count the number of submissions of a TicketID.
Greater than 1 --> screen out.
Joffm
But this is exactly what I wrote: Two questions "TicketID" and "Email"it seems different from what you advised about prefilled?
.../limesurvey/index.php/596423?lang=en&TicketID=0001&Email=test.rachel@edu.cn
And to prevent repeated submissions?
In your version there is included the plugin "statFunctions".
Just count the number of submissions of a TicketID.
Greater than 1 --> screen out.
Joffm
- eavenhuang
01 May 2023 12:15
Replied by eavenhuang on topic Use limesurvey for ticketing systems to submit feedback
Dear Joffm,
I used Panel Integration to create customer values, Email and TicketID, and I can used the trigger in Zammad to include URL like limesurvey.local/limesurvey/index.php/59...l=test.rachel@edu.cn , both email and ticket ID are variables in Zammad. However, it seems different from what you advised about prefilled?
The other concern is that - how can we prevent repeated submission? I can't use cookie option because it's possible that we have one Email accont that needs to submit survey for many tickets. Any other possible approaches?
I used Panel Integration to create customer values, Email and TicketID, and I can used the trigger in Zammad to include URL like limesurvey.local/limesurvey/index.php/59...l=test.rachel@edu.cn , both email and ticket ID are variables in Zammad. However, it seems different from what you advised about prefilled?
The other concern is that - how can we prevent repeated submission? I can't use cookie option because it's possible that we have one Email accont that needs to submit survey for many tickets. Any other possible approaches?