考试

获取已发布的考试列表

接口调用说明:

GET https://lxapi.lexiangla.com/cgi-bin/v1/exams

参数说明:

参数 是否必须 默认值 说明
sort id 排序参数,支持按考试的created_at排序

SDK封装方法使用示例:

$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->get('exams?per_page=2');

响应document

200 OK 状态码
{
    "data": [
        {
            "type": "exam",
            "id": "d7ded3ce97e711e9af2f0a58ac1303b9",
            "attributes": {
                "title": "乐享第一场考试",
                "started_at": "2019-06-04 15:34:00",
                "ended_at": "2019-06-29 15:34:00",
                "created_at": "2019-06-26 15:56:02",
                "staffs_count": 3117,
                "finished_staffs_count": 0,
                "status": "running"
            },
            "links": {
                "platform": "https://lexiangla.com/exams/d7ded3ce97e711e9af2f0a58ac1303b9"
            },
            "relationships": {
                "owner": {
                    "data": {
                        "type": "staff",
                        "id": "ThreeZhang"
                    }
                }
            }
        },
        {
            "type": "exam",
            "id": "865ff65493c811e9a1550a58ac130253",
            "attributes": {
                "title": "乐享第二场考试",
                "started_at": "2019-06-21 10:00:00",
                "ended_at": "2019-07-31 10:00:00",
                "created_at": "2019-06-21 10:01:46",
                "staffs_count": 3117,
                "finished_staffs_count": 3,
                "status": "running"
            },
            "links": {
                "platform": "https://km.lexiangla.com/exams/865ff65493c811e9a1550a58ac130253"
            },
            "relationships": {
                "owner": {
                    "data": {
                        "type": "staff",
                        "id": "FourLee"
                    }
                }
            }
        }
    ],
    "links": {
        "first": "https://lxapi.lexiangla.com/cgi-bin/v1/exams?per_page=2&page=1",
        "last": "https://lxapi.lexiangla.com/cgi-bin/v1/exams?per_page=2&page=176",
        "prev": null,
        "next": "https://lxapi.lexiangla.com/cgi-bin/v1/exams?per_page=2&page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 176,
        "path": "https://lxapi.lexiangla.com/cgi-bin/v1/exams",
        "per_page": 2,
        "to": 2,
        "total": 352
    },
    "included": [
        {
            "type": "staff",
            "id": "ThreeZhang",
            "attributes": {
                "name": "张三",
                "english_name": null
            }
        },
        {
            "type": "staff",
            "id": "FourLee",
            "attributes": {
                "name": "李四",
                "english_name": null
            }
        }
    ]
}

参数说明:

参数 说明
title 考试主题
started_at 考试开始时间
ended_at 考试截止时间
status 考试状态(running:进行中;end:考试结束;published:待考)
staffs_count 应考人数
finished_staffs_count 已考人数
created_at 创建时间

获取单场考试考生列表

接口调用说明:

GET https://lxapi.lexiangla.com/cgi-bin/v1/exams/{id}/staffs

参数说明:

参数 是否必须 默认值 说明
sort id 排序参数,支持按staff的id、考试得分result_score排序
id 要获取考试答卷情况的考试ID

SDK封装方法使用示例:

$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->get('exams/865ff65493c811e9a1550a58ac130253/staffs');

响应document

200 OK 状态码
{
    "data": [
        {
            "type": "staff",
            "id": "ThreeZhang",
            "attributes": {
                "name": "张三",
                "english_name": null,
                "organization": "开发组\\乐享开发",
                "event_status": "failed",
                "review_status": "unreviewed",
                "finish_at": "2019-06-21 16:54:14",
                "result_score": 50,
                "max_score_used_time": 20,
                "avg_used_time": 20
            }
        },
        {
            "type": "staff",
            "id": "FiveWang",
            "attributes": {
                "name": "王五",
                "english_name": null,
                "organization": "产品组",
                "event_status": "failed",
                "review_status": "unreviewed",
                "finish_at": "2019-06-21 15:38:40",
                "result_score": 20,
                "max_score_used_time": 20,
                "avg_used_time": 20
            }
        }
    ],
    "links": {
        "first": "https://lxapi.lexiangla.com/cgi-bin/v1/exams/865ff65493c811e9a1550a58ac130253/staffs?per_page=2&sort=-result_score&page=1",
        "last": "https://lxapi.lexiangla.com/cgi-bin/v1/exams/865ff65493c811e9a1550a58ac130253/staffs?per_page=2&sort=-result_score&page=1559",
        "prev": null,
        "next": "https://lxapi.lexiangla.com/cgi-bin/v1/exams/865ff65493c811e9a1550a58ac130253/staffs?per_page=2&sort=-result_score&page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1559,
        "path": "https://lxapi.lexiangla.com/cgi-bin/v1/exams/865ff65493c811e9a1550a58ac130253/staffs",
        "per_page": 2,
        "to": 2,
        "total": 3117
    }
}

