Skip to content

Commit

Permalink
Change to prolific data collection
Browse files Browse the repository at this point in the history
  • Loading branch information
neharaj-commits committed Jul 15, 2024
1 parent 949ac93 commit 1434db9
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,23 @@
<script src="https://unpkg.com/@jspsych/[email protected]">/* Button plugin */</script>
<script src="https://unpkg.com/@jspsych/[email protected]">/* Preload plugin */</script>
<script src="https://unpkg.com/@jspsych/[email protected]">/* Instructions plugin */</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js">/* jQuery Library for proliferate data collection */</script>
<script src="https://proliferate.alps.science/static/js/proliferate.js" type="text/javascript">/* Proliferate data collection plugin */</script>
<link href="https://unpkg.com/[email protected]/css/jspsych.css" rel="stylesheet" type="text/css" />
</head>
<body></body>
<script>
/* Initialize jsPsych */
var jsPsych = initJsPsych({
on_finish: function() {
// jsPsych.data.displayData('csv');
jsPsych.data.get().localSave( 'csv','pilotA_data.csv');
on_finish: function(data) {
// DISPLAY RESPONSES IN BROWSER AFTER EXPERIMENT
// jsPsych.data.displayData('csv');

// DOWNLOAD RESPONSES AS .CSV FILE AFTER EXPERIMENT
// jsPsych.data.get().localSave( 'csv','pilotA_data.csv');

// COLLECT RESPONSES IN PROLIFERATE
proliferate.submit({"trials": data.values()});
}
});

Expand Down Expand Up @@ -187,6 +195,17 @@
show_progress_bar: true
};

/*
------------------------------------------
ADD SUBJECT_ID IN PROLIFIC DATA
------------------------------------------*/

var subject_id = jsPsych.data.getURLVariable('PROLIFIC_PID');

jsPsych.data.addProperties({
subject_id: subject_id
});

/*
-------------------------------------------
WELCOME AND INSTRUCTIONS
Expand Down Expand Up @@ -410,7 +429,7 @@

var contact_msg = {
type: jsPsychHtmlButtonResponse,
stimulus: `<p> Thank you for completing the experiment. Please email for [email protected] any questions or concerns. </p>`,
stimulus: `<p> Thank you for completing the experiment. Please email [email protected] for any questions or concerns. </p>`,
choices: [ 'Finish']
};

Expand Down

0 comments on commit 1434db9

Please sign in to comment.