';
@@ -1517,7 +1536,10 @@ sub handback_box {
next if (!@$files);
my $file_counter = 1;
foreach my $file (@$files) {
- my ($file_disp) = ($file =~ m|.+/(.+)$|);
+ my ($file_path, $file_disp) = ($file =~ m|(.+/)(.+)$|);
+ my ($name,$version,$ext) = &file_name_version_ext($file_disp);
+ $file_disp = "$name.$ext";
+ $file = $file_path.$file_disp;
$result.=&mt('Return commented version of [_1] to student.',
''.$file_disp.'');
$result.=''."\n";
@@ -1992,6 +2014,8 @@ KEYWORDS
' ';
$endform.='(Next and Previous (student) do not save the scores.)'."\n" ;
+ $endform.="";
$endform.='
';
$endform.=&show_grading_menu_form($symb);
$request->print($endform);
@@ -2326,6 +2350,7 @@ sub saveHandGrade {
my $partial= $pts/$wgt;
if ($partial eq $record{'resource.'.$new_part.'.awarded'}) {
#do not update score for part if not changed.
+ &handback_files($request,$symb,$stuname,$domain,$newflg,$new_part,\%newrecord);
next;
} else {
push @parts_graded, $new_part;
@@ -3510,6 +3535,7 @@ sub csvuploadassign {
my ($request)= @_;
my ($symb)=&get_symb($request);
if (!$symb) {return '';}
+ my $error_msg = '';
&Apache::loncommon::load_tmp_file($request);
my @gradedata = &Apache::loncommon::upfile_record_sep();
if ($env{'form.noFirstLine'}) { shift(@gradedata); }
@@ -3562,12 +3588,20 @@ sub csvuploadassign {
my $part=$1;
my $wgt =&Apache::lonnet::EXT('resource.'.$part.'.weight',
$symb,$domain,$username);
- $entries{$fields{$dest}}=~s/\s//g;
- my $pcr=$entries{$fields{$dest}} / $wgt;
- my $award='correct_by_override';
- $grades{"resource.$part.awarded"}=$pcr;
- $grades{"resource.$part.solved"}=$award;
- $points{$part}=1;
+ if ($wgt) {
+ $entries{$fields{$dest}}=~s/\s//g;
+ my $pcr=$entries{$fields{$dest}} / $wgt;
+ my $award='correct_by_override';
+ $grades{"resource.$part.awarded"}=$pcr;
+ $grades{"resource.$part.solved"}=$award;
+ $points{$part}=1;
+ } else {
+ $error_msg = " " .
+ &mt("Some point values were assigned"
+ ." for problems with a weight "
+ ."of zero. These values were "
+ ."ignored.");
+ }
} else {
if ($dest=~/stores_(.*)_awarded/) { if ($points{$1}) {next;} }
if ($dest=~/stores_(.*)_solved/) { if ($points{$1}) {next;} }
@@ -3607,7 +3641,7 @@ sub csvuploadassign {
}
$request->print(" \n");
$request->print(&show_grading_menu_form($symb));
- return '';
+ return $error_msg;
}
#------------- end of section for handling csv file upload ---------
#