Skip to content

Commit

Permalink
allow specification of debriefing text in exp-lookit-exit-survey usin…
Browse files Browse the repository at this point in the history
…g text-blocks
  • Loading branch information
Kim Scott committed Dec 5, 2020
1 parent 07b4edf commit 72decea
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 59 deletions.
64 changes: 10 additions & 54 deletions app/components/exp-lookit-exit-survey/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import Ember from 'ember';
import ExpFrameBaseComponent from '../exp-frame-base/component';
import FullScreen from '../../mixins/full-screen';

/**
* @module exp-player
* @submodule frames
*/

const Validations = buildValidations({
birthDate: validator('presence', {
presence: true,
Expand All @@ -28,30 +23,8 @@ const Validations = buildValidations({
})
});

/**
/*
Standard exit survey for Lookit studies: confirm participant birthdate, ask user for video sharing permission level & Databrary sharing, option to withdraw, freeform comments, debriefing/thank you text. Leaves fullscreen mode.
```json
"frames": {
"my-exit-survey": {
"kind": "exp-lookit-exit-survey",
"debriefing": {
"title": "Thank you!",
"text": "Learning how children react to ducks will help scientists design better rubber ducks.",
"image": {
"src": "https://s3.amazonaws.com/lookitcontents/ducks/duck.png",
"alt": "Very cute duck"
}
}
}
}
```
@class Exp-lookit-exit-survey
@extends Exp-frame-base
@uses Full-screen
@uses Validations
*/

export default ExpFrameBaseComponent.extend(Validations, FullScreen, {
Expand All @@ -60,16 +33,6 @@ export default ExpFrameBaseComponent.extend(Validations, FullScreen, {
frameType: 'EXIT',
fullScreenElementId: 'experiment-player',
frameSchemaProperties: {
/**
Object specifying information to show on second page of exit survey, before returning to main Lookit site.
@property {Object} debriefing
@param {String} title Title of debriefing page
@param {String} text Paragraph to show as debriefing
@param {Object} image Object specifying source URL [src] & alt-text [alt] for any image to show during debriefing (optional). Example: `{
"src": "https://s3.amazonaws.com/lookitcontents/ducks/duck.png",
"alt": "Very cute duck"
}`
*/
debriefing: {
type: 'object',
properties: {
Expand All @@ -90,15 +53,13 @@ export default ExpFrameBaseComponent.extend(Validations, FullScreen, {
type: 'string'
}
}
},
blocks: {
type: 'array',
default: []
}
}
},
/**
* Whether to show a 'share this study on Facebook' button
*
* @property {Boolean} showShareButton
* @default true
*/
showShareButton: {
type: 'boolean',
description: 'Whether to show a \'share this study on Facebook\' button',
Expand All @@ -115,39 +76,34 @@ export default ExpFrameBaseComponent.extend(Validations, FullScreen, {
data: {
type: 'object',
properties: {
/**
/*
* Child's birthdate as entered into exit survey; timestamp string starting YYYY-mm-dd.
* @attribute birthDate
*/
birthDate: {
type: 'string',
default: null
},
/**
/*
* Whether data can be shared with Databrary: 'yes' or 'no'
* @attribute databraryShare
*/
databraryShare: {
type: 'string'
},
/**
/*
* Video privacy level: 'private', 'scientific', or 'public'
* @attribute useOfMedia
*/
useOfMedia: {
type: 'string'
},
/**
/*
* Whether the the box to withdraw video data is checked
* @attribute withdrawal
*/
withdrawal: {
type: 'boolean',
default: false
},
/**
/*
* Freeform comments entered by parent
* @attribute feedback
*/
feedback: {
type: 'string',
Expand Down
32 changes: 27 additions & 5 deletions app/components/exp-lookit-exit-survey/doc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,33 @@ This frame will display the exit survey and a debriefing page about the Lookit p
"kind": "exp-lookit-exit-survey",
"debriefing": {
"title": "Thank you!",
"text": "PLACEHOLDER DEBRIEFING TEXT. SEE DOCS FOR ADVICE ON WHAT TO INCLUDE HERE.",
"image": {
"src": "https://s3.amazonaws.com/lookitcontents/ducks/duck.png",
"alt": "Very cute duck"
}
"blocks": [
{
"text": "THIS IS ALL JUST PLACEHOLDER DEBRIEFING TEXT. SEE DOCS FOR ADVICE ON WHAT TO INCLUDE HERE.",
"listblocks": [
{
"text": "Suscipit adipiscing bibendum est ultricies integer quis auctor."
},
{
"text": "Imperdiet sed euismod nisi porta lorem mollis."
},
{
"text": "Sollicitudin tempor id eu nisl nunc mi."
}
]
},
{
"title": "Nulla porttitor",
"image": {
"src": "https://www.mit.edu/~kimscott/placeholderstimuli/img/apple.jpg",
"alt": "Sample image your child saw of an apple"
}
},
{
"title": "Your gift card will arrive in 2-3 days",
"text": "Suscipit adipiscing bibendum est ultricies integer quis auctor."
}
]
}
}
Expand Down
7 changes: 7 additions & 0 deletions app/components/exp-lookit-exit-survey/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@
{{#if debriefing.text}}
{{exp-format debriefing.text}}
{{/if}}

{{#if debriefing.blocks}}
{{#each debriefing.blocks as |textBlock|}}
{{exp-text-block block=textBlock}}
{{/each}}
{{/if}}

</p>

<hr>
Expand Down

0 comments on commit 72decea

Please sign in to comment.