[LON-CAPA-cvs] cvs: loncom /homework grades.pm

albertel lon-capa-cvs-allow@mail.lon-capa.org
Fri, 16 Nov 2007 07:56:22 -0000


This is a MIME encoded message

--albertel1195199782
Content-Type: text/plain

albertel		Fri Nov 16 02:56:22 2007 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  - &mt() scantron
  
  
--albertel1195199782
Content-Type: text/plain
Content-Disposition: attachment; filename="albertel-20071116025622.txt"

Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.491 loncom/homework/grades.pm:1.492
--- loncom/homework/grades.pm:1.491	Fri Nov 16 02:55:01 2007
+++ loncom/homework/grades.pm	Fri Nov 16 02:56:15 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.491 2007/11/16 07:55:01 albertel Exp $
+# $Id: grades.pm,v 1.492 2007/11/16 07:56:15 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4909,35 +4909,35 @@
     '.&Apache::loncommon::start_data_table('LC_scantron_action').'
        '.&Apache::loncommon::start_data_table_header_row().'
             <th colspan="2">
-              &nbsp;Specify file and which Folder/Sequence to grade
+              &nbsp;'.&mt('Specify file and which Folder/Sequence to grade').'
             </th>
        '.&Apache::loncommon::end_data_table_header_row().'
        '.&Apache::loncommon::start_data_table_row().'
-            <td> Sequence to grade: </td><td> '.$sequence_selector.' </td>
+            <td> '.&mt('Sequence to grade:').' </td><td> '.$sequence_selector.' </td>
        '.&Apache::loncommon::end_data_table_row().'
        '.&Apache::loncommon::start_data_table_row().'
-            <td> Filename of scoring office file: </td><td> '.$file_selector.' </td>
+            <td> '.&mt('Filename of scoring office file:').' </td><td> '.$file_selector.' </td>
        '.&Apache::loncommon::end_data_table_row().'
        '.&Apache::loncommon::start_data_table_row().'
-            <td> Format of data file: </td><td> '.$format_selector.' </td>
+            <td> '.&mt('Format of data file:').' </td><td> '.$format_selector.' </td>
        '.&Apache::loncommon::end_data_table_row().'
        '.&Apache::loncommon::start_data_table_row().'
-            <td> Saved CODEs to validate against: </td><td> '.$CODE_selector.' </td>
+            <td> '.&mt('Saved CODEs to validate against:').' </td><td> '.$CODE_selector.' </td>
        '.&Apache::loncommon::end_data_table_row().'
        '.&Apache::loncommon::start_data_table_row().'
-            <td> Each CODE is only to be used once:</td><td> '.$CODE_unique.' </td>
+            <td> '.&mt('Each CODE is only to be used once:').'</td><td> '.$CODE_unique.' </td>
        '.&Apache::loncommon::end_data_table_row().'
        '.&Apache::loncommon::start_data_table_row().'
-	    <td> Options: </td>
+	    <td> '.&mt('Options:').' </td>
             <td>
-	       <label><input type="checkbox" name="scantron_options_redo" value="redo_skipped"/> Do only previously skipped records</label> <br />
-               <label><input type="checkbox" name="scantron_options_ignore" value="ignore_corrections"/> Remove all existing corrections</label> <br />
-               <label><input type="checkbox" name="scantron_options_hidden" value="ignore_hidden"/> Skip hidden resources when grading</label>
+	       <label><input type="checkbox" name="scantron_options_redo" value="redo_skipped"/> '.&mt('Do only previously skipped records').'</label> <br />
+               <label><input type="checkbox" name="scantron_options_ignore" value="ignore_corrections"/> '.&mt('Remove all existing corrections').'</label> <br />
+               <label><input type="checkbox" name="scantron_options_hidden" value="ignore_hidden"/> '.&mt('Skip hidden resources when grading').'</label>
 	    </td>
        '.&Apache::loncommon::end_data_table_row().'
        '.&Apache::loncommon::start_data_table_row().'
             <td colspan="2">
