From b7d43b32805e038d9297272470928266558f1101 Mon Sep 17 00:00:00 2001 From: KristinDiep Date: Sat, 1 Apr 2017 16:14:57 -0400 Subject: [PATCH] added 'other key' option --- examples/iat-example.html | 16 +++--- plugins/jspsych-iat.js | 113 +++++++++++++++++++++----------------- 2 files changed, 72 insertions(+), 57 deletions(-) diff --git a/examples/iat-example.html b/examples/iat-example.html index b15d7ccc..b1ae0260 100644 --- a/examples/iat-example.html +++ b/examples/iat-example.html @@ -42,8 +42,8 @@ var category_block = { var instructions_block = { type: 'text', - text: "

Press E for:
" + - "YOUNG

" + "

Press I for:
" + "OLD

" + + text: "

Press E for:
" + + "YOUNG

" + "

Press I for:
" + "OLD

" + "
" + "

Put a left finger on the E key for items that belong to the Old People category. Put a right finger on the " + "I key for items that belong to the Young People " + @@ -93,8 +93,8 @@ var trial_block = { var instructions_block2 = { type: 'text', - text: "

Press E for:
" + - "BAD
" + "
" + + text: "
Press E for:
" + + "BAD
" + "
" + "Press I for:
" + "GOOD
" + "
" + "

Put a left finger on the E key for items that " + @@ -149,9 +149,9 @@ var trial_block2 = { var instructions_block3 = { type: 'text', - text: "

Press 'E' for:
" + - "Bad
" + "or
" + "Old People
" + "
" + - "Press 'I' for:
" + "Good
" + "or
" + "Young People
" + + text: "
Press 'E' for:
" + + "BAD
" + "or
" + "OLD PEOPLE
" + "
" + + "Press 'I' for:
" + "GOOD
" + "or
" + "YOUNG PEOPLE
" + "

Use E for Bad and for " + "Old People
" + "Use I for Good and for Young People
" + "Each item belongs to only one category.

" + "If you " + @@ -424,7 +424,7 @@ var trial_block4 = { var timeline = []; // timeline.push(welcome_block); // timeline.push(category_block); -// timeline.push(instructions_block); +//timeline.push(instructions_block); timeline.push(trial_block); timeline.push(instructions_block2); timeline.push(trial_block2); diff --git a/plugins/jspsych-iat.js b/plugins/jspsych-iat.js index bd63c742..86a28ea3 100644 --- a/plugins/jspsych-iat.js +++ b/plugins/jspsych-iat.js @@ -9,7 +9,7 @@ **/ -jsPsych.plugins["iat"] = (function() { + jsPsych.plugins["iat"] = (function() { var plugin = {}; @@ -44,8 +44,9 @@ jsPsych.plugins["iat"] = (function() { trial.is_html = (typeof trial.is_html == 'undefined') ? false : trial.is_html; trial.prompt = trial.prompt || ""; + //Creates extra styling needed - var node = display_element.innerHTML += '