| 1 | package Gruntmaster::Daemon::Judge::Absolute; |
| 2 | |
| 3 | use 5.014000; |
| 4 | use strict; |
| 5 | use warnings; |
| 6 | |
| 7 | use Gruntmaster::Daemon::Constants qw/AC/; |
| 8 | |
| 9 | our $VERSION = '5999.000_005'; |
| 10 | |
| 11 | ################################################## |
| 12 | |
| 13 | sub judge{ |
| 14 | my $result = pop; |
| 15 | ref $result ? (result => $result->[0], result_text => $result->[1]) : (result => AC, result_text => 'Accepted') |
| 16 | } |
| 17 | |
| 18 | 1; |
| 19 | __END__ |
| 20 | |
| 21 | =encoding utf-8 |
| 22 | |
| 23 | =head1 NAME |
| 24 | |
| 25 | Gruntmaster::Daemon::Judge::Absolute - All-or-nothing ACM-style judge |
| 26 | |
| 27 | =head1 SYNOPSIS |
| 28 | |
| 29 | use Gruntmaster::Daemon::Judge::Absolute; |
| 30 | Gruntmaster::Daemon::Judge::Absolute::judge($result1, $result2, $result3, ...); |
| 31 | |
| 32 | =head1 DESCRIPTION |
| 33 | |
| 34 | Gruntmaster::Daemon::Judge::Absolute is a judge which returns the result of the last test executed. Gruntmaster::Daemon stops running tests if the judge is Gruntmaster::Daemon::Judge::Absolute and a test fails, so the last test result is Accepted if and only if all tests succeeded. |
| 35 | |
| 36 | =head1 AUTHOR |
| 37 | |
| 38 | Marius Gavrilescu E<lt>marius@ieval.roE<gt> |
| 39 | |
| 40 | =head1 COPYRIGHT AND LICENSE |
| 41 | |
| 42 | Copyright (C) 2014 by Marius Gavrilescu |
| 43 | |
| 44 | This library is free software: you can redistribute it and/or modify |
| 45 | it under the terms of the GNU Affero General Public License as published by |
| 46 | the Free Software Foundation, either version 3 of the License, or |
| 47 | (at your option) any later version. |
| 48 | |
| 49 | |
| 50 | =cut |