Check out the LimeSurvey source code on GitHub!

How can i show only N questions of one grp?

More
6 years 2 months ago - 6 years 2 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: 6 years 2 months ago by willyx.
The topic has been locked.
More
6 years 2 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
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"
The topic has been locked.
More
6 years 2 months ago #54273 by willyx
I can have all questions in one page isn't a problem for me
The topic has been locked.
More
6 years 2 months ago #54276 by tpartner
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.
More
6 years 2 months ago #54277 by willyx
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.
More
6 years 2 months ago #54278 by tpartner
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.
The topic has been locked.
More
6 years 2 months ago #54296 by willyx
Works, tnks.
I'll send some money to buy a pizza for the project, tnks .)
The topic has been locked.
More
6 years 2 months ago - 6 years 2 months ago #54299 by willyx
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: 6 years 2 months ago by willyx.
The topic has been locked.
More
6 years 2 months ago #54302 by tpartner
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.
More
6 years 2 months ago #54309 by willyx
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.
More
6 years 2 months ago - 6 years 2 months ago #54346 by willyx
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: 6 years 2 months ago by willyx.
The topic has been locked.
More
6 years 2 months ago #54348 by tpartner
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.
More
6 years 2 months ago #54350 by willyx
Deleted all files, tables reinstalled, build a new survey, same error when activated...the only stuff left is config.php :(
The topic has been locked.
More
6 years 2 months ago #54388 by tpartner
What exactly is the error? Can you post the contents of your config.php (removing passwords)?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
6 years 2 months ago #54424 by Mazi
Try to re-upload all files in binary mode. The error message "Parse error: syntax error, unexpected T_ELSEIF in /web/htdocs/www.insomnia-guild.it/home/torre/admin/dataentry.php on line 429" points to a broken/incomplete file upload.


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"
The topic has been locked.
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form