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() {
getQuestioncatList().then(response => {
this.questioncatData = response.data.results;
getQuestioncatList({page:0}).then(response => {
this.questioncatData = response.data;
});
},
changeSort(val) {

View File

@ -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;
},

View File

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