> For the complete documentation index, see [llms.txt](https://liuxingran.gitbook.io/hdu-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://liuxingran.gitbook.io/hdu-api/apis/exam.md).

# 考试 API

此章节是关于考试 API 的描述。

## `Exam` objects

[`Exam`](/hdu-api/apis/exam.md#exam-objects) 对象提供了一系列考试信息 API。

**Constructor**:

*class* hdu\_api.**Exam**(*session*)

|    参数   |          type         | required | default |            备注            |
| :-----: | :-------------------: | :------: | :-----: | :----------------------: |
| session | objects `ExamSession` |   true   |    无    | 一个已初始化的 `ExamSession` 对象 |

**Class methods**:

* *classmethod* Exam.**grade**(*year, term, raw=False, dictionary=DEFAULT\_DICTIONARY*)

    学期成绩。
* *classmethod* Exam.**grade\_current**(*raw=False, dictionary=DEFAULT\_DICTIONARY*)

    本学期成绩。
* *classmethod* Exam.**level\_grade**(*raw=False, dictionary=DEFAULT\_DICTIONARY*)

    等级考试成绩，如 CET-4 成绩。
* *classmethod* Exam.**schedule**(*year, term, raw=False, dictionary=DEFAULT\_DICTIONARY*)

    考试安排。
* *classmethod* Exam.**schedule\_current**(*raw=False, dictionary=DEFAULT\_DICTIONARY*)

    本学期考试安排。
* *classmethod* Exam.**schedule\_make\_up**(*term, raw=False, dictionary=DEFAULT\_DICTIONARY*)

    补考安排。

参数说明：

* raw - 是否输出为原始格式
* dictionary - raw 为 true 时，使用该字典替换返回数据的 key
* year - 学年，格式如 '2018-2019'
* term - 学期，1 表示第一个学期，2 表示第二个学期

**Class attributes**:

* Exam.**session**

    `ExamSession` 对象。
