use File::Slurp qw/read_file write_file/;
use IO::Prompter [ -style => 'bold', '-stdio', '-verbatim' ];
use JSON::MaybeXS qw/encode_json/;
+use PerlX::Maybe;
use Term::ANSIColor qw/RED RESET/;
use constant LEVEL_VALUES => {
runner => $runner,
judge => $judge,
testcnt => $testcnt,
+ maybe private => $private,
+ maybe timeout => $timeout,
+ maybe olimit => $olimit,
+ maybe gensource => $gensource,
+ maybe genformat => $genformat,
+ maybe versource => $versource,
+ maybe verformat => $verformat,
);
- $options{private} = $private if $private;
- $options{timeout} = $timeout if $timeout;
- $options{olimit} = $olimit if $olimit;
$options{tests} = encode_json \@tests if @tests;
- $options{gensource} = $gensource if $gensource;
- $options{genformat} = $genformat if $genformat;
- $options{versource} = $versource if $versource;
- $options{verformat} = $verformat if $verformat;
db->insert(problems => \%options);
db->insert(contest_problems => {problem => $id, contest => $contest}) if $contest;
}