一款基于间隔重复算法的刷题应用,帮助你高效记忆和掌握题目。支持判断题、单选题、多选题三种题型。
构建后生成单个 HTML 文件,方便分享和离线使用。
# 安装依赖
npm install
# 开发模式
npm run dev
# 构建生产版本(生成 dist/index.html)
npm run build
# 预览生产版本
npm run preview
题库存储在 assets/questions.json 文件中。替换此文件即可使用自己的题库。
题库是一个 JSON 数组,每个元素是一道题目。支持三种题型:
{
"id": "judgment_1",
"type": "judgment",
"question": "这是一道判断题的题目内容",
"answer": true
}
| 字段 | 类型 | 说明 |
|---|---|---|
id |
string | 题目唯一标识,建议格式:judgment_序号 |
type |
string | 固定为 "judgment" |
question |
string | 题目内容 |
answer |
boolean | 正确答案,true 或 false |
{
"id": "single_1",
"type": "single",
"question": "这是一道单选题的题目内容",
"options": [
{ "text": "选项 A" },
{ "text": "选项 B" },
{ "text": "选项 C" },
{ "text": "选项 D" }
],
"answer": [0]
}
| 字段 | 类型 | 说明 |
|---|---|---|
id |
string | 题目唯一标识,建议格式:single_序号 |
type |
string | 固定为 "single" |
question |
string | 题目内容,支持换行符 \n |
options |
array | 选项数组,每个选项包含 text 字段 |
answer |
number[] | 正确答案的索引数组(从 0 开始),单选题只有一个元素 |
{
"id": "multiple_1",
"type": "multiple",
"question": "这是一道多选题的题目内容",
"options": [
{ "text": "选项 A" },
{ "text": "选项 B" },
{ "text": "选项 C" },
{ "text": "选项 D" }
],
"answer": [0, 2]
}
格式与单选题相同,区别在于 answer 数组可以包含多个索引。
[
{
"id": "judgment_1",
"type": "judgment",
"question": "地球是太阳系中最大的行星。",
"answer": false
},
{
"id": "single_1",
"type": "single",
"question": "以下哪个是 JavaScript 的包管理器?",
"options": [
{ "text": "pip" },
{ "text": "npm" },
{ "text": "cargo" },
{ "text": "gem" }
],
"answer": [1]
},
{
"id": "multiple_1",
"type": "multiple",
"question": "以下哪些是前端框架?",
"options": [
{ "text": "React" },
{ "text": "Django" },
{ "text": "Vue" },
{ "text": "Flask" }
],
"answer": [0, 2]
}
]
id 必须不同,否则会导致进度记录混乱answer 中的索引对应 options 数组的位置,第一个选项是 0\n**:题目内容中如需换行,使用 \n 转义字符assets/questions.json 后需要重新运行 npm run build如果更换了题库,建议清除浏览器中的学习进度:
或者在浏览器开发者工具的 Console 中执行:
localStorage.removeItem('quiz-state')
应用使用间隔重复算法来安排题目的复习,灵感来源于不背单词。
这些参数可以在应用设置中调整。
MIT