CREATE TABLE problems (
id TEXT PRIMARY KEY,
- author TEXT NOT NULL,
+ author TEXT,
generator GENERATOR NOT NULL,
judge JUDGE NOT NULL,
level PLEVEL NOT NULL,
problem TEXT NOT NULL REFERENCES problems,
result INT,
result_text TEXT,
- results JSON,
+ results TEXT,
source TEXT NOT NULL,
owner TEXT NOT NULL REFERENCES users
);
});
local $Gruntmaster::OldData::contest = $_;
for (problems) {
+ eval {
+ my $meta = problem_meta;
+ $db->problems->create({
+ id => $_,
+ author => problem_author,
+ generator => problem_generator() // $meta->{generator},
+ judge => problem_judge() // $meta->{judge},
+ level => problem_level,
+ name => problem_name,
+ olimit => problem_olimit() // $meta->{olimit},
+ owner => problem_owner,
+ private => (problem_private() ? 1 : 0),
+ runner => problem_runner() // $meta->{runner},
+ statement => problem_statement,
+ testcnt => problem_testcnt() // $meta->{testcnt},
+ timeout => problem_timeout() // $meta->{timeout},
+ (problem_runner() // $meta->{runner}) eq 'File' ? (tests => encode_json $meta->{tests}) : (),
+ exists $meta->{files} ? (versource => $meta->{files}{ver}{content}, verformat => $meta->{files}{ver}{format}) : ()
+ })
+ };
$db->contest_problems->create({
contest => $Gruntmaster::OldData::contest,
problem => $_,