API Docs for: 0.5.1
Show:

File: addon/components/exp-lookit-preview-explanation/component.js

  1. import layout from './template';
  2. import ExpFrameBaseComponent from '../../components/exp-frame-base/component';
  3.  
  4. /**
  5. * @module exp-player
  6. * @submodule frames
  7. */
  8.  
  9. /**
  10. * A frame that to explain any blinding procedures to parents, and offer them the option to preview stimuli before the study. Two buttons allow the user to move forward: one goes to the next frame (if the parent wants to preview stimuli), and one skips the next frame and goes to the one after that (if the parent declins). Therefore, this frame should be followed by an {{#crossLink "ExpVideoPreview"}}{{/crossLink}} frame.
  11.  
  12. ```json
  13. "frames": {
  14. "my-video-preview-explanation": {
  15. "introBlock": {
  16. "text": "During the videos, we'll ask that you hold your child over your shoulder like this, so that you're facing face away from the screen."
  17. },
  18. "image": {
  19. "alt": "Father holding child looking over his shoulder",
  20. "src": "https://s3.amazonaws.com/lookitcontents/exp-physics/OverShoulder.jpg"
  21. },
  22. "kind": "exp-lookit-preview-explanation",
  23. "skipButtonText": "Skip preview",
  24. "previewButtonText": "I'd like to preview the videos",
  25. "id": "video-preview-explanation",
  26. "blocks": [
  27. {
  28. "text": "The reason we ask this is that your child is learning from you all the time. Even if he or she can't see where you're looking, you may unconsciously shift towards one side or the other and influence your child's attention. We want to make sure we're measuring your child's preferences, not yours!"
  29. },
  30. {
  31. "text": "If you'd like to see the videos your child will be shown, you can take a look ahead of time now. It's important that you preview the videos without your child, so that the videos will still be new to them."
  32. }
  33. ],
  34. "showPreviousButton": true
  35. }
  36. }
  37.  
  38. * ```
  39. * @class ExpLookitPreviewExplanation
  40. * @extends ExpFrameBase
  41. */
  42.  
  43. export default ExpFrameBaseComponent.extend({
  44. type: 'exp-lookit-preview-explanation',
  45. layout: layout,
  46. meta: {
  47. name: 'ExpLookitPreviewExplanation',
  48. description: 'Let parents know about blinding, give option to preview videos.',
  49. parameters: {
  50. type: 'object',
  51. properties: {
  52. /**
  53. * A unique identifier for this item
  54. *
  55. * @property {String} id
  56. */
  57. id: {
  58. type: 'string',
  59. description: 'A unique identifier for this item'
  60. },
  61. /**
  62. * Whether to show a 'previous' button
  63. *
  64. * @property {Boolean} showPreviousButton
  65. * @default true
  66. */
  67. showPreviousButton: {
  68. type: 'boolean',
  69. default: true
  70. },
  71. /**
  72. * Array of text blocks (paragraphs) to display after the image.
  73. *
  74. * @property {Object} blocks
  75. * @param {String} title title to display
  76. * @param {String} text paragraph of text
  77. * @param {Boolean} emph whether to bold this paragraph
  78. */
  79. blocks: {
  80. type: 'array',
  81. items: {
  82. type: 'object',
  83. properties: {
  84. title: {
  85. type: 'string'
  86. },
  87. text: {
  88. type: 'string'
  89. },
  90. emph: {
  91. type: 'boolean'
  92. }
  93. }
  94. },
  95. default: []
  96. },
  97. /**
  98. * Object specifying first block of text (pre-image) to display.
  99. *
  100. * @property {Object} introBlock
  101. * @param {String} title title to display
  102. * @param {String} text paragraph of text
  103. * @param {Boolean} emph whether to bold this paragraph
  104. */
  105. introBlock: {
  106. type: 'object',
  107. properties: {
  108. title: {
  109. type: 'string'
  110. },
  111. text: {
  112. type: 'string'
  113. },
  114. emph: {
  115. type: 'boolean'
  116. }
  117. }
  118. },
  119. /**
  120. * Image to display after the intro block. (Displayed centered,
  121. * with border, max height 220px.) E.g., a picture of a parent
  122. * holding a child looking over their shoulder.
  123. *
  124. * @property {Object} image
  125. * @param {String} src URL of image
  126. * @param {String} alt alt-text
  127. */
  128. image: {
  129. type: 'object',
  130. properties: {
  131. src: {
  132. type: 'string'
  133. },
  134. alt: {
  135. type: 'string'
  136. }
  137. }
  138. },
  139. /**
  140. * Text to display on the button to go to the next frame
  141. *
  142. * @property {String} previewButtonText
  143. * @default 'I\'d like to preview the videos'
  144. */
  145. previewButtonText: {
  146. type: 'string',
  147. default: 'I\'d like to preview the videos'
  148. },
  149. /**
  150. * Text to display on the button to skip the next frame
  151. *
  152. * @property {String} skipButtonText
  153. * @default 'Skip preview'
  154. */
  155. skipButtonText: {
  156. type: 'string',
  157. default: 'Skip preview'
  158. }
  159. }
  160. },
  161. data: {
  162. type: 'object',
  163. properties: {
  164. // define data structure here
  165. }
  166. }
  167. },
  168. actions: {
  169. skipone: function() {
  170. this.get('skipone')();
  171. }
  172. }
  173. });
  174.