- 「新建题目」先选编程题还是 SQL 题,选了就不能改;编辑时按题目本身进对应的页 - SQL 出题页(设计稿「SQL 出题页」方案 B):测试数据一组一行,改完自动重跑, 跑不通的用中文说原因;保存时才打包上传测试点,不用再手动「预览」「上传」 - 新建时存草稿,误关页面不丢 - 编程题出题页去掉 SQL 那一堆分支(以前勾上 SQL 会静默清掉语法要求和流程图) - 题目列表能按题型筛,SQL 题标题后面挂标签 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
21 lines
664 B
TypeScript
21 lines
664 B
TypeScript
import type { AdminProblemRow, AdminProblemListItem } from "utils/types"
|
|
|
|
// 把后端的列表项塑形成管理端列表行,与请求逻辑解耦。
|
|
export function toAdminProblemRow(result: AdminProblemListItem): AdminProblemRow {
|
|
return {
|
|
id: result.id,
|
|
_id: result._id,
|
|
title: result.title,
|
|
username: result.createdBy.username,
|
|
createTime: result.createTime,
|
|
visible: result.visible,
|
|
difficulty: result.difficulty,
|
|
tags: result.tags,
|
|
isSql: result.isSql,
|
|
hasAstRules: result.hasAstRules,
|
|
allowFlowchart: result.allowFlowchart,
|
|
showFlowchart: result.showFlowchart,
|
|
topReaction: result.topReaction,
|
|
}
|
|
}
|