Skip to content

Commit

Permalink
Merge pull request #241 from lookit/feature/239-allow-mandatory-preview
Browse files Browse the repository at this point in the history
provide `requirePreview` option on exp-lookit-stimuli-preview frame
  • Loading branch information
Kim Scott committed Apr 9, 2021
2 parents 514cba1 + bd546f3 commit a0f814b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
5 changes: 5 additions & 0 deletions app/components/exp-lookit-stimuli-preview/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ export default ExpFrameBaseComponent.extend(VideoRecord, ExpandAssets, {
default: true
},

requirePreview: {
type: 'boolean',
default: false
},

blocks: {
type: 'array',
items: {
Expand Down
4 changes: 4 additions & 0 deletions app/components/exp-lookit-stimuli-preview/doc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Example
"kind": "exp-lookit-stimuli-preview",
"doRecording": true,
"skipButtonText": "Skip preview",
"requirePreview": false,
"previewButtonText": "I'd like to preview the videos",
"blocks": [
{
Expand Down Expand Up @@ -103,6 +104,9 @@ blocks [Array]
previewButtonText [String | ``'I\'d like to preview the videos'``
Text on the preview button user clicks to proceed to stimuli/images

requirePreview [Boolean | ``false``]
Whether to require previewing the stimuli. If true, no button to skip preview is provided.

skipButtonText [String | ``'Skip preview'``]
Text to display on the button to skip the next frame

Expand Down
10 changes: 6 additions & 4 deletions app/components/exp-lookit-stimuli-preview/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@
{{#if prompt}}

<div class="row exp-controls col-md-12">
{{#if showPreviousButton}}
<button type="button" class="btn btn-default pull-left" {{ action "previous" }} > {{t "Previous" }}</button>
{{/if}}
<button type="button" class="btn btn-primary pull-right" {{ action "next" }} > {{skipButtonText}} </button>
{{#unless requirePreview}}
<button type="button" class="btn btn-primary pull-right" {{ action "next" }} > {{skipButtonText}} </button>
{{/unless}}
</div>

<div class="exp-controls col-md-12 row">
{{#if showPreviousButton}}
<button type="button" class="btn btn-default pull-left" {{ action "previous" }} > {{t "Previous" }}</button>
{{/if}}
<button type="button" class="btn btn-success pull-right" disabled={{recorderSettingUp}} {{action "accept"}}>
{{previewButtonText}}
{{#if recorderSettingUp}} ({{t "please wait, setting up" }}...){{/if}}
Expand Down

0 comments on commit a0f814b

Please sign in to comment.