Archived
1
0
Fork 0

Fix grades generation

This commit is contained in:
Mercier Pierre-Olivier 2013-11-23 04:18:32 +01:00
parent 37dde8ce57
commit f8e5d1b5c0
2 changed files with 18 additions and 1 deletions

View file

@ -146,6 +146,23 @@ sub getIds
return \%ids; return \%ids;
} }
sub getNonZeroIds
{
my $self = shift;
my $login = shift;
my %ids;
foreach my $group (@{ $self->{groups} })
{
my %tmp = $group->getIds($login);
while (my ($key, $value) = each %tmp)
{
$ids{$key} = $value if $value;
}
}
return \%ids;
}
sub getValue sub getValue
{ {
my $self = shift; my $self = shift;

View file

@ -145,7 +145,7 @@ sub grades_generate
log DEBUG, "Fill from file: $path"; log DEBUG, "Fill from file: $path";
log TRACE, $trace->getIds($login); log TRACE, $trace->getIds($login);
$grading->fill($trace->getIds($login)); $grading->fill($trace->getNonZeroIds($login));
} }
log DEBUG, "Computed grades: ".$grading->compute($login); log DEBUG, "Computed grades: ".$grading->compute($login);