修改界面

This commit is contained in:
2025-05-20 02:59:58 +08:00
parent 83b3790e8b
commit 9ca61d5092
13 changed files with 394 additions and 499 deletions
+12 -1
View File
@@ -22,6 +22,17 @@ class Question:
questions.append(Question(*line.strip('\n').split(',')))
return questions
@staticmethod
def load_from_xls(path: str) -> list['Question']:
questions = []
wb = load_workbook(path, read_only=True)
ws = wb.active
for row in ws.iter_rows(min_col=2, max_col=3, min_row=2, values_only=True):
if row[0] is None and row[1] is None:
break
questions.append(Question(*row))
return questions
@property
def no(self) -> str:
return self._no
@@ -112,4 +123,4 @@ class Course:
if __name__ == '__main__':
...
...