--- loncom/homework/grades.pm 2011/10/10 18:27:34 1.596.2.5 +++ loncom/homework/grades.pm 2011/10/10 18:55:39 1.596.2.6 @@ -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.6 2011/10/10 18:55:39 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -4993,12 +4993,12 @@ sub updateGradeByPage { from the file that we are parsing that represents one entire sheet 'bubble line' refers to the data - representing the line of bubbles that are on the physical bubble sheet + representing the line of bubbles that are on the physical bubblesheet -The overall process is that a scanned in bubble sheet data is uploaded +The overall process is that a scanned in bubblesheet data is uploaded into a course. When a user wants to grade, they select a -sequence/folder of resources, a file of bubble sheet info, and pick +sequence/folder of resources, a file of bubblesheet info, and pick one of the predefined configurations for what each scanline looks like. @@ -5014,14 +5014,14 @@ username:domain. During the validation phase the instructor can choose to skip scanlines. -After the validation phase, there are now 3 bubble sheet files +After the validation phase, there are now 3 bubblesheet files scantron_original_filename (unmodified original file) scantron_corrected_filename (file where the corrected information has replaced the original information) scantron_skipped_filename (contains the exact text of scanlines that where skipped) Also there is a separate hash nohist_scantrondata that contains extra -correction information that isn't representable in the bubble sheet +correction information that isn't representable in the bubblesheet file (see &scantron_getfile() for more information) After all scanlines are either valid, marked as valid or skipped, then @@ -5318,7 +5318,7 @@ sub scantron_CODEunique { =item scantron_selectphase - Generates the initial screen to start the bubble sheet process. + Generates the initial screen to start the bubblesheet process. Allows for - starting a grading run. - downloading existing scan data (original, corrected or skipped info) @@ -6341,7 +6341,7 @@ sub remember_current_skipped { =item check_for_error Checks if there was an error when attempting to remove a specific - scantron_.. bubble sheet data file. Prints out an error if + scantron_.. bubblesheet data file. Prints out an error if something went wrong. =cut @@ -6477,7 +6477,7 @@ SCANTRONFORM =item scantron_validate_file - Dispatch routine for doing validation of a bubble sheet data file. + Dispatch routine for doing validation of a bubblesheet data file. Also processes any necessary information resets that need to occur before validation begins (ignore previous corrections, @@ -6588,7 +6588,7 @@ sub scantron_validate_file { =item scantron_remove_file - Removes the requested bubble sheet data file, makes sure that + Removes the requested bubblesheet data file, makes sure that scantron_original_ is never removed @@ -6613,7 +6613,7 @@ sub scantron_remove_file { =item scantron_remove_scan_data - Removes all scan_data correction for the requested bubble sheet + Removes all scan_data correction for the requested bubblesheet data file. (In the case that both the are doing skipped records we need to remember the old skipped lines for the time being so that element persists for a while.) @@ -6650,7 +6650,7 @@ sub scantron_remove_scan_data { =item scantron_getfile - Fetches the requested bubble sheet data file (all 3 versions), and + Fetches the requested bubblesheet data file (all 3 versions), and the scan_data hash Arguments: @@ -6750,7 +6750,7 @@ sub lonnet_putfile { =item scantron_putfile - Stores the current version of the bubble sheet data files, and the + Stores the current version of the bubblesheet data files, and the scan_data hash. (Does not modify the original version only the corrected and skipped versions. @@ -6844,7 +6844,7 @@ sub get_todo_count { =item scantron_put_line - Updates the 'corrected' or 'skipped' versions of the bubble sheet + Updates the 'corrected' or 'skipped' versions of the bubblesheet data file. Arguments: @@ -7033,19 +7033,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"); @@ -7055,10 +7064,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"); @@ -7074,14 +7083,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' @@ -7108,7 +7118,7 @@ sub scantron_get_correction { $r->print(" "); $r->print("\n
"); @@ -7148,7 +7158,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: @@ -7166,7 +7176,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 +7979,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 +7992,11 @@ SCANTRONFORM ''.&mt('Source').''.&mt('Bubbled responses').''. &Apache::loncommon::end_data_table_header_row()."\n". &Apache::loncommon::start_data_table_row(). - ''.&mt('Bubble Sheet').''. + ''.&mt('Bubblesheet').''. ''.$studentdata.''. &Apache::loncommon::end_data_table_row(). &Apache::loncommon::start_data_table_row(). - 'Stored submissions'. + ''.&mt('Stored submissions').''. ''.$studentrecord.''."\n". &Apache::loncommon::end_data_table_row(). &Apache::loncommon::end_data_table().'

'); @@ -9775,7 +9785,7 @@ ssi_with_retries() =item scantron_process_students() : - Routine that does the actual grading of the bubble sheet information. + Routine that does the actual grading of the bubblesheet information. The parsed scanline hash is added to %env @@ -9795,7 +9805,7 @@ ssi_with_retries() =item scantron_upload_scantron_data() : - Creates the screen for adding a new bubble sheet data file to a course. + Creates the screen for adding a new bubblesheet data file to a course. =item scantron_upload_scantron_data_save() : @@ -9809,7 +9819,7 @@ ssi_with_retries() =item scantron_download_scantron_data() : Shows a list of the three internal files (original, corrected, - skipped) for a specific bubble sheet data file that exists in the + skipped) for a specific bubblesheet data file that exists in the course. =item scantron_validate_ID() :