<div dir="ltr">Rex,<div><br></div><div>Here's the code, I thought it might be easier to cut and paste it in construction space to make it easier to debug.  The problem works fine for me in construction space.   One student with $f1=1.0 and one student with $f1=6.0221e23 have gotten it correct so far. </div><div><br></div><div><div><problem></div><div><part id="t06p12a"></div><div><script type="loncapa/perl"></div><div>$n1=&random(0.025,0.050,0.001);</div><div>$t1=&random(1,2);</div><div>$unit1=&choose($t1,"moles","molecules");</div><div>$f1=&choose($t1,1.00,6.0221e23);</div><div>$mw1=(12.011*20.0)+(1.008*24.0)+(15.999*2.0);</div><div>$ansa= $n1 * 1e-3 * $f1/ $mw1;</div><div></script></div><div><br></div><div><startouttext /></div><div><p>A particular oral contraceptive contains &format($n1,'3f') mg of ethinyl estradiol </div><div>in each pill. The formula of this compound is <chem>C20H24O2</chem>. </div><div>How many $unit1 of ethinyl estradiol are there in one pill?  (give answer to 3 digits)</p></div><div><endouttext /></div><div><numericalresponse format="3e" answer="$ansa" id="11"></div><div><span style="white-space:pre-wrap">        </span><responseparam name="tol" type="tolerance" default="5%" description="Numerical Tolerance" /></div><div><span style="white-space:pre-wrap">       </span><responseparam name="sig" type="int_range,0-16" default="3,4" description="Significant Figures" /></div><div><span style="white-space:pre-wrap"> </span><textline /></div><div><span style="white-space:pre-wrap">       </span><hintgroup></div><div><span style="white-space:pre-wrap">                </span><startouttext /><endouttext /></div><div><span style="white-space:pre-wrap">       </span></hintgroup></div><div></numericalresponse></div><div></part></div><div><part id="t06p12b"></div><div><script type="loncapa/perl"></div><div>$t2=&random(1,3);</div><div>$sub2=&choose($t2,"carbon","hydrogen","oxygen");</div><div>$f2=&choose($t2,20.0,24.0,2.0);</div><div>$ansb=($ansa/$f1)* $f2 * 6.0221e23;</div><div></script></div><div><br></div><div><startouttext /></div><div><p>How many $sub2 atoms are there in one of these pills (due to the presence </div><div>of ethinyl estradiol)?  (give answer to 3 digits)</p></div><div><br></div><div><endouttext /></div><div><numericalresponse format="3e" answer="$ansb" id="12"></div><div><span style="white-space:pre-wrap">     </span><responseparam name="tol" type="tolerance" default="5%" description="Numerical Tolerance" /></div><div><span style="white-space:pre-wrap">       </span><responseparam name="sig" type="int_range,0-16" default="3,4" description="Significant Figures" /></div><div><span style="white-space:pre-wrap"> </span><textline /></div><div><span style="white-space:pre-wrap">       </span><hintgroup></div><div><span style="white-space:pre-wrap">                </span><startouttext /><endouttext /></div><div><span style="white-space:pre-wrap">       </span></hintgroup></div><div></numericalresponse></div><div></part></div><div><br></div><div><part id="t06p12c"></div><div><script type="loncapa/perl"></div><div>$mw3=&choose($t2,12.011,1.008,15.999);</div><div>$ansc=$ansb*$mw3/6.0221e23;</div><div></script></div><div><br></div><div><startouttext /></div><div><p>What mass of $sub2 is this? (Enter the answer in grams.)</p></div><div><br></div><div><endouttext /></div><div><numericalresponse format="3e" answer="$ansc" id="13"></div><div><span style="white-space:pre-wrap">      </span><responseparam name="tol" type="tolerance" default="5%" description="Numerical Tolerance" /></div><div><span style="white-space:pre-wrap">       </span><responseparam name="sig" type="int_range,0-16" default="3,4" description="Significant Figures" /></div><div><span style="white-space:pre-wrap"> </span><textline /></div><div><span style="white-space:pre-wrap">       </span><hintgroup></div><div><span style="white-space:pre-wrap">                </span><startouttext /><endouttext /></div><div><span style="white-space:pre-wrap">       </span></hintgroup></div><div></numericalresponse></div><div></part></div><div></problem></div><div><br></div><div><br></div><div><br></div></div></div>