feat: 修改共享平台考试系统

This commit is contained in:
zty 2025-10-15 10:02:37 +08:00
parent f73762e62b
commit 6abd7c0c8c
3 changed files with 14 additions and 11 deletions

View File

@ -182,8 +182,8 @@
}); });
}, },
getQuestioncatAll() { getQuestioncatAll() {
getQuestioncatList().then(response => { getQuestioncatList({page:0}).then(response => {
this.questioncatData = response.data.results; this.questioncatData = response.data;
}); });
}, },
changeSort(val) { changeSort(val) {

View File

@ -230,9 +230,9 @@
); );
}, },
}, },
created() { // created() {
this.getQuestioncat(); // this.getQuestioncat();
}, // },
methods: { methods: {
updateQuestion(data){ updateQuestion(data){
this.qDialog = false; this.qDialog = false;
@ -243,12 +243,12 @@
this.qid = item.id; this.qid = item.id;
this.currentEditIndex = index; this.currentEditIndex = index;
}, },
getQuestioncat() { // getQuestioncat() {
getQuestioncatList({page:0}).then(response => { // getQuestioncatList({page:0}).then(response => {
this.workscopeData = response.data; // this.workscopeData = response.data;
this.type_list = response.data; // this.type_list = response.data;
}); // });
}, // },
handleChoose1(){ handleChoose1(){
this.impDialogVisible = true; this.impDialogVisible = true;
}, },

View File

@ -17,6 +17,9 @@ def export_question(questions:object):
row = ws1.row_dimensions[1] row = ws1.row_dimensions[1]
row.font = Font(bold=True) row.font = Font(bold=True)
for i in questions: 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]) 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' filename = 'questions' + datetime.now().strftime("%Y%m%d%H%M%S") +'.xlsx'
path = '/media/temp/' path = '/media/temp/'