Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
5559b23
basic functionality
qdercon May 13, 2025
fef1ebe
snaps
qdercon May 13, 2025
754371e
it runs
qdercon May 13, 2025
81bb9ca
colours!
qdercon May 13, 2025
2c0cfbb
ordering
qdercon May 14, 2025
bdb0b42
added backgroud glow when in snapping range
May 14, 2025
bf80804
Merge pull request #1 from DomDaSquishyBomb/background-glow
qdercon May 14, 2025
2cf35e6
fixed bug in parameter setting background
May 14, 2025
76bc726
Merge branch 'background-glow' into free-sort-ordered-plugin
May 14, 2025
f22e717
added parameters for stimuli and boxes which are dictionaries which e…
DomDaSquishyBomb May 14, 2025
42cf54d
orignal logic works with new dictionary params
DomDaSquishyBomb May 14, 2025
788919d
glow etc
qdercon May 14, 2025
2cec5a1
Merge remote-tracking branch 'origin/free-sort-ordered-plugin' into b…
qdercon May 14, 2025
31c4075
v0.0.1
qdercon May 14, 2025
c9bff4f
Merge pull request #2 from DomDaSquishyBomb/better-snapping-animation
qdercon May 14, 2025
1ccb8a1
fix correctness by colour
qdercon May 14, 2025
1983e35
added template trial
mekline May 14, 2025
a9aa4e5
Merge pull request #3 from DomDaSquishyBomb/mks-template-examples
mekline May 14, 2025
517ddcd
adding some sort-able image assets
mekline May 14, 2025
67498a1
Merge pull request #4 from DomDaSquishyBomb/add-stimuli
mekline May 14, 2025
957a9c7
correctness from stimulus/boxes + viewport restriction
qdercon May 14, 2025
fbde3be
added two potential demos that dont work yet, but should work once al…
mekline May 14, 2025
0c03376
Merge remote-tracking branch 'origin/add-stimuli' into free-sort-orde…
qdercon May 14, 2025
9eb6a58
Merge pull request #5 from DomDaSquishyBomb/mks-makes-examples
mekline May 14, 2025
8936571
correctness from stimulus/boxes + viewport restriction
qdercon May 14, 2025
4457b24
Merge branch 'free-sort-ordered-plugin' of https://github.com/DomDaSq…
qdercon May 14, 2025
b5dbcb4
doesn't let you put stuff in when filled for allow many
DomDaSquishyBomb May 14, 2025
6f965f6
fixed box colours
qdercon May 14, 2025
04b5267
holding area location can now be set
May 14, 2025
3be1841
scale all of the time instead of just whenever from box
DomDaSquishyBomb May 14, 2025
2fa5137
new trial + prompt formatting
May 14, 2025
03f9838
ping back when wrong!
qdercon May 14, 2025
0a8cccc
Merge branch 'free-sort-ordered-plugin' of https://github.com/DomDaSq…
qdercon May 14, 2025
37ee7a6
minor edit
qdercon May 14, 2025
7972561
Merge branch 'free-sort-ordered-plugin' of https://github.com/DomDaSq…
May 14, 2025
079955d
Update README.md
rinaharsch May 14, 2025
60dabbe
Merge branch 'free-sort-ordered-plugin' of github.com:DomDaSquishyBom…
May 14, 2025
2acb772
merged with holding-location and fixed conflicts
May 15, 2025
367a619
Changed stimuli = trial.stimulus to stimulus = trial.stimulus
DomDaSquishyBomb May 15, 2025
529d419
attempting to merge
May 15, 2025
08677f7
Merge branch 'free-sort-ordered-plugin' of https://github.com/DomDaSq…
May 15, 2025
6d28868
removed stim_height
DomDaSquishyBomb May 15, 2025
f2a80fe
Merge branch 'free-sort-ordered-plugin' of https://github.com/DomDaSq…
DomDaSquishyBomb May 15, 2025
9b33e17
starting to put together sequence of trials
May 15, 2025
7c5e03c
changed the name in the npx auto files
DomDaSquishyBomb May 15, 2025
393b9ef
fixing correctness
qdercon May 15, 2025
dc6bb80
Merge branch 'free-sort-ordered-plugin' of https://github.com/DomDaSq…
qdercon May 15, 2025
886ce6e
stimuli -> stimulus
qdercon May 15, 2025
612aa4c
renamed in minimal html
DomDaSquishyBomb May 15, 2025
658ba9f
Merge branch 'free-sort-ordered-plugin' of https://github.com/DomDaSq…
DomDaSquishyBomb May 15, 2025
1d080d1
try to have stimuli not overlap
May 15, 2025
d32efb4
merge to add stimuli not overlapping
May 15, 2025
d792814
fixed typo
May 15, 2025
5f718a4
minor changes to dimensions and add option to change backgrounds etc
qdercon May 15, 2025
9550cde
Merge branch 'free-sort-ordered-plugin' of https://github.com/DomDaSq…
qdercon May 15, 2025
ba5c197
change to snap-sort
qdercon May 15, 2025
22bcbf4
changed the reference names in the file to snap sort without changing…
DomDaSquishyBomb May 15, 2025
516e31c
Merge branch 'free-sort-ordered-plugin' of https://github.com/DomDaSq…
DomDaSquishyBomb May 15, 2025
94b7da3
demo!
May 15, 2025
d080fcb
Merge branch 'free-sort-ordered-plugin' of github.com:DomDaSquishyBom…
May 15, 2025
f31fcd9
stacking
qdercon May 15, 2025
7f922b7
Merge branch 'free-sort-ordered-plugin' of https://github.com/DomDaSq…
qdercon May 15, 2025
b54df2a
remove console.log
qdercon May 15, 2025
e670924
upd index_min
qdercon May 15, 2025
d5f0fd4
demo version
qdercon May 15, 2025
d077d65
fixes in demo for hackathon presentation
qdercon May 15, 2025
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
5 changes: 3 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/plugin-free-sort-ordered/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ See [documentation](/packages/plugin-free-sort-ordered/README.md)

