mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-12 08:38:11 +00:00
instructions merge conflict
This commit is contained in:
commit
e5e385ebb5
@ -939,7 +939,8 @@ jsPsych.plugins = (function() {
|
|||||||
IMAGE: 8,
|
IMAGE: 8,
|
||||||
AUDIO: 9,
|
AUDIO: 9,
|
||||||
VIDEO: 10,
|
VIDEO: 10,
|
||||||
OBJECT: 11
|
OBJECT: 11,
|
||||||
|
COMPLEX: 12
|
||||||
}
|
}
|
||||||
|
|
||||||
module.universalPluginParameters = {
|
module.universalPluginParameters = {
|
||||||
|
@ -156,6 +156,39 @@ describe('The data parameter', function(){
|
|||||||
expect(jsPsych.data.get().filter({added: false}).count()).toBe(1);
|
expect(jsPsych.data.get().filter({added: false}).count()).toBe(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('timeline variable should be available in trial on_finish', function(){
|
||||||
|
require(root + 'jspsych.js');
|
||||||
|
require(root + 'plugins/jspsych-html-keyboard-response.js');
|
||||||
|
|
||||||
|
var trial = {
|
||||||
|
timeline: [
|
||||||
|
{
|
||||||
|
type: 'html-keyboard-response',
|
||||||
|
stimulus: 'foo',
|
||||||
|
data: {added: jsPsych.timelineVariable('added')},
|
||||||
|
on_finish: function(data){
|
||||||
|
data.added_copy = data.added;
|
||||||
|
}}
|
||||||
|
],
|
||||||
|
timeline_variables: [
|
||||||
|
{added: true},
|
||||||
|
{added: false}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
jsPsych.init({
|
||||||
|
timeline: [trial]
|
||||||
|
});
|
||||||
|
|
||||||
|
utils.pressKey(32); // trial 1
|
||||||
|
utils.pressKey(32); // trial 2
|
||||||
|
|
||||||
|
console.log(jsPsych.data.get().json())
|
||||||
|
|
||||||
|
expect(jsPsych.data.get().filter({added_copy: true}).count()).toBe(1);
|
||||||
|
expect(jsPsych.data.get().filter({added_copy: false}).count()).toBe(1);
|
||||||
|
});
|
||||||
|
|
||||||
test.skip('should record data to all nested trials with timeline variables even when nested trials have own data', function(){
|
test.skip('should record data to all nested trials with timeline variables even when nested trials have own data', function(){
|
||||||
|
|
||||||
require(root + 'jspsych.js');
|
require(root + 'jspsych.js');
|
||||||
|
@ -16,14 +16,18 @@ describe('survey-multi-select plugin', function(){
|
|||||||
test('quoted values for options work', function(){
|
test('quoted values for options work', function(){
|
||||||
var trial = {
|
var trial = {
|
||||||
type: 'survey-multi-select',
|
type: 'survey-multi-select',
|
||||||
questions: ['foo'],
|
questions: [{
|
||||||
options: [['Hello "boo"', "yes, 'bar'"]]
|
prompt: 'foo',
|
||||||
|
options: ['Hello "boo"', "yes, 'bar'"]
|
||||||
|
}]
|
||||||
}
|
}
|
||||||
|
|
||||||
jsPsych.init({
|
jsPsych.init({
|
||||||
timeline: [trial]
|
timeline: [trial]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log(jsPsych.getDisplayElement().innerHTML);
|
||||||
|
|
||||||
expect(jsPsych.getDisplayElement().querySelector('#jspsych-survey-multi-select-option-0-0 input').value).toBe('Hello "boo"');
|
expect(jsPsych.getDisplayElement().querySelector('#jspsych-survey-multi-select-option-0-0 input').value).toBe('Hello "boo"');
|
||||||
expect(jsPsych.getDisplayElement().querySelector('#jspsych-survey-multi-select-option-0-1 input').value).toBe("yes, 'bar'");
|
expect(jsPsych.getDisplayElement().querySelector('#jspsych-survey-multi-select-option-0-1 input').value).toBe("yes, 'bar'");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user