jspsych / jspsych-contrib Goto Github PK
View Code? Open in Web Editor NEWAn open repository of jsPsych plugins and extensions, without any official support
An open repository of jsPsych plugins and extensions, without any official support
Hello, it seems like the latest version (1.1.0) of html-vas-response is not on NPM. <script src="https://unpkg.com/@jspsych-contrib/[email protected]"></script>
returns a 404 error and <script src="https://unpkg.com/@jspsych-contrib/plugin-html-vas-response"></script>
appears to load version 1.0.0. Do I need to do anything to update it?
Hello,
I was excited to see that someone contributed a VAS plugin for jsPsych. I'd very much like to try this plugin in one of my experiments, however, when I try to use it as a drop-in replacement for survey-likert
(with the appropriate parameters) it throws an error: Uncaught ReferenceError: jsPsychModule is not defined
.
I downloaded the plugin using npm and compiled the experiment with webpack. The experiment compiles, but during runtime throws the error above. I'm confident that the error is related to the VAS plugin as the experiment works perfectly fine with the likert scale plugin, however, when using the VAS plugin the error occurs.
Any thoughts on how to remedy the issue so I can play around with the plugin would be appreciated!
Hi all,
I'm currently trying to implement a mediapipe face tracking extension for jsPsych, but a runtime error keeps me from moving on. I added @mediapipe/face_mesh
as an dependency and try to instantiate it in the constructor of the new jsPsychExtensionMediapipeFacemesh
. However, I'm stuck with the VM throwing the error Uncaught TypeError: face_mesh.FaceMesh is not a constructor
.
I suspect that it is related to the way of handling dependencies by npm and that not all parts of mediapipe were included in the dist js file created by npm. Because I'm fairly new to JS/TS and npm, I greatly appreciate any help.
Please find an example here: https://github.com/mgrewe/jspsych-contrib/tree/mediapipe_test
Thanks!
I'm assuming that our recommendation is that folks load plugins/extensions from this repo via unpkg.com
links. How do we trigger a release of a package in this repo?
As suggested here: jspsych/datapipe#89
an simple extension that allows to "simulate" key presses with touchbuttons.
I think that the self-paced reading plugin fails to trigger any of the events normally used to save data (such as on_trial_finish
or on_data_update
on any of the words except the last one.
You can find our timeline herehere.
Now consider:
const jsPsych = initJsPsych({
display_element: document.getElementById('jsPsychTarget'),
on_finish: console.log(`I'm done`),
on_data_update: function(data) {
console.log('Just added new data. The contents of the data are: '+JSON.stringify(data));
},
on_trial_finish: function(data) {
console.log('A trial just ended.');
console.log(JSON.stringify(data));
}
});
Critically, console.log
only triggers on the final word of a sentence:
If I have time, I'll try to come up with a minimal working example.
It seems like running:
<!DOCTYPE html>
<html>
<head>
<!-- Title shown in tab -->
<title>Test</title>
<script src="https://unpkg.com/[email protected]"></script>
<link href="https://unpkg.com/jspsych/css/jspsych.css" rel="stylesheet" type="text/css" />
<script src="https://unpkg.com/@jspsych-contrib/plugin-survey-slider"></script>
</head>
<body></body>
<script>
var jsPsych = initJsPsych()
jsPsych.run({
type: jsPsychSurveySlider,
questions: [{ prompt: "How old are you?" }],
})
</script>
</html>
Fails (i.e., it says that jsPsychSurveySlider
is undefined. Tried different variant URLs like:
<script src="https://unpkg.com/@jspsych-contrib/[email protected]"></script>
and
<script src="https://unpkg.com/jspsych-contrib/[email protected]"></script>
Am I doing something wrong or is this a larger issue?
Also, there is an typo in the plugin's README, there is no closing /script statement
Given that jspsych has already several useful plugins for creating questionnaires (survey-likert), it would benefit a lot for being able to use analog scales (i.e., sliders) instead of discrete choices (PS: note that this option is not available either in SurveyJS/survey-plugin afaik).
We've been using this plugin code in the past to get:
with:
var questionnaire = {
type: jsPsychSurveySlider,
questions: [
{
prompt: "<b>Question 1</b>",
name: "question1",
ticks: ["Strongly disagree", "Strongly agree"],
required: true,
min: 0,
max: 1,
step: 0.01,
slider_start: 0.5,
},
{
prompt: "<b>Question 2</b>",
name: "question2",
ticks: ["No", "Yes"],
required: true,
min: 0,
max: 1,
step: 0.01,
slider_start: 0.5,
},
],
randomize_question_order: false,
preamble: "Some instructions.",
require_movement: false,
slider_width: 600,
data: {
screen: "questionnaire",
},
}
timeline.push(questionnaire)
I believe such plugin would benefit from being added here (or even as part of the official distribution IMO) but for this it would need to be updated (to typescript if I understand?) and cleaned up (and add a data simulation option). Although it's probably not a lot of work, it's still slightly beyond my javascript skill level. And I was wondering if I could get some guidance and help with that?
I have not found a list of references for projects of other authors.
Maybe that could be a great source for all jsPsych users to see even more examples?
I could for example contribute https://github.com/1kastner/memory-test for now as a sample and another project might be added soon.
I think it may not be intuitive for some folks to look in /packages
.
We could either add a list to the README that folks can update when they contribute, or we could just add a general statement about looking in /packages
to the README.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.