-              <input type="submit" value="Grading: Validate Scantron Records" />
+              <input type="submit" value="'.&mt('Grading: Validate Scantron Records').'" />
             </td>
        '.&Apache::loncommon::end_data_table_row().'
     '.&Apache::loncommon::end_data_table().'
@@ -4956,7 +4956,7 @@
     '.&Apache::loncommon::start_data_table('LC_scantron_action').'
        '.&Apache::loncommon::start_data_table_header_row().'
             <th>
-              &nbsp;Specify a Scantron data file to upload.
+              &nbsp;'.&mt('Specify a Scantron data file to upload.').'
             </th>
        '.&Apache::loncommon::end_data_table_header_row().'
        '.&Apache::loncommon::start_data_table_row().'
@@ -4965,27 +4965,27 @@
     my $default_form_data=&defaultFormData(&get_symb($r,1));
     my $cdom= $env{'course.'.$env{'request.course.id'}.'.domain'};
     my $cnum= $env{'course.'.$env{'request.course.id'}.'.num'};
-    $r->print(<<UPLOAD);
+    $r->print('
               <script type="text/javascript" language="javascript">
     function checkUpload(formname) {
 	if (formname.upfile.value == "") {
-	    alert("Please use the browse button to select a file from your local directory.");
+	    alert("'.&mt('Please use the browse button to select a file from your local directory.').'");
 	    return false;
 	}
 	formname.submit();
     }
               </script>
 
-              <form enctype='multipart/form-data' action='/adm/grades' name='rules' method='post'>
-                $default_form_data
-                <input name='courseid' type='hidden' value='$cnum' />
-                <input name='domainid' type='hidden' value='$cdom' />
-                <input name='command' value='scantronupload_save' type='hidden' />
-                File to upload:<input type="file" name="upfile" size="50" />
+              <form enctype="multipart/form-data" action="/adm/grades" name="rules" method="post">
+                '.$default_form_data.'
+                <input name="courseid" type="hidden" value="'.$cnum.'" />
+                <input name="domainid" type="hidden" value="'.$cdom.'" />
+                <input name="command" value="scantronupload_save" type="hidden" />
+                '.&mt('File to upload: [_1]','<input type="file" name="upfile" size="50" />').'
                 <br />
-                <input type="button" onClick="javascript:checkUpload(this.form);" value="Upload Scantron Data" />
+                <input type="button" onClick="javascript:checkUpload(this.form);" value="'.&mt('Upload Scantron Data').'" />
               </form>
-UPLOAD
+');
 
         $r->print('
             </td>
@@ -5005,13 +5005,13 @@
      '.&Apache::loncommon::start_data_table('LC_scantron_action').'
        '.&Apache::loncommon::start_data_table_header_row().'
               <th>
-                &nbsp;Download a scoring office file
+                &nbsp;'.&mt('Download a scoring office file').'
               </th>
        '.&Apache::loncommon::end_data_table_header_row().'
        '.&Apache::loncommon::start_data_table_row().'
-              <td> Filename of scoring office file: '.$file_selector.' 
+              <td> '.&mt('Filename of scoring office file: [_1]',$file_selector).' 
                 <br />
-                <input type="submit" value="Download: Show List of Associated Files" />
+                <input type="submit" value="'.&mt('Download: Show List of Associated Files').'" />
        '.&Apache::loncommon::end_data_table_row().'
      '.&Apache::loncommon::end_data_table().'
    </form>
@@ -5807,7 +5807,7 @@
 sub check_for_error {
     my ($r,$result)=@_;
     if ($result ne 'ok' && $result ne 'not_found' ) {
-	$r->print("An error occurred ($result) when trying to Remove the existing corrections.");
+	$r->print(&mt("An error occurred ([_1]) when trying to remove the existing corrections.",$result));
     }
 }
 
@@ -5831,25 +5831,25 @@
 	$CODElist=$env{'form.scantron_CODElist'};
 	if ($env{'form.scantron_CODElist'} eq '') { $CODElist='<span class="LC_warning">None</span>'; }
 	$CODElist=
-	    '<tr><td><b>List of CODES to validate against:</b></td><td><tt>'.
+	    '<tr><td><b>'.&mt('List of CODES to validate against:').'</b></td><td><tt>'.
 	    $env{'form.scantron_CODElist'}.'</tt></td></tr>';
     }
-    return (<<STUFF);
+    return ('
 <p>
-<span class="LC_warning">Please double check the information
-                 below before clicking on '$button_text'</span>
+<span class="LC_warning">
+'.&mt('Please double check the information below before clicking on \'[_1]\'',&mt($button_text)).'</span>
 </p>
 <table>
-<tr><td><b>Sequence to be Graded:</b></td><td>$title</td></tr>
-<tr><td><b>Data File that will be used:</b></td><td><tt>$env{'form.scantron_selectfile'}</tt></td></tr>
-$CODElist
+<tr><td><b>'.&mt('Sequence to be Graded:').'</b></td><td>'.$title.'</td></tr>
+<tr><td><b>'.&mt('Data File that will be used:').'</b></td><td><tt>'.$env{'form.scantron_selectfile'}.'</tt></td></tr>
+'.$CODElist.'
 </table>
 <br />
-<p> If this information is correct, please click on '$button_text'.</p>
-<p> If something is incorrect, please click the 'Grading Menu' button to start over.</p>
+<p> '.&mt('If this information is correct, please click on \'[_1]\'.',&mt($button_text)).'</p>
+<p> '.&mt('If something is incorrect, please click the \'Grading Menu\' button to start over.').'</p>
 
 <br />
