获取答题详情
2026/2/11小于 1 分钟
获取答题详情
获取指定考试指定学科的详细答题情况,包括大题、小题得分等信息。
方法定义
def get_answer_records(subject_data: Union[Subject, str], exam_data: Union[Exam, str] = "") -> AnswerRecord参数
| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
subject_data | Subject | str | - | 学科 ID、名称或 Subject 实例。 |
exam_data | Exam | str | "" | 目标考试。留空则为最新考试。 |
返回值
返回 AnswerRecord 对象。
示例代码
# 获取最新考试语文科目的答题详情
answer_record = student.get_answer_records("语文")
# 查看各大题得分
for topic in answer_record.topics:
print(f"题号: {topic.topic_number}")
print(f"得分: {topic.score} / {topic.full_score}")
# 查看小题详情
for sub_topic in topic.sub_topics:
print(f" 小题: {sub_topic.topic_number}")
print(f" 得分: {sub_topic.score}")
# 获取指定考试的答题详情
answer_record2 = student.get_answer_records("数学", "XX中学期中考试")返回示例
题号: 1
得分: 15.0 / 15.0
小题: 1
得分: 5.0
小题: 2
得分: 5.0
小题: 3
得分: 5.0
题号: 2
得分: 18.0 / 20.0