diff --git a/db/app_uoj233.sql b/db/app_uoj233.sql index 12b362a..48892b5 100644 --- a/db/app_uoj233.sql +++ b/db/app_uoj233.sql @@ -622,8 +622,10 @@ CREATE TABLE `problems` ( `ac_num` int NOT NULL DEFAULT '0', `submit_num` int NOT NULL DEFAULT '0', `difficulty` int NOT NULL DEFAULT '-1', + `type` varchar(20) NOT NULL DEFAULT 'local', `assigned_to_judger` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'any', PRIMARY KEY (`id`), + KEY `type` (`type`), KEY `assigned_to_judger` (`assigned_to_judger`), KEY `uploader` (`uploader`), KEY `difficulty` (`difficulty`), @@ -648,6 +650,7 @@ UNLOCK TABLES; /*!40101 SET character_set_client = utf8mb4 */; CREATE TABLE `problems_contents` ( `id` int NOT NULL, + `remote_content` longtext COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', `statement` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `statement_md` longtext COLLATE utf8mb4_unicode_ci NOT NULL, PRIMARY KEY (`id`) diff --git a/web/Dockerfile b/web/Dockerfile index 94d5602..e9f118a 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -6,7 +6,7 @@ ENV USE_MIRROR $USE_MIRROR SHELL ["/bin/bash", "-c"] ENV DEBIAN_FRONTEND=noninteractive -ENV PKGS="php7.4 php7.4-yaml php7.4-xml php7.4-dev php7.4-zip php7.4-mysql php7.4-mbstring php7.4-gd php7.4-imagick libseccomp-dev git vim ntp zip unzip curl wget apache2 libapache2-mod-xsendfile php-pear mysql-client build-essential fp-compiler re2c libseccomp-dev libyaml-dev python2.7 python3.10 python3-requests openjdk-8-jdk openjdk-11-jdk openjdk-17-jdk" +ENV PKGS="php7.4 php7.4-yaml php7.4-xml php7.4-dev php7.4-zip php7.4-mysql php7.4-mbstring php7.4-gd php7.4-curl php7.4-imagick libseccomp-dev git vim ntp zip unzip curl wget apache2 libapache2-mod-xsendfile php-pear mysql-client build-essential fp-compiler re2c libseccomp-dev libyaml-dev python2.7 python3.10 python3-requests openjdk-8-jdk openjdk-11-jdk openjdk-17-jdk" RUN if [[ "$USE_MIRROR" == "1" ]]; then\ sed -i "s@http://.*archive.ubuntu.com@https://mirrors.aliyun.com@g" /etc/apt/sources.list &&\ sed -i "s@http://.*security.ubuntu.com@https://mirrors.aliyun.com@g" /etc/apt/sources.list ;\ diff --git a/web/app/composer.json b/web/app/composer.json index 8ef8663..7ebf2b0 100644 --- a/web/app/composer.json +++ b/web/app/composer.json @@ -3,7 +3,10 @@ "gregwar/captcha": "^1.1", "phpmailer/phpmailer": "^6.6", "ezyang/htmlpurifier": "^4.16", - "erusev/parsedown": "^1.7" + "erusev/parsedown": "^1.7", + "php-curl-class/php-curl-class": "^2.0", + "ext-dom": "20031129", + "ivopetkov/html5-dom-document-php": "2.*" }, "autoload": { "classmap": [ diff --git a/web/app/controllers/contest_inside.php b/web/app/controllers/contest_inside.php index 3b47fe4..210bd23 100644 --- a/web/app/controllers/contest_inside.php +++ b/web/app/controllers/contest_inside.php @@ -54,10 +54,10 @@ if ($is_manager) { isset($tabs_info[$cur_tab]) || UOJResponse::page404(); if (UOJContest::cur()->userCanStartFinalTest(Auth::user())) { - if (CONTEST_PENDING_FINAL_TEST <= $contest['cur_progress']) { + if (CONTEST_PENDING_FINAL_TEST == $contest['cur_progress']) { $start_test_form = new UOJBs4Form('start_test'); $start_test_form->handle = function () { - UOJContest::finalTest(); + UOJContest::cur()->finalTest(); }; $start_test_form->submit_button_config['class_str'] = 'btn btn-danger d-block w-100'; $start_test_form->submit_button_config['smart_confirm'] = ''; diff --git a/web/app/controllers/contest_manage.php b/web/app/controllers/contest_manage.php index 5ef3f81..0ab7f2a 100644 --- a/web/app/controllers/contest_manage.php +++ b/web/app/controllers/contest_manage.php @@ -596,11 +596,11 @@ EOD); EOD, function ($row) { - $problem = UOJProblem::query($row['problem_id']); + $problem = UOJContestProblem::query($row['problem_id'], UOJContest::cur()); echo '