feat(流程图): AI 点评改成拿例子和测试数据在图上走一遍,同一张图不能再原样重交抽等级

原来让 AI 按逻辑 40 / 完整 30 / 规范 20 / 清晰 10 打总分:同一张图交两次能差 35 分
(有一张 C 再交变 S),22% 的提交和上一次一模一样;评语里写 node_9 这种学生看不到的编号。
照画布稿 FlowResFail / FlowResPass:
- AI 拿题目的例子和最多 3 组测试数据,从开始照着图走到结束,逐组说输出什么、对不对、
  最先错在哪个框;全对 A,全对且写法挑不出毛病 S,走对一半以上 B,否则 C
- 结果页签:「3 组走对 2 组」,逐组 ✓ / ✗,点开看「你的图输出 / 应该输出」,画布上按先后
  编号亮出这一组走过的框、错的那个标红;图一改就不亮,载回那一版又能亮
- 画布和上次评完的那张一模一样时「交给 AI 点评」灰掉;后端也兜着:同一道题一模一样的图
  直接照搬上次走例子的结果,不再问 AI
- 题目一组例子、测试数据都没有时退回老的四项分;老提交照旧按四项分显示
- 历次等级、提交列表的胶囊只写等级,不写分数

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-10-12 21:08:42 +08:00
1 parent 09f8a56913
commit 099c6d7ba6
17 files changed
+969 -77

No files matched your search

@@ -1,8 +1,7 @@
<script lang="ts" setup>
import { storeToRefs } from "pinia"
import { compressToBase64 } from "utils/functions"
import { useBreakpoints } from "shared/composables/breakpoints"
import { countBlank, toMermaid } from "shared/components/FlowchartEditor/model"
import { countBlank } from "shared/components/FlowchartEditor/model"
import { useProblemStore } from "oj/store/problem"
import { useFlowchartStore, type FlowchartEditorInstance } from "oj/store/flowchart"
@@ -19,7 +18,7 @@ const flowchartEditorRef = inject<Ref<FlowchartEditorInstance | null>>("flowchar
const message = useMessage()
const { problem } = storeToRefs(useProblemStore())
const flowchartStore = useFlowchartStore()
const { loading } = storeToRefs(flowchartStore)
const { loading, unchanged } = storeToRefs(flowchartStore)
const { isDesktop } = useBreakpoints()
function submit() {
@@ -36,7 +35,7 @@ function submit() {
message.warning(`有 ${blank} 个框还没写字,点一下框就能写`)
return
}
flowchartStore.submit(toMermaid(doc), compressToBase64(JSON.stringify(doc)))
flowchartStore.submit(doc)
}
// 进题、换题都读一次历次分数(store 里同一道题只读一次)
@@ -48,7 +47,8 @@ watch(() => problem.value?.id, flowchartStore.ensureLoaded, { immediate: true })
:size="isDesktop ? 'medium' : 'small'"
type="primary"
:loading="loading"
:disabled="loading"
:disabled="loading || unchanged"
:title="unchanged && !loading ? '这一版已经点评过了,改一改再交' : undefined"
@click="submit"
>
{{ loading ? "AI 点评中…" : "交给 AI 点评" }}