version 1.333, 2006/03/13 20:26:51
|
version 1.334, 2006/03/13 21:10:34
|
Line 4764 sub scantron_validate_file {
|
Line 4764 sub scantron_validate_file {
|
my $result=&scantron_form_start($max_bubble).$default_form_data; |
my $result=&scantron_form_start($max_bubble).$default_form_data; |
$r->print($result); |
$r->print($result); |
|
|
my @validate_phases=( 'ID', |
my @validate_phases=( 'sequence', |
|
'ID', |
'CODE', |
'CODE', |
'doublebubble', |
'doublebubble', |
'missingbubbles'); |
'missingbubbles'); |
Line 4797 STUFF
|
Line 4798 STUFF
|
$r->print("<input type='hidden' name='validatepass' value='".$currentphase."' />"); |
$r->print("<input type='hidden' name='validatepass' value='".$currentphase."' />"); |
} |
} |
if ($stop) { |
if ($stop) { |
$r->print('<input type="submit" name="submit" value="Continue ->" />'); |
if ($validate_phases[$currentphase] eq 'sequence') { |
$r->print(' using corrected info <br />'); |
$r->print('<input type="submit" name="submit" value="Ignore -> " />'); |
$r->print("<input type='submit' value='Skip' name='scantron_skip_record' />"); |
$r->print(' this error <br />'); |
$r->print(" this scanline saving it for later."); |
|
|
$r->print(" <p>Or click the 'Grading Menu' button to start over.</p>"); |
|
} else { |
|
$r->print('<input type="submit" name="submit" value="Continue ->" />'); |
|
$r->print(' using corrected info <br />'); |
|
$r->print("<input type='submit' value='Skip' name='scantron_skip_record' />"); |
|
$r->print(" this scanline saving it for later."); |
|
} |
} |
} |
$r->print(" </form><br />".&show_grading_menu_form($symb). |
$r->print(" </form><br />".&show_grading_menu_form($symb). |
"</body></html>"); |
"</body></html>"); |
Line 4933 sub scantron_put_line {
|
Line 4941 sub scantron_put_line {
|
$scanlines->{'corrected'}[$i]=$newline; |
$scanlines->{'corrected'}[$i]=$newline; |
} |
} |
|
|
|
sub scantron_filter_not_exam { |
|
my ($curres)=@_; |
|
|
|
if (ref($curres) && $curres->is_problem() && !$curres->is_exam()) { |
|
# if the user has asked to not have either hidden |
|
# or 'randomout' controlled resources to be graded |
|
# don't include them |
|
if ($env{'form.scantron_options_hidden'} eq 'ignore_hidden' |
|
&& $curres->randomout) { |
|
return 0; |
|
} |
|
return 1; |
|
} |
|
return 0; |
|
} |
|
|
|
sub scantron_validate_sequence { |
|
my ($r,$currentphase) = @_; |
|
|
|
my $navmap=Apache::lonnavmaps::navmap->new(); |
|
my (undef,undef,$sequence)= |
|
&Apache::lonnet::decode_symb($env{'form.selectpage'}); |
|
|
|
my $map=$navmap->getResourceByUrl($sequence); |
|
|
|
$r->print('<input type="hidden" name="validate_sequence_exam" |
|
value="ignore" />'); |
|
if ($env{'form.validate_sequence_exam'} ne 'ignore') { |
|
my @resources= |
|
$navmap->retrieveResources($map,\&scantron_filter_not_exam,1,0); |
|
if (@resources) { |
|
$r->print("<p>".&mt('Some resource in the sequece currently are not set to exam mode. Grading these resources currently may not work correctly.')."</p>"); |
|
return (1,$currentphase); |
|
} |
|
} |
|
|
|
return (0,$currentphase+1); |
|
} |
|
|
sub scantron_validate_ID { |
sub scantron_validate_ID { |
my ($r,$currentphase) = @_; |
my ($r,$currentphase) = @_; |
|
|