{% extends "layout/basic.html" %} {% block content %}

{{ _('Import With Title Guard') }}

{% if messages and messages.length %}
{% for message in messages %}
{{ message }}
{% endfor %}
{% endif %} {% if result %}
导入包{{ uploadedName }}
成功{{ result.imported }}
失败{{ result.failed }}
未执行{{ result.skipped }}
{% for row in result.rows %} {% endfor %}
顺序原 PID目标 PID题名状态说明
{{ row.order }}{{ row.originalPid or '-' }}{{ row.targetPid }} {{ row.title }}{{ row.status }}{{ row.message }}
{% elif stage %}
导入包 / SHA-256{{ uploadedName }} · {{ archiveHash }}
包内题目{{ totalCount }}
待导入{{ selectedCount }}
已排除{{ excludedCount }}
需留意{{ conflictCount }}

待导入题目顺序

拖动手柄,或使用移动按钮;移除表示本次不导入。
    {% for row in rows %}
  1. {{ loop.index }}
    {{ row.originalTitle }}
    原 PID:{{ row.originalPid or '(空)' }} · {{ row.yamlPath }}
    {% if row.targetTitle != row.originalTitle %}
    重名处理后将导入为:{{ row.targetTitle }}
    {% endif %}
    {% for error in row.errors %}{{ error }}{% endfor %} {% for warning in row.warnings %}{{ warning }}{% endfor %} {% for item in row.matches %}同名:{{ item.pid }} {{ item.title }}{% endfor %}
  2. {% endfor %}

题号处理

先完成排序;选择重编后,新 PID 会严格按当前列表顺序生成。
当前保留 ZIP 内的原 PID;原 PID 为空、格式错误、重复或已被占用时,校验不会通过。

题号映射预览

拖动排序或修改编号参数后会立即更新。
{% for row in rows %} {% endfor %}
顺序题目原 PID 新 PID状态
{{ loop.index }}{{ row.targetTitle }}{{ row.originalPid or '(空)' }}→{{ row.targetPid }}等待前端校验
重新上传

确认时服务器会再次检查预览标识、暂存文件哈希、目标题号和当前题库冲突。全部校验通过后才开始导入。

{% else %}

上传后仅生成预览,不会立即导入。

预览中可拖动调整题目顺序,再决定是否按顺序重编题号;重名标题会自动避让。

{{ _('Upload zipfile') }} :


{{ form.form_checkbox({ label:'Hidden', columns:6, name:'hidden', placeholder:_('Make the problem hidden.'), row:false }) }} {% if handler.user.hasPriv(PRIV.PRIV_EDIT_SYSTEM) %} {{ form.form_checkbox({ label:'Keep original user', columns:6, name:'keepUser', placeholder:_('Keep original problem owner. Only used if this problemset is exported from current system.'), row:false }) }} {% endif %}

压缩包最大 256 MiB、解压后最大 512 MiB、最多 20,000 个条目和 200 道题。

{% endif %}
{% endblock %}