feat: add teaching enhancement features
1. AI personalized hints after 3 failures (streaming SSE) 2. Submission error distribution panel in "my submissions" tab 3. Similar problem recommendations on AC or 3+ failures 4. Admin stuck problems analysis page Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,9 @@ export const useProblemStore = defineStore("problem", () => {
|
||||
const problem = ref<Problem | null>(null)
|
||||
const route = useRoute()
|
||||
|
||||
// 本次会话内累计的失败次数(与服务端 my_failed_count 叠加)
|
||||
const localFailCount = ref(0)
|
||||
|
||||
// ==================== 计算属性 ====================
|
||||
const languages = computed<LANGUAGE[]>(() => {
|
||||
if (route.name === "problem" && problem.value?.allow_flowchart) {
|
||||
@@ -18,11 +21,27 @@ export const useProblemStore = defineStore("problem", () => {
|
||||
return problem.value?.languages ?? []
|
||||
})
|
||||
|
||||
return {
|
||||
// 状态
|
||||
problem,
|
||||
const totalFailCount = computed(
|
||||
() => (problem.value?.my_failed_count ?? 0) + localFailCount.value,
|
||||
)
|
||||
|
||||
// 计算属性
|
||||
function incrementFailCount() {
|
||||
localFailCount.value++
|
||||
}
|
||||
|
||||
// 切题时重置
|
||||
watch(
|
||||
() => problem.value?.id,
|
||||
() => {
|
||||
localFailCount.value = 0
|
||||
},
|
||||
)
|
||||
|
||||
return {
|
||||
problem,
|
||||
localFailCount,
|
||||
languages,
|
||||
totalFailCount,
|
||||
incrementFailCount,
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user