lookit / lookit-jspsych

0 stars 0 forks source link

Video file names in standard format #70

Open becky-gilbert opened 1 day ago

becky-gilbert commented 1 day ago

This PR updates the video file names in the record package so that they match the format used by EFP and expected by the lookit-api and and the AWS S3-Lambda trigger.

This naming system requires two arguments from the plugin that calls recorder.start:

  1. whether or not this is a consent recording, which is used for the prefix
  2. the "trial_type" (plugin name), which is used to create the frame_id value

The frame_id value is the same one that lookit-jspsych uses in the response sequence field, and that's used in the lookit-api to identify trials. The format is: {trial_index}-{trial_type}. Trial types are not necessarily unique across the experiment, but the trial indices are.

Implementation note

Our previous file naming system used a set of pre-defined strings as an argument in the recorder.start method: "consent" | "session_video" | "trial_video". It would be nice to still have a set of pre-defined strings for the new trial_type string passed to recorder.start. But I don't think that's makes sense now, since our trial recording extension is meant to be used with any jsPsych plugin, so we'd have to maintain a long list of all (currently ~40) jsPsych trial types ("html-button-response", etc.). So this argument is just an unconstrained string. I'm open to suggestions for ways of constraining or validating it.

TO DO

As discussed here #36, we would like to give researchers the ability to assign their own unique/meaningful trial IDs, and use these index-type IDs as a fallback. But in the interest of meeting our first MVP, I'm just implementing the index-type solution for now, and we can add the support for researcher-provided trial IDs later.

changeset-bot[bot] commented 1 day ago

🦋 Changeset detected

Latest commit: f6b667b449f171f4ba4b2d9d2c96adb0e5ab6cd9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | -------------- | ----- | | @lookit/record | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR