Browse Source

一次答多个题

lizhen_gitee 5 months ago
parent
commit
ee9a1d85e5
1 changed files with 4 additions and 0 deletions
  1. 4 0
      application/api/controller/Question.php

+ 4 - 0
application/api/controller/Question.php

@@ -95,6 +95,10 @@ class Question extends Api
         if (!$user_questions) {
             $this->error('提交数据有误');
         }
+        //避免超次数
+        if(count($user_questions) + $count >= $exam_times_user_eday){
+            $this->error('今日答题次数用完了,明天再来吧');
+        }
         $questions_ids  = array_column($user_questions, 'id');         // 答题id
         $answers        = array_column($user_questions, 'answer');     // 用户答案