--- loncom/homework/grades.pm 2005/06/04 03:36:36 1.271 +++ loncom/homework/grades.pm 2005/06/04 19:05:31 1.273 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.271 2005/06/04 03:36:36 albertel Exp $ +# $Id: grades.pm,v 1.273 2005/06/04 19:05:31 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3873,12 +3873,12 @@ sub scantron_CODElist { sub scantron_CODEunique { my $result='<nobr> - <input type="radio" name="scantron_CODEunique" - value="Yes" checked="on" /> Yes + <label><input type="radio" name="scantron_CODEunique" + value="Yes" checked="on" /> Yes </label> </nobr> <nobr> - <input type="radio" name="scantron_CODEunique" - value="No" /> No + <label><input type="radio" name="scantron_CODEunique" + value="No" /> No </label> </nobr>'; return $result; } @@ -3928,8 +3928,8 @@ sub scantron_selectphase { <tr bgcolor="#ffffe6"> <td> Options: </td> <td> - <input type="checkbox" name="scantron_options_redo" value="redo_skipped"/> Do only previously skipped records <br /> - <input type="checkbox" name="scantron_options_ignore" value="ignore_corrections"/> Remove all exisiting corrections + <label><input type="checkbox" name="scantron_options_redo" value="redo_skipped"/> Do only previously skipped records</label> <br /> + <label><input type="checkbox" name="scantron_options_ignore" value="ignore_corrections"/> Remove all exisiting corrections</label> </td> </tr> <tr bgcolor="#ffffe6"> @@ -4735,19 +4735,22 @@ sub scantron_get_correction { $r->print("<p>How should I handle this? <br /> \n"); $r->print("\n<br /> "); my $i=0; - if ($error eq 'incorrectCODE') { + if ($error eq 'incorrectCODE' + && $$scan_record{'scantron.CODE'}=~/\S/ ) { my ($max,$closest)=&scantron_get_closely_matching_CODEs($arg,$$scan_record{'scantron.CODE'}); foreach my $testcode (@{$closest}) { my $checked=''; if (!$i) { $checked=' checked="on" '; } - $r->print("<input type='radio' name='scantron_CODE_resolution' value='use_closest_$i' $checked /> Use the similar CODE <b><tt>".$testcode."</tt></b> instead.<input type='hidden' name='scantron_CODE_closest_$i' value='$testcode' />"); + $r->print("<label><input type='radio' name='scantron_CODE_resolution' value='use_closest_$i' $checked /> Use the similar CODE <b><tt>".$testcode."</tt></b> instead.</label><input type='hidden' name='scantron_CODE_closest_$i' value='$testcode' />"); $r->print("\n<br />"); $i++; } } - my $checked; if (!$i) { $checked=' checked="on" '; } - $r->print("<input type='radio' name='scantron_CODE_resolution' value='use_unfound' $checked /> Use the CODE <b><tt>".$$scan_record{'scantron.CODE'}."</tt></b> that is was on the paper, ignoring the error."); - $r->print("\n<br />"); + if ($$scan_record{'scantron.CODE'}=~/\S/ ) { + my $checked; if (!$i) { $checked=' checked="on" '; } + $r->print("<label><input type='radio' name='scantron_CODE_resolution' value='use_unfound' $checked /> Use the CODE <b><tt>".$$scan_record{'scantron.CODE'}."</tt></b> that is was on the paper, ignoring the error.</label>"); + $r->print("\n<br />"); + } $r->print(<<ENDSCRIPT); <script type="text/javascript"> @@ -4766,9 +4769,9 @@ ENDSCRIPT "&scantron_CODElist=".&Apache::lonnet::escape($env{'form.scantron_CODElist'}). "&curCODE=".&Apache::lonnet::escape($$scan_record{'scantron.CODE'}). "&scantron_selectfile=".&Apache::lonnet::escape($env{'form.scantron_selectfile'}); - $r->print("<input type='radio' name='scantron_CODE_resolution' value='use_found' /> <a target='_blank' href='$href'>Select</a> a CODE from the list of all CODEs and use it. Selected CODE is <input readonly='true' type='text' size='8' name='scantron_CODE_selectedvalue' onfocus=\"javascript:change_radio('use_found')\" onchange=\"javascript:change_radio('use_found')\" />"); + $r->print("<label><input type='radio' name='scantron_CODE_resolution' value='use_found' /> <a target='_blank' href='$href'>Select</a> a CODE from the list of all CODEs and use it.</label> Selected CODE is <input readonly='true' type='text' size='8' name='scantron_CODE_selectedvalue' onfocus=\"javascript:change_radio('use_found')\" onchange=\"javascript:change_radio('use_found')\" />"); $r->print("\n<br />"); - $r->print("<input type='radio' name='scantron_CODE_resolution' value='use_typed' /> Use <input type='text' size='8' name='scantron_CODE_newvalue' onfocus=\"javascript:change_radio('use_typed')\" onkeypress=\"javascript:change_radio('use_typed')\" /> as the CODE."); + $r->print("<label><input type='radio' name='scantron_CODE_resolution' value='use_typed' /> Use </label><input type='text' size='8' name='scantron_CODE_newvalue' onfocus=\"javascript:change_radio('use_typed')\" onkeypress=\"javascript:change_radio('use_typed')\" /> as the CODE."); $r->print("\n<br /><br />"); } elsif ($error eq 'doublebubble') { $r->print("<p>There have been multiple bubbles scanned for a some question(s)</p>\n"); @@ -4811,11 +4814,11 @@ sub scantron_bubble_selector { } $r->print('<td></td></tr><tr>'); for (my $i=0;$i<$max;$i++) { - $r->print('<td><input type="radio" name="scantron_correct_Q_'.$quest. - '" value="'.$i.'" />'.$alphabet[$i]."</td>"); + $r->print('<td><label><input type="radio" name="scantron_correct_Q_'. + $quest.'" value="'.$i.'" />'.$alphabet[$i]."</label></td>"); } - $r->print('<td><input type="radio" name="scantron_correct_Q_'.$quest. - '" value="none" /> No bubble </td>'); + $r->print('<td><label><input type="radio" name="scantron_correct_Q_'. + $quest.'" value="none" /> No bubble </label></td>'); $r->print('</tr></table>'); }