In case it is helpful for anyone else, here is my modified code:
var pavlovia_finish = {
type: "pavlovia",
command: "finish",
participantId: surveyCode,
// Thomas Pronk; your filter function here
dataFilter: function(data) {
// Printing the data received from jsPsych.data.get().csv(); a CSV data structure
console.log(data);
// You can also access the data directly, for instance getting it as JSON
console.log(jsPsych.data.get().csv());
// Return whatever data you'd like to store
return data;
},
// Thomas Pronk; call this function when we're done with the experiment and data reception has been confirmed by Pavlovia
completedCallback: function() {
window.location.replace(finishURL);
}
};
tl.push(pavlovia_finish);