Welcome to the LimeSurvey Community Forum

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

Show X out of Y question groups

  • hans_maulwurf
  • hans_maulwurf's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 5 months ago - 8 years 5 months ago #126270 by hans_maulwurf
Show X out of Y question groups was created by hans_maulwurf
So I want to do a survey with seven question-groups (participants should answer the same questions for seven different videos).
As one group takes pretty long to answer, I want every participant to only answer four of the groups. This should happen randomized, so that in the end I have about the same amount of data for every group.

As I found out so far, this "X out of Y"-problem is easy solvable as long as it is about questions in the same question-group (as shown here )

It's as well solvable if you want only 1 out of Y groups, by using a random-element (as shown here )

But how is it done if you want to show - like in my case - more than one group out of a number of groups?


Edit: Sorry for the double post, but I think this question actually belongs rather here than in "Installation & update issues".
Last edit: 8 years 5 months ago by hans_maulwurf.
The topic has been locked.
More
8 years 5 months ago #126288 by first
Replied by first on topic Show X out of Y question groups
Need to show x out of y groups.

1: Create a multi question with y number of answer options. Randomize this question
2:Select top x number of checkboxes using javascript
3:Hide this question using javascript or preferably CSS.
4:Have group relavance from this question.

Attached is dummy lss and working demo placed at LS demo installation.

File Attachment:

File Name: limesurvey...9747.lss
File Size:17 KB


Working demo at LS installation.
demo.limesurvey.org/index.php?r=admin/su...view/surveyid/389747

Survey Designer and Programmer
The following user(s) said Thank You: holch, tpartner, hans_maulwurf
The topic has been locked.
  • hans_maulwurf
  • hans_maulwurf's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 5 months ago #126292 by hans_maulwurf
Replied by hans_maulwurf on topic Show X out of Y question groups
Works like a charm! Thank you so much!

One small thing for people trying to do the same:
I guess you meant to put "showNumberOfGroups" into the for-loop instead of writing "2" in there directly, right?
(so the line would be
Code:
for(var i=0; i<showNumberOfGroups;i++){"
)

Your version:
Code:
<script>
$(function(){
$('body').hide()
var showNumberOfGroups = 2; //enter number of groups to randomly show.
var $cboxs = $('input:checkbox');
for(var i=0;i<2;i++){
$cboxs.eq(i).prop('checked',true);
}
document.getElementById('movenextbtn').click();
})
</script>
The topic has been locked.
More
8 years 5 months ago #126313 by first
Replied by first on topic Show X out of Y question groups
Got got it right ..:)

Survey Designer and Programmer
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
8 years 5 months ago #126314 by Mazi
Replied by Mazi on topic Show X out of Y question groups
Nice solution, Trivender.

Can you please port this to manual.limesurvey.org/Workarounds:_Survey_behaviour so it doesn't get lost?

Thanks!

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
More
8 years 5 months ago #126360 by first
Replied by first on topic Show X out of Y question groups
Sure I will post it there . But I curious to know if someone can suggest how we can tick(auto select) x number of options in a multi choice question using EM only. That way we wont have to hide question using CSS and auto submit via js. :)

Survey Designer and Programmer
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 5 months ago - 8 years 5 months ago #126382 by DenisChenu
Replied by DenisChenu on topic Show X out of Y question groups

OMdev wrote: Sure I will post it there . But I curious to know if someone can suggest how we can tick(auto select) x number of options in a multi choice question using EM only. That way we wont have to hide question using CSS and auto submit via js. :)

Equation question type can SET value.

Even if the multi question is hidden, exemple with MULTI / SQ01, SQ02,SQ03

equation question:
{MULTI_SQ01="Y"}{MULTI_SQ02=""}{MULTI_SQ03="Y"}

PS: see the manual : manual.limesurvey.org/Expression_Manager...t_Operator_.28.3D.29

See : demonstration.sondages.pro/676785?newtest=Y# MULTIPLE2 don't use JS, but only EM.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 8 years 5 months ago by DenisChenu. Reason: PS
The topic has been locked.
More
8 years 5 months ago #126385 by first
Replied by first on topic Show X out of Y question groups
Hi Denis, the requirement here is to randomly select X number of option in a multi select question using EM. I am not able to see this happening in your example.

Survey Designer and Programmer
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 5 months ago #126386 by DenisChenu
Replied by DenisChenu on topic Show X out of Y question groups
You speak from 'tick' multi choice with only EM ....

Now, i don't search for the alea function ;)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
More
8 years 5 months ago #126390 by first
Replied by first on topic Show X out of Y question groups

Survey Designer and Programmer
The topic has been locked.
More
7 years 1 month ago #147980 by jsoares
Replied by jsoares on topic Show X out of Y question groups
Looking for help for the guru's around here.

Using the information provided in this topic, I am able to replicate the functionality described showing X out of Y questions. This is perfect because it provides similar functionality as the Question by Question and allowing us to use a timer on each question.

I have four groups of questions, when using this process each question would have its own group.

1st question: can i have questions groups by using the relevance field?
2nd question: would i then be able to create a additional random group/question to match the relevance grouping?
3rd question: Is it possible using javacript/jscript to just to the next random group once number of questions have been reached?

What I am trying to do is to be able to present X number of questions from four different groupings of questions, using this proven workaround?

I hope someone can help and look forward to everyone's suggestions.
The topic has been locked.
More
4 years 2 months ago #192659 by dirk01
Replied by dirk01 on topic Show X out of Y question groups
Hi there,


I have a MR-question1 in the middle of my survey.

This MR-question1 is automatically filled based on previous answers, so certain answers are checked.

Now I want a limited random selection of these checked items as a basis for conditions on further questions.

I thought I use another MR-question2 with a filter on MR-question1 and then use the script below to random select certain number of answers answers.

However, the script uses all!! the answers from the MR to randomize, not all only the filtered ones.

Kind regards,

Dirk
Code:
<script>
$(function(){
$('body').hide()
var showNumberOfGroups = 2; //enter number of groups to randomly show.
var $cboxs = $('input:checkbox');
for(var i=0;i<2;i++){
$cboxs.eq(i).prop('checked',true);
}
document.getElementById('movenextbtn').click();
})
</script>
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose