Advertisement
dermetfan

json question

Nov 25th, 2013
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. Try jsoneditoronline.org. This is what your JSON file should look like in order to work:
  2.  
  3. {
  4. "com.jorch.pokeMap.Characters.Pregunta": {
  5. "question1": {
  6. "question": "what is an class in java?",
  7. "answer": "is the abstraction of an object in the real world",
  8. "opciones": [
  9. "is an instance of a object",
  10. "i don't know",
  11. "is the abstraction of an object in te real world"
  12. ],
  13. "check": false
  14. },
  15. "question2": {
  16. "question": "what is an class in java?",
  17. "answer": "is the abstraction of an object in the real world",
  18. "opciones": [
  19. "is an instance of a object",
  20. "i don't know",
  21. "is the abstraction of an object in te real world"
  22. ],
  23. "check": false
  24. },
  25. "question3": {
  26. "question": "what is an class in java?",
  27. "answer": "is the abstraction of an object in the real world",
  28. "opciones": [
  29. "is an instance of a object",
  30. "i don't know",
  31. "is the abstraction of an object in te real world"
  32. ],
  33. "check": false
  34. },
  35. "question4": {
  36. "question": "what is an class in java?",
  37. "answer": "is the abstraction of an object in the real world",
  38. "opciones": [
  39. "is an instance of a object",
  40. "i don't know",
  41. "is the abstraction of an object in te real world"
  42. ],
  43. "check": false
  44. }
  45. }
  46. }
  47.  
  48. To make it simple, you can use arrays:
  49.  
  50. {
  51. "questions": [
  52. "what is your birthday",
  53. "how old are you",
  54. "what is your name"
  55. ]
  56. }
  57.  
  58. But of course you can also use an array of objects which allows to save more information with each question. This is actually what you did in your file.
  59.  
  60. {
  61. "question objects": [
  62. {
  63. "name": "birthday",
  64. "text": "what is your birthday"
  65. },
  66. {
  67. "name": "age",
  68. "text": "how old are you"
  69. },
  70. {
  71. "name": "name",
  72. "text": "what is your name"
  73. }
  74. ]
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement