Diff for /loncom/homework/grades.pm between versions 1.596.2.12.2.60.2.8 and 1.596.2.12.2.60.2.9

version 1.596.2.12.2.60.2.8, 2025/01/18 05:20:01 version 1.596.2.12.2.60.2.9, 2025/01/18 21:29:42
Line 4461  sub processHandGrade { Line 4461  sub processHandGrade {
   
 #---- Save the score and award for each student, if changed  #---- Save the score and award for each student, if changed
 sub saveHandGrade {  sub saveHandGrade {
     my ($request,$symb,$stuname,$domain,$newflg,$submitter,$part,$queueable,$needpb,$skip_passback,$pbsave) = @_;      my ($request,$symb,$stuname,$domain,$newflg,$submitter,
           $part,$queueable,$needpb,$skip_passback,$pbsave) = @_;
     my @version_parts;      my @version_parts;
     my $usec = &Apache::lonnet::getsection($domain,$stuname,      my $usec = &Apache::lonnet::getsection($domain,$stuname,
    $env{'request.course.id'});     $env{'request.course.id'});
Line 4469  sub saveHandGrade { Line 4470  sub saveHandGrade {
     my %record = &Apache::lonnet::restore($symb,$env{'request.course.id'},$domain,$stuname);      my %record = &Apache::lonnet::restore($symb,$env{'request.course.id'},$domain,$stuname);
     my @parts_graded;      my @parts_graded;
     my %newrecord  = ();      my %newrecord  = ();
     my ($pts,$wgt,$totchg,$sendupdate) = ('','',0,0);      my ($pts,$wgt,$totchg,$sendupdate,$poss_pb) = ('','',0,0,0);
     my %aggregate = ();      my %aggregate = ();
     my $aggregateflag = 0;      my $aggregateflag = 0;
     if ($env{'form.HIDE'.$newflg}) {      if ($env{'form.HIDE'.$newflg}) {
Line 4477  sub saveHandGrade { Line 4478  sub saveHandGrade {
         my $numchgs = &makehidden($version,$parts,\%record,$symb,$domain,$stuname,1);          my $numchgs = &makehidden($version,$parts,\%record,$symb,$domain,$stuname,1);
         $totchg += $numchgs;          $totchg += $numchgs;
     }      }
       if ((ref($needpb) eq 'HASH') && (keys(%{$needpb}))) {
           $poss_pb = 1;
       }
     my (%weights,%awardeds,%excuseds);      my (%weights,%awardeds,%excuseds);
     my @parts = split(/:/,$env{'form.partlist'.$newflg});      my @parts = split(/:/,$env{'form.partlist'.$newflg});
     foreach my $new_part (@parts) {      foreach my $new_part (@parts) {
  #collaborator ($submitter may vary for different parts)   #collaborator ($submitter may vary for different parts)
  if ($submitter && $new_part ne $part) { next; }   if ($submitter && $new_part ne $part) { next; }
  my $dropMenu = $env{'form.GD_SEL'.$newflg.'_'.$new_part};   my $dropMenu = $env{'form.GD_SEL'.$newflg.'_'.$new_part};
         if ($env{'form.WGT'.$newflg.'_'.$new_part} eq '') {          if ($poss_pb) {
               $weights{$symb}{$new_part} =
                   &Apache::lonnet::EXT('resource.'.$new_part.'.weight',$symb,$udom,$uname);
           } elsif ($env{'form.WGT'.$newflg.'_'.$new_part} eq '') {
             $weights{$symb}{$new_part} = 1;              $weights{$symb}{$new_part} = 1;
         } else {          } else {
             $weights{$symb}{$new_part} = $env{'form.WGT'.$newflg.'_'.$new_part};              $weights{$symb}{$new_part} = $env{'form.WGT'.$newflg.'_'.$new_part};
Line 4594  sub saveHandGrade { Line 4601  sub saveHandGrade {
         &Apache::lonnet::cinc('nohist_resourcetracker',\%aggregate,          &Apache::lonnet::cinc('nohist_resourcetracker',\%aggregate,
       $cdom,$cnum);        $cdom,$cnum);
     }      }
     if (($sendupdate || $totchg) && (!$submitter)) {      if (($sendupdate || $totchg) && (!$submitter) && ($poss_pb)) {
         if ((ref($needpb) eq 'HASH') &&          &process_passbacks('handgrade',[$symb],$cdom,$cnum,$domain,$stuname,$usec,\%weights,
             (keys(%{$needpb}))) {                             \%awardeds,\%excuseds,$needpb,$skip_passback,$pbsave);
             &process_passbacks('handgrade',[$symb],$cdom,$cnum,$domain,$stuname,$usec,\%weights,  
                                \%awardeds,\%excuseds,$needpb,$skip_passback,$pbsave);  
         }  
     }      }
     return ('',$pts,$wgt,$totchg,$sendupdate);      return ('',$pts,$wgt,$totchg,$sendupdate);
 }  }

Removed from v.1.596.2.12.2.60.2.8  
changed lines
  Added in v.1.596.2.12.2.60.2.9


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>