diff --git a/web/app/libs/uoj-luogu-lib.php b/web/app/libs/uoj-luogu-lib.php index 1a57a5a..527f76a 100644 --- a/web/app/libs/uoj-luogu-lib.php +++ b/web/app/libs/uoj-luogu-lib.php @@ -1,12 +1,14 @@ "answer", + "type" => "source code", + "file_name" => "answer.code", + "languages" => LUOGU_SUPPORTED_LANGUAGES, + ), + )); + $esc_extra_config = json_encode(array( + "luogu_pid" => $pid, + "view_content_type" => "ALL", + "view_details_type" => "ALL", + )); + + DB::query("insert into problems (title, is_hidden, submission_requirement, extra_config, hackable, type) values ('" . DB::escape($problem['title']) . "', 1, '" . DB::escape($esc_submission_requirements) . "', '" . DB::escape($esc_extra_config) . "', 0, 'luogu')"); + + $id = DB::insert_id(); + + DB::query("insert into problems_contents (id, statement, statement_md) values ($id, '" . DB::escape($problem['statement']) . "', '" . DB::escape($problem['statement_md']) . "')"); + + dataNewProblem($id); + + return $id; +}