Skip to content

Commit

Permalink
Merge pull request #413 from lookit/develop
Browse files Browse the repository at this point in the history
* Update docs template (#412)
* Fix/309 ajv compile frame schema error (#328)
* Add error catching/logging for recording start and stop/upload problems (#402)
* Replace links to old docs site with current links (#416)

---------

Co-authored-by: Victor Antoine <[email protected]>
  • Loading branch information
becky-gilbert and Vantoine2019 authored Nov 22, 2024
2 parents afb2fda + 9e8b47f commit bd01dd8
Show file tree
Hide file tree
Showing 20 changed files with 468 additions and 290 deletions.
8 changes: 7 additions & 1 deletion _styles/elf.css → _static/css/elf.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
img {
border: thin solid gray !important;
box-shadow: 3px 3px 3px #ccc;
margin-bottom: 1em;
}

div.version {
margin-left: 1.5em;
color: gray;
Expand All @@ -18,7 +24,7 @@ nav#toggle-lookit-frameplayer li {
border: thin solid whitesmoke;
padding: 10px 10px .5em 12px;
border-width: 1px 1px 0px 1px;
margin: 0 10px 0 0;
margin: 0;
border-radius: 20px 8px 0px 0px;
background-color: #343131;
}
Expand Down
3 changes: 3 additions & 0 deletions _static/js/links_in_new_tab.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$(document).ready(function () {
$('a[href^="http://"], a[href^="https://"]').not('a[class*=internal]').attr('target', '_blank');
});
59 changes: 59 additions & 0 deletions _templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{%- extends "!layout.html" %}

{% block sidebartitle %}

{# From the sphinx-rtd-theme layout: https://github.com/simonw/sphinx_rtd_theme/blob/master/sphinx_rtd_theme/layout.html #}

{% if logo and theme_logo_only %}
<a href="{{ theme_logo_url or pathto(master_doc) }}">
{% else %}
<a href="{{ theme_logo_url or pathto(master_doc) }}" class="icon icon-home"> {{ project }}
{% endif %}

{% if logo %}
{# Not strictly valid HTML, but it's the only way to display/scale
it properly, without weird scripting or heaps of work
#}
<img src="{{ pathto('_static/' + logo, 1) }}" class="logo" alt="{{ _('Logo') }}"/>
{% endif %}
</a>

{% if theme_display_version %}
{%- set nav_version = version %}
{% if READTHEDOCS and current_version %}
{%- set nav_version = current_version %}
{% endif %}
{% if nav_version %}
<div class="version">
{{ nav_version }}
</div>
{% endif %}
{% endif %}

{% include "searchbox.html" %}

{# From Kim's forked RTD theme: https://github.com/kimberscott/sphinx-rtd-theme-frameplayer #}
<div id="toggle-tab-container" style="position: relative;">
<nav id="toggle-lookit-frameplayer">
<ul>
<li><a href="https://lookit.readthedocs.io" class="icon icon-home"> CHS </a></li>
<li id="selected">
{% if logo and theme_logo_only %}
<a href="{{ pathto(master_doc) }}">
{% else %}
<a href="{{ pathto(master_doc) }}" class="fa fa-puzzle-piece"> Lookit EFP
{% endif %}
{% if logo %}
{# Not strictly valid HTML, but it's the only way to display/scale
it properly, without weird scripting or heaps of work
#}
<img src="{{ pathto('_static/' + logo, 1) }}" class="logo" alt="{{ _('Logo') }}"/>
{% endif %}
</a>
</li>
<li><a href="https://lookit.readthedocs.io/projects/chs-jspsych/" class="fa fa-puzzle-piece"> jsPsych </a></li>
</ul>
</nav>
</div>

{% endblock %}
1 change: 0 additions & 1 deletion _themes/sphinx_rtd_theme
Submodule sphinx_rtd_theme deleted from 0ed829
12 changes: 8 additions & 4 deletions app/components/exp-frame-base/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ let ExpFrameBase = Ember.Component.extend(FullScreen, SessionRecord, {
}
}
catch (error) {
console.error(`Failed to compile frameSchemaProperties to use for validating researcher usage of frame type '${this.get('kind')}.`);
console.error(`Failed to compile frameSchemaProperties to use for validating researcher usage of frame type '${this.get('kind')}'. Compile error message='${error.message}`);
}

// Set the language (do this after generating properties to allow use of a generated language property)
Expand Down Expand Up @@ -714,9 +714,13 @@ let ExpFrameBase = Ember.Component.extend(FullScreen, SessionRecord, {
_this.sendAction('next', frameIndex);
} else {
this.get('session').set('recordingInProgress', false);
this.stopSessionRecorder().finally(() => {
_this.sendAction('next', frameIndex);
});
// Error catching/logging for stopping/upload problems is
// handled inside stopSessionRecorder. The finally callback ensures that the
// participant moves on after the stop promise is no longer pending.
this.stopSessionRecorder()
.finally(() => {
_this.sendAction('next', frameIndex);
});
}
} else {
this.sendAction('next', frameIndex);
Expand Down
36 changes: 18 additions & 18 deletions app/components/exp-lookit-calibration/doc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -269,24 +269,24 @@ rename ``calibrationAudioSources`` and ``calibrationVideoSources``, and remove t
.. code:: javascript
"sample-physics-calibration": {
"kind": "exp-lookit-calibration", <-- change the "kind"
"baseDir": "https://www.mit.edu/~kimscott/placeholderstimuli/", <-- leave this the same
"audioTypes": [ <-- leave this the same
"kind": "exp-lookit-calibration", // <-- change the "kind"
"baseDir": "https://www.mit.edu/~kimscott/placeholderstimuli/", // <-- leave this the same
"audioTypes": [ // <-- leave this the same
"ogg",
"mp3"
],
"videoTypes": [ <-- leave this the same
"videoTypes": [ // <-- leave this the same
"webm",
"mp4"
],
"calibrationLength": 3000, <-- leave this the same
"calibrationAudio": "chimes", <-- just rename from "calibrationAudioSources"
"calibrationVideo": "attentiongrabber", <-- just rename from "calibrationVideoSources"
"calibrationLength": 3000, // <-- leave this the same
"calibrationAudio": "chimes", // <-- just rename from "calibrationAudioSources"
"calibrationVideo": "attentiongrabber", // <-- just rename from "calibrationVideoSources"
"pauseAudio": "pause", <-- leave these the same
"pauseAudio": "pause", // <-- leave these the same
"unpauseAudio": "return_after_pause",
"pauseVideo": "attentiongrabber" <-- just rename from "attnSources"
"pauseVideo": "attentiongrabber" // <-- just rename from "attnSources"
}
If your old frame defined ``calibrationPositions``, you can leave that the same too. Otherwise this will continue to
Expand Down Expand Up @@ -341,22 +341,22 @@ You can change it to an ``exp-lookit-calibration`` frame just by changing the ``
.. code:: javascript
"sample-trial": {
"kind": "exp-lookit-calibration", <-- change the "kind"
"baseDir": "https://s3.amazonaws.com/lookitcontents/labelsconcepts/", <-- leave this the same
"audioTypes": [ <-- leave this the same
"kind": "exp-lookit-calibration", // <-- change the "kind"
"baseDir": "https://s3.amazonaws.com/lookitcontents/labelsconcepts/", // <-- leave this the same
"audioTypes": [ // <-- leave this the same
"ogg",
"mp3"
],
"videoTypes": [ <-- leave this the same
"videoTypes": [ // <-- leave this the same
"webm",
"mp4"
],
"calibrationLength": 0, <-- leave this the same
"calibrationAudio": "chimes", <-- leave this the same
"calibrationVideo": "attentiongrabber", <-- leave this the same
"calibrationLength": 0, // <-- leave this the same
"calibrationAudio": "chimes", // <-- leave this the same
"calibrationVideo": "attentiongrabber", // <-- leave this the same
"pauseAudio": "pause", <-- leave these the same
"pauseAudio": "pause", // <-- leave these the same
"unpauseAudio": "return_after_pause",
"pauseVideo": "attentiongrabber" <-- copy this from announcementVideo
"pauseVideo": "attentiongrabber" // <-- copy this from announcementVideo
}
4 changes: 2 additions & 2 deletions app/components/exp-lookit-change-detection/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,14 @@ export default ExpFrameBaseComponent.extend(VideoRecord, PauseUnpause, ExpandAss
* @attribute leftSequence
*/
leftSequence: {
type: 'Object'
type: 'object'
},
/**
* Sequence of images shown on the right
* @attribute rightSequence
*/
rightSequence: {
type: 'Object'
type: 'object'
},
videoId: {
type: 'string'
Expand Down
2 changes: 1 addition & 1 deletion app/components/exp-lookit-images-audio/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export default ExpFrameBaseComponent.extend(VideoRecord, PauseUnpause, ExpandAss
* @attribute {Boolean} correctImageSelected
*/
correctImageSelected: {
type: 'Boolean'
type: 'boolean'
},
/**
* Source URL of audio played, if any. If multiple sources provided (e.g.
Expand Down
26 changes: 13 additions & 13 deletions app/components/exp-lookit-images-audio/doc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -676,13 +676,13 @@ To create the test trial portion as an exp-lookit-images-audio frame, we will:
.. code:: javascript
"test-trial": {
"kind": "exp-lookit-images-audio", <-- update the "kind"
"baseDir": "https://s3.amazonaws.com/lookitcontents/labelsconcepts/", <-- keep this the same
"audioTypes": [ <-- keep this the same
"kind": "exp-lookit-images-audio", // <-- update the "kind"
"baseDir": "https://s3.amazonaws.com/lookitcontents/labelsconcepts/", // <-- keep this the same
"audioTypes": [ // <-- keep this the same
"ogg",
"mp3"
],
"videoTypes": [ <-- keep this the same
"videoTypes": [ // <-- keep this the same
"webm",
"mp4"
],
Expand All @@ -700,17 +700,17 @@ To create the test trial portion as an exp-lookit-images-audio frame, we will:
...
"images": [
{
"id": "left" <-- you can actually name this whatever you want
"id": "left", // <-- you can actually name this whatever you want
"src": "stapler_test_02.jpg", <-- "leftImage"
"position": "left"
},
{
"id": "right" <-- you can actually name this whatever you want
"src": "novel_02.jpg", <-- "rightImage"
"id": "right", // <-- you can actually name this whatever you want
"src": "novel_02.jpg", // <-- "rightImage"
"position": "right"
}
],
"audio": "400Hz_tones" <-- "testAudio"
"audio": "400Hz_tones" // <-- "testAudio"
}
Note that it is not yet possible to make the audio loop. If you need audio to loop, for now please create a version
Expand All @@ -726,17 +726,17 @@ To create the test trial portion as an exp-lookit-images-audio frame, we will:
...
"images": [
{
"id": "left" <-- you can actually name this whatever you want
"src": "POSSIBLEIMAGES#1", <-- "POSSIBLEIMAGES#leftImageIndex
"id": "left", // <-- you can actually name this whatever you want
"src": "POSSIBLEIMAGES#1", // <-- "POSSIBLEIMAGES#leftImageIndex
"position": "left"
},
{
"id": "right" <-- you can actually name this whatever you want
"src": "POSSIBLEIMAGES#0", <-- "POSSIBLEIMAGES#rightImageIndex
"id": "right", // <-- you can actually name this whatever you want
"src": "POSSIBLEIMAGES#0", // <-- "POSSIBLEIMAGES#rightImageIndex
"position": "right"
}
],
"audio": "400Hz_tones" <-- "testAudio",
"audio": "400Hz_tones", // <-- "testAudio",
"parameters": {
"POSSIBLEIMAGES": ["novel_02.jpg", "stapler_test_02.jpg"]
}
Expand Down
2 changes: 1 addition & 1 deletion app/components/exp-lookit-instruction-video/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export default ExpFrameBaseComponent.extend(ExpandAssets, {
},

requireWatchOrRead: {
type: 'Boolean',
type: 'boolean',
description: 'Whether to require that the participant watches the video (or reads the whole transcript) to move on',
default: true
},
Expand Down
Loading

0 comments on commit bd01dd8

Please sign in to comment.