出题表单:SQL 题隐藏代码规则检查
AstRulesEditor 基于 tree-sitter 对 Python/C 做 AST 解析(后端 ast_checker 只注册了这两种语言),对 SQL 没有意义;此前只要 SQL 在已选语言里就会渲染 出对应 tab,选项全是 for/while 循环等编程语言概念。切到 SQL 时隐藏该区块 并清空 ast_rules,避免出题界面出现无意义配置。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -198,6 +198,10 @@ watch(
|
||||
problem.value.sql_config = { mode: "query", order_sensitive: false }
|
||||
}
|
||||
currentActiveAnswer.value = "SQL"
|
||||
// 代码规则检查基于 Python/C 的 AST 解析,对 SQL 没有意义,清空避免脏数据
|
||||
if (problem.value.ast_rules) {
|
||||
problem.value.ast_rules = null
|
||||
}
|
||||
} else if (problem.value.sql_config) {
|
||||
problem.value.sql_config = null
|
||||
}
|
||||
@@ -754,7 +758,7 @@ watch(
|
||||
</n-gi>
|
||||
</n-grid>
|
||||
|
||||
<n-grid :cols="2">
|
||||
<n-grid v-if="!isSQLProblem" :cols="2">
|
||||
<n-gi :span="1">
|
||||
<AstRulesEditor
|
||||
v-model="problem.ast_rules!"
|
||||
|
||||
Reference in New Issue
Block a user