- ($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";
+ (private => $private)x!! $private,
+ (timeout => $timeout)x!! $timeout,
+ (olimit => $olimit)x!! $olimit,
+ (tests => encode_json \@tests)x!! @tests,
+ (gensource => $gensource)x!! $gensource,
+ (genformat => $genformat)x!! $genformat,
+ (versource => $versource)x!! $versource,
+ (verformat => $verformat)x!! $verformat,
+ });
+
+ $db->contest_problems->create({problem => $id, contest => $contest}) if $contest;
+ #PUBLISH genpage => $contest ? "ct/$contest/pb/index.html" : 'pb/index.html';
+ #PUBLISH genpage => $contest ? "ct/$contest/pb/$id.html" : "pb/$id.html";