Welcome to the LimeSurvey Community Forum

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

Search Results (Searched for: random)

  • jelo
  • jelo's Avatar
Today 10:07
You can create an equation question which randomly assigns the URL. In the EndURL field you place the questioncode of the equation question.

Take a look at this thread.
forums.limesurvey.org/index.php/forum/de...adomization-end-urls
  • J.Auer
  • J.Auer's Avatar
Today 10:00
LimeSurvey version: 3.28.22+220802
Own server or LimeSurvey hosting: Hosting
Survey theme/template: extends_fruity
==================

Hello!
Im working on a study with three parts: Pretest, Game, and Posttest.So, in the Pretest phase, I've got a link to the game set up in the End-URL. Which is working fine.
But here's the thing: there are actually two versions of the game, each with its own link.Is there any way in Limesurvey to put both links in the End-URL and have it randomly pick one?

Thanks in advance!
  • Joffm
  • Joffm's Avatar
Yesterday 16:08 - Yesterday 16:41
Hallo,
ich denke, es ist ein simpler GIGO-Fehler (Garbage in - Garbage out, oder auf deutsch "Mist rein - Mist raus")
Das steht in Deinem script.

var originalModalText = "Eine oder mehrere Pflichtfragen wurden nicht beantwortet. Bitte füllen diese nach Möglichkeit aus, bevor du mit der nächsten Seite fortfährst.";


Der wirkliche Originaltext ist aber
 

Dann klappt es auch
 

Und denke daran. In "deutsch" sieht der Text wohl anders aus.

Das ist ja ein ganz schön langer Text.
Du kannst/solltest ihn etwas strukturieren. Kannst Du ja mittels HTML oder Inline-css.
Dann muss aber hier  von "text" zu "html" geändert werden.
Code:
   
if(modalBody.length > 0) {
      ($.trim($(this).text()));
      modalBody.html(newModalText);
}


 

Und: Das script muss natürlich nur einmal auf einer Seite sein. Das war ja mein Einwand "Sie könnten sich gegenseitig stören"
Daher habe ich es aus allen Fragen gelöscht außer der ersten "sex3u4"


Ich glaube auch nicht, dass Du etwas gewinnst, indem Du eine Zufallszahl von 1-4 erzeugst und dann doch nur 
zufall<3 und zufall>2  benutzt.

Außerdem:
Schau noch einmal auf Schreibfehler! Es gibt die sexuelle Spielart "Bandage".
Und ich fand, dass im Fragebogen auf einer Seite thematisch etwas hin- und hergehoppst wird.
Ich hielte es hier wirklich für besser, dann eine neue Seite zu beginnen mit einem Überleitungstext, etwas Feedback, usw.
Dann gibt es eine Frage nach dem benutzten Device. Du kannst dies doch einfach in LimeSurvey testen statt zu fragen. Oder hat die Frage einen besonderen tieferen Sinn.
Und Deine Info über die Zielsetzung würde ich nicht auf der letzten Seite platzieren, sondern im Schlusstext.


Ich finde dieses kleine pdf ganz gut. Kannst Du ja einmal lesen.
Der Autor war auch lange Zeit hier im Forum aktiv.
 

File Attachment:

File Name: surveyfrie...5-15.zip
File Size:977 KB


Joffm

Und der kleine Scherz am Ende:
Der Export hat nichts mit der ISS zu tun; eine solche Raumstation passt auch gar nicht in meinen Garten.
Es ist
lss (limesurvey survey)
wie auch
lsg (limesurvey group)
lsq (limesurvey question)
lsa (limesurvey archive)



 
  • Paz90
  • Paz90's Avatar
Yesterday 14:12 - Yesterday 14:13

Erstmal, vielen Dank für deine Antwort!....
naja, wir kennen das Design Deiner Umfrage nicht.
Aber wenn ich sehe Fragengruppe "Demographische Daten" fürchte ich, Du hast alle Fragen in einer Gruppe, zeigst auch "Gruppe für Gruppe" an und lässt Deine Teilnehmer*:_außen 😉scrollen, scrollen.

Naja wenn man bei jeder Frage weiterklicken muss wird das doch auch sehr schnell nervig, vor allem wenn es keine ganzen Skalen sind sondern beispielweise Frage nach dem Geschlecht. 

Da besteht natürlich die große Gefahr, dass sich scripte gegenseitig beeinflussen, die ja hier immer auf dasselbe Element zugreifen.
Und der Text wird geändert, sobald die Seite aufgebaut ist - nicht, wenn das Modal aufploppt.
Wobei diese Gefahr geringer ist, wenn der Ersetzungstext identisch ist.

Ansonsten: Überdenke das Design!

