diff --git a/client/src/views/exam/questionChoose.vue b/client/src/views/exam/questionChoose.vue index 2c2e06b..b5114f3 100644 --- a/client/src/views/exam/questionChoose.vue +++ b/client/src/views/exam/questionChoose.vue @@ -182,8 +182,8 @@ }); }, getQuestioncatAll() { - getQuestioncatList().then(response => { - this.questioncatData = response.data.results; + getQuestioncatList({page:0}).then(response => { + this.questioncatData = response.data; }); }, changeSort(val) { diff --git a/client/src/views/exam/testPaperCreate.vue b/client/src/views/exam/testPaperCreate.vue index 8662e4e..4d84043 100644 --- a/client/src/views/exam/testPaperCreate.vue +++ b/client/src/views/exam/testPaperCreate.vue @@ -230,9 +230,9 @@ ); }, }, - created() { - this.getQuestioncat(); - }, + // created() { + // this.getQuestioncat(); + // }, methods: { updateQuestion(data){ this.qDialog = false; @@ -243,12 +243,12 @@ this.qid = item.id; this.currentEditIndex = index; }, - getQuestioncat() { - getQuestioncatList({page:0}).then(response => { - this.workscopeData = response.data; - this.type_list = response.data; - }); - }, + // getQuestioncat() { + // getQuestioncatList({page:0}).then(response => { + // this.workscopeData = response.data; + // this.type_list = response.data; + // }); + // }, handleChoose1(){ this.impDialogVisible = true; }, diff --git a/server/apps/exam/exports.py b/server/apps/exam/exports.py index 9558373..f27b202 100644 --- a/server/apps/exam/exports.py +++ b/server/apps/exam/exports.py @@ -17,6 +17,9 @@ def export_question(questions:object): row = ws1.row_dimensions[1] row.font = Font(bold=True) for i in questions: + if not i.questioncat: + print(f"没有分类{i.name}") + continue ws1.append([i.questioncat.name, i.type, i.name, json.dumps(i.options, ensure_ascii=False), ''.join(sorted(i.right)), i.resolution]) filename = 'questions' + datetime.now().strftime("%Y%m%d%H%M%S") +'.xlsx' path = '/media/temp/'