我希望读取 JSON 文件并使用该信息来创建多项选择测验。我只是无法理解如何从 JSON 文件中实际读取它。我已经设法读对了问题的数量,但仅此而已。
这是我的 JSON 文件的当前布局:
{
"numOfQues": 5,
"questions": [
{
"question": "Who is the US President?",
"options": [
"Joe Biden",
"Joe BIREN",
"Joe Momma",
"Joe Bein"
],
"answer": 2
},
{
"question": "Who scored the best goal in Puskas history?",
"options": [
"Erik Lamela",
"Son Heung-Min",
"Cristiano Ronaldo",
"Wayne Rooney"
],
"answer": 4
},
{
"question": "Where should Lamela really have finished?",
"options": [
"First",
"Second",
"Third",
"Fourth"
],
"answer": 3
},
{
"question": "What does …Run Code Online (Sandbox Code Playgroud)