:fix:修改题目类型

This commit is contained in:
zty 2024-05-30 17:18:22 +08:00
parent 571a48c1fb
commit f09effbcb0
1 changed files with 2 additions and 1 deletions

View File

@ -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