Browse Source

Merge branch 'dongxiaoqin_0220'

dongxiaoqin 1 year ago
parent
commit
e08e8602c6
1 changed files with 7 additions and 0 deletions
  1. 7 0
      app/workerapi/controller/InterviewController.php

+ 7 - 0
app/workerapi/controller/InterviewController.php

@@ -226,12 +226,19 @@ class InterviewController extends BaseApiController
             foreach($data as &$item) {
                 $answer = $answers[$item['id']];
                 $item['options'] = preg_replace('/[^a-zA-Z]/', '', $item['options']);
+
+                //用户选项排序
+                $options = str_split($item['options']);
+                sort($options);
+                $item['options'] = implode('', $options);
+
                 if ($answer == '对' || $answer == '错') {
                     $item['options'] = $item['options'] == 'A' ? '对' : '错';
                 }
                 if ($item['options'] == $answer) {
                     $rights ++;
                 }
+                $item['answer'] = $answer;
             }
             if ($rights / count($data) >= 0.8) {
                 $result = $list3;