Welcome to the LimeSurvey Community Forum

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

randomization and question by question

  • holch
  • holch's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #201169 by holch
Replied by holch on topic randomization and question by question
I personally prefer one question per page here, yes. Might take a little longer, but not much. And your respondent will be more focused on your question. I highly doubt that you will have more dropouts because of question by question.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #201179 by Joffm
Replied by Joffm on topic randomization and question by question

Perhaps there's a way to automatically trigger the next page when an answer is selected?

Yes, there is, WHEN an answer is selected.
Therefore there is a worlaround for autoproceed in single punch questions like radio buttons.

But how do you decide when a multipunch question or a slider question is answered?
The first "mouse up" event? You can't be sure that the respondent doesn't want to adjust his choice.

I find it so frustrating ...

This is probably due to the low frustration tolerance of the youth. ;)

But feel free to create a theme where the "next"-button is on the left.
This might be the best solution, because the "previous"-button usually is hidden.
Have a look at the "navigator.twig"

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • FSoave
  • FSoave's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 10 months ago - 3 years 10 months ago #201214 by FSoave
Replied by FSoave on topic randomization and question by question
Hi, so to update, I think I've found the solution.
About demographic questions, with the group by group I can eventually have them 1 per page. However I think 2 per page is a good tradeoff since they are small questions.
Then, for the videos I have groups and each group contains 3 questions: video, slider, slider. Each of these groups are in the same randomization group so they are presented randomly

I've managed to:
- show video, until it's end
- then hide the video block
- and display the sliders (2 for now) I need
- the next button only displays after the user has moved both sliders (this is a workaround since if I make the sliders mandatory and the user press 'next' before setting them, the whole group is shown again, including the video, and I don't want the user to watch the video more than once)

this is the code I'm using and it's in the group's Description
Code:
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
  // Hide the "Next" button
  $('#ls-button-submit').hide();
  $('#question115').hide();
  $('#question130').hide();
 
  var vid = document.getElementById("myvideo");
  vid.volume = 0.7;
  vid.onended = function() {
  // Hide video
  //$(this).hide();
  $('#question114').hide();
  // Show sliders
  $('#question115').show();
  $('#question130').show();
 
 
  // Show the "Next" button
  var enableNext1 = false;
  var enableNext2 = false;
 
  var v = $('#answer562798X17X115SQ001slid').change(function() {
    enableNext1 = true;
    if(enableNext2) $('#ls-button-submit').show(); // if also the second one was moved
   });
  var v = $('#answer562798X17X130SQ001slid').change(function() {
    enableNext2 = true;
    if(enableNext1) $('#ls-button-submit').show(); //if also the first one was moved
   });
  } //onended
});
</script>

the only potential issue is that I still don't get how to target correctly the blocks (eg video/slider) is JS. So for the ids (eg #question114 and #answer562798X17X115SQ001slid) I have to look them up from the developer tools and manually change the script for every new group I have.

Another thing which took me way to long to find in the cryptic options is how to center the slider (and it still feels a bad hack). As per image below, I don't have a label (to the left of the slider). To center the slider I had to set the Label column width at 25% and the Text input box width at 50%. (I wish this was written somewhere in the manual)


Find a sample survey attached (I guess you will have to change the ids in the js code as described above)

File Attachment:

File Name: limesurvey...5536.lss
File Size:34 KB
Last edit: 3 years 10 months ago by FSoave.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #201222 by Joffm
Replied by Joffm on topic randomization and question by question
Hi,
here a few examples to make it less frustrating to move to the right side.





the cryptic options is how to center the slider (and it still feels a bad hack)

This is neither cryptic nor a hack. It is normal behaviour.
Remember that a slider question is based on a "multiple numerical input".
So it is obvious that the input field (which is only replaced by the slider) will be centered if you set the label width to 25% and the input width to 50% (25% remaining at the right)
You would have achieved the same with 17% and 67%, or 8% and 83%.

And for

So for the ids (eg #question114 and #answer562798X17X115SQ001slid) I have to look them up from the developer tools and manually change the script for every new group I have.

First you must not use the developer tools. These values are displayed in the GUI
Here you see the questionID and the groupID
and you know the surveyID.
But it is a lot easier.

Instead of placing the script in the group description, place it into the video question.
As you display the entire group it is rendered when the page is displayed
$(document).ready(function() {

If the video and the two slider question have question IDs in ascending order,
you may use the variables {SID}, {GID}, {QID} which give you the survey-, group- and questionID of the actual question (the video).

So with
var sID='{SID}';
var gID='{GID}';
var qID='{QID}';
var qID1=+qID+1;
var qID2=+qID+2;
sgq=sID+'X'+gID+'X'+qID;
sgq1=sID+'X'+gID+'X'+qID1;
sgq2=sID+'X'+gID+'X'+qID2;


you get the question IDs of the video question and the two following (slider) questions.
The "+" sign avoids that the addition is done arithmetically, not just a concatenating of text.
Now you may say:
Code:
// Hide slider block
  $('#question'+qID1).hide();
  $('#question'+qID2).hide();
and
Code:
// Hide video block
  $('#question'+qID).hide();
  // Show slider block
  $('#question'+qID1).show();
  $('#question'+qID2).show();

And the sgq gives you the full code of the questions like "985536X610X10701"

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: FSoave
The topic has been locked.
  • FSoave
  • FSoave's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 10 months ago #201231 by FSoave
Replied by FSoave on topic randomization and question by question

If the video and the two slider question have question IDs in ascending order,
you may use the variables {SID}, {GID}, {QID} which give you the survey-, group- and questionID of the actual question (the video).


you don't know how thankful I am for your explanation. Maybe it's my problem but I've literally spent hours trying to find a clear example for this without luck!
Thanks!!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose