-
Hi! Thanks so much for the wonderful course this Monday! I would like to write a word-sorting experiment where participants see a bag of words and are required to make a sentence by reorganizing the available words. For example, there are words 'eating', 'I', 'apples', 'like', and four blanks on the bottom for them to fill out the whole sentence. Participants are supposed to drag each word to the correct blank to make it an intelligible utterance - 'I like eating apples'. Could I ask where to go first? I saw a plugin called 'free-sort' which is a little bit similar to what I want to do, so maybe I can modify it. But I still have no idea about how to display 'a bag of words', how to create blanks accepting words and how to record and save the completed sentence. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @qxu1994 This is definitely new plugin territory. The https://jqueryui.com/sortable/#display-grid Here's another similar library: https://sortablejs.github.io/Sortable/ My suggestion would be to start by implementing one trial of your task using a library like one of these in a plain HTML document with no jsPsych. Once you've got a single trial working roughly how you want it, then you can translate the code you've got into a plugin. This is my typical workflow for creating brand new plugins. There's some info here about how to create a new plugin file, and we'll try to spend some time talking about this for Week 3 of the workshop. |
Beta Was this translation helpful? Give feedback.
Hi @qxu1994
This is definitely new plugin territory.
The
free-sort
plugin could be a good starting point, but it doesn't have the feature of snapping into a blank spot. There are some JavaScript libraries that already do this kind of user interaction. For example, this demo of jQuery UI's sortable feature seems pretty similar to what you are looking for:https://jqueryui.com/sortable/#display-grid
Here's another similar library:
https://sortablejs.github.io/Sortable/
My suggestion would be to start by implementing one trial of your task using a library like one of these in a plain HTML document with no jsPsych. Once you've got a single trial working roughly how you want it, then you can t…