--- loncom/homework/grades.pm 2011/10/17 12:41:34 1.662
+++ loncom/homework/grades.pm 2011/11/14 03:08:01 1.663
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.662 2011/10/17 12:41:34 raeburn Exp $
+# $Id: grades.pm,v 1.663 2011/11/14 03:08:01 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -6226,6 +6226,12 @@ sub scantron_warning_screen {
'
'.&mt('List of CODES to validate against:').'
'.
$env{'form.scantron_CODElist'}.'
';
}
+ my $lastbubblepoints;
+ if ($env{'form.scantron_lastbubblepoints'} ne '') {
+ $lastbubblepoints =
+ '
'.&mt('Hand-graded items: points from last bubble in row').'
'.
+ $env{'form.scantron_lastbubblepoints'}.'
';
+ }
return ('
@@ -6234,7 +6240,7 @@ sub scantron_warning_screen {
'.&mt('Sequence to be Graded:').'
'.$title.'
'.&mt('Data File that will be used:').'
'.$env{'form.scantron_selectfile'}.'
-'.$CODElist.'
+'.$CODElist.$lastbubblepoints.'
'.&mt('If this information is correct, please click on \'[_1]\'.',&mt($button_text)).'
'.&mt('If something is incorrect, please return to [_1]Grade/Manage/Review Bubblesheets[_2] to start over.','','').'
@@ -6272,8 +6278,9 @@ sub scantron_do_warning {
}
} else {
my $warning=&scantron_warning_screen('Grading: Validate Records',$symb);
+ my $bubbledbyhand=&hand_bubble_option();
$r->print('
-'.$warning.'
+'.$warning.$bubbledbyhand.'
');
@@ -6369,6 +6376,9 @@ sub scantron_validate_file {
return '';
}
my $result=&scantron_form_start($max_bubble).$default_form_data;
+ if ($env{'form.scantron_lastbubblepoints'} ne '') {
+ $result .= '';
+ }
$r->print($result);
my @validate_phases=( 'sequence',
@@ -7641,6 +7651,41 @@ sub scantron_validate_missingbubbles {
return (0,$currentphase+1);
}
+sub hand_bubble_option {
+ my (undef, undef, $sequence) =
+ &Apache::lonnet::decode_symb($env{'form.selectpage'});
+ return if ($sequence eq '');
+ my $navmap = Apache::lonnavmaps::navmap->new();
+ unless (ref($navmap)) {
+ return;
+ }
+ my $needs_hand_bubbles;
+ my $map=$navmap->getResourceByUrl($sequence);
+ my @resources=$navmap->retrieveResources($map,\&scantron_filter,1,0);
+ foreach my $res (@resources) {
+ if (ref($res)) {
+ if ($res->is_problem()) {
+ my $partlist = $res->parts();
+ foreach my $part (@{ $partlist }) {
+ my @types = $res->responseType($part);
+ if (grep(/^(chem|essay|image|formula|math|string|functionplot)$/,@types)) {
+ $needs_hand_bubbles = 1;
+ last;
+ }
+ }
+ }
+ }
+ }
+ if ($needs_hand_bubbles) {
+ my %scantron_config=&get_scantron_config($env{'form.scantron_format'});
+ my $bubbles_per_row = &bubblesheet_bubbles_per_row(\%scantron_config);
+ return &mt('The sequence to be graded contains response types which are handgraded.').'
'.
+ &mt('If you have already graded these by bubbling sheets to indicate points awarded, [_1]what point value is assigned to a filled last bubble in each row?',' ').
+ ' '.&mt('or').' '.
+ '
';
+ }
+ return;
+}
sub scantron_process_students {
my ($r,$symb) = @_;
@@ -7932,6 +7977,9 @@ sub grade_student_bubbles {
if ($bubbles_per_row ne '') {
$form{'bubbles_per_row'} = $bubbles_per_row;
}
+ if ($env{'form.scantron_lastbubblepoints'} ne '') {
+ $form{'scantron_lastbubblepoints'} = $env{'form.scantron_lastbubblepoints'};
+ }
if (ref($parts) eq 'HASH') {
if (ref($parts->{$ressymb}) eq 'ARRAY') {
foreach my $part (@{$parts->{$ressymb}}) {