Advertisement
fdiazb

Untitled

Jul 24th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. /***
  2. * MULTIPLE CHOICE SINGLE ANSWERS
  3. * @type {[*]}
  4. */
  5.  
  6. // Case: Single answer
  7.  
  8. var item = [
  9. {
  10. showText: true,
  11. showImage: false,
  12. allowMultiple: true,
  13. question: 'What is the Pikachu number?',
  14. answers: [
  15. {text: '25'},
  16. {text: '50'},
  17. {text: '150'}],
  18. correct: 0 // If is multiple, must be validate than correct.length == 1
  19. }
  20. ];
  21.  
  22. // Case: Multiple answer
  23.  
  24. var item2 = [
  25. {
  26. showText: true,
  27. showImage: false,
  28. allowMultiple: true,
  29. question: '4+5 = ?',
  30. answers: [
  31. {text: '9'},
  32. {text: '(10-1)'},
  33. {text: '-1'}],
  34. correct: [0, 1]
  35. }
  36. ];
  37.  
  38.  
  39. // Case: Including images
  40.  
  41. var item3 = [
  42. {
  43. showText: true,
  44. showImage: true,
  45. allowMultiple: true,
  46. question: '4+5 = ?',
  47. answers: [
  48. {text: '9', src: '3030303.png'},
  49. {text: '(10-1)', src: '3030302.png'},
  50. {text: '-1', src: '3030304.png'}],
  51. correct: [0, 1]
  52. }
  53. ];
  54.  
  55.  
  56.  
  57. /***
  58. * MULTIPLE CHOICE WITH MULTIPLE ANSWERS
  59. * @type {[*]}
  60. */
  61.  
  62. // Diferencias respecto a MULTIPLE CHOICE WITH SINGLE ANSWER
  63. // - correct no es un array, es un entero (que indica la posiciΓ³n del array).
  64.  
  65. var item = [
  66. {
  67. showText: true,
  68. showImage: false,
  69. allowMultiple: true,
  70. question: 'What is the Pikachu number?',
  71. answers: [
  72. {text: '25'},
  73. {text: '50'},
  74. {text: '150'}],
  75. correct: 0 // If is multiple, must be validate than correct.length == 1
  76. }
  77. ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement