feat(题单): 题单页重做——布置中的放最上面,详情顶上一条进度和奖章阶梯,没加入看得见题点不进;老师看全班、后台一屏编辑
Deploy / deploy (push) Canceled after 0s
Deploy / deploy (push) Canceled after 0s
- 列表:布置中的大卡片(做对几道、布置到哪天、再做对几道拿哪个奖章),其余小卡片,加入过的在前 - 详情:进度 + 奖章阶梯(下一个金圈「再做对 n 道」),题目两列写几点做对 / 交过几次; 以前做对过的标「旧代码先藏着」;做完整条变绿,烟花只在做完那一刻放 - 老师多一个「全班情况」页签;题目页从链接直接进来没加入时,条上给「加入题单」 - 后台一屏编辑:布置一周 / 两周 / 四周 / 选日期,公开开关,粘贴多个题号一次加,拖动排序,奖章只剩两种条件 - 旧代码藏着的地方都说清楚是哪个题单、哪天之后能看 - 修掉列表卡片把选做题数说成「新加了 N 题」 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8c53e28dcb
commit
c17f88cdbb
32 files changed
+2630
-2181
No files matched your search
+15
-25
@@ -36,10 +36,10 @@ import {
|
||||
type HeatmapItem,
|
||||
type SolvedList,
|
||||
type ProblemSet,
|
||||
type ProblemSetBadge,
|
||||
type ProblemSetClassView,
|
||||
type ProblemSetList,
|
||||
type ProblemSetLock,
|
||||
type ProblemSetProblem,
|
||||
type ProblemSetProgressList,
|
||||
type UserBadge,
|
||||
type FlowchartStatistics,
|
||||
type SubmissionStatistics,
|
||||
@@ -482,23 +482,15 @@ export function retryFlowchartSubmission(submissionId: string) {
|
||||
return api.post<{ status: string }>(`flowcharts/${encodeURIComponent(submissionId)}/retry`)
|
||||
}
|
||||
|
||||
/** 自己在这道题上评完的每一次(早的在前),加入题单之前的已经滤掉 */
|
||||
/** 自己在这道题上评完的每一次(早的在前),题单布置期内藏着的已经滤掉 */
|
||||
export function getFlowchartScores(problemId: number) {
|
||||
return api.get<FlowchartScores>(`problems/${problemId}/flowchart/scores`)
|
||||
}
|
||||
|
||||
// ==================== 题单相关API ====================
|
||||
|
||||
export function getProblemSetList(
|
||||
offset = 0,
|
||||
limit = 10,
|
||||
keyword = "",
|
||||
difficulty = "",
|
||||
status = "",
|
||||
) {
|
||||
return api.get<ProblemSetList>("problem-sets", {
|
||||
params: { offset, limit, keyword, difficulty, status },
|
||||
})
|
||||
export function getProblemSetList(offset = 0, limit = 10, keyword = "") {
|
||||
return api.get<ProblemSetList>("problem-sets", { params: { offset, limit, keyword } })
|
||||
}
|
||||
|
||||
export function getProblemSetDetail(id: number) {
|
||||
@@ -517,20 +509,18 @@ export function getUserBadges(username?: string) {
|
||||
return api.get<UserBadge[]>(`users/${encodeURIComponent(username ?? "me")}/badges`)
|
||||
}
|
||||
|
||||
export function getProblemSetBadges(problemSetId: number) {
|
||||
return api.get<ProblemSetBadge[]>(`problem-sets/${problemSetId}/badges`)
|
||||
/** 老师看某个班在题单里的情况;不传班级就看服务端推断的那个班 */
|
||||
export function getProblemSetClassView(problemSetId: number, className = "") {
|
||||
return api.get<ProblemSetClassView>(`problem-sets/${problemSetId}/class-view`, {
|
||||
params: className ? { className } : {},
|
||||
})
|
||||
}
|
||||
|
||||
export function getProblemSetUserProgress(
|
||||
problemSetId: number,
|
||||
params?: {
|
||||
limit?: number
|
||||
offset?: number
|
||||
className?: string
|
||||
completionStatus?: "" | "completed" | "in_progress" | "not_started"
|
||||
},
|
||||
) {
|
||||
return api.get<ProblemSetProgressList>(`problem-sets/${problemSetId}/user-progress`, { params })
|
||||
/** 这道题以前的代码为什么藏着:落在哪些正在布置的题单里。传主键或题号都行 */
|
||||
export function getProblemSetLocks(problem: { id: number } | { displayId: string }) {
|
||||
return api.get<ProblemSetLock[]>("problem-sets/locks", {
|
||||
params: "id" in problem ? { problemId: problem.id } : { problemDisplayId: problem.displayId },
|
||||
})
|
||||
}
|
||||
|
||||
export function getExercises(tutorialId: number): Promise<Exercise[]> {
|
||||
|
||||
Reference in new issue
Block a user