Replies: 2 comments
-
Do you have any trials in your timeline after the data are saved? If the participant is closing the browser window or moving to another page immediately after the save data trial is called then the request might cancel before it is completed. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I don't think so. Below is code that may show that this is the case: //save data to server folder
function saveData(name, data){
var xhr = new XMLHttpRequest();
xhr.open('POST', 'FamSearch_writedata.php'); // 'write_data.php' is the path to the php file
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.send(JSON.stringify({filename: name, filedata: data}));
}
function savethedata() {
//save cleaned data
// console.log("data.all: " + data_all.condition[0])
saveData(datafilename, prepdata(data_all));
}
var save_data = {
type: 'call-function',
func: savethedata,
on_start: function(){
var today = new Date();
// data_all.Exp_end_time.push(today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds());
}
}
rsvp_task.push(save_data);
var debriefing_form = {
type:'external-html',
url: "https://acl.psychology.gatech.edu/jspsych-6.1.0/examples/debriefingform.html",
cont_btn: "end" // id of continue button, trial advances when this is clicked
};
rsvp_task.push(debriefing_form);
var survey_link = {
type: "html-keyboard-response",
stimulus: "YOUR SURVEY CODE IS: " + rand_string,
choices: jsPsych.NO_KEYS
}
rsvp_task.push(survey_link);
var all_faces = faces.concat(practice_faces)
jsPsych.init({
timeline: rsvp_task,
preload_images: all_faces,
exclusions: {
min_width: 1200,
min_height: 400
},
on_finish: function() {
}
// use_webaudio: false
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I am running a study using jsPsych, and saving the data to a server. The problem is that although the data are often saved when I try it, and is saved for about 66-80% of the participants who submit the survey code on MTurk, there are still about 20-30% of participants less data files than submitted assignments. It doesn't appear that there is any "funny business" on their end. I should mention that I don't seem to have any problems saving demographics data, and I had no problem with this when I used this code for undergraduates (also online).
I am wondering why this might happen. It appears that this occurs more often early on after publishing the HIT rather than later. Given that this is the time when a lot of people participate, I am thinking that it may be a bottleneck issue.
Any feedback would be greatly appreciated.
Thanks.
Here is some of the code that is used for saving data:
My php files:
FamSearch__writedata.php (which is identical to FamSearch_demo_writedata.php):
Beta Was this translation helpful? Give feedback.
All reactions