bjoluc / jspsych-builder

A CLI utility to easily develop and package jsPsych experiments
MIT License
47 stars 12 forks source link

Pass `pragmas` to `run(...)`? #22

Closed jmuchovej closed 2 years ago

jmuchovej commented 2 years ago

This could definitely be resolved by specifying something like...

// experiment.{ts,js}
const VERSION = ...

But since we're already specifying a version in the docblock, could we have ctx.meta (at this seemed to be where the pragmas were getting stored?) passed through to the run(...) function? I'm not sure it's a tonne of work to do that, but wanted to check-in before working on that.

Of course, we can write separate experiments, but I'm a fan of DRY, and most of the experiments I've worked on usually vary in stimuli, but not the actual study design. (Changes in study design seems to be the pattern across research projects, not within them.)

bjoluc commented 2 years ago

+1. I think I'm in favor of only passing title, version, and description separately, since I can't think of any reason to directly access the current media pragmas or the future assets pragma.

bjoluc commented 2 years ago

Implementing this, I realized it's not nice to expose the description in the JS bundle by default, given that it's not meant to be user-facing (only used in JATOS so far), hence only adding title and version. Any objections?

jmuchovej commented 2 years ago

Hmm... I can see why descriptions may not be necessary.

I was mostly thinking that descriptions might make sense as a way of summarizing a study, but I know in my current studies I wouldn't be using it. (Since I can use the version to lookup specific changes and with MDX, I can make things as dynamic as necessary.)

TL;DR: No objections to just passing title and version.

bjoluc commented 2 years ago

I was mostly thinking that descriptions might make sense as a way of summarizing a study, but I know in my current studies I wouldn't be using it.

That was my intention with description too, but primarily for developers and experimenters in the JATOS dashboard. Reconsidering description, I'm wondering if it's even good to ask for it in the interactive init command...

jmuchovej commented 2 years ago

Once Prolific rolls out their API, I think something like the description could be useful. It would also be useful to package things like the redirect URL into a JATOS build, but I don't think that's worth keeping on the radar for the moment (as Prolific hasn't even put their API into a Beta.)

I wager the same/similar things could be done with MTurk, but I haven't used MTurk in well over a year. 😅

github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 4.2.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: