У меня есть json-файл с вопросами и ответами по математике.
Cодержание файла:
{
"module": {
"number": 1,
"name": "Mathematics",
"questions": 30,
"revision": "2017-08-13"
},
"questions": [
{
"number": 1,
"question": "Eighteen thousandths, written as a decimal, is:",
"answers": [
"0.0018",
"0.018",
"0.18"
],
"correct_answer": 1
},
{
"number": 2,
"question": "The next number in the sequence <b>1, 3, 6, 10, </b> is:",
"answers": [
"12",
"13",
"14",
"15"
],
"correct_answer": 4
},
{
"number": 3,
"question": "PI is:",
"answers": [
"135.3",
"3.15",
"3.14",
"3.16"
],
"correct_answer": 3
},
{
"number": 4,
"question": "2-2*4 is:",
"answers": [
"4",
"0",
"8",
"6"
],
"correct_answer": 4
},
{
"number": 5,
"question": "10**2 is:",
"answers": [
"100",
"20",
"300",
"1000"
],
"correct_answer": 1
}
]
}
Вопрос, как работать с данными которые там есть? Мне нужно задавать юзеру вопросы и кемперить правильный ли ответ он дал.
number,question,answers, а на сервере получить от клиентаanswerи сопоставить сcorrect_answer– Andrei Khotko Apr 13 '21 at 10:26