Usage
Download the source and add the text file in the same directory.
Then run
$ python main.py question.txt
Create metadata for questions
difficulty:basic,category:数学,subcategory:足し算
Add question
difficulty:basic,category:数学,subcategory:足し算
question:1+1=
options:1,2,3,4
answer:2
explanation:1+1=2
question:2+1=
options:1,2,3,4
answer:3
explanation:2+1=3
difficulty:basic,category:数学,subcategory:掛け算
question:2*1=
options:1,2,3,4
answer:2
explanation:2*1=2
difficulty:advance,category:歴史,subcategory:世界史
...
Result
{
"basic": [
{
"数学": [
{
"足し算": [
{
"question": "1+1=",
"options": [
"1",
"2",
"3",
"4"
],
"answer": 2,
"explanation": "1+1=2"
},
{
"question": "2+1=",
"options": [
"1",
"2",
"3",
"4"
],
"answer": 3,
"explanation": "2+1=3"
}
]
},
{
"掛け算": [
{
"question": "2*1=",
"options": [
"1",
"2",
"3",
"4"
],
"answer": 2,
"explanation": "2*1=2"
}
]
}
]
}
]
}