## Author / Citation

[Cherrie Chang](https://github.com/cherriechang)
[Cherrie Chang](https://github.com/cherriechang)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions packages/plugin-free-sort-ordered/assets/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<!DOCTYPE html>
<html>
<head>
<title>jsPsychPluginFreeSortOrdered Example</title>
<script src="https://unpkg.com/jspsych"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<!-- Load the published plugin package here, e.g.
<script src="https://unpkg.com/plugin-free-sort-ordered"></script>
<script src="../dist/index.browser.js"></script> -->
<script src="../dist/index.browser.js"></script>
<link rel="stylesheet" href="https://unpkg.com/jspsych/css/jspsych.css" />
<link rel="stylesheet" href="../src/styles.css" />
</head>

<body></body>
<script>
const jsPsych = initJsPsych({
on_finish: function() {
jsPsych.data.displayData();
}
});

const trial = {
type: jsPsychPluginFreeSortOrdered,
stimulus: [
'../assets/blue-rec.png',
'../assets/green-rec.png',
'../assets/red-rec.png',
'../assets/blue-rec.png',
'../assets/green-rec.png',
],
stim_height: 100,
stim_width: 120,
scale_factor: 1.1,
holding_area_height: 400,
holding_area_width: 1000,
box_colors: ["#0271bc", "#3ab54b", "#FF0000", "#0271bc", "#3ab54b"],
check_correct_order: true,
allow_multiple: true,
box_margin: 30,
snap_margin: 15,
prompt: 'Drag and drop the boxes to sort them in order.',
prompt_location: 'above',
button_label: 'Continue',
include_counter: true,
};

jsPsych.run([trial])
</script>
</html>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
126 changes: 115 additions & 11 deletions packages/plugin-free-sort-ordered/examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<title>jsPsychPluginFreeSortOrdered Example</title>
<script src="https://unpkg.com/jspsych"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<!-- Load the published plugin package here, e.g.
<script src="https://unpkg.com/plugin-free-sort-ordered"></script>
<script src="../dist/index.browser.js"></script> -->
Expand All @@ -13,27 +14,130 @@

<body></body>
<script>
const jsPsych = initJsPsych();
const jsPsych = initJsPsych({
on_finish: function() {
jsPsych.data.displayData();
}
});

const trial = {
const trial1 = {
type: jsPsychPluginFreeSortOrdered,
stimulus: [
'../assets/blue-rec.png',
'../assets/green-rec.png',
'../assets/red-rec.png',
{id: 0, file: '../assets/blue-rec.png', height: 100, width: 200},
{id: 1, file: '../assets/green-rec.png', height: 100, width: 200},
{id: 2, file: '../assets/red-rec.png', height: 100, width: 200}
],
stim_height: 100,
stim_width: 200,
stim_order: [2, 0, 1],
scale_factor: 1,
holding_area_height: 500,
holding_area_width: 1000,
stim_width: 120,
scale_factor: 1.1,
boxes: [
{id: 0, color: '#0271bc', height: 100, width: 200},
{id: 1, color: '#3ab54b', height: 100, width: 200},
{id: 2, color: '#FF0000', height: 100, width: 200}
],
use_correctness: true,
correctness_by: "color",
box_margin: 40,
snap_margin: 20,
prompt: 'Drag and drop the boxes to sort them in order.',
prompt_location: 'above',
button_label: 'Continue',
include_counter: true,
};

jsPsych.run([trial])
const trial2 = {
type: jsPsychPluginFreeSortOrdered,
prompt: 'This is a template trial, we can make lots of variations to see how this plugin can function!',
scale_factor: 1.1,
holding_area_height: 400,
holding_area_width: 800,
box_margin: 40,
snap_margin: 20,
prompt_location: 'above',
button_label: 'Continue',
include_counter: false,
stimulus: [
{id: 0, file: '../assets/blue-rec.png', height: 100, width: 200},
{id: 1, file: '../assets/blue-rec.png', height: 100, width: 200},
{id: 2, file: '../assets/blue-rec.png', height: 100, width: 200}
],
stim_height: 100,
<!--Debug note! If you dont include these stim height and width parameters, you get bad box clicking behavior-->
stim_width: 120,
boxes: [
{id: 0, colour: '#0271bc', height: 100, width: 200},
{id: 1, colour: '#3ab54b', height: 100, width: 200},
{id: 2, colour: '#FF0000', height: 100, width: 200}
],
use_correctness: false

};


const trial10 = {
type: jsPsychPluginFreeSortOrdered,
prompt: 'WONT WORK YET. This is a trial with a correct answer. You have to put all of the green shapes in the single box before you can move on.',
scale_factor: 1.1,
holding_area_height: 400,
holding_area_width: 800,
box_margin: 40,
snap_margin: 20,
prompt_location: 'above',
button_label: 'Continue',
include_counter: false,
stimulus: [
{id: 0, file: '../assets/green-circle.png', height: 100, width: 100},
{id: 0, file: '../assets/green-triangle.png', height: 100, width: 100},
{id: 0, file: '../assets/green-square.png', height: 100, width: 100},
{id: 1, file: '../assets/orange-circle.png', height: 100, width: 100},
{id: 1, file: '../assets/purple-triangle.png', height: 100, width: 100},
{id: 1, file: '../assets/purple-square.png', height: 100, width: 100}
],
stim_height: 100,
stim_width: 120,
boxes: [
{id: 0, colour: '#0271bc', height: 100, width: 200}
],
use_correctness: true,
correctness_by: 'id',
use_criteria: true,
criteria: 'exact_correct_answers',
show_button: 'on_criteria'
};

const trial11 = {
type: jsPsychPluginFreeSortOrdered,
prompt: 'WONT WORK YET. Put the circles in the red box, the triangles in the blue box, and the squares in the green box. The trial will advance automatically once you put the last shape in the boxes, even if the answer is wrong.',
scale_factor: 1.1,
holding_area_height: 400,
holding_area_width: 800,
box_margin: 40,
snap_margin: 20,
prompt_location: 'above',
button_label: 'Continue',
include_counter: false,
stimulus: [
{id: 0, file: '../assets/green-circle.png', height: 100, width: 100},
{id: 1, file: '../assets/green-triangle.png', height: 100, width: 100},
{id: 2, file: '../assets/green-square.png', height: 100, width: 100},
{id: 0, file: '../assets/orange-circle.png', height: 100, width: 100},
{id: 1, file: '../assets/purple-triangle.png', height: 100, width: 100},
{id: 2, file: '../assets/purple-square.png', height: 100, width: 100}
],
stim_height: 100,
stim_width: 120,
boxes: [
{id: 0, colour: 'Red', height: 100, width: 200},
{id: 1, colour: 'Blue', height: 100, width: 200},
{id: 2, colour: 'Green', height: 100, width: 200}
],
use_correctness: false,
use_criteria: true,
criteria: 'all_items_sorted',
response_ends_trial: true
};


jsPsych.run([trial1, trial2])
</script>
</html>
Loading