选题添加最多次数
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import math
|
||||
import os
|
||||
import traceback
|
||||
|
||||
@@ -39,11 +40,13 @@ class DTGWorker(QObject):
|
||||
students = Student.load_from_xls(self.input_filepath)
|
||||
questions = Question.load_from_xls(self.input_question_filepath)
|
||||
|
||||
d = DocPaper(self.output_filename, template_path=resource_path("template/template.docx"))
|
||||
max_question_count = math.ceil(len(students) * 3 / len(questions))
|
||||
|
||||
d = DocPaper(self.output_filename, template_path=resource_path("template/template-2.docx"))
|
||||
for index, student in enumerate(students):
|
||||
if (p := int((index + 1) / len(students) * 100)) != 100:
|
||||
self.progress[int].emit(p)
|
||||
student.pick_question(questions)
|
||||
student.pick_question(questions, max_count=max_question_count)
|
||||
d.add_paper(course, student)
|
||||
d.save(self.output_filepath)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user