--- loncom/homework/grades.pm 2015/01/23 23:34:17 1.596.2.12.2.31 +++ loncom/homework/grades.pm 2015/03/17 12:37:40 1.596.2.12.2.34 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.596.2.12.2.31 2015/01/23 23:34:17 raeburn Exp $ +# $Id: grades.pm,v 1.596.2.12.2.34 2015/03/17 12:37:40 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -465,7 +465,7 @@ sub cleanRecord { $env{'form.kwstyle'} = $keyhash{$loginuser.'_kwstyle'} ne '' ? $keyhash{$loginuser.'_kwstyle'} : ''; $env{'form.'.$symb} = 1; # so that we don't have to read it from disk for multiple sub of the same prob. } - return '

'.&keywords_highlight(&HTML::Entities::encode($answer, '"<>&')).'
'; + return '

'.&keywords_highlight($answer).'
'; } elsif ( $response eq 'organic') { my $result=&mt('Smile representation: [_1]', '"'.&HTML::Entities::encode($answer, '"<>&').'"'); @@ -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; @@ -5071,11 +5071,12 @@ sub displaySubByDates { } else { $displaySub[0].=&mt('Trial: [_1]', $$record{"$where.$partid.tries"}); - if ($rndseed || $lastrndseed{$partid}) { + if (($rndseed ne '') && ($lastrndseed{$partid} ne '')) { if ($rndseed ne $lastrndseed{$partid}) { $newvariation = ' ('.&mt('New variation this try').')'; } } + $lastrndseed{$partid} = $rndseed; } my $responseType=($isTask ? 'Task' : $responseType->{$partid}->{$responseId}); @@ -5947,8 +5948,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; }