From ecc7c52314f3fd49d68c64df8346ef6fc9ce352e Mon Sep 17 00:00:00 2001 From: wucongxing8150 <815046773@qq.com> Date: Tue, 29 Jul 2025 16:08:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E9=A2=98=E5=BA=93?= =?UTF-8?q?=E4=B8=8D=E5=85=81=E8=AE=B8=E9=87=8D=E5=A4=8D=E7=9A=84=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E9=80=BB=E8=BE=9111?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/service/QuestionQa.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/service/QuestionQa.go b/api/service/QuestionQa.go index bb7720b..e965939 100644 --- a/api/service/QuestionQa.go +++ b/api/service/QuestionQa.go @@ -484,7 +484,11 @@ func (r *QuestionQaService) PutQuestionQa(qaId int64, req requests.PutQuestionQa if len(questions) < item.Quantity { tx.Rollback() - return false, errors.New("选题超出现有题目数量") + if len(notQuestionIds) > 0 { + return false, errors.New("因不允许重复选题超出现有题目数量") + } else { + return false, errors.New("选题超出现有题目数量") + } } for _, question := range questions {