-STUFF
+');
 }
 
 =pod
@@ -5870,23 +5870,23 @@
     if ( $env{'form.selectpage'} eq '' ||
 	 $env{'form.scantron_selectfile'} eq '' ||
 	 $env{'form.scantron_format'} eq '' ) {
-	$r->print("<p>You have forgetten to specify some information. Please go Back and try again.</p>");
+	$r->print("<p>".&mt('You have forgetten to specify some information. Please go Back and try again.')."</p>");
 	if ( $env{'form.selectpage'} eq '') {
-	    $r->print('<p><span class="LC_error">You have not selected a Sequence to grade</span></p>');
+	    $r->print('<p><span class="LC_error">'.&mt('You have not selected a Sequence to grade').'</span></p>');
 	} 
 	if ( $env{'form.scantron_selectfile'} eq '') {
-	    $r->print('<p><span class="LC_error">You have not selected a file that contains the student\'s response data.</span></p>');
+	    $r->print('<p><span class="LC_error">'.&mt('You have not selected a file that contains the student\'s response data.').'</span></p>');
 	} 
 	if ( $env{'form.scantron_format'} eq '') {
-	    $r->print('<p><span class="LC_error">You have not selected a the format of the student\'s response data.</span></p>');
+	    $r->print('<p><span class="LC_error">'.&mt('You have not selected a the format of the student\'s response data.').'</span></p>');
 	} 
     } else {
 	my $warning=&scantron_warning_screen('Grading: Validate Records');
-	$r->print(<<STUFF);
-$warning
-<input type="submit" name="submit" value="Grading: Validate Records" />
+	$r->print('
+'.$warning.'
+<input type="submit" name="submit" value="'.&mt('Grading: Validate Records').'" />
 <input type="hidden" name="command" value="scantron_validate" />
-STUFF
+');
     }
     $r->print("</form><br />".&show_grading_menu_form($symb));
     return '';
@@ -5965,7 +5965,7 @@
     if ($env{'form.scantron_corrections'}) {
 	&scantron_process_corrections($r);
     }
-    $r->print("<p>Gathering necessary info.</p>");$r->rflush();
+    $r->print('<p>'.&mt('Gathering necessary info.').'</p>');$r->rflush();
     #get the student pick code ready
     $r->print(&Apache::loncommon::studentbrowser_javascript());
     my $max_bubble=&scantron_get_maxbubble();
@@ -5985,7 +5985,7 @@
 
     my $stop=0;
     while (!$stop && $currentphase < scalar(@validate_phases)) {
-	$r->print("<p> Validating ".$validate_phases[$currentphase]."</p>");
+	$r->print('<p> '.&mt('Validating '.$validate_phases[$currentphase]).'</p>');
 	$r->rflush();
 	my $which="scantron_validate_".$validate_phases[$currentphase];
 	{
@@ -5995,12 +5995,12 @@
     }
     if (!$stop) {
 	my $warning=&scantron_warning_screen('Start Grading');
-	$r->print(<<STUFF);
-Validation process complete.<br />
-$warning
-<input type="submit" name="submit" value="Start Grading" />
+	$r->print('
+'.&mt('Validation process complete.').'<br />
+'.$warning.'
+<input type="submit" name="submit" value="'.&mt('Start Grading').'" />
 <input type="hidden" name="command" value="scantron_process" />
-STUFF
+');
 
     } else {
 	$r->print('<input type="hidden" name="command" value="scantron_validate" />');
@@ -6008,15 +6008,15 @@
     }
     if ($stop) {
 	if ($validate_phases[$currentphase] eq 'sequence') {
-	    $r->print('<input type="submit" name="submit" value="Ignore -> " />');
-	    $r->print(' this error <br />');
+	    $r->print('<input type="submit" name="submit" value="'.&mt('Ignore -&gt;').' " />');
+	    $r->print(' '.&mt('this error').' <br />');
 
-	    $r->print(" <p>Or click the 'Grading Menu' button to start over.</p>");
+	    $r->print(" <p>".&mt("Or click the 'Grading Menu' button to start over.")."</p>");
 	} else {
-	    $r->print('<input type="submit" name="submit" value="Continue ->" />');
-	    $r->print(' using corrected info <br />');
-	    $r->print("<input type='submit' value='Skip' name='scantron_skip_record' />");
-	    $r->print(" this scanline saving it for later.");
+	    $r->print('<input type="submit" name="submit" value="'.&mt('Continue -&gt;').'" />');
+	    $r->print(' '.&mt('using corrected info').' <br />');
+	    $r->print("<input type='submit' value='".&mt("Skip")."' name='scantron_skip_record' />");
+	    $r->print(" ".&mt("this scanline saving it for later."));
 	}
     }
     $r->print(" </form><br />".&show_grading_menu_form($symb));
@@ -6500,30 +6500,32 @@
 #to show both the current line and the previous one and allow skipping
 #the previous one or the current one
 
-    $r->print("<p><b>An error was detected ($error)</b>");
     if ( $$scan_record{'scantron.PaperID'} =~ /\S/) {
-	$r->print(" for PaperID <tt>".
-		  $$scan_record{'scantron.PaperID'}."</tt> \n");
+	$r->print("<p>".&mt("<b>An error was detected ($error)</b>".
+			    " for PaperID <tt>[_1]</tt>",
+			    $$scan_record{'scantron.PaperID'})."</p> \n");
     } else {
-	$r->print(" in scanline $i <pre>".
-		  $line."</pre> \n");
-    }
-    my $message="<p>The ID on the form is  <tt>".
-	$$scan_record{'scantron.ID'}."</tt><br />\n".
-	"The name on the paper is ".
-	$$scan_record{'scantron.LastName'}.",".
-	$$scan_record{'scantron.FirstName'}."</p>";
+	$r->print("<p>".&mt("<b>An error was detected ($error)</b>".
+			    " in scanline [_1] <pre>[_2]</pre>",
+			    $i,$line)."</p> \n");
+    }
+    my $message="<p>".&mt("The ID on the form is  <tt>[_1]</tt><br />".
+			  "The name on the paper is [_2],[_3]",
+			  $$scan_record{'scantron.ID'},
+			  $$scan_record{'scantron.LastName'},
+			  $$scan_record{'scantron.FirstName'})."</p>";
 
     $r->print('<input type="hidden" name="scantron_corrections" value="'.$error.'" />'."\n");
     $r->print('<input type="hidden" name="scantron_line" value="'.$i.'" />'."\n");
     if ($error =~ /ID$/) {
 	if ($error eq 'incorrectID') {
-	    $r->print("The encoded ID is not in the classlist</p>\n");
+	    $r->print("<p>".&mt("The encoded ID is not in the classlist").
+		      "</p>\n");
 	} elsif ($error eq 'duplicateID') {
-	    $r->print("The encoded ID has also been used by a previous paper $arg</p>\n");
+	    $r->print("<p>".&mt("The encoded ID has also been used by a previous paper [_1]",$arg)."</p>\n");
 	}
 	$r->print($message);
-	$r->print("<p>How should I handle this? <br /> \n");
+	$r->print("<p>".&mt("How should I handle this?")." <br /> \n");
 	$r->print("\n<ul><li> ");
 	#FIXME it would be nice if this sent back the user ID and
 	#could do partial userID matches
@@ -6536,14 +6538,14 @@
 	$r->print('</li>');
     } elsif ($error =~ /CODE$/) {
 	if ($error eq 'incorrectCODE') {
-	    $r->print("</p><p>The encoded CODE is not in the list of possible CODEs</p>\n");
+	    $r->print("<p>".&mt("The encoded CODE is not in the list of possible CODEs.")."</p>\n");
 	} elsif ($error eq 'duplicateCODE') {
-	    $r->print("</p><p>The encoded CODE has also been used by a previous paper ".join(', ',@{$arg}).", and CODEs are supposed to be unique</p>\n");
+	    $r->print("<p>".&mt("The encoded CODE has also been used by a previous paper [_1], and CODEs are supposed to be unique.",join(', ',@{$arg}))."</p>\n");
 	}
-	$r->print("<p>The CODE on the form is  <tt>'".
-		  $$scan_record{'scantron.CODE'}."'</tt><br />\n");
+	$r->print("<p>".&mt("The CODE on the form is  <tt>'[_1]'</tt>",
+			    $$scan_record{'scantron.CODE'})."<br />\n");
 	$r->print($message);
-	$r->print("<p>How should I handle this? <br /> \n");
+	$r->print("<p>".&mt("How should I handle this?")." <br /> \n");
 	$r->print("\n<br /> ");
 	my $i=0;
 	if ($error eq 'incorrectCODE' 
@@ -6553,7 +6555,13 @@
 		foreach my $testcode (@{$closest}) {
 		    my $checked='';
 		    if (!$i) { $checked=' checked="checked" '; }
-		    $r->print("<label><input type='radio' name='scantron_CODE_resolution' value='use_closest_$i' $checked /> Use the similar CODE <b><tt>".$testcode."</tt></b> instead.</label><input type='hidden' name='scantron_CODE_closest_$i' value='$testcode' />");
+		    $r->print("
+   <label>
+       <input type='radio' name='scantron_CODE_resolution' value='use_closest_$i' $checked />
+       ".&mt("Use the similar CODE [_1] instead.",
+	    "<b><tt>".$testcode."</tt></b>")."
+    </label>
+    <input type='hidden' name='scantron_CODE_closest_$i' value='$testcode' />");
 		    $r->print("\n<br />");
 		    $i++;
 		}
@@ -6561,7 +6569,12 @@
 	}
 	if ($$scan_record{'scantron.CODE'}=~/\S/ ) {
 	    my $checked; if (!$i) { $checked=' checked="checked" '; }
-	    $r->print("<label><input type='radio' name='scantron_CODE_resolution' value='use_unfound' $checked /> Use the CODE <b><tt>".$$scan_record{'scantron.CODE'}."</tt></b> that is was on the paper, ignoring the error.</label>");
+	    $r->print("
+    <label>
+        <input type='radio' name='scantron_CODE_resolution' value='use_unfound' $checked />
+       ".&mt("Use the CODE [_1] that is was on the paper, ignoring the error.",
+	     "<b><tt>".$$scan_record{'scantron.CODE'}."</tt></b>")."
+    </label>");
 	    $r->print("\n<br />");
 	}
 
@@ -6583,17 +6596,27 @@
 	   "&curCODE=".&escape($$scan_record{'scantron.CODE'}).
 	   "&scantron_selectfile=".&escape($env{'form.scantron_selectfile'});
 	if ($env{'form.scantron_CODElist'} =~ /\S/) { 
-	    $r->print("<label><input type='radio' name='scantron_CODE_resolution' value='use_found' /> <a target='_blank' href='$href'>Select</a> a CODE from the list of all CODEs and use it.</label> Selected CODE is <input readonly='true' type='text' size='8' name='scantron_CODE_selectedvalue' onfocus=\"javascript:change_radio('use_found')\" onchange=\"javascript:change_radio('use_found')\" />");
+	    $r->print("
+    <label>
+       <input type='radio' name='scantron_CODE_resolution' value='use_found' />
+       ".&mt("[_1]Select[_2] a CODE from the list of all CODEs and use it.",
+	     "<a target='_blank' href='$href'>","</a>")."
+    </label> 
+    ".&mt("Selected CODE is [_1]","<input readonly='true' type='text' size='8' name='scantron_CODE_selectedvalue' onfocus=\"javascript:change_radio('use_found')\" onchange=\"javascript:change_radio('use_found')\" />"));
 	    $r->print("\n<br />");
 	}
-	$r->print("<label><input type='radio' name='scantron_CODE_resolution' value='use_typed' /> Use </label><input type='text' size='8' name='scantron_CODE_newvalue' onfocus=\"javascript:change_radio('use_typed')\" onkeypress=\"javascript:change_radio('use_typed')\" /> as the CODE.");
+	$r->print("
+    <label>
+       <input type='radio' name='scantron_CODE_resolution' value='use_typed' />
+       ".&mt("Use [_1] as the CODE.",
+	     "</label><input type='text' size='8' name='scantron_CODE_newvalue' onfocus=\"javascript:change_radio('use_typed')\" onkeypress=\"javascript:change_radio('use_typed')\" />"));
 	$r->print("\n<br /><br />");
     } elsif ($error eq 'doublebubble') {
-	$r->print("<p>There have been multiple bubbles scanned for a some question(s)</p>\n");
+	$r->print("<p>".&mt("There have been multiple bubbles scanned for a some question(s)")."</p>\n");
 	$r->print('<input type="hidden" name="scantron_questions" value="'.
 		  join(',',@{$arg}).'" />');
 	$r->print($message);
-	$r->print("<p>Please indicate which bubble should be used for grading</p>");
+	$r->print("<p>".&mt("Please indicate which bubble should be used for grading")."</p>");
 	foreach my $question (@{$arg}) {
 	    my $selected  = &get_response_bubbles($scan_record, $question);
 	    my @select_array = split(/:/,$selected);
@@ -6601,10 +6624,10 @@
 				      @select_array);
 	}
     } elsif ($error eq 'missingbubble') {
-	$r->print("<p>There have been <b>no</b> bubbles scanned for some question(s)</p>\n");
+	$r->print("<p>".&mt("There have been <b>no</b> bubbles scanned for some question(s)")."</p>\n");
 	$r->print($message);
-	$r->print("<p>Please indicate which bubble should be used for grading</p>");
-	$r->print("Some questions have no scanned bubbles\n");
+	$r->print("<p>".&mt("Please indicate which bubble should be used for grading.")."</p>");
+	$r->print(&mt("Some questions have no scanned bubbles")."\n");
 	$r->print('<input type="hidden" name="scantron_questions" value="'.
 		  join(',',@{$arg}).'" />');
 	foreach my $question (@{$arg}) {
@@ -6675,7 +6698,7 @@
 	    my $lspan = $total_lines * 2;   #  2 table rows per bubble line.
 
 	    $r->print('<td rowspan='.$lspan.'><label><input type="radio" name="scantron_correct_Q_'.
-	      $quest.'" value="none" /> No bubble </label></td>');
+	      $quest.'" value="none" /> '.&mt('No bubble').' </label></td>');
 	
 	}
 
