I'm looking to read a JSON file and use that information to create a multiple choice quiz. I'm just having trouble understanding how to actually read it in from a JSON file. I've managed to read in the number of questions right but that is all.
This is currently the layout of my JSON file:
{
"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 Conor love?",
"options": [
"Breaking curbs",
"Breathing",
"Having shit football opinions",
"Being from Carlow"
],
"answer": 1
},
{
"question": "Who is the best footballer ever?",
"options": [
"Eric Dier",
"Emile Heskey",
"Bobby Zamora",
"Phil Jones"
],
"answer": 4
}
]
}