Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jspsych Surveys #24

Merged
merged 42 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
deb22fb
Update readme
okaycj Mar 22, 2024
2ffde67
Update eslint package to fix warning message
okaycj Mar 22, 2024
9eb1b96
Add exit survey pacakge
okaycj Mar 22, 2024
43e507e
exit survey
okaycj Mar 22, 2024
cc98017
Use survey_function to format survey text
okaycj Mar 26, 2024
aebc86c
edit exit survey question titles and descriptions
becky-gilbert Mar 27, 2024
1d6edcb
change question names and MC values to match EFP names
becky-gilbert Mar 27, 2024
ec75dee
add withdrawal and feedback questions
becky-gilbert Mar 27, 2024
bf8878f
Change package name, exit survey parameters
okaycj Mar 27, 2024
2328104
Fixed typing
okaycj Mar 27, 2024
2e9b691
Added privacy and databrary params
okaycj Mar 27, 2024
1b78ea0
Update API to get a study
okaycj Mar 28, 2024
471b96b
Get study to add to withdraw copu
okaycj Mar 28, 2024
afe5d14
Add MD link
okaycj Mar 28, 2024
e2eba50
disable the video sharing questions if video withdrawal is true
becky-gilbert Mar 28, 2024
36be231
add support for private level only option for media use question
becky-gilbert Mar 28, 2024
90761bf
Merge branch 'jspsych-surveys' of https://github.com/lookit/lookit-js…
becky-gilbert Mar 28, 2024
3d999b8
fix private_level_only so that value is private in data
becky-gilbert Mar 28, 2024
1d428f2
Add global data store
okaycj Apr 1, 2024
a69de96
fix withdrawal question value in data and logic for enabling/disablin…
becky-gilbert Apr 1, 2024
c227f3f
add validation for child birthdate: cannot be a future date
becky-gilbert Apr 1, 2024
9e254a7
Combine helpers and api into new package called data
okaycj Apr 3, 2024
3f6fef9
Update root package
okaycj Apr 3, 2024
5ba5109
Update initjspych to use new data structure
okaycj Apr 3, 2024
2bfc2d7
Update survey to use new data structure
okaycj Apr 3, 2024
1aa1f98
Moved exit survey function to utils
okaycj Apr 3, 2024
111bf90
First pass at tests
okaycj Apr 9, 2024
c6017df
Add consent servey plugin
okaycj Apr 10, 2024
40adad1
These packages are needed when building in linux environment
okaycj Apr 10, 2024
eb9e31d
Add data finish function
okaycj Apr 10, 2024
9e36eeb
Remove unneeded comments
okaycj Apr 10, 2024
a7f0e08
Added text markdown to consent survey
okaycj Apr 10, 2024
5cb89d2
Update tests
okaycj Apr 11, 2024
51deb02
Update versions of deps
okaycj Apr 11, 2024
c4f2cf8
Update to getUuids
okaycj Apr 16, 2024
cf81bd4
freeze loaded data
okaycj Apr 18, 2024
ceb94d7
install jspsych/plugin-survey from npm and fix compatibility (pass ob…
becky-gilbert May 1, 2024
f9019f2
replace exit.json with exit_json.ts and fix import
becky-gilbert May 1, 2024
ae527c6
fix linting errors
becky-gilbert May 1, 2024
c620bae
fix failing data test due to syntax error in untranspiled deep-freeze…
becky-gilbert May 2, 2024
2048267
fix linting error
becky-gilbert May 2, 2024
111ac52
Needed to adjust ts config to build.
okaycj May 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions packages/exit-survey/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { TrialType } from "jspsych";
import SurveyPlugin from "../../../../jsPsych/packages/plugin-survey";
import surveyJSON from "./survey.json";

type Writeable<T> = { -readonly [P in keyof T]: T[P] };
type SurveyPluginInfo = typeof SurveyPlugin.info;
interface Info extends SurveyPluginInfo {
parameters: Writeable<typeof SurveyPlugin.info.parameters>;
}
becky-gilbert marked this conversation as resolved.
Show resolved Hide resolved

class ExitSurvey extends SurveyPlugin {
trial(display_element: HTMLElement, trial: TrialType<Info>) {
trial.survey_json = JSON.stringify(surveyJSON);
return super.trial(display_element, trial);
}
}

export default ExitSurvey;
45 changes: 45 additions & 0 deletions packages/exit-survey/src/survey.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"logoPosition": "right",
"pages": [
{
"name": "page1",
"elements": [
{
"type": "text",
"name": "question1",
"title": "Please confirm your child's birthdate\n",
"isRequired": true,
"inputType": "date"
},
{
"type": "boolean",
"name": "question2",
"title": "Would you like to share your video and other data from this session with authorized users of the secure data library Databrary?\n",
"isRequired": true
},
{
"type": "radiogroup",
"name": "question3",
"title": "Use of video clips and images",
"isRequired": true,
"choices": [
{
"value": "Item 1",
"text": "Private: Video may only be viewed by authorized scientists"
},
{
"value": "Item 2",
"text": "Scientific and educational: Video may be shared for scientific or educational purposes. For example, we might show a video clip in a talk at a scientific conference or an undergraduate class about cognitive development, or include an image or video in a scientific paper. In some circumstances, video or images may be available online, for instance as supplemental material in a scientific paper."
},
{
"value": "Item 3",
"text": "Publicity: Please select this option if you'd be excited about seeing your child featured on the Lookit website or in a news article about this study! Your video may be shared for publicity as well as scientific and educational purposes; it will never be used for commercial purposes. Video clips shared may be available online to the general public."
}
]
}
]
}
],
"showQuestionNumbers": "off",
"title": "Exit Survey"
}
Loading