--- loncom/homework/grades.pm 2005/02/07 17:07:58 1.242 +++ loncom/homework/grades.pm 2005/02/12 03:43:06 1.245 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.242 2005/02/07 17:07:58 albertel Exp $ +# $Id: grades.pm,v 1.245 2005/02/12 03:43:06 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2655,15 +2655,17 @@ sub csvupload_javascript_reverse_associa function verify(vf) { var foundsomething=0; var founduname=0; + var foundID=0; var founddomain=0; for (i=0;i<=vf.nfields.value;i++) { tw=eval('vf.f'+i+'.selectedIndex'); - if (i==0 && tw!=0) { founduname=1; } - if (i==1 && tw!=0) { founddomain=1; } - if (i!=0 && i!=1 && tw!=0) { foundsomething=1; } + if (i==0 && tw!=0) { foundID=1; } + if (i==1 && tw!=0) { founduname=1; } + if (i==2 && tw!=0) { founddomain=1; } + if (i!=0 && i!=1 && i!=2 && tw!=0) { foundsomething=1; } } - if (founduname==0 || founddomain==0) { - alert('You need to specify at both the username and domain'); + if ((founduname==0 && foundID==0) || founddomain==0) { + alert('You need to specify the domain and either the username or ID'); return; } if (foundsomething==0) { @@ -2693,15 +2695,17 @@ sub csvupload_javascript_forward_associa function verify(vf) { var foundsomething=0; var founduname=0; + var foundID=0; var founddomain=0; for (i=0;i<=vf.nfields.value;i++) { tw=eval('vf.f'+i+'.selectedIndex'); - if (tw==1) { founduname=1; } - if (tw==2) { founddomain=1; } - if (tw>2) { foundsomething=1; } + if (tw==1) { foundID=1; } + if (tw==2) { founduname=1; } + if (tw==3) { founddomain=1; } + if (tw>3) { foundsomething=1; } } - if (founduname==0 || founddomain==0) { - alert('You need to specify at both the username and domain'); + if ((founduname==0 && foundID==0) || founddomain==0) { + alert('You need to specify the domain and either the username or ID'); return; } if (foundsomething==0) { @@ -2733,7 +2737,8 @@ sub csvuploadmap_header { } my ($result) = &showResourceInfo($url,$ENV{'form.probTitle'}); - + my $checked=(($ENV{'form.noFirstLine'})?' checked="checked"':''); + my $ignore=&mt('Ignore First Line'); $request->print(<

Uploading Class Grades

@@ -2744,6 +2749,7 @@ Total number of records found in file: $ 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.
+ @@ -2768,13 +2774,18 @@ ENDPICK sub csvupload_fields { my ($url,$symb) = @_; my (@parts) = &getpartlist($url,$symb); - my @fields=(['username','Student Username'],['domain','Student Domain']); + my @fields=(['ID','Student ID'], + ['username','Student Username'], + ['domain','Student Domain']); foreach my $part (sort(@parts)) { my @datum; my $display=&Apache::lonnet::metadata($url,$part.'.display'); my $name=$part; if (!$display) { $display = $name; } @datum=($name,$display); + if ($name=~/^stores_(.*)_awarded/) { + push(@fields,['stores_'.$1.'_points',"Points [Part: $1]"]); + } push(@fields,\@datum); } return (@fields); @@ -2815,6 +2826,7 @@ CSVFORMJS '.'."\n"; $result.=''."\n"; my $upfile_select=&Apache::loncommon::upfile_select_html(); + my $ignore=&mt('Ignore First Line'); $result.=< @@ -2824,7 +2836,7 @@ CSVFORMJS $upfile_select
- +