Add perlcritic test and make code comply
[gruntmaster-daemon.git] / lib / Gruntmaster / Daemon / Judge / Points.pm
CommitLineData
5c5cd38a
MG
1package Gruntmaster::Daemon::Judge::Points;
2
3use 5.014000;
4use strict;
5use warnings;
6
7use Gruntmaster::Daemon::Constants qw/AC REJ/;
8use List::Util qw/sum/;
9use Log::Log4perl qw/get_logger/;
bc372959 10
3e7fd903 11our $VERSION = '5999.000_004';
5c5cd38a
MG
12
13##################################################
14
15sub judge{
99d37110 16 no warnings qw/numeric/; ## no critic (ProhibitNoWarnings)
a722431b
MG
17 get_logger->trace("Judging results: @_");
18 my $points = sum 0, grep { !ref } @_;
19 $points == 100 ? (result => AC, result_text => 'Accepted') : (result => REJ, result_text => "$points points", points => $points)
5c5cd38a
MG
20}
21
8aec2ffe
MG
221;
23__END__
24
25=encoding utf-8
26
27=head1 NAME
28
29Gruntmaster::Daemon::Judge::Points - 0 to 100 points IOI-style judge
30
31=head1 SYNOPSIS
32
33 use Gruntmaster::Daemon::Judge::Points;
0005d3ad 34 Gruntmaster::Daemon::Judge::Points::judge($result1, $result2, $result3, ...);
8aec2ffe
MG
35
36=head1 DESCRIPTION
37
38Gruntmaster::Daemon::Judge::Points is a judge which adds up the given results and returns C<Accepted> if the final score is 100 points or C<X points> otherwise.
39
40=head1 AUTHOR
41
42Marius Gavrilescu E<lt>marius@ieval.roE<gt>
43
44=head1 COPYRIGHT AND LICENSE
45
46Copyright (C) 2014 by Marius Gavrilescu
47
48This library is free software: you can redistribute it and/or modify
49it under the terms of the GNU Affero General Public License as published by
50the Free Software Foundation, either version 3 of the License, or
51(at your option) any later version.
52
53
54=cut
This page took 0.035337 seconds and 4 git commands to generate.