Merge pull request #736 from kupiqu/save_stimulus_start_slider

systematically saving stimulus and slider start position in all slider plugins
This commit is contained in:
Becky Gilbert 2020-09-16 17:25:23 -07:00 committed by GitHub
commit 657418ba20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 5 deletions

View File

@ -181,7 +181,8 @@ jsPsych.plugins['audio-slider-response'] = (function() {
// save data // save data
var trialdata = { var trialdata = {
"rt": response.rt, "rt": response.rt,
"stimulus": trial.stimulus, "stimulus": trial.stimulus,
"start": trial.start,
"response": response.response "response": response.response
}; };

View File

@ -135,7 +135,7 @@ jsPsych.plugins['html-slider-response'] = (function() {
rt: null, rt: null,
response: null response: null
}; };
if(trial.require_movement){ if(trial.require_movement){
display_element.querySelector('#jspsych-html-slider-response-response').addEventListener('change', function(){ display_element.querySelector('#jspsych-html-slider-response-response').addEventListener('change', function(){
display_element.querySelector('#jspsych-html-slider-response-next').disabled = false; display_element.querySelector('#jspsych-html-slider-response-next').disabled = false;
@ -163,8 +163,9 @@ jsPsych.plugins['html-slider-response'] = (function() {
// save data // save data
var trialdata = { var trialdata = {
"rt": response.rt, "rt": response.rt,
"response": response.response, "stimulus": trial.stimulus,
"stimulus": trial.stimulus "start": trial.start,
"response": response.response
}; };
display_element.innerHTML = ''; display_element.innerHTML = '';

View File

@ -198,6 +198,8 @@ jsPsych.plugins['image-slider-response'] = (function() {
// save data // save data
var trialdata = { var trialdata = {
"rt": response.rt, "rt": response.rt,
"stimulus": trial.stimulus,
"start": trial.start,
"response": response.response "response": response.response
}; };

View File

@ -171,7 +171,7 @@ jsPsych.plugins["video-slider-response"] = (function() {
} }
var type = file_name.substr(file_name.lastIndexOf('.') + 1); var type = file_name.substr(file_name.lastIndexOf('.') + 1);
type = type.toLowerCase(); type = type.toLowerCase();
video_html+='<source src="' + file_name + '" type="video/'+type+'">'; video_html+='<source src="' + file_name + '" type="video/'+type+'">';
} }
} }
video_html += "</video>"; video_html += "</video>";
@ -269,6 +269,7 @@ jsPsych.plugins["video-slider-response"] = (function() {
var trial_data = { var trial_data = {
"rt": response.rt, "rt": response.rt,
"stimulus": trial.stimulus, "stimulus": trial.stimulus,
"start": trial.start,
"response": response.response "response": response.response
}; };