feat(题目页): 「统计」页签重做——学生看难不难、几次做对、常错在哪,老师按班看谁没做对

- 全部按人算:原来的「通过数」是 AC 条数、「通过率」按提交算;击败用户、饼图、历年 AC 率去掉
- 错得最多的那种给一句该怎么办(都指向「运行例子」),自己交了 3 次以上还没对再多一张卡
- 老师选一个班:做对 / 交了没对(次数、最后结果)/ 没交;班里错得和全站不一样时点出来
- 题库入口工具栏的「课堂统计」并进这里(题单没有页签,按钮留着)
- 新接口 /problems/:id/stats(按内部题号,比赛题不再查到同号公开题),删掉 beat-count、yearly-ac

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-09-30 00:39:57 +08:00
1 parent 91d9c9c6d7
commit 99319fdcc5
10 files changed
+1017 -317

No files matched your search

+9 -10
View File
@@ -22,7 +22,7 @@ import {
type CreateSubmissionResponse,
type ProblemAuthor,
type ProblemListItem,
type YearlyAc,
type ProblemStats,
type ProblemList,
type CreateFlowchartResponse,
type FlowchartScores,
@@ -115,9 +115,14 @@ export async function getProblem(problemID: string, contestID: string) {
return problem
}
// 未登录返回 "0",登录后返回百分比字符串
export function getProblemBeatRate(problemID: number) {
return api.get<string>(`problems/${problemID}/beat-count`)
/**
* 题目页「统计」页签。problemID 是内部题号(problem.id),比赛题也能查。
* className 只有老师用:看哪个班的明细,不填就是最近做过这题的班
*/
export function getProblemStats(problemID: number, className?: string) {
return api.get<ProblemStats>(`problems/${problemID}/stats`, {
params: className ? { className } : {},
})
}
export async function getSubmission(id: string): Promise<Submission> {
@@ -405,12 +410,6 @@ export function getSimilarProblems(problemId: string) {
.then((response) => response.map(toProblemRow))
}
export type { YearlyAc as YearlyACData } from "@oj2/contract"
export function getProblemYearlyAC(problemId: string) {
return api.get<YearlyAc[]>(`problems/${encodeURIComponent(problemId)}/yearly-ac`)
}
// ==================== 流程图相关API ====================
export function submitFlowchart(data: {