- ($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";
+ );
+ $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->problems->create (\%options);
+
+ $db->contest_problems->create({problem => $id, contest => $contest}) if $contest;