From f09effbcb0ec87583f6a4c0d6275d7d92b3899ff Mon Sep 17 00:00:00 2001 From: zty Date: Thu, 30 May 2024 17:18:22 +0800 Subject: [PATCH] =?UTF-8?q?:fix=EF=BC=9A=E4=BF=AE=E6=94=B9=E9=A2=98?= =?UTF-8?q?=E7=9B=AE=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/apps/exam/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/apps/exam/views.py b/server/apps/exam/views.py index 1b2848c..8a2df89 100644 --- a/server/apps/exam/views.py +++ b/server/apps/exam/views.py @@ -273,6 +273,7 @@ class PaperViewSet(ModelViewSet): @action(methods=['post'], detail=False, perms_map={'post': 'question'}, serializer_class=Serializer) def upload_paper(self, request): doc_path = request.data.get('doc_path') + question_type = request.data.get('question_type') excel_path = settings.BASE_DIR + "/media/default/question.xlsx" doc_path = settings.BASE_DIR + doc_path # excel_path = "C:\code\data\question.xlsx" @@ -284,7 +285,7 @@ class PaperViewSet(ModelViewSet): shutil.copy(excel_path, question_excel) excel_save_path = os.path.join(question_excel, os.path.basename(EXCEL_PATH)) # 解析word文档到excel - res = interpret_text(3, excel_save_path, doc_path) + res = interpret_text(3, excel_save_path, doc_path, question_type) ids = [] if res: # 将excel 入库并返回 queston_id