Welcome to the LimeSurvey Community Forum

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

How can i show only N questions of one grp?

  • willyx
  • willyx's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 3 months ago - 13 years 3 months ago #54247 by willyx
Hi, i've used the new randomize function (randomize grp) of the 1.91beta. This is really cool, but now i've another problem... from that 100 questions in that randomized grp i need to show only 10 of them. Choose 10 random questions from a pool of 100. I know that is not possibible and i should look for the workaround secton. But i've only some .net coding skills, i'm not able to build a javascript :(
Any help? Tnks
Last edit: 13 years 3 months ago by willyx.
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
13 years 3 months ago #54253 by Mazi
Well, the only solution I see is to ask a developer for advanced (paid) support to help you out. Even JS won't be a solution if the questions are spread over different pages. You'd probably have to edit the PHP source code.

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.
  • willyx
  • willyx's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 3 months ago #54273 by willyx
Replied by willyx on topic How can i show only N questions of one grp?
I can have all questions in one page isn't a problem for me
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
13 years 3 months ago #54276 by tpartner
Replied by tpartner on topic How can i show only N questions of one grp?
Can you attach a sample survey?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • willyx
  • willyx's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 3 months ago #54277 by willyx
Replied by willyx on topic How can i show only N questions of one grp?
www.insomnia-guild.it/torre/index.php?si...77&newtest=Y&lang=it

It have 450+ questions divided in 5-6 groups Questions are random shuffled. I need to show only 3 storia (hystory) questions, 8 italian questions, 3 civic ecc. I've no problems to show all in one page, i need to have at the end only 25 questions...
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
13 years 3 months ago #54278 by tpartner
Replied by tpartner on topic How can i show only N questions of one grp?
Okay, I would run the survey in group-by-group mode, set up the survey to use JavaScript and place the following script in the source of each group description. Replace"NN" (line 5) with the number of questions you want displayed in each group (page).

The script initially hides all questions on a page and then shows the first number of questions you want, Since the questions are already randomized on the page, you effectively get random sub-sets of questions for each respondent.
Code:
<script type="text/javascript" charset="utf-8">
 
    $(document).ready(function() {
 
        showQuestions(NN);
 
        function showQuestions(showNum) {
 
            $('div[id^="question"]').hide();
            $('div[id^="question"]').each(function(i) {
                if (i < showNum) {
                    $(this).show();
                }
            });
        }
    });
 
</script>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • willyx
  • willyx's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 2 months ago #54296 by willyx
Replied by willyx on topic How can i show only N questions of one grp?
Works, tnks.
I'll send some money to buy a pizza for the project, tnks .)
The topic has been locked.
  • willyx
  • willyx's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 2 months ago - 13 years 2 months ago #54299 by willyx
Replied by willyx on topic How can i show only N questions of one grp?
mmm...2 bugs:
1)Preview question grps uses the wrong gid. If my grps are as gid 1-2-3-4-5 is all ok. If i've 2-5-6-7-8 (deleted some) when i try to preview the first grp he pass the gid 2 and then show not the gid2 grp, but the second grp (in my example gid 5)
2)I've tryed to active my survey, but after the welcome screen i get a session error. I've no problems if disabled and i use preview.

I've post the first one in the bug traker
U can test it in www.insomnia-guild.it/torre/admin default password.
Last edit: 13 years 2 months ago by willyx.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
13 years 2 months ago #54302 by tpartner
Replied by tpartner on topic How can i show only N questions of one grp?
Are the bugs related to the inserted JavaScript?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • willyx
  • willyx's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 2 months ago #54309 by willyx
Replied by willyx on topic How can i show only N questions of one grp?
The first one no, i had it from the beginning. The second one i need to check it, maybe is related to the javascript
The topic has been locked.
  • willyx
  • willyx's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 2 months ago - 13 years 2 months ago #54346 by willyx
Replied by willyx on topic How can i show only N questions of one grp?
I've removed the java code, build a new survey but i'm unable to use teh survey, it give to me the cookies error:(

Also if i go in response data entry screen i get :
Parse error: syntax error, unexpected T_ELSEIF in /web/htdocs/www.insomnia-guild.it/home/torre/admin/dataentry.php on line 429
Last edit: 13 years 2 months ago by willyx.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
13 years 2 months ago #54348 by tpartner
Replied by tpartner on topic How can i show only N questions of one grp?
I don't believe that either of hese bugs are caused by the JavaScript. It is strictly client-side and only acts on the current page so cannot affect sessions or control the display of other groups.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose