--- loncom/homework/grades.pm 2011/10/09 15:31:12 1.655 +++ loncom/homework/grades.pm 2011/10/10 10:13:17 1.658 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.655 2011/10/09 15:31:12 raeburn Exp $ +# $Id: grades.pm,v 1.658 2011/10/10 10:13:17 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -45,6 +45,7 @@ use Apache::lonlocal; use Apache::lonenc; use Apache::lonstathelpers; use Apache::lonquickgrades; +use Apache::bridgetask(); use String::Similarity; use LONCAPA; @@ -1414,6 +1415,7 @@ INNERJS adds => 'Add selection to keyword list? Edit if desired.', comp => 'Compose Message for: ', incl => 'Include', + type => 'Type', subj => 'Subject', mesa => 'Message', new => 'New', @@ -1422,6 +1424,7 @@ INNERJS kehi => 'Keyword Highlight Options', txtc => 'Text Color', font => 'Font Size', + fnst => 'Font Style', ); $request->print(&Apache::lonhtmlcommon::scripttag(<'); pDoc.write(''); - pDoc.write("
Type<\\/b><\\/td>$lt{'incl'}<\\/b><\\/td>$lt{'mesa'}<\\/td><\\/tr>"); + pDoc.write("$lt{'type'}<\\/b><\\/td>$lt{'incl'}<\\/b><\\/td>$lt{'mesa'}<\\/td><\\/tr>"); } function displaySubject(msg,shwsel) { pDoc = pWin.document; @@ -1628,7 +1631,7 @@ INNERJS hDoc.write('
'); hDoc.write(''); - hDoc.write("'. &Apache::loncommon::end_data_table_header_row()."\n". &Apache::loncommon::start_data_table_row(). - ''. - ''. + ''. + ''. &Apache::loncommon::end_data_table_row(). &Apache::loncommon::start_data_table_row(). - ''. - ''."\n". + ''. + ''."\n". &Apache::loncommon::end_data_table_row(). &Apache::loncommon::end_data_table().'

'); } else {
$lt{'txtc'}<\\/b><\\/td>$lt{'font'}<\\/b><\\/td>Font Style<\\/td><\\/tr>"); + hDoc.write("$lt{'txtc'}<\\/b><\\/td>$lt{'font'}<\\/b><\\/td>$lt{'fnst'}<\\/td><\\/tr>"); } function highlightbody(clrval,clrtxt,clrsel,szval,sztxt,szsel,syval,sytxt,sysel) { @@ -4087,6 +4090,7 @@ sub csvuploadassign { my ($classlist) = &getclasslist('all',0); my @notallowed; my @skipped; + my @warnings; my $countdone=0; foreach my $grade (@gradedata) { my %entries=&Apache::loncommon::record_sep($grade); @@ -4136,7 +4140,7 @@ sub csvuploadassign { my $award=($pcr == 0) ? 'incorrect_by_override' : 'correct_by_override'; if ($pcr>1) { - push(@skipped,&mt("[_1]: point value larger than weight","$username:$domain")); + push(@warnings,&mt("[_1]: point value larger than weight","$username:$domain")); } $grades{"resource.$part.awarded"}=$pcr; $grades{"resource.$part.solved"}=$award; @@ -4182,6 +4186,10 @@ sub csvuploadassign { } } $request->print('
'.&Apache::lonhtmlcommon::confirm_success(&mt("Saved scores for [quant,_1,student]",$countdone),$countdone==0)); + if (@warnings) { + $request->print('
'.&Apache::lonhtmlcommon::confirm_success(&mt('Warnings generated for the following saved scores:'),1).'
'); + $request->print(join(', ',@warnings)); + } if (@skipped) { $request->print('
'.&Apache::lonhtmlcommon::confirm_success(&mt('No scores stored for the following username(s):'),1).'
'); $request->print(join(', ',@skipped)); @@ -6864,19 +6872,28 @@ sub scantron_get_correction { #the previous one or the current one if ( $$scan_record{'scantron.PaperID'} =~ /\S/) { - $r->print("

".&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'})."

"; + $r->print( + '

' + .&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 [_2], [_3]', + $$scan_record{'scantron.LastName'}, + $$scan_record{'scantron.FirstName'}) + .'

'; $r->print(''."\n"); $r->print(''."\n"); @@ -6886,10 +6903,10 @@ sub scantron_get_correction { if ($error =~ /ID$/) { if ($error eq 'incorrectID') { - $r->print("

".&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"); @@ -6905,14 +6922,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
"); my $i=0; if ($error eq 'incorrectCODE' @@ -6977,7 +6995,7 @@ ENDSCRIPT "")); $r->print("\n

"); } elsif ($error eq 'doublebubble') { - $r->print("

".&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: @@ -6995,7 +7013,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"); @@ -7822,12 +7840,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". @@ -7835,12 +7853,12 @@ SCANTRONFORM '

'.&mt('Source').''.&mt('Bubbled responses').''.&mt('Bubble Sheet').''.$studentdata.''.&mt('Bubblesheet').''.$studentdata.'Stored submissions'.$studentrecord.''.&mt('Stored submissions').''.$studentrecord.'