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