Denke immer an die "goldene Regel": Eine Frage pro Seite.

Komischerweise hat es bei meiner Testumfrage auch bei mehreren Fragen pro Seite geklappt, sobald die Randomisierung dazu kam ging es auf einmal nicht mehr und es wird bei der sanften Erinnerung wieder der alte Text angezeigt. Allerdings scheint es bei Ihnen ja zu klappen. 

Du kannst ja einmal den lss Export der Umfrage schicken.
Dann sehen wir besser, wo "der Hase im Pfeffer liegt".

File Attachment:

File Name: limesurvey...8711.lss
File Size:912 KB


passt das so mit dem ISS report? 
Vielen Dank für deine Hilfe!


 

  • Joffm
  • Joffm's Avatar
14 May 2024 12:17
Hi,
at first I wonder why you didn't answer the questions about your version, your hosting, etc.
Not only that you ignored them, you removed them.

Now, the buzzword is : random number.

So you have to create a question of type "equation" (let's call it rn) where you create this random number.
Here you find the functions you can use
[url] manual.limesurvey.org/ExpressionScript_-...mplemented_functions [/url]
You see there is the function "rand(x,y)"

We extend this a bit to 
{if(is_empty(rn),rand(1,2),rn)}
Meaning: IF the random number is still empty, create one from 1-2, ELSE  keep it as it is.
This avoids, that a new random number is created if the respondent goes back to this question group.

Now your variable rn has one of the two possible values ("1" or "2")

You only have to set the condition of your two video questions respectively
One is displayed if rn==1
the other is displayed if rn==2

Please, read the manual about question types, about ExpressionScript.

Joffm
  • emilie4221
  • emilie4221's Avatar
14 May 2024 11:32
Hi,
I am currently setting up an experimental survey using LimeSurvey and I intend to implement a randomisation feature. The goal is to show one specific video to one group of participants, and a different video to another group, both group will answer the questionnaire. Could you provide guidance on how best to achieve this? Any tips or resources you could recommend would be greatly appreciated.Thank you for your assistance.
  • Joffm
  • Joffm's Avatar
13 May 2024 16:38 - 13 May 2024 17:01
Hallo,
naja, wir kennen das Design Deiner Umfrage nicht.
Aber wenn ich sehe Fragengruppe "Demographische Daten" fürchte ich, Du hast alle Fragen in einer Gruppe, zeigst auch "Gruppe für Gruppe" an und lässt Deine Teilnehmer*:_außen 😉scrollen, scrollen.

Da besteht natürlich die große Gefahr, dass sich scripte gegenseitig beeinflussen, die ja hier immer auf dasselbe Element zugreifen.
Und der Text wird geändert, sobald die Seite aufgebaut ist - nicht, wenn das Modal aufploppt.
Wobei diese Gefahr geringer ist, wenn der Ersetzungstext identisch ist.

Ansonsten: Überdenke das Design!




Denke immer an die "goldene Regel": Eine Frage pro Seite.

Du kannst ja einmal den lss Export der Umfrage schicken.
Dann sehen wir besser, wo "der Hase im Pfeffer liegt".

Joffm
 
  • Paz90
  • Paz90's Avatar
13 May 2024 13:53
Ihre LimeSurvey-Version: [siehe rechts unten auf Ihrem LimeSurvey-Verwaltungsbildschirm]
Eigener Server oder LimeSurvey-Cloud:  6.5.3+240415 

Liebes Forum,
Ich habe ein Problem und zwar wollte ich den Text des Softreminder ändern, dies hat auch dank der Hilfe hier im Forum mittels Java Skript code Prima geklappt. Allerdings scheint das ganze mit Randomisierten Gruppen nicht zu funktionieren. Habe jetzt lange herumgetüftelt, in meiner Probe Umfrage hat es funktioniert den Text des Softreminders zu ändern, allerdings sobald ich zufällige Gruppen von Befragten bilde (Randomisierung) funktioniert das ganze nicht mehr (es wird wieder der alte Text angezeigt). Woran liegt das? Und gibt es dafür eine Lösung? 
Hier ein Bild von dem Java Skript code:


 
  • Joffm
  • Joffm's Avatar
08 May 2024 15:09
Sorry, but where did you find this code?
Code:
var questionContainer = $('#question{QID}');
 
// Find all the checkboxes within the question container
var checkboxes = questionContainer.find('input[type="checkbox"]');
 
// Filter out the fixed checkboxes (2 and 5) and store their values
var fixedCheckboxes = ;
checkboxes.each(function() {
var checkbox = $(this);
var checkboxValue = parseInt(checkbox.val());
if (checkboxValue === 2 || checkboxValue === 5) {
fixedCheckboxes.push(checkbox);
}
});
 
// Remove the fixed checkboxes from the list
checkboxes = checkboxes.not(fixedCheckboxes);
 
// Shuffle the remaining checkboxes
checkboxes.sort(function() { return Math.random() - 0.5; });
 
// Insert the fixed checkboxes at their respective positions
questionContainer.find('input[type="checkbox"]').slice(0, 0).before(fixedCheckboxes[0]);
questionContainer.find('input[type="checkbox"]').slice(3, 3).before(fixedCheckboxes[1]);

which is absolutely different from what is in the linked thread
[url] forums.limesurvey.org/forum/can-i-do-thi...-random-items#263207 [/url]
Why didn't you use this?

Here you see three arrays. 
You only use one array with your random codes. (arr1)
Shuffle it.
Insert your "fixed" codes at the resp. places (javascript function "splice")
No randomization, no concatination
Just store into your question of type "short text"
$('input:text', thisQuestion).val(arr1);
 
  • rajkumar_dms
  • rajkumar_dms's Avatar
08 May 2024 12:14
Replied by rajkumar_dms on topic Customized Rotation for Check box & Radio Bottom
I had adapt that unable to make that
here is the java script for the same
<script type="text/javascript" charset="utf-8">
/ Wait for the LimeSurvey page to fully load
$(document).on('ready pjax:scriptcomplete',function(){
// Identify the question container
var questionContainer = $('#question{QID}');

// Find all the checkboxes within the question container
var checkboxes = questionContainer.find('input[type="checkbox"]');

// Filter out the fixed checkboxes (2 and 5) and store their values
var fixedCheckboxes = ;
checkboxes.each(function() {
var checkbox = $(this);
var checkboxValue = parseInt(checkbox.val());
if (checkboxValue === 2 || checkboxValue === 5) {
fixedCheckboxes.push(checkbox);
}
});

// Remove the fixed checkboxes from the list
checkboxes = checkboxes.not(fixedCheckboxes);

// Shuffle the remaining checkboxes
checkboxes.sort(function() { return Math.random() - 0.5; });

// Insert the fixed checkboxes at their respective positions
questionContainer.find('input[type="checkbox"]').slice(0, 0).before(fixedCheckboxes[0]);
questionContainer.find('input[type="checkbox"]').slice(3, 3).before(fixedCheckboxes[1]);
});
</script>

Also attached the lss file for the same
  • Joffm
  • Joffm's Avatar
06 May 2024 11:17
You can adapt this (of course without removing certain checkboxes)
[url] forums.limesurvey.org/forum/can-i-do-thi...-random-items#263207 [/url]
One array with your random codes.
Shuffle it
Insert your "fixed" codes at the resp. places (javascript function "splice")
[url] www.w3schools.com/jsref/jsref_splice.asp [/url]

Joffm
  • Joffm
  • Joffm's Avatar
03 May 2024 11:47
Replied by Joffm on topic Random Groups with Random Items
Hi,
you can shorten the second script to
Code:
<script charset="utf-8" type="text/javascript">
 
        $(document).ready(function() {
          var answerCodes = '{QOrder}'.split(',');
          var x1 = answerCodes.indexOf("1");
          var x5 = answerCodes.indexOf("5");
          var x10 = answerCodes.indexOf("10");
          $( '#question{QID} .question-item:eq('+x1+')').addClass('hide-pseudo-elements').find('input.checkbox').remove();
          $( '#question{QID} .question-item:eq('+x5+')').addClass('hide-pseudo-elements').find('input.checkbox').remove();
          $( '#question{QID} .question-item:eq('+x10+')').addClass('hide-pseudo-elements').find('input.checkbox').remove();
     });
</script>

In my previous solution I missed the quotes. Therefore the "brute force" solution

Joffm
  • davebostockgmail
  • davebostockgmail's Avatar
03 May 2024 11:26
Replied by davebostockgmail on topic Random Groups with Random Items
Amazing and thank you as always this is perfect for my needs.

Apologies again for not being clear in my first post,

Thanks and have a great weekend
Dave
  • rajkumar_dms
  • rajkumar_dms's Avatar
03 May 2024 10:04
We want hide it fully like we hide equation type question and perform all the action like equation question
  • Joffm
  • Joffm's Avatar
03 May 2024 09:15
Oh, you really allow to go back?
That's not a big problem.
Iinstead of the default answer in Q20 just create a question of type "equation" after Q1 and Q17 where you preset the value of Q20 {Q20=list(...)}.

But tell me, if you use "question by question" mode, how do you want to hide Q20?
 
Displaying 1 - 15 out of 624 results.

Lime-years ahead

Online-surveys for every purse and purpose