sub cmd_add{
my $id = shift;
my $name = prompt 'Problem name';
- my $private = prompt 'Private?', '-yn';
+ my $private = prompt('Private?', '-yn') eq 'y';
my $author = prompt 'Problem author (full name)';
my $owner = prompt 'Problem owner (username)';
my $level = prompt 'Problem level', -menu => "beginner\neasy\nmedium\nhard";
prompt_file \%meta, int => '[Runner::Interactive] Interactive verifier';
}
- insert_problem $id => name => $name, level => $level, statement => $statement, author => $author, owner => $owner, private => $private, generator => $generator, runner => $runner, judge => $judge, testcnt => $testcnt, (defined $timeout ? (timeout => $timeout) : ()), (defined $olimit ? (olimit => $olimit) : ());
+ insert_problem $id => (
+ name => $name,
+ level => $level,
+ statement => $statement,
+ author => $author,
+ owner => $owner,
+ generator => $generator,
+ runner => $runner,
+ judge => $judge,
+ testcnt => $testcnt,
+ ($private ? (private => $private) : ()),
+ (defined $timeout ? (timeout => $timeout) : ()),
+ (defined $olimit ? (olimit => $olimit) : ()));
set_problem_meta $id => \%meta;
PUBLISH genpage => $contest ? "ct/$contest/pb/index.html" : 'pb/index.html';
PUBLISH genpage => $contest ? "ct/$contest/pb/$id.html" : "pb/$id.html";