--- loncom/homework/grades.pm 2015/01/24 02:27:01 1.596.2.12.2.32 +++ loncom/homework/grades.pm 2015/03/10 17:01:24 1.596.2.12.2.33 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.596.2.12.2.32 2015/01/24 02:27:01 raeburn Exp $ +# $Id: grades.pm,v 1.596.2.12.2.33 2015/03/10 17:01:24 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2632,7 +2632,7 @@ sub get_last_submission { } unless ($hide) { if (@randomize) { - foreach my $id (@hidden) { + foreach my $id (@randomize) { if ($key =~ /^\Q$id\E/) { $hide = 'rand'; last; @@ -5947,8 +5947,17 @@ sub username_to_idmap { my ($classlist)= @_; my %idmap; foreach my $student (keys(%$classlist)) { - $idmap{$classlist->{$student}->[&Apache::loncoursedata::CL_ID]}= - $student; + my $id = $classlist->{$student}->[&Apache::loncoursedata::CL_ID]; + unless ($id eq '') { + if (!exists($idmap{$id})) { + $idmap{$id} = $student; + } else { + my $status = $classlist->{$student}->[&Apache::loncoursedata::CL_STATUS]; + if ($status eq 'Active') { + $idmap{$id} = $student; + } + } + } } return %idmap; }