feat(题目): 语法没过时把代码里每一处中文标点都标出来,和「换成英文(N 处)」对得上
- 原来编辑器里只标报错点名的第一处,按钮却写着「4 处」,学生对不上、也不知道一键替换 会改哪里。字符串和注释里的中文标点是合法的,不标(和一键替换同一套判断) - 这种情况下没交上去:结果页签那一段叫「交之前检查」,标题写「还没有交上去」, 不再叫「提交结果」 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b5d2f1589e
commit
11ff340110
3 files changed
+56
-4
No files matched your search
@@ -1,7 +1,13 @@
|
||||
<script setup lang="ts">
|
||||
import { useCodeStore } from "oj/store/code"
|
||||
import { findChinesePunctuation } from "oj/problem/utils/chinesePunctuation"
|
||||
import { applyFixes, clearErrorMark, currentCode, showErrorMark } from "oj/problem/utils/errorMark"
|
||||
import {
|
||||
applyFixes,
|
||||
clearErrorMark,
|
||||
currentCode,
|
||||
showErrorMark,
|
||||
showPunctuationMarks,
|
||||
} from "oj/problem/utils/errorMark"
|
||||
import { explainPythonCompileError } from "oj/problem/utils/pythonError"
|
||||
|
||||
/**
|
||||
@@ -55,6 +61,9 @@ watch(
|
||||
fixedCount.value = null
|
||||
if (ex?.line) showErrorMark(ex.line, ex.sourceLine, ex.caret)
|
||||
else clearErrorMark()
|
||||
// 中文标点一处不漏地标出来,和按钮上的「N 处」对得上
|
||||
const code = ex?.punctuation ? currentCode() : null
|
||||
if (code !== null) showPunctuationMarks(findChinesePunctuation(code))
|
||||
},
|
||||
{ immediate: true },
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user