Browse Source

test_info: 修改数据结构

Signed-off-by: binren <zhangbr@elab-plus.com>
binren 5 years ago
parent
commit
48cd7459b0
1 changed files with 5 additions and 2 deletions
  1. 5 2
      test_info.py

+ 5 - 2
test_info.py

@@ -103,11 +103,14 @@ class TestInfo(object):
             answers.sort(key=lambda obj: obj[0])
             sub_question_data = []
             for sub_question_id, others in groupby(answers, key=lambda obj: obj[0]):
+                others_data = []
+                for ot in others:
+                    others_data.append([x for x in ot])
                 sub_question = {}
                 sub_question['id'] = sub_question_id
-                sub_question['题干'] = others[0][1]
+                sub_question['题干'] = others_data[0][1]
                 sub_option = []
-                for th in others:
+                for th in others_data:
                     sub_option.append([th[2], th[3], th[4]])
                 sub_question['option'] = sub_option
                 sub_option.append(sub_question)