借小丑牌结算时一张张牌亮起来:结果里每组测试点一个方块,从左往右依次亮, 对的绿、错的红并写组号,不到 1 秒亮完,提示和按钮亮完才出来,全对时亮完再放烟花。 大字和「通过几个」判完马上就有;只播刚交的那条,刷新、看旧提交、系统减少动画都直接全亮。 提交详情多给每组对没对(只有对错,不带数据),比赛照旧不给。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1a173f75d7
commit
36b3cd6b21
8 files changed
+375
-144
No files matched your search
@@ -9,6 +9,7 @@ import { useLessonStore } from "shared/store/lesson"
|
||||
import { isFlowchartPass, useFlowchartStore } from "oj/store/flowchart"
|
||||
import { SubmissionStatus } from "utils/constants"
|
||||
import { useProblemPageContext } from "../composables/problemPageContext"
|
||||
import { caseRevealDuration } from "../utils/caseReveal"
|
||||
|
||||
/**
|
||||
* 判完之后「该发生什么」:失败计数、标成已解决、烟花、点评、回题单。
|
||||
@@ -222,6 +223,20 @@ watch(
|
||||
},
|
||||
)
|
||||
|
||||
/**
|
||||
* 这一条要播「测试点一格一格亮」的话,等它亮完。判完那一刻只有 WebSocket 推来的结果,
|
||||
* 方块要等详情(带每组对错)回来才开始亮,所以先等详情,最多 3 秒
|
||||
*/
|
||||
async function afterCasesRevealed(id: string | undefined) {
|
||||
if (!submissionStore.shouldRevealCases(id)) return
|
||||
await until(() => submission.value?.id === id && submission.value?.code !== undefined).toBe(
|
||||
true,
|
||||
{ timeout: 3000 },
|
||||
)
|
||||
const count = submission.value?.caseSummary?.results?.length ?? 0
|
||||
if (count) await new Promise((resolve) => setTimeout(resolve, caseRevealDuration(count)))
|
||||
}
|
||||
|
||||
// ==================== AC庆祝效果 ====================
|
||||
watch(
|
||||
() => submission.value?.result,
|
||||
@@ -238,14 +253,17 @@ watch(
|
||||
|
||||
if (result !== SubmissionStatus.accepted) return
|
||||
|
||||
// 2. 放烟花
|
||||
const fireworks = celebrate()
|
||||
|
||||
// 3. 烟花放完弹出评价框。比赛里不打扰;题单里 1.5 秒后要跳回题单页,弹了也会被冲掉
|
||||
if (ctx.value.reviewAfterAccepted) {
|
||||
reviewOwed.value = true
|
||||
showCommentPanelAfter(fireworks)
|
||||
}
|
||||
// (评价是欠着的这件事马上记下:方块还在亮的时候离开这道题,也要先评)
|
||||
if (ctx.value.reviewAfterAccepted) reviewOwed.value = true
|
||||
|
||||
// 2. 放烟花:等结果页签里的方块一格一格亮完(不到 1 秒)再放
|
||||
const id = submission.value?.id
|
||||
void afterCasesRevealed(id).then(() => {
|
||||
if (submission.value?.id !== id) return
|
||||
const fireworks = celebrate()
|
||||
if (ctx.value.reviewAfterAccepted) showCommentPanelAfter(fireworks)
|
||||
})
|
||||
|
||||
if (ctx.value.backToProblemSet) {
|
||||
// 延迟回到题单页面
|
||||
|
||||
Reference in new issue
Block a user