@@ -7167,7 +7190,7 @@
     my $domsel=&Apache::loncommon::select_dom_form($env{'request.role.domain'},
 						   'domainid');
     my $default_form_data=&defaultFormData(&get_symb($r,1));
-    $r->print(<<UPLOAD);
+    $r->print('
 <script type="text/javascript" language="javascript">
     function checkUpload(formname) {
 	if (formname.upfile.value == "") {
@@ -7178,19 +7201,23 @@
     }
 </script>
 
-<form enctype='multipart/form-data' action='/adm/grades' name='rules' method='post'>
-$default_form_data
+<form enctype="multipart/form-data" action="/adm/grades" name="rules" method="post">
+'.$default_form_data.'
 <table>
-<tr><td>$select_link </td></tr>
-<tr><td>Course ID:   </td><td><input name='courseid' type='text' />  </td></tr>
-<tr><td>Course Name: </td><td><input name='coursename' type='text' /></td></tr>
-<tr><td>Domain:      </td><td>$domsel                                </td></tr>
-<tr><td>File to upload:</td><td><input type="file" name="upfile" size="50" /></td></tr>
+<tr><td>'.$select_link.'                             </td></tr>
+<tr><td>'.&mt('Course ID:').'     </td>
+    <td><input name="courseid"   type="text" />      </td></tr>
+<tr><td>'.&mt('Course Name:').'   </td>
+    <td><input name="coursename" type="text" />      </td></tr>
+<tr><td>'.&mt('Domain:').'        </td>
+    <td>'.$domsel.'                                  </td></tr>
+<tr><td>'.&mt('File to upload:').'</td>
+    <td><input type="file" name="upfile" size="50" /></td></tr>
 </table>
-<input name='command' value='scantronupload_save' type='hidden' />
-<input type="button" onClick="javascript:checkUpload(this.form);" value="Upload Scantron Data" />
+<input name="command" value="scantronupload_save" type="hidden" />
+<input type="button" onClick="javascript:checkUpload(this.form);" value="'.&mt('Upload Scantron Data').'" />
 </form>
-UPLOAD
+');
     return '';
 }
 
@@ -7209,12 +7236,12 @@
     my $doanotherupload=
 	'<br /><form action="/adm/grades" method="post">'."\n".
 	'<input type="hidden" name="command" value="scantronupload" />'."\n".
-	'<input type="submit" name="submit" value="Do Another Upload" />'."\n".
+	'<input type="submit" name="submit" value="'.&mt('Do Another Upload').'" />'."\n".
 	'</form>'."\n";
     if (!&Apache::lonnet::allowed('usc',$env{'form.domainid'}) &&
 	!&Apache::lonnet::allowed('usc',
 			    $env{'form.domainid'}.'_'.$env{'form.courseid'})) {
-	$r->print("You are not allowed to upload Scantron data to the requested course.<br />");
+	$r->print(&mt("You are not allowed to upload Scantron data to the requested course.")."<br />");
 	if ($symb) {
 	    $r->print(&show_grading_menu_form($symb));
 	} else {
@@ -7223,7 +7250,7 @@
 	return '';
     }
     my %coursedata=&Apache::lonnet::coursedescription($env{'form.domainid'}.'_'.$env{'form.courseid'});
-    $r->print("Doing upload to ".$coursedata{'description'}." <br />");
+    $r->print(&mt("Doing upload to [_1]",$coursedata{'description'})." <br />");
     my $fname=$env{'form.upfile.filename'};
     #FIXME
     #copied from lonnet::userfileupload()
@@ -7241,13 +7268,18 @@
     my $uploadedfile=$fname;
     $fname='scantron_orig_'.$fname;
     if (length($env{'form.upfile'}) < 2) {
-	$r->print("<span class=\"LC_error\">Error:</span> The file you attempted to upload, <tt>".&HTML::Entities::encode($env{'form.upfile.filename'},'<>&"')."</tt>, contained no information. Please check that you entered the correct filename.");
+	$r->print(&mt("<span class=\"LC_error\">Error:</span> The file you attempted to upload, [_1]  contained no information. Please check that you entered the correct filename.",'<span class="LC_filename">'.&HTML::Entities::encode($env{'form.upfile.filename'},'<>&"')."</span>"));
     } else {
 	my $result=&Apache::lonnet::finishuserfileupload($env{'form.courseid'},$env{'form.domainid'},'upfile',$fname);
 	if ($result =~ m|^/uploaded/|) {
-	    $r->print("<span class=\"LC_success\">Success:</span> Successfully uploaded ".(length($env{'form.upfile'})-1)." bytes of data into location <tt>".$result."</tt>");
+	    $r->print(&mt("<span class=\"LC_success\">Success:</span> Successfully uploaded [_1] bytes of data into location [_2]",
+			  (length($env{'form.upfile'})-1),
+			  '<span class="LC_filename">'.$result."</span>"));
 	} else {
-	    $r->print("<span class=\"LC_error\">Error:</span> An error (".$result.") occurred when attempting to upload the file, <tt>".&HTML::Entities::encode($env{'form.upfile.filename'},'<>&"')."</tt>");
+	    $r->print(&mt("<span class=\"LC_error\">Error:</span> An error ([_1]) occurred when attempting to upload the file, [_2]",
+			  $result,
+			  '<span class="LC_filename">'.&HTML::Entities::encode($env{'form.upfile.filename'},'<>&"')."</span>"));
+
 	}
     }
     if ($symb) {
@@ -7291,11 +7323,11 @@
     my $cdom=$env{'course.'.$env{'request.course.id'}.'.domain'};
     my $file=$env{'form.scantron_selectfile'};
     if (! &valid_file($file)) {
-	$r->print(<<ERROR);
+	$r->print('
 	<p>
-	    The requested file name was invalid.
+	    '.&mt('The requested file name was invalid.').'
         </p>
-ERROR
+');
 	$r->print(&show_grading_menu_form(&get_symb($r,1)));
 	return;
     }
@@ -7305,17 +7337,20 @@
     &Apache::lonnet::allowuploaded('/adm/grades',$orig);
     &Apache::lonnet::allowuploaded('/adm/grades',$corrected);
     &Apache::lonnet::allowuploaded('/adm/grades',$skipped);
-    $r->print(<<DOWNLOAD);
+    $r->print('
     <p>
-	<a href="$orig">Original</a> file as uploaded by the scantron office.
+	'.&mt('[_1]Original[_2] file as uploaded by the scantron office.',
+	      '<a href="'.$orig.'">','</a>').'
     </p>
     <p>
-	<a href="$corrected">Corrections</a>, a file of corrected records that were used in grading.
+	'.&mt('[_1]Corrections[_2], a file of corrected records that were used in grading.',
+	      '<a href="'.$corrected.'">','</a>').'
     </p>
     <p>
-	<a href="$skipped">Skipped</a>, a file of records that were skipped.
+	'.&mt('[_1]Skipped[_2], a file of records that were skipped.',
+	      '<a href="'.$skipped.'">','</a>').'
     </p>
-DOWNLOAD
+');
     $r->print(&show_grading_menu_form(&get_symb($r,1)));
     return '';
 }

--albertel1195199782--