r/JavaScriptTips • • Sep 27 '22

JSON

Hello I need help, I have assignment to create quiz using JSON, here is data.json and I need to parse it to get quiz form like this, and after that i need to import local storage but that is not problem, problem is to parse it to create questions like this.

I don't have too much time to do this so can someone help me how to do this, thank you <3.

var json = '{"quiz": {"q1": {"question": "Which one is correct team name in NBA?","options": ["New York Bulls","Los Angeles Kings","Golden State Warriros","Huston Rocket"],"answer": "Huston Rocket"}, "q2": {"question": "Namaste is a traditional greeting in which Asian language?","options": ["Hindi","Mandarin","Nepalese","Thai"], "answer": "Hindi"},"q3": {"question": "The Spree river flows through which major European capital city?","options": ["Berlin","Paris","Rome","London"],"answer": "Berlin"},"q4": {"question": "Which famous artist had both a Rose Period and a Blue Period?","options": ["Pablo Picasso","Vincent van Gogh","Salvador Dalí","Edgar Degas"],"answer": "Pablo Picasso"}}}'

5 Upvotes

5 comments sorted by

View all comments

4

u/TeslaRanger Sep 27 '22

So, you want us to do your homework for you?

Would you like our lunch money too?

2

u/gerbs650 Sep 28 '22

No bro just share your GitHub with the guy /s