--- loncom/homework/grades.pm 2011/10/10 18:27:34 1.596.2.5 +++ loncom/homework/grades.pm 2012/08/09 23:25:48 1.596.2.13 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.596.2.5 2011/10/10 18:27:34 raeburn Exp $ +# $Id: grades.pm,v 1.596.2.13 2012/08/09 23:25:48 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -52,6 +52,7 @@ use POSIX qw(floor); my %perm=(); +my %old_essays=(); # These variables are used to recover from ssi errors @@ -260,6 +261,7 @@ sub showResourceInfo { sub reset_caches { &reset_analyze_cache(); &reset_perm(); + &reset_old_essays(); } { @@ -416,7 +418,7 @@ sub cleanRecord { '
".&mt("An error was detected ($error)". - " for PaperID [_1]", - $$scan_record{'scantron.PaperID'})."
\n"); + $r->print( + '' + .&mt('An error was detected ([_1]) for PaperID [_2]', + "$error", + ''.$$scan_record{'scantron.PaperID'}.'') + ."
\n"); } else { - $r->print("".&mt("An error was detected ($error)". - " in scanline [_1]
[_2]", - $i,$line)." \n"); - } - my $message="
".&mt("The ID on the form is [_1]
".
- "The name on the paper is [_2],[_3]",
- $$scan_record{'scantron.ID'},
- $$scan_record{'scantron.LastName'},
- $$scan_record{'scantron.FirstName'})."
' + .&mt('An error was detected ([_1]) in scanline [_2] [_3]', + "$error", $i, "
$line") + ." \n"); + } + my $message = + '
'
+ .&mt('The ID on the form is [_1]',
+ "$$scan_record{'scantron.ID'}")
+ .'
'
+ .&mt('The name on the paper is [_1], [_2]',
+ $$scan_record{'scantron.LastName'},
+ $$scan_record{'scantron.FirstName'})
+ .'
".&mt("The encoded ID is not in the classlist"). + $r->print('
'.&mt("The encoded ID is not in the classlist"). "
\n"); } elsif ($error eq 'duplicateID') { - $r->print("".&mt("The encoded ID has also been used by a previous paper [_1]",$arg)."
\n"); + $r->print(''.&mt("The encoded ID has also been used by a previous paper [_1]",$arg)."
\n"); } $r->print($message); $r->print("".&mt("How should I handle this?")."
\n");
@@ -7074,14 +7088,15 @@ sub scantron_get_correction {
$r->print('');
} elsif ($error =~ /CODE$/) {
if ($error eq 'incorrectCODE') {
- $r->print("
".&mt("The encoded CODE is not in the list of possible CODEs.")."
\n"); + $r->print(''.&mt("The encoded CODE is not in the list of possible CODEs.")."
\n"); } elsif ($error eq 'duplicateCODE') { - $r->print("".&mt("The encoded CODE has also been used by a previous paper [_1], and CODEs are supposed to be unique.",join(', ',@{$arg}))."
\n"); + $r->print(''.&mt("The encoded CODE has also been used by a previous paper [_1], and CODEs are supposed to be unique.",join(', ',@{$arg}))."
\n"); } - $r->print("".&mt("The CODE on the form is '[_1]'",
- $$scan_record{'scantron.CODE'})."
\n");
+ $r->print("
".&mt('The CODE on the form is [_1]', + "'$$scan_record{'scantron.CODE'}'") + ."
\n"); $r->print($message); - $r->print("".&mt("How should I handle this?")."
\n");
+ $r->print("
".&mt("How should I handle this?")."
\n"); $r->print("\n".&mt("There have been multiple bubbles scanned for some question(s)")."
\n"); + $r->print(''.&mt("There have been multiple bubbles scanned for some question(s)")."
\n"); # The form field scantron_questions is acutally a list of line numbers. # represented by this form so: @@ -7166,7 +7181,7 @@ ENDSCRIPT } $r->print(&verify_bubbles_checked(@lines_to_correct)); } elsif ($error eq 'missingbubble') { - $r->print("".&mt("There have been no bubbles scanned for some question(s)")."
\n"); + $r->print(''.&mt("There have been [_1]no[_2] bubbles scanned for some question(s)",'','')."
\n"); $r->print($message); $r->print("".&mt("Please indicate which bubble should be used for grading.")."
"); $r->print(&mt("Some questions have no scanned bubbles.")."\n"); @@ -7969,12 +7984,12 @@ SCANTRONFORM $studentrecord .= $recording; } if ($studentrecord ne $studentdata) { - $r->print('');
+ $r->print(' ');
if ($scancode eq '') {
- $r->print(&mt('Mismatch grading bubble sheet for user: [_1] with ID: [_2].',
+ $r->print(&mt('Mismatch grading bubblesheet for user: [_1] with ID: [_2].',
$uname.':'.$udom,$scan_record->{'scantron.ID'}));
} else {
- $r->print(&mt('Mismatch grading bubble sheet for user: [_1] with ID: [_2] and CODE: [_3].',
+ $r->print(&mt('Mismatch grading bubblesheet for user: [_1] with ID: [_2] and CODE: [_3].',
$uname.':'.$udom,$scan_record->{'scantron.ID'},$scancode));
}
$r->print('
'.&Apache::loncommon::start_data_table()."\n".
@@ -7982,11 +7997,11 @@ SCANTRONFORM
'
'.
- &mt('Comparison of bubblesheet data (including corrections) with corresponding submission records (most recent submission) for [_1][quant,_2,student][_3] ([_4] bubblesheet lines/student).',
+ &mt('Comparison of bubblesheet data (including corrections) with corresponding submission records (most recent submission) for [_1][quant,_2,student][_3] ([quant,_4,bubblesheet line] per student).',
'',
$numstudents,
'',
@@ -8954,6 +8969,21 @@ sub init_perm {
}
}
+sub init_old_essays {
+ my ($symb,$apath,$adom,$aname) = @_;
+ if ($symb ne '') {
+ my %essays = &Apache::lonnet::dump('nohist_essay_'.$apath,$adom,$aname);
+ if (keys(%essays) > 0) {
+ $old_essays{$symb} = \%essays;
+ }
+ }
+ return;
+}
+
+sub reset_old_essays {
+ undef(%old_essays);
+}
+
sub gather_clicker_ids {
my %clicker_ids;
@@ -9372,9 +9402,10 @@ sub assign_clicker_grades {
# FIXME: This should probably look for the first handgradeable part
my $part=$$partlist[0];
# Start screen output
- my ($result) = &showResourceInfo($symb,$env{'form.probTitle'}).'
';
+ my ($result) = &showResourceInfo($symb,$env{'form.probTitle'});
- $result .= &Apache::loncommon::start_data_table().
+ $result .= '
'.
+ &Apache::loncommon::start_data_table().
&Apache::loncommon::start_data_table_header_row().
'