本服务提供与 OCS 网课助手兼容的题库查询接口,支持单选、多选、判断、填空与简答题,模糊匹配自动容错标点和题型前缀。下面是实时检索测试。
https://tk.xiaochenshops.cc/api.php在 OCS 的「题库配置」中粘贴后台生成的配置即可,无需改脚本。
登录管理后台,进入「API 对接」页。
复制生成的题库配置 JSON。
粘贴到 OCS 题库配置中并保存,即可搜题。
[
{
"url": "https://tk.xiaochenshops.cc/api.php",
"name": "小陈题库",
"method": "post",
"contentType": "json",
"data": {
"title": "${title}",
"type": "${type}",
"options": "${options}",
"answer_mode": "text"
},
"handler": "return (res)=> res.code === 1 ? res.results.map(r=>[r.question,r.answer]) : [res.msg, undefined]"
}
]