Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@
"chart_selected": "Selected {0}"
},
"qa": {
"recommended_repetitive_tips": "Duplicate questions exist",
"retrieve_error": "Model recommendation failed...",
"retrieve_again": "Retrieve Again",
"recently": "recently",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/ko-KR.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@
"chart_selected": "{0}개 선택됨"
},
"qa": {
"recommended_repetitive_tips": "중복된 문제가 존재합니다",
"retrieve_error": "모델 추천 문제 실패...",
"retrieve_again": "다시 가져오기",
"recently": "최근",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@
}
},
"datasource": {
"recommended_repetitive_tips": "存在重复问题",
"recommended_problem_tips": "自定义配置至少一个问题,每个问题2-200个字符",
"recommended_problem_configuration": "推荐问题配置",
"problem_generation_method": "问题生成方式",
Expand Down
11 changes: 11 additions & 0 deletions frontend/src/views/ds/RecommendedProblemConfigDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,29 @@ const closeDialog = () => {
const save = () => {
if (state.recommended.recommended_config == 2) {
let checkProblem = false
let repetitiveQuestion = false
if (state.recommended.recommendedProblemList.length === 0) {
checkProblem = true
}
const questions = new Set<string>()
state.recommended.recommendedProblemList.forEach((problem: RecommendedProblem): void => {
if (problem.question.length > 200 || problem.question.length < 2) {
checkProblem = true
}
if (questions.has(problem.question)) {
repetitiveQuestion = true
}
questions.add(problem.question)
})
if (checkProblem) {
ElMessage.error(t('datasource.recommended_problem_tips'))
return
}

if (repetitiveQuestion) {
ElMessage.error(t('datasource.recommended_repetitive_tips'))
return
}
}
recommendedApi
.save_recommended_problem({
Expand Down