4
This commit is contained in:
+11
-3
@@ -482,8 +482,16 @@ func (r *QuestionService) PutQuestionTest(questionId int64, req requests.PutQues
|
||||
}
|
||||
|
||||
// 题目类型
|
||||
if req.QuestionType != question.QuestionType {
|
||||
questionData["question_type"] = req.QuestionType
|
||||
if req.QuestionType != "" {
|
||||
questionType, err := strconv.Atoi(req.QuestionType)
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
return false, errors.New("题目类型错误")
|
||||
}
|
||||
|
||||
if questionType != question.QuestionType {
|
||||
questionData["question_type"] = req.QuestionType
|
||||
}
|
||||
}
|
||||
|
||||
// 状态
|
||||
@@ -614,7 +622,7 @@ func (r *QuestionService) PutQuestionTest(questionId int64, req requests.PutQues
|
||||
}
|
||||
}
|
||||
|
||||
if req.QuestionType == 1 || req.QuestionType == 2 {
|
||||
if req.QuestionType == "1" || req.QuestionType == "2" {
|
||||
// 新增选项
|
||||
questionOptionDao := dao.QuestionOptionDao{}
|
||||
if req.Input1 != nil {
|
||||
|
||||
Reference in New Issue
Block a user