[LON-CAPA-users] Random sequence of questions
lon-capa-users@mail.lon-capa.org
lon-capa-users@mail.lon-capa.org
Tue, 9 Jan 2007 22:19:52 -0500
<div>OK, I will chime in with my weird little system.<br><br>First, you can=
build a sequence of problems, import them as Course Coordinator (for examp=
le, as MySequence), then use the "Randomly Pick" option. This solves the fi=
rst issue, as I understand it. As I recall, the questions are in "order": f=
or example, the student will see questions 2,4,5,7,8.<br><br>I don't do thi=
s. My requirement was to provide a randomly selected set of 15 problems sel=
ected from a pool of 2,000-3,000 problems. My code could certainly be modif=
ied to address all three issues. I tried to publish them as open source. <b=
r><br>Here is what I do:<br><br>- I create the problems as libraries, not p=
roblems, so I can import them into a master problem.<br><br>- I create a ma=
ster script listing all the problems in a table. This is done in brewington=
/Chemistry/RegentsReview/ProblemList.library, for example.<br><br><libra=
ry><br><script type=3D"loncapa/perl"><br>@DirectoryArr =3D (<br>&n=
bsp;  =
; {problem=3D>"200101/question=5F001.library", midterm=
=3D>"y"}, <br> &nbs=
p; {problem=3D>"200101/question=5F00=
2.library", midterm=3D>"y"},<br> &nbs=
p; {problem=3D>"20=
0101/question=5F003.library", midterm=3D>"y"},<br> &nbs=
p; =
{problem=3D>"200101/question=5F004.library", midterm=3D>"y"},<br>&nbs=
p; &=
nbsp; {problem=3D>"200101/question=5F005.library", midterm=
=3D>"y"},<br>  =
; {problem=3D>"200101/question=5F006=
.library", midterm=3D>"y"},<br>  =
; &n=
bsp; . . . goes on for awhile!<br>  =
; &n=
bsp; {problem=3D>"200608/question=5F050.library", midterm=3D>"n=
"},<br> );<br></script><br></library><br><br>The mi=
dterm field allows me to use the same list for the same problem presentatio=
n format, but only those problems with a "y" will be selected (for reviewin=
g for midterms).<br><br>- I have a utility script brewington/Common/RandomS=
elector.library which retrieves the desired 15 problems from the list and p=
uts them into an array aProblem[0..14]. This script ensures a don't get the=
same problem in twice, and allows me to select only subsets of problems fo=
r inclusion (for example, just the midterm problems).<br><br><library>=
;<br><script type=3D"loncapa/perl"><br># This script requires prior i=
mport of a ProblemLibrary.library<br># this is required to properly define =
the @DirectoryArr hash, which is then manipulated<br># by this script<br><b=
r>$probCount =3D $#DirectoryArr;<br>$seed =3D &random(1,1000000,1);<br>=
@DirectoryArr =3D &random=5Fpermutation($seed,@DirectoryArr);<br><br># =
build array of random problem numbers<br>$i=3D0;<br># indices into Director=
yArr for the 15 problems we wish to generate<br>@NumList=3D(-1,-1,-1,-1,-1,=
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1); <br> do <br> &n=
bsp; {<br> $a =3D &random (0,$probCount,1);<br> =
if (($MidtermOnly eq "false") || ($DirectoryArr[$a]{'midterm'}=
eq "y"))<br> {<br> &n=
bsp; $found =3D "false";<br>  =
; for ($j=3D0; $j < $i; $j++)<br> &nb=
sp; {<br> =
if ($NumList[$j] =3D=3D $a)<br> &=
nbsp; {<br>&nbs=
p; =
$found=3D"true";<br> &=
nbsp; }<br> &nbs=
p; }<br> if ($found e=
q "false")<br> =
{<br> $NumList[=
$i]=3D$a;<br> $=
aProblem[$i] =3D $DirectoryArr[$a]{'problem'};<br><br> &nb=
sp; $i++;<br> &n=
bsp; }<br>  =
; } # end midterm check<br> }<br>while =
($i < $DesiredNumProblems);<br><br></script><br></library><b=
r><br>I'm sure it is not optimal code, but it works:)<br><br>- I create a p=
roblem brewington/Chemistry/RegentsReview/FinalMaster.problem which imports=
the ProblemList and the RandomSelector logic, then builds a multipart prob=
lem using the constructed $aProblem array. <br><br><problem><br><s=
cript type=3D"loncapa/perl"><br><br>$DesiredNumProblems =3D 15;<br>$Midt=
ermOnly =3D "false";<br></script><br><br><import id=3D"999"> Pr=
oblemList.library </import><br><import id=3D"998"> ../../Common=
/RandomSelector.library </import><br><br>1)&nbsp;&nbsp =
<br><part id=3D"100"> <br><import id=3D"101">$aProblem[0]</i=
mport><br></part><br><br>2) &nbsp;&nbsp<br><part id=3D"=
200"> <br><import id=3D"201">$aProblem[1]</import><br></p=
art><br> . . .<br>15) &nbsp;&nbsp <br><part id=3D=
"1500"> <br><import id=3D"1501">$aProblem[14]</import><br>&l=
t;/part><br></problem><br><br>- I can then put this FinalMaster in=
to a page or a sequence as desired, for importing into the Course Documents=
. <br><br>I create a number of pages with the same FinalMaster and a second=
dummy problem; this is just to get a SubmitAll button (the students kept a=
nswering a bunch of questions, then submitting the answer for one part whic=
h clears the other answers they put in). Each page has a different set of 1=
5 problems in random order.<br><br><br>OK, it is a bit kludgy, but I have h=
ad some success with it. It makes a great review process - students will wo=
rk 30-50 of these problems over the course of a few days, after which they =
are pretty prepared to take our New York State Regents test.<br><br><br>bre=
w<br><br></div><font color=3D"#990099">-----lon-capa-users-admin@mail.lon-c=
apa.org wrote: -----<br><br></font><blockquote style=3D"border-left: 2px so=
lid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; =
margin-right: 0px;">To: lon-capa-users@mail.lon-capa.org<br>From: John Merr=
ill <merrill3@msu.edu><br>Sent by: lon-capa-users-admin@mail.lon-capa=
.org<br>Date: 01/09/2007 12:21PM<br>Subject: Re: [LON-CAPA-users] Random se=
quence of questions<br><br><font face=3D"monospace" size=3D"3">Wow. Mighty =
silent! I was really looking forward to some useful advice <br>here. =
I hope it isn't as hopeless as this would lead one to believe.<br>John<br><=
br>*** merrill3@msu.edu ***<br>John Merrill, Director<br>Biological Science=
s Program<br>100 North Kedzie Lab<br>Michigan State University<br>East Lans=
ing MI 48824 USA<br>*** www.biosci.msu.edu ***<br>On Jan 6, 2007, at =
1:40 PM, lucasm@ohiou.edu wrote:<br><br>> Hi,<br>><br>> I know thi=
s has been bandied about a number of times. I also know the <br>> =
current "best practice" shifts from release to release sometimes 8)<br>>=
<br>> What's the best way to do the following things?<br>><br>> * =
I have 10 questions - I want a student to get 5 of them.<br>><br>> * =
I have 10 questions - I want a student to get 5 of them in random <br=
>> order.<br>><br>> * I have 10 questions - I want a student to ge=
t all 10 but in random <br>> order.<br>><br>> By the way, ar=
e the "practice" style questions in place and what are <br>> the n=
uances of their use?<br>><br>> Thanks!<br>> Mark<br>><br>> -=
---------------------------------------------------------------------- <br>=
> -----<br>> Mark Lucas<span style=3D"visibility: hidden;"> &nbs=
p; </span> <span style=3D"visibility: hidden;">  =
; </span> <span style=3D"visibility: hidden;"> =
</span> <span style=3D"visibility: hidden;"> </span>=
<span style=3D"visibility: hidden;"> </span> email:=
lucasm@ohiou.edu<br>> 252D Clippinger Lab <span style=3D"visibili=
ty: hidden;"> </span> <span style=3D"visibility: hid=
den;"> </span> <span style=3D"visibility: hidden;">&=
nbsp; </span> <span style=3D"visibility: hidden;"> &n=
bsp; </span> phone: (740)597-2984<br>> Department of Physics =
and Astronomy fax: (740)59=
3-0433<br>> Ohio University<br>> Athens, OH 45701<br>> =5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F<br>> LON-CAPA-=
users mailing list<br>> LON-CAPA-users@mail.lon-capa.org<br>> <a href=
=3D"http://mail.lon-capa.org/mailman/listinfo/lon-capa-users">http://mail.l=
on-capa.org/mailman/listinfo/lon-capa-users</a><br>><br><br>=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F<br>LON-CAPA-users ma=
iling list<br>LON-CAPA-users@mail.lon-capa.org<br><a href=3D"http://mail.lo=
n-capa.org/mailman/listinfo/lon-capa-users">http://mail.lon-capa.org/mailma=
n/listinfo/lon-capa-users</a><br></font>
</blockquote><br>=