Welcome, Guest
Username: Password: Remember me

TOPIC: How can i show only N questions of one grp?

How can i show only N questions of one grp? 3 years 10 months ago #54247

  • willyx
  • willyx's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 13
  • Karma: 0
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: 3 years 10 months ago by willyx.
The topic has been locked.

Re:How can i show only N questions of one grp? 3 years 10 months ago #54253

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5331
  • Thank you received: 296
  • Karma: 249
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
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The topic has been locked.

Re:How can i show only N questions of one grp? 3 years 10 months ago #54273

  • willyx
  • willyx's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 13
  • Karma: 0
I can have all questions in one page isn't a problem for me
The topic has been locked.

Re:How can i show only N questions of one grp? 3 years 10 months ago #54276

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4272
  • Thank you received: 806
  • Karma: 369
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The topic has been locked.

Re:How can i show only N questions of one grp? 3 years 10 months ago #54277

  • willyx
  • willyx's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 13
  • Karma: 0
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.

Re:How can i show only N questions of one grp? 3 years 10 months ago #54278

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4272
  • Thank you received: 806
  • Karma: 369
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.
<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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The topic has been locked.

Re:How can i show only N questions of one grp? 3 years 10 months ago #54296

  • willyx
  • willyx's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 13
  • Karma: 0
Works, tnks.
I'll send some money to buy a pizza for the project, tnks .)
The topic has been locked.

Re:How can i show only N questions of one grp? 3 years 10 months ago #54299

  • willyx
  • willyx's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 13
  • Karma: 0
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: 3 years 10 months ago by willyx.
The topic has been locked.

Re:How can i show only N questions of one grp? 3 years 10 months ago #54302

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4272
  • Thank you received: 806
  • Karma: 369
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The topic has been locked.

Re:How can i show only N questions of one grp? 3 years 10 months ago #54309

  • willyx
  • willyx's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 13
  • Karma: 0
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.
Moderators: ITEd
Time to create page: 0.173 seconds
Donation Image