Zero values are now treated as valid computation
This commit is contained in:
parent
664617171e
commit
d709297002
@ -238,9 +238,10 @@ sub compute ($$$;$$)
|
||||
$parent->appendChild( $grade );
|
||||
}
|
||||
|
||||
for my $node (@{ $self->{tree} }) {
|
||||
for my $node (@{ $self->{tree} })
|
||||
{
|
||||
my $t = $node->compute($operators, $ids, $doc, $grade);
|
||||
push @current, $t if $t;
|
||||
push @current, $t if (defined $t);
|
||||
}
|
||||
|
||||
my $res;
|
||||
@ -249,11 +250,11 @@ sub compute ($$$;$$)
|
||||
my $operator = $self->{operator};
|
||||
|
||||
my $cpt = new Safe;
|
||||
$cpt->permit_only(qw(:base_core :base_mem :base_loop padany));
|
||||
$cpt->permit_only(qw(:base_core :base_mem :base_loop padany rv2gv));
|
||||
$res = reduce {
|
||||
$cpt->share('$a');
|
||||
$cpt->share('$b');
|
||||
$cpt->reval($operators->{ $operator }) or die "Safe alert: $@";
|
||||
$cpt->reval($operators->{ $operator }) // die "Safe alert: $@";
|
||||
}
|
||||
@current;
|
||||
}
|
||||
@ -333,7 +334,7 @@ sub compute ($$$;$$)
|
||||
my $ids = shift;
|
||||
my $ret = undef;
|
||||
|
||||
if ((not $self->{ref}) || $self->{ref} ~~ $ids) {
|
||||
if ((not $self->{ref}) || grep { $self->{ref} eq $_ } keys %$ids) {
|
||||
$ret = $self->getValue( $ids );
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,7 @@ use File::Basename;
|
||||
use lib "../../";
|
||||
|
||||
use ACU::LDAP;
|
||||
use ACU::Log;
|
||||
use ACU::Process;
|
||||
|
||||
|
||||
@ -18,7 +19,7 @@ if ($#ARGV >= 1)
|
||||
|
||||
if ($year !~ /^[0-9]{4}$/)
|
||||
{
|
||||
unshift $year;
|
||||
unshift @_, $year;
|
||||
$year = LDAP::get_year();
|
||||
}
|
||||
|
||||
@ -32,7 +33,7 @@ if ($#ARGV >= 1)
|
||||
|
||||
close $input unless $input eq *STDIN;
|
||||
|
||||
$file{ basename($f, ".txt", ".lst", ".list", ".xml") } = $cnt;
|
||||
$files{ basename($f, ".txt", ".lst", ".list", ".xml") } = $cnt;
|
||||
}
|
||||
|
||||
if (my $err = Process::Client::launch("intradata_get", { action => "new_bonus", type => "grades", id => $project_id, "year" => $year }, \%files))
|
||||
|
Reference in New Issue
Block a user