Skip to content

Commit

Permalink
Fix hook
Browse files Browse the repository at this point in the history
  • Loading branch information
JannisBush committed Apr 12, 2019
1 parent dd469f6 commit 3f01f3d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
13 changes: 7 additions & 6 deletions custom_views.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const keyPress_simontask = function(config) {

if (keyPressed === key1 || keyPressed === key2) {
let correctness;
const RT = Date.now() - startingTime - pause; // measure RT before anything else
const RT = Date.now() - startingTime; // measure RT before anything else

if (
config.data[CT].expected ===
Expand Down Expand Up @@ -91,15 +91,16 @@ const keyPress_simontask = function(config) {
}
};

$(".babe-view").append(answerContainerElem);
$("body").on("keydown", handleKeyPress);
//$(".babe-view").append(answerContainerElem);
//$("body").on("keydown", handleKeyPress);

const enableResponse = function() {
// $(".babe-view").append(answerContainerElem);
// $("body").on("keydown", handleKeyPress);
$(".babe-view").append(answerContainerElem);
$("body").on("keydown", handleKeyPress);
startingTime = Date.now();
};

startingTime = Date.now();
//startingTime = Date.now();

// creates the DOM of the trial view
babeUtils.view.createTrialDOM(
Expand Down
8 changes: 4 additions & 4 deletions views.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ const practice_session = keyPress_simontask({
trial_type: 'practice',
data: simonTask_info.keyPress_practice,
fix_duration: 2200,
stim_duration: 500,
pause: 500,
//stim_duration: 500, // this hides the stimulus after 500ms!
//pause: 500, // random pause generated in the custom_view
//hook: {after_response_enabled: count_time}
});

Expand All @@ -130,7 +130,7 @@ const test_session = keyPress_simontask({
trial_type: 'main',
data: simonTask_info.keyPress_test,
fix_duration: 200,
stim_duration: 500,
pause: 500,
//stim_duration: 500, // this hides the stimulus after 500ms!
//pause: 500, // random pause generated in the custom_view
//hook: {after_response_enabled: count_time}
});

0 comments on commit 3f01f3d

Please sign in to comment.