instructions merge conflict

This commit is contained in:
KristinDiep 2017-07-27 15:01:44 -04:00
commit e5e385ebb5
3 changed files with 41 additions and 3 deletions

View File

@ -939,7 +939,8 @@ jsPsych.plugins = (function() {
IMAGE: 8,
AUDIO: 9,
VIDEO: 10,
OBJECT: 11
OBJECT: 11,
COMPLEX: 12
}
module.universalPluginParameters = {

View File

@ -156,6 +156,39 @@ describe('The data parameter', function(){
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(){
require(root + 'jspsych.js');

View File

@ -16,14 +16,18 @@ describe('survey-multi-select plugin', function(){
test('quoted values for options work', function(){
var trial = {
type: 'survey-multi-select',
questions: ['foo'],
options: [['Hello "boo"', "yes, 'bar'"]]
questions: [{
prompt: 'foo',
options: ['Hello "boo"', "yes, 'bar'"]
}]
}
jsPsych.init({
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-1 input').value).toBe("yes, 'bar'");