feat(main.py): 添加成绩最近一次更新时间显示功能
This commit is contained in:
@@ -247,7 +247,9 @@ else:
|
|||||||
# 输出响应内容
|
# 输出响应内容
|
||||||
run_log += f"{response_text}"
|
run_log += f"{response_text}"
|
||||||
else:
|
else:
|
||||||
|
last_submission_time = get_grade(student_client, output_type="last_submission_time")
|
||||||
run_log += "成绩未更新"
|
run_log += "成绩未更新"
|
||||||
|
run_log += f"最近一次更新时间:{last_submission_time}"
|
||||||
|
|
||||||
# 更新info.txt
|
# 更新info.txt
|
||||||
if run_count == 2:
|
if run_count == 2:
|
||||||
|
|||||||
@@ -96,6 +96,9 @@ def get_grade(student_client, output_type="none"):
|
|||||||
f"------"
|
f"------"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
last_submission_time = sorted_grade[0]["submission_time"]
|
||||||
|
print(last_submission_time)
|
||||||
|
|
||||||
if output_type == "grade":
|
if output_type == "grade":
|
||||||
return grade
|
return grade
|
||||||
elif output_type == "gpa":
|
elif output_type == "gpa":
|
||||||
@@ -104,6 +107,8 @@ def get_grade(student_client, output_type="none"):
|
|||||||
return percentage_gpa
|
return percentage_gpa
|
||||||
elif output_type == "integrated_grade_info":
|
elif output_type == "integrated_grade_info":
|
||||||
return integrated_grade_info
|
return integrated_grade_info
|
||||||
|
elif output_type == "last_submission_time":
|
||||||
|
return last_submission_time
|
||||||
else:
|
else:
|
||||||
return "获取成绩:参数缺失"
|
return "获取成绩:参数缺失"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user