参数说明:

参数 说明
name 考生姓名
english_name 考生英文名
organization 考生部门
event_status 考生答卷提交状态(waiting:待考;active:考试中;finished:已交卷;reexamining:重考中;passed:通过;failed:未通过)
review_status 考生答卷人工阅卷状态(reviewed:已阅卷;unreviewed:未阅卷)
finish_at 交卷时间
result_score 答卷得分
max_score_used_time 最高分用时,单位:秒数
avg_used_time 平均用时,适用于可重考的考试,单位:秒数

获取单个成员考试列表

接口调用说明:

GET https://lxapi.lexiangla.com/cgi-bin/v1/staffs/{id}/exams

参数说明:

参数 是否必须 默认值 说明
sort id 排序参数,支持按交卷时间finish_at、得分result_score排序
id 员工的企业微信ID

SDK封装方法使用示例:

$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->get('staffs/ThreeZhang/exams');

响应document

200 OK 状态码
{
    "data": [
        {
            "type": "exam",
            "id": "1b2b82a87dcb11e98df70a58ac1300a9",
            "attributes": {
                "title": "正常情况下--随机试卷30单选2分30多选3分",
                "started_at": "2019-05-24 10:24:00",
                "ended_at": "2019-06-02 10:24:00",
                "created_at": "2019-05-24 10:24:49",
                "status": "end",
                "event_status": "waiting",
                "review_status": "unreviewed",
                "finish_at": "2019-05-28 11:21:11",
                "result_score": 150,
                "max_score_used_time": 20,
                "avg_used_time": 20
            },
            "links": {
                "platform": "https://km.lexiangla.com/exams/1b2b82a87dcb11e98df70a58ac1300a9"
            }
        },
        {
            "type": "exam",
            "id": "2c7110827dcb11e989b70a58ac1300a9",
            "attributes": {
                "title": "可考10次固定试卷30单选2分30多选3分",
                "started_at": "2019-05-24 10:24:00",
                "ended_at": "2019-06-02 10:24:00",
                "created_at": "2019-05-24 10:25:18",
                "status": "end",
                "event_status": "waiting",
                "review_status": "unreviewed",
                "finish_at": "2019-05-24 14:39:02",
                "result_score": 150,
                "max_score_used_time": 20,
                "avg_used_time": 20
            },
            "links": {
                "platform": "https://km.lexiangla.com/exams/2c7110827dcb11e989b70a58ac1300a9"
            }
        }
    ],
    "links": {
        "first": "https://lxapi.lexiangla.com/cgi-bin/v1/staffs/v_wwdzhang/exams?per_page=2&sort=-result_score&page=1",
        "last": "https://lxapi.lexiangla.com/cgi-bin/v1/staffs/v_wwdzhang/exams?per_page=2&sort=-result_score&page=44",
        "prev": null,
        "next": "https://lxapi.lexiangla.com/cgi-bin/v1/staffs/v_wwdzhang/exams?per_page=2&sort=-result_score&page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 44,
        "path": "https://lxapi.lexiangla.com/cgi-bin/v1/staffs/v_wwdzhang/exams",
        "per_page": 2,
        "to": 2,
        "total": 87
    }
}

参数说明:

参数 说明
title 考试主题
started_at 考试开始时间
ended_at 考试截止时间
status 考试状态(running:进行中;end:考试结束;published:待考)
created_at 考试创建时间
event_status 考生答卷提交状态(waiting:待考;active:考试中;finished:已交卷;reexamining:重考中;passed:通过;failed:未通过)
review_status 考生答卷人工阅卷状态(reviewed:已阅卷;unreviewed:未阅卷)
finish_at 交卷时间
result_score 答卷得分
max_score_used_time 最高分用时,单位:秒数
avg_used_time 平均用时,适用于可重考的考试,单位:秒数