core: simplify contest & homework logic

This commit is contained in:
undefined committed 2022-07-10 22:12:18 +08:00
1 parent 81518ab424
commit 08462cf870
14 files changed
+143 -218

No files matched your search

+1
View File
@@ -782,6 +782,7 @@ Testdata Config: 测试数据配置
Testdata: 测试数据
Text: 文本
The 'default' role applies to ALL REGISTERED USER.: default 角色作用于<b>所有已注册用户</b>
The contest is a flexible time contest. You need to complete the contest within a specified time after you attended.: 本场比赛采用灵活时间模式,你需要在参加后的指定时间内完成比赛。
The homework's deadline is due but in extension. You can still submit for this problem but your score will be penalized.: 作业已超过截止时间,但仍在延期时间内。您递交题目将无法获得全部分数。
The invitation code to enter to successfully join the domain. You can only use letters and numbers in the code and it should not be longer than 64 characters.: 加入此域的邀请码。您只能使用字母和数字,并且不能长于 64 个字符。
The invitation code you provided is invalid.: 您提供的邀请码无效。
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@hydrooj/ui-default",
"version": "4.38.11",
"version": "4.38.12",
"author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0",
"main": "hydro.js",
@@ -10,7 +10,7 @@
"lint": "eslint"
},
"devDependencies": {
"@blueprintjs/core": "^4.5.1",
"@blueprintjs/core": "^4.6.0",
"@fontsource/dm-mono": "^4.5.8",
"@fontsource/fira-code": "^4.5.10",
"@fontsource/inconsolata": "^4.5.6",
@@ -27,7 +27,7 @@
"@types/markdown-it": "^12.2.3",
"@types/pickadate": "^3.5.32",
"@types/qrcode": "^1.4.2",
"@types/react-dom": "^18.0.5",
"@types/react-dom": "^18.0.6",
"@types/redux-logger": "^3.0.9",
"ansi_up": "^5.1.0",
"autoprefixer": "^9.8.8",
@@ -61,7 +61,7 @@
"jquery.transit": "^0.9.12",
"matchmedia-polyfill": "^0.3.2",
"mini-css-extract-plugin": "^1.6.2",
"moment": "^2.29.3",
"moment": "^2.29.4",
"monaco-editor": "^0.33.0",
"monaco-editor-nls": "^2.0.0",
"monaco-editor-webpack-plugin": "^7.0.1",
@@ -30,6 +30,11 @@
<p>{{ _('We will check code similarity after this contest.') }}</p>
</blockquote>
{% endif %}
{% if tdoc.duration %}
<blockquote class="note">
<p>{{ _('The contest is a flexible time contest. You need to complete the contest within a specified time after you attended.') }}</p>
</blockquote>
{% endif %}
</div>
</div>
{% if model.contest.isOngoing(tdoc, tsdoc) or model.contest.isDone(tdoc, tsdoc) %}
@@ -1,6 +1,6 @@
{% import "components/paginator.html" as paginator with context %}
{% extends "layout/basic.html" %}
{% set type = 'homework' if tdoc.docType == 60 else 'contest' %}
{% set type = 'homework' if tdoc.rule == 'homework' else 'contest' %}
{% block content %}
<div class="row"><div class="medium-12 columns scoreboard--{{ tdoc.rule }}">
<div class="section visible">
@@ -109,7 +109,7 @@
<dt>{{ _('Rule') }}</dt><dd>{{ model.contest.RULES[tdoc.rule].TEXT }}</dd>
<dt>{{ _('Problem') }}</dt><dd>{{ tdoc.pids.length }}</dd>
<dt>{{ _('Start at') }}</dt><dd>{{ contest.render_time(tsdoc.startAt or tdoc.beginAt) }}</dd>
<dt>{{ _('End at') }}</dt><dd>{{ contest.render_time(tdoc.endAt) }}</dd>
<dt>{{ _('End at') }}</dt><dd>{{ contest.render_time(tsdoc.endAt or tdoc.endAt) }}</dd>
<dt>{{ _('Duration') }}</dt><dd>{{ contest.render_duration(tdoc) }} {{ _('hour(s)') }}</dd>
<dt>{{ _('Host') }}</dt><dd>{{ user.render_inline(owner_udoc, badge=false) }}</dd>
<dt>{{ _('Partic.') }}</dt><dd>{{ tdoc['attend']|default(0) }}</dd>