From d2d06d0772c531f13a9ca1e01aa72b56fb4fad41 Mon Sep 17 00:00:00 2001 From: Josh de Leeuw Date: Mon, 23 Jul 2012 17:14:50 -0400 Subject: [PATCH] added prompt option to XAB --- jspsych-xab.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/jspsych-xab.js b/jspsych-xab.js index e7f45363..b388902d 100755 --- a/jspsych-xab.js +++ b/jspsych-xab.js @@ -16,9 +16,14 @@ trials[i]["a_path"] = xab_stims[i][0]; trials[i]["b_path"] = xab_stims[i][1]; trials[i]["timing"] = params["timing"]; - trials[i]["data"] = params["data"][i] || params["data"] || undefined; trials[i]["left_key"] = params["left_key"] || 81; // defaults to 'q' trials[i]["right_key"] = params["right_key"] || 80; // defaults to 'p' + if(params["prompt"]) { + trials[i]["prompt"] = params["prompt"]; + } + if(params["data"]){ + trials[i]["data"] = params["data"][i]; + } } return trials; } @@ -58,6 +63,11 @@ "class": 'xab' })); + if(trial.prompt) + { + $this.append(trial.prompt); + } + var resp_func = function(e) { var flag = false;