diff --git a/RTKap.js b/RTKap.js new file mode 100644 index 0000000..e0f1bdd --- /dev/null +++ b/RTKap.js @@ -0,0 +1,155 @@ +/* Change 1: Adding the image hosting site */ +// define the site that hosts stimuli images +// usually https://.github.io// +var repo_site = "https://spoggesi.github.io/Qualtrics-test/"; + +/* create timeline */ +var timeline = []; + +/* define instructions trial */ +var instructions = { + type: "html-keyboard-response", + stimulus: "

Please eat a spoonful of the sample, but do not finish it.

" + + "

You will now carry out the same task as the practice task.

" + + "

This time, please respond to whether you associate the word shown with the yoghurt you have just eaten or your experience of eating this yoghurt.

" + + "

There are no incorrect answers, just your opinion.

" + + "

Please place your fingers over the F and J keys ready to make your choices.

" + + "

Press any key to begin.

", + post_trial_gap: 2000 +}; +timeline.push(instructions); + +/* test trials */ + +var test_stimuli = [{ + stimulus: '
energetic
', + data: {test_part: 'energetickaphome', correct_response: 'j'} + }, + { + stimulus: '
indulgent
', + data: {test_part: 'indulgentkaphome', correct_response: 'j'} + }, + { + stimulus: '
nervous
', + data: {test_part: 'nervouskaphome', correct_response: 'j'} + }, + { + stimulus: '
relaxed
', + data: {test_part: 'relaxedkaphome', correct_response: 'j'} + }, + { + stimulus: '
active
', + data: {test_part: 'activekaphome', correct_response: 'j'} + }, + { + stimulus: '
happy
', + data: {test_part: 'happykaphome', correct_response: 'j'} + }, + { + stimulus: '
uninspired
', + data: {test_part: 'uninspiredkaphome', correct_response: 'j'} + }, + { + stimulus: '
classic
', + data: {test_part: 'classickaphome', correct_response: 'j'} + }, + { + stimulus: '
impressed
', + data: {test_part: 'impressedkaphome', correct_response: 'j'} + }, + { + stimulus: '
sour
', + data: {test_part: 'sourkaphome', correct_response: 'j'} + }, + { + stimulus: '
sweet
', + data: {test_part: 'sweetkaphome', correct_response: 'j'} + }, + { + stimulus: '
thick
', + data: {test_part: 'thickkaphome', correct_response: 'j'} + }, + { + stimulus: '
creamy
', + data: {test_part: 'creamykaphome', correct_response: 'j'} + }, + { + stimulus: '
healthy
', + data: {test_part: 'healthykaphome', correct_response: 'j'} + }, + { + stimulus: '
tasty
', + data: {test_part: 'tastykaphome', correct_response: 'j'} + } +]; + +var fixation = { + type: 'html-keyboard-response', + stimulus: '
+
', + choices: jsPsych.NO_KEYS, + prompt: '
press "F" for NO
press "J" for YES
', + trial_duration: function () { + return jsPsych.randomization.sampleWithoutReplacement([1000], 1)[0]; + }, + data: { + test_part: 'fixation' + } +} + +var test = { + type: "html-keyboard-response", + stimulus: jsPsych.timelineVariable('stimulus'), + choices: ['f', 'j'], + data: jsPsych.timelineVariable('data'), + prompt: '
press "F" for NO
press "J" for YES
', + on_finish: function (data) { + data.correct = data.key_press == jsPsych.pluginAPI.convertKeyCharacterToKeyCode(data.correct_response); + }, +} + +var test_procedure = { + timeline: [fixation, test], + timeline_variables: test_stimuli, + repetitions: 3, + randomize_order: true +} +timeline.push(test_procedure); + +/* define debrief */ + +var debrief_block = { + type: "html-keyboard-response", + stimulus: function () { + var energetic = jsPsych.data.get().filter({test_part: 'energetic'}); + var indulgent = jsPsych.data.get().filter({test_part: 'indulgent'}); + var nervous = jsPsych.data.get().filter({test_part: 'nervous'}); + var relaxed = jsPsych.data.get().filter({test_part: 'relaxed'}); + var active = jsPsych.data.get().filter({test_part: 'active'}); + var happy = jsPsych.data.get().filter({test_part: 'happy'}); + var uninspired = jsPsych.data.get().filter({test_part: 'uninspired'}); + var classic = jsPsych.data.get().filter({test_part: 'classic'}); + var impressed= jsPsych.data.get().filter({test_part: 'impressed'}); + var sour = jsPsych.data.get().filter({test_part: 'sour'}); + var sweet = jsPsych.data.get().filter({test_part: 'sweet'}); + var thick = jsPsych.data.get().filter({test_part: 'thick'}); + var creamy = jsPsych.data.get().filter({test_part: 'creamy'}); + var healthy = jsPsych.data.get().filter({test_part: 'healthy'}); + var tasty = jsPsych.data.get().filter({test_part: 'tasty'}); + + var rt_energetic = Math.round(energetic.select('rt').mean()); + var rt_indulgent = Math.round(indulgent.select('rt').mean()); + var rt_nervous = Math.round(nervous.select('rt').mean()); + var rt_relaxed = Math.round(relaxed.select('rt').mean()); + var rt_active = Math.round(active.select('rt').mean()); + var rt_happy = Math.round(happy.select('rt').mean()); + var rt_uninspired = Math.round(uninspired.select('rt').mean()); + var rt_classic = Math.round(classic.select('rt').mean()); + var rt_impressed = Math.round(impressed.select('rt').mean()); + var rt_sour= Math.round(indulgent.select('rt').mean()); + var rt_sweet= Math.round(sweet.select('rt').mean()); + var rt_thick= Math.round(thick.select('rt').mean()); + var rt_creamy= Math.round(creamy.select('rt').mean()); + var rt_healthy= Math.round(healthy.select('rt').mean()); + var rt_tasty= Math.round(tasty.select('rt').mean()); + } +};