feat(比赛): 比赛页一页看题目和自己的名次;排名竞争感做足、结束有领奖台;老师考试中看全班、考完看成绩;新建比赛一屏做完
Deploy / deploy (push) Canceled after 0s
Deploy / deploy (push) Canceled after 0s
- 学生比赛页(设计稿 B):左边题目带几人做对、谁最先做对;右边我第几名、5 分钟里升了几名、再做对 1 道能到第几名、我前后的人 - 期中、期末考试中只有自己的进度,写明「排名考完公布」,题目页的排名入口也藏起来 - 排名页:按班筛、名次变化、最先做对的深绿格、自己那行钉住;结束后前三名领奖台 + 我的成绩卡;排名曲线和学生的「导出数据」去掉 - 老师的「全班情况」:卡在一道题、15 分钟没交的放最上面,没进来的人对上看板的请假;考完变「成绩」,点格子看代码、标看过了(代替后台审核页),导出成绩 - 比赛列表:进行中的一大块「接着比」,已结束的写我第几名,前三带奖杯 - 新建比赛:默认 10 分钟后开始,时长点按钮,搜题号把题加进来自动编号、拖动排顺序 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b94e028ff4
commit
151bbdcb50
19 files changed
+3768
-743
No files matched your search
@@ -212,6 +212,24 @@ export function readableDuration(seconds: number): string {
|
||||
return rest ? `${hours} 小时 ${rest} 分` : `${hours} 小时`
|
||||
}
|
||||
|
||||
/**
|
||||
* 比赛有多长,给人看的:「40 分钟」「1 小时 30 分钟」「3 天」。
|
||||
* `duration()` 会拆出「1月6天59分钟」这种,比赛列表里读不下去;一天以上只说几天
|
||||
*/
|
||||
export function contestLength(start: Date | string, end: Date | string): string {
|
||||
const minutes = Math.round(
|
||||
(normalizeDate(end).getTime() - normalizeDate(start).getTime()) / 60_000,
|
||||
)
|
||||
if (!Number.isFinite(minutes) || minutes <= 0) return ""
|
||||
if (minutes < 60) return `${minutes} 分钟`
|
||||
if (minutes < 24 * 60) {
|
||||
const h = Math.floor(minutes / 60)
|
||||
const m = minutes % 60
|
||||
return m ? `${h} 小时 ${m} 分钟` : `${h} 小时`
|
||||
}
|
||||
return `${Math.round(minutes / (24 * 60))} 天`
|
||||
}
|
||||
|
||||
export function durationToDays(start: Date | string, end: Date | string): string {
|
||||
const durationObj = getDurationObject(start, end)
|
||||
const units = [
|
||||
|
||||
@@ -329,12 +329,6 @@ export type BlankContest = Omit<
|
||||
*/
|
||||
export type { ContestSubmissionInfo } from "@oj2/contract"
|
||||
|
||||
/**
|
||||
* 榜单行。`submissionInfo` 的收窄(JSONB 原文的 snake_case 形状)已经搬进
|
||||
* `contestRankItemSchema`,这里不再需要 Omit + 覆盖。
|
||||
*/
|
||||
export type ContestRank = import("@oj2/contract").ContestRankItem
|
||||
|
||||
export type { WebsiteConfig, OnlineCount } from "@oj2/contract"
|
||||
|
||||
export type {
|
||||
@@ -344,7 +338,6 @@ export type {
|
||||
OrphanTestCase,
|
||||
AdminUser,
|
||||
AdminUserList,
|
||||
AcmHelperItem,
|
||||
AdminContestList,
|
||||
AdminProblemSetProgress,
|
||||
AdminProblemSetProblem,
|
||||
|
||||
Reference in new issue
Block a user