Skip to content

Commit

Permalink
Merge pull request #229 from mpelz/patch-2
Browse files Browse the repository at this point in the history
Update random-parameter-set.rst
  • Loading branch information
Kim Scott committed Feb 24, 2021
2 parents 577189c + 9d255ea commit 5ce12d1
Showing 1 changed file with 71 additions and 2 deletions.
73 changes: 71 additions & 2 deletions app/randomizers/random-parameter-set.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ use the ``random-parameter-set`` randomizer:

- ``frameList``: this is just what it sounds like: a list of all the frames
that should be generated by this randomizer. Each frame is a JSON object
just like you would use in the overall schema, with two differences:
just like you would use in the overall schema, with three differences:

- Rather than giving each frame in the list its own name (e.g. "test_trial1"),
the frameList automatically generates these names for each of the frames
within it, so you can begin each frame with "kind": "exp-lookit-text", etc.
rather than nesting it under another identifier (examples of this can be found
below).

- You can define default properties, to share across all of the frames
generated by this randomizer, in the JSON object
Expand All @@ -56,7 +62,7 @@ use the ``random-parameter-set`` randomizer:
You can `determine the weights based on the child's age <https://lookit.github.io/lookit-frameplayer-docs/classes/Random-parameter-set.html#property_parameterSetWeights>`_, to maintain balanced conditions.) You can also `keep kids in the same condition across all sessions they complete, or rotate them through conditions in order <https://lookit.github.io/lookit-frameplayer-docs/classes/Random-parameter-set.html#property_conditionForAdditionalSessions>`_.


Example
Examples
~~~~~~~~~~~~~~~~~~~~~~~~~~

Let’s walk through an example of using this randomizer. Suppose we start
Expand Down Expand Up @@ -274,6 +280,69 @@ another object), it is replaced by the corresponding value from the
]


Here is another example of how to use the "random-parameter-set" sampler in the context of different frame types (here, "exp-lookit-images-audio" and "exp-lookit-video". In this case, the sampler will randomly pick one of the two ``parameterSets``, displaying either 2 images of Zenna and then the bowl video, or 2 images of Remy and then the cup video. Note again how each frame does not have its own title within the ``frameList``, and just begins with the definition of its ``kind``.

.. code:: json
{
"frames": {
"test-trials": {
"sampler": "random-parameter-set",
"kind": "choice",
"frameList": [
{
"kind": "exp-lookit-images-audio",
"images": [
{
"id": "happy",
"src": "FIRST_IMAGE_PLACEHOLDER",
"position": "left"
},
{
"id": "sad",
"src": "SECOND_IMAGE_PLACEHOLDER",
"position": "right"
}
]
},
{
"kind": "exp-lookit-video",
"video": {
"top": 10,
"left": 25,
"loop": false,
"width": 50,
"source": "VIDEO_PLACEHOLDER"
},
"autoProceed": true,
"doRecording": false,
"videoTypes": [
"mp4"
]
}
],
"commonFrameProperties": {
"baseDir": "https://www.mit.edu/~kimscott/placeholderstimuli/"
},
"parameterSets": [
{
"FIRST_IMAGE_PLACEHOLDER": "happy_zenna.jpg",
"SECOND_IMAGE_PLACEHOLDER": "sad_zenna.jpg",
"VIDEO_PLACEHOLDER": "cropped_bowl"
},
{
"FIRST_IMAGE_PLACEHOLDER": "happy_remy.jpg",
"SECOND_IMAGE_PLACEHOLDER": "sad_remy.jpg",
"VIDEO_PLACEHOLDER": "cropped_cup"
}
]
}
},
"sequence": [
"test-trials"
]
}
Parameters
----------------

Expand Down

0 comments on commit 5ce12d1

Please sign in to comment.