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

albertel lon-capa-cvs@mail.lon-capa.org
Sat, 12 Feb 2005 03:43:06 -0000


albertel		Fri Feb 11 22:43:06 2005 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  - BG#3935 ignore first line option
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.244 loncom/homework/grades.pm:1.245
--- loncom/homework/grades.pm:1.244	Fri Feb 11 22:14:44 2005
+++ loncom/homework/grades.pm	Fri Feb 11 22:43:06 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.244 2005/02/12 03:14:44 albertel Exp $
+# $Id: grades.pm,v 1.245 2005/02/12 03:43:06 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2737,7 +2737,8 @@
     }
 
     my ($result) = &showResourceInfo($url,$ENV{'form.probTitle'});
-
+    my $checked=(($ENV{'form.noFirstLine'})?' checked="checked"':'');
+    my $ignore=&mt('Ignore First Line');
     $request->print(<<ENDPICK);
 <form method="post" enctype="multipart/form-data" action="/adm/grades" name="gradesupload">
 <h3><font color="#339933">Uploading Class Grades</font></h3>
@@ -2748,6 +2749,7 @@
 Enter as many fields as you can. The system will inform you and bring you back
 to this page if the data selected is insufficient to run your class.<hr />
 <input type="button" value="Reverse Association" onClick="javascript:this.form.associate.value='Reverse Association';submit(this.form);" />
+<label><input type="checkbox" name="noFirstLine" $checked />$ignore</label>
 <input type="hidden" name="associate"  value="" />
 <input type="hidden" name="phase"      value="three" />
 <input type="hidden" name="datatoken"  value="$datatoken" />
@@ -2824,6 +2826,7 @@
 	'.</b></td></tr>'."\n";
     $result.='<tr bgcolor=#ffffe6><td>'."\n";
     my $upfile_select=&Apache::loncommon::upfile_select_html();
+    my $ignore=&mt('Ignore First Line');
     $result.=<<ENDUPFORM;
 <form method="post" enctype="multipart/form-data" action="/adm/grades" name="gradesupload">
 <input type="hidden" name="symb" value="$symb" />
@@ -2833,7 +2836,7 @@
 <input type="hidden" name="saveState"  value="$ENV{'form.saveState'}" />
 $upfile_select
 <br /><input type="button" onClick="javascript:checkUpload(this.form);" value="Upload Scores" />
-
+<label><input type="checkbox" name="noFirstLine" />$ignore</lable>
 </form>
 ENDUPFORM
     $result.='</td></tr></table>'."\n";
@@ -2856,6 +2859,7 @@
 	&Apache::loncommon::load_tmp_file($request);
     }
     my @records=&Apache::loncommon::upfile_record_sep();
+    if ($ENV{'form.noFirstLine'}) { shift(@records); }
     &csvuploadmap_header($request,$symb,$url,$datatoken,$#records+1);
     my ($i,$keyfields);
     if (@records) {
@@ -2887,6 +2891,7 @@
     if (!$symb) {return '';}
     &Apache::loncommon::load_tmp_file($request);
     my @gradedata = &Apache::loncommon::upfile_record_sep();
+    if ($ENV{'form.noFirstLine'}) { shift(@gradedata); }
     my @keyfields = split(/\,/,$ENV{'form.keyfields'});
     my %fields=();
     for (my $i=0; $i<=$ENV{'form.nfields'}; $i++) {