From: Marius Gavrilescu Date: Fri, 21 Feb 2014 15:46:06 +0000 (+0200) Subject: Do not make all problems private X-Git-Tag: 5999.000_002~5 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=646feed421894c0a4b59b4adf6e8c97e14578e14;p=gruntmaster-data.git Do not make all problems private --- diff --git a/gruntmaster-problem b/gruntmaster-problem index 5b4375f..76e921f 100755 --- a/gruntmaster-problem +++ b/gruntmaster-problem @@ -28,7 +28,7 @@ sub prompt_file{ 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"; @@ -56,7 +56,19 @@ sub cmd_add{ 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";