新增 SQL 题型前端支持
- LANGUAGE 类型与六张语言映射表补 SQL;编辑器 SQLite 方言高亮 - 出题表单:SQL 语言选项、题型/行序配置卡片、数据脚本压缩包上传、标准答案必填校验 - 修复做题页语言回退硬编码 Python3 的问题(SQL 题会提交被拒) - SQL 题隐藏自测猫/自测屏/复制到自测猫(外部运行器不支持 SQL) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -140,7 +140,8 @@ defineExpose({
|
||||
|
||||
onMounted(() => {
|
||||
if (!languages.value.includes(codeStore.code.language)) {
|
||||
codeStore.code.language = "Python3"
|
||||
// 回退到题目支持的第一种语言(如 SQL 题只有 "SQL",硬编码 Python3 会被后端拒绝)
|
||||
codeStore.code.language = languages.value[0] ?? "Python3"
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@@ -175,6 +176,7 @@ onMounted(() => {
|
||||
|
||||
<template v-if="codeStore.code.language !== 'Flowchart'">
|
||||
<IconButton
|
||||
v-if="codeStore.code.language !== 'SQL'"
|
||||
icon="streamline-ultimate-color:business-lucky-cat"
|
||||
tip="自测猫"
|
||||
@click="goTestCat"
|
||||
|
||||
@@ -130,6 +130,16 @@ onBeforeUnmount(() => {
|
||||
watch(isMobile, (value) => {
|
||||
if (value) screenModeStore.resetScreenMode()
|
||||
})
|
||||
|
||||
// SQL 题不支持"自测"模式(外部代码运行器无法执行 SQL),切到该屏时自动跳到下一模式
|
||||
watch(
|
||||
() => screenModeStore.isCodeOnlyMode,
|
||||
(codeOnly) => {
|
||||
if (codeOnly && problem.value?.languages.includes("SQL")) {
|
||||
screenModeStore.switchScreenMode()
|
||||
}
|
||||
},
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user