--- loncom/homework/grades.pm 2011/10/09 16:23:34 1.656 +++ loncom/homework/grades.pm 2013/12/03 14:54:29 1.708 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.656 2011/10/09 16:23:34 raeburn Exp $ +# $Id: grades.pm,v 1.708 2013/12/03 14:54:29 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; @@ -53,6 +54,7 @@ use POSIX qw(floor); my %perm=(); +my %old_essays=(); # These variables are used to recover from ssi errors @@ -201,6 +203,7 @@ sub get_display_part { sub reset_caches { &reset_analyze_cache(); &reset_perm(); + &reset_old_essays(); } { @@ -340,7 +343,7 @@ sub cleanRecord { return '
'. ''.&mt('Answer').''.$toprow.''. ''.$grayFont.&mt('Option ID').''. - $grayFont.$bottomrow.''.'
'. ''.&mt('Answer').''.$toprow.''. ''.$grayFont.&mt('Option ID').''. - $bottomrow.''.'
'. &keywords_highlight($oessay). '
' + .&mt('Unable to accept last correction, an error occurred: [_1]', + $errmsg) + .'
-'.&mt('Please double check the information below before clicking on \'[_1]\'',&mt($button_text)).' +'.&mt("Please double check the information below before clicking on '[_1]'",&mt($button_text)).'
'.&mt('If this information is correct, please click on \'[_1]\'.',&mt($button_text)).' +
'.&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.','','').'
".&mt('Some resources in the sequence currently are not set to exam mode. Grading these resources currently may not work correctly.')."
' + .&mt('Some resources in the sequence currently are not set to' + .' bubblesheet exam mode. Grading these resources currently may not' + .' work correctly.') + .'
".&mt("An error was detected ($error)". - " for PaperID [_1]", - $$scan_record{'scantron.PaperID'})."
".&mt("An error was detected ($error)". - " in scanline [_1]
[_2]
".&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]) for PaperID [_2]', + "$error", + ''.$$scan_record{'scantron.PaperID'}.'') + ."
' + .&mt('An error was detected ([_1]) in scanline [_2] [_3]', + "$error", $i, "
$line
' + .&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"). "
".&mt("The encoded ID has also been used by a previous paper [_1]",$arg)."
'.&mt("The encoded ID has also been used by a previous paper [_1]",$arg)."
".&mt("How should I handle this?")." \n"); @@ -6901,20 +7291,21 @@ sub scantron_get_correction { $r->print(&Apache::loncommon::selectstudent_link('scantronupload', 'scantron_username','scantron_domain')); $r->print(": "); - $r->print("\n@". + $r->print("\n:\n". &Apache::loncommon::select_dom_form($env{'request.role.domain'},'scantron_domain')); $r->print(''); } elsif ($error =~ /CODE$/) { if ($error eq 'incorrectCODE') { - $r->print("
".&mt("The encoded CODE is not in the list of possible CODEs.")."
'.&mt("The encoded CODE is not in the list of possible CODEs.")."
".&mt("The encoded CODE has also been used by a previous paper [_1], and CODEs are supposed to be unique.",join(', ',@{$arg}))."
'.&mt("The encoded CODE has also been used by a previous paper [_1], and CODEs are supposed to be unique.",join(', ',@{$arg}))."
".&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'}'") + ."
".&mt("How should I handle this?")." \n"); + $r->print("
".&mt("How should I handle this?")."
".&mt("There have been multiple bubbles scanned for some question(s)")."
'.&mt("There have been multiple bubbles scanned for some question(s)")."
".&mt("Please indicate which bubble should be used for grading")."
".&mt("There have been no bubbles scanned for some question(s)")."
'.&mt("There have been [_1]no[_2] bubbles scanned for some question(s)",'','')."
".&mt("Please indicate which bubble should be used for grading.")."
'. + &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('[quant,_1,point]',$bubbles_per_row).' '.&mt('or').' '. + '0 points
'); + $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". @@ -7837,12 +8448,12 @@ SCANTRONFORM '
'); 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". @@ -7837,12 +8448,12 @@ SCANTRONFORM '
- '.&mt('The requested file name was invalid.').' + '.&mt('The requested filename was invalid.').'
'.&mt('Exact matches for [quant,_1,student].',$passed).''.&mt('Discrepancies detected for [quant,_1,student].',$failed).'
' + .&mt('Exact matches for [_1][quant,_2,student][_3].','',$passed,'') + .'' + .&mt('Discrepancies detected for [_1][quant,_2,student][_3].','',$failed,'') + .'