[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>&lt;libra=
ry&gt;<br>&lt;script type=3D"loncapa/perl"&gt;<br>@DirectoryArr =3D (<br>&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp; {problem=3D&gt;"200101/question=5F001.library", midterm=
=3D&gt;"y"}, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {problem=3D&gt;"200101/question=5F00=
2.library", midterm=3D&gt;"y"},<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {problem=3D&gt;"20=
0101/question=5F003.library", midterm=3D&gt;"y"},<br>&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
{problem=3D&gt;"200101/question=5F004.library", midterm=3D&gt;"y"},<br>&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp; {problem=3D&gt;"200101/question=5F005.library", midterm=
=3D&gt;"y"},<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {problem=3D&gt;"200101/question=5F006=
.library", midterm=3D&gt;"y"},<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp; . . .&nbsp; goes on for awhile!<br>&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp; {problem=3D&gt;"200608/question=5F050.library", midterm=3D&gt;"n=
"},<br>&nbsp;&nbsp; );<br>&lt;/script&gt;<br>&lt;/library&gt;<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>&lt;library&gt=
;<br>&lt;script type=3D"loncapa/perl"&gt;<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 &amp;random(1,1000000,1);<br>=
@DirectoryArr =3D &amp;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);&nbsp; <br>&nbsp;do&nbsp; <br>&nbsp;&nbsp;&n=
bsp; {<br>&nbsp;&nbsp;&nbsp; $a =3D &amp;random (0,$probCount,1);<br>&nbsp;=
&nbsp;&nbsp; if (($MidtermOnly eq "false") || ($DirectoryArr[$a]{'midterm'}=
 eq "y"))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp; $found =3D "false";<br>&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp; for ($j=3D0; $j &lt; $i; $j++)<br>&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($NumList[$j] =3D=3D $a)<br>&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
$found=3D"true";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($found e=
q "false")<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $NumList[=
$i]=3D$a;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $=
aProblem[$i] =3D $DirectoryArr[$a]{'problem'};<br><br>&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $i++;<br>&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp; }&nbsp;&nbsp; # end midterm check<br>&nbsp;&nbsp;&nbsp; }<br>while =
($i &lt; $DesiredNumProblems);<br><br>&lt;/script&gt;<br>&lt;/library&gt;<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>&lt;problem&gt;<br>&lt;s=
cript type=3D"loncapa/perl"&gt;<br><br>$DesiredNumProblems =3D 15;<br>$Midt=
ermOnly =3D "false";<br>&lt;/script&gt;<br><br>&lt;import id=3D"999"&gt; Pr=
oblemList.library &lt;/import&gt;<br>&lt;import id=3D"998"&gt; ../../Common=
/RandomSelector.library &lt;/import&gt;<br><br>1)&amp;nbsp;&amp;nbsp&nbsp; =
<br>&lt;part id=3D"100"&gt; <br>&lt;import id=3D"101"&gt;$aProblem[0]&lt;/i=
mport&gt;<br>&lt;/part&gt;<br><br>2) &amp;nbsp;&amp;nbsp<br>&lt;part id=3D"=
200"&gt; <br>&lt;import id=3D"201"&gt;$aProblem[1]&lt;/import&gt;<br>&lt;/p=
art&gt;<br>&nbsp;&nbsp; . . .<br>15) &amp;nbsp;&amp;nbsp <br>&lt;part id=3D=
"1500"&gt; <br>&lt;import id=3D"1501"&gt;$aProblem[14]&lt;/import&gt;<br>&l=
t;/part&gt;<br>&lt;/problem&gt;<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 &lt;merrill3@msu.edu&gt;<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 &nbsp;<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 &nbsp;USA<br>*** www.biosci.msu.edu ***<br>On Jan 6, 2007, at =
1:40 PM, lucasm@ohiou.edu wrote:<br><br>&gt; Hi,<br>&gt;<br>&gt; I know thi=
s has been bandied about a number of times. I also know the &nbsp;<br>&gt; =
current "best practice" shifts from release to release sometimes 8)<br>&gt;=
<br>&gt; What's the best way to do the following things?<br>&gt;<br>&gt; * =
I have 10 questions - I want a student to get 5 of them.<br>&gt;<br>&gt; * =
I have 10 questions - I want a student to get 5 of them in random &nbsp;<br=
>&gt; order.<br>&gt;<br>&gt; * I have 10 questions - I want a student to ge=
t all 10 but in random &nbsp;<br>&gt; order.<br>&gt;<br>&gt; By the way, ar=
e the "practice" style questions in place and what are &nbsp;<br>&gt; the n=
uances of their use?<br>&gt;<br>&gt; Thanks!<br>&gt; Mark<br>&gt;<br>&gt; -=
---------------------------------------------------------------------- <br>=
&gt; -----<br>&gt; Mark Lucas<span style=3D"visibility: hidden;">&nbsp;&nbs=
p;&nbsp;&nbsp;</span>	<span style=3D"visibility: hidden;">&nbsp;&nbsp;&nbsp=
;&nbsp;</span>	<span style=3D"visibility: hidden;">&nbsp;&nbsp;&nbsp;&nbsp;=
</span>	<span style=3D"visibility: hidden;">&nbsp;&nbsp;&nbsp;&nbsp;</span>=
	<span style=3D"visibility: hidden;">&nbsp;&nbsp;&nbsp;&nbsp;</span>	email:=
 lucasm@ohiou.edu<br>&gt; 252D Clippinger Lab &nbsp;<span style=3D"visibili=
ty: hidden;">&nbsp;&nbsp;&nbsp;&nbsp;</span>	<span style=3D"visibility: hid=
den;">&nbsp;&nbsp;&nbsp;&nbsp;</span>	<span style=3D"visibility: hidden;">&=
nbsp;&nbsp;&nbsp;&nbsp;</span>	<span style=3D"visibility: hidden;">&nbsp;&n=
bsp;&nbsp;&nbsp;</span>	phone: (740)597-2984<br>&gt; Department of Physics =
and Astronomy &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fax: &nbsp; (740)59=
3-0433<br>&gt; Ohio University<br>&gt; Athens, OH 45701<br>&gt; =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>&gt; LON-CAPA-=
users mailing list<br>&gt; LON-CAPA-users@mail.lon-capa.org<br>&gt; <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>&gt;<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>=