addInput('id', 'text', '重试请求', '', function ($id) { if (!validateUInt($id)) return 'ID 不合法'; $u = queryDatumBrief($id); if (!$u) return '请求不存在'; if ($u['status'] == 'Generating') return '请求处理中'; return ''; }, null); $cancel_form->handle = function() { $id = $_POST['id']; DB::update("update datum_requests set status = 'Waiting' where id = $id"); }; $cancel_form->submit_button_config['class_str'] = 'btn btn-danger'; $cancel_form->submit_button_config['align'] = 'offset'; $cancel_form->submit_button_config['text'] = '重试'; $cancel_form->runAtServer(); $retry_form = new UOJForm('retry'); $retry_form->addInput('id', 'text', '重试请求', '', function ($id) { if (!validateUInt($id)) return 'ID 不合法'; $u = queryDatumBrief($id); if (!$u) return '请求不存在'; if ($u['status'] == 'Generating') return '请求处理中'; return ''; }, null); $retry_form->handle = function() { $id = $_POST['id']; DB::update("update datum_requests set request_time = now() where id = $id"); DB::update("update datum_requests set finish_time = NULL where id = $id"); DB::update("update datum_requests set status = 'Waiting' where id = $id"); }; $retry_form->submit_button_config['class_str'] = 'btn btn-danger'; $retry_form->submit_button_config['align'] = 'offset'; $retry_form->submit_button_config['text'] = '重试'; $retry_form->runAtServer(); $new_datum_form = new UOJForm('datum'); $new_datum_form->addInput('pid', 'text', '题目编号', '', function ($pid) { if (!validateUInt($pid)) return '题号不合法'; if (!queryProblemBrief($pid)) return '题目不存在'; return ''; }, null); $new_datum_form->addInput('timelim', 'text', '时间限制', '', function ($pid) { if (!validateUInt($pid)) return '时间限制不合法'; return ''; }, null); $new_datum_form->addInput('memlim', 'text', '空间限制', '', function ($pid) { if (!validateUInt($pid)) return '空间限制不合法'; return ''; }, null); $new_datum_form->addSourceCodeInput('std', '标程', array('C++17')); $new_datum_form->handle = function() { $std = ''; if ($_POST['std_upload_type'] == 'editor') $std = $_POST['std_editor']; else $std = $_POST['std_file']; $std = DB::escape($std); $pid = $_POST['pid']; $timelim = $_POST['timelim']; $memlim = $_POST['memlim']; DB::insert("insert into datum_requests (pid, request_time, timelimit, memlimit, status, std) values ($pid, now(), $timelim, $memlim, 'Waiting', '$std')"); }; $new_datum_form->runAtServer(); ?> 重试由大模型不稳定导致失败的请求'; $retry_form->printHTML(); echo '

数据生成完毕后请手动点击校验配置并同步数据

'; $new_datum_form->printHTML(); ?>