# [LON-CAPA-users] Random sequence of questions

Lars Jensen lon-capa-users@mail.lon-capa.org
Tue, 09 Jan 2007 17:09:43 -0800

```Hi John,

Take a look at this problem - it gives you one way of doing it. With
minor modifications, it does most if not all of what you need.

Lars.

<problem>
<script type="loncapa/perl">
\$a = &random(4,20,1);
@month31 = ("January", "March", "May", "July", "August", "October",
"December");
@month30 = ("April", "June", "September", "November");
@week = ("Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
"Saturday", "Sunday");
\$tag1 = &random(0,6,1);
\$tag2 = &random(0,3,1);
\$tag3 = &random(0,6,1);
@quest = ("What is the probability that two people have a birthday in
\$month31[\$tag1]?",
"What is the probability that two people born in \$month30[\$tag2]
have a birthday in the first half of the month?",
"What is the probability that two people have a birthday on the same
day of the same month?",
"What is the probability that two people have a birthday on the
\${a}'th of any month?",
"What is the probability that two people were born on a \$week[\$tag3]?");
@ans = ((31/365)**2, (15/30)**2, (1/365), (12/365)**2, (1/7)**2);

\$seed = &random(1,1000000,10);
@squest = &random_permutation(\$seed,@quest);
@sans = &random_permutation(\$seed,@ans);
</script>
<startouttext />Consider two people being randomly selected.  (For
simplicity, ignore leap years.)
<br />
<br />
<part id="13">
(a) \$squest[0] <br />
<endouttext />
<responseparam name="tol" default=".0003" type="tolerance"
description="Numerical Tolerance" />
<textline size="10" />
</formularesponse></part>
<startouttext />
<br />
<br />
<part id="14">
(b)\$squest[1] <br />
<responseparam name="tol" default=".0003" type="tolerance"
description="Numerical Tolerance" />
<textline size="10" />
</formularesponse></part>
</problem>

John Merrill wrote:
> Wow. Mighty silent! I was really looking forward to some useful advice
> here. I hope it isn't as hopeless as this would lead one to believe.
> John
>
> *** merrill3@msu.edu ***
> John Merrill, Director
> Biological Sciences Program
> 100 North Kedzie Lab
> Michigan State University
> East Lansing MI 48824  USA
> *** www.biosci.msu.edu ***
> On Jan 6, 2007, at 1:40 PM, lucasm@ohiou.edu wrote:
>
>> Hi,
>>
>> I know this has been bandied about a number of times. I also know the
>> current "best practice" shifts from release to release sometimes 8)
>>
>> What's the best way to do the following things?
>>
>> * I have 10 questions - I want a student to get 5 of them.
>>
>> * I have 10 questions - I want a student to get 5 of them in random
>> order.
>>
>> * I have 10 questions - I want a student to get all 10 but in random
>> order.
>>
>> By the way, are the "practice" style questions in place and what are
>> the nuances of their use?
>>
>> Thanks!
>> Mark
>>
>> ----------------------------------------------------------------------------
>>
>> Mark Lucas                    email: lucasm@ohiou.edu
>> 252D Clippinger Lab                  phone: (740)597-2984
>> Department of Physics and Astronomy             fax:   (740)593-0433
>> Ohio University
>> Athens, OH 45701
>> _______________________________________________
>> LON-CAPA-users mailing list
>> LON-CAPA-users@mail.lon-capa.org
>> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users
>>
>
> _______________________________________________
> LON-CAPA-users mailing list
> LON-CAPA-users@mail.lon-capa.org
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users

```