magpie-ea / magpie-modules

the reusable front-end bits in the _magpie modules
MIT License
7 stars 1 forks source link

Feature: hook after response given + unlimited number of hooks (array) #53

Open JannisBush opened 5 years ago

michael-franke commented 5 years ago

The hook system seems unable to realize basic affordances. An example is in SimonTask -> branch example_hook_problems.

Desired behavior:

JannisBush commented 5 years ago

This behavior works perfectly fine and was (almost) already there.

The problem that the stimulus hides after a short time was introduced here: hide of stimulus added, this also makes it only possible to answer after the stimulus hides (see here for explanation of the hook/trial life cycle)

The problem that the response was enabled to early was introduced here: response enabled to early

The RT measurement was actually incorrect, because only the pause was subtracted and not the fixation time and the stim duration. I now changed it, to only start measuring the RT after the response is enabled, this means we don't have to subtract anything.

https://github.com/babe-project/SimonTask/commit/3f01f3d019e075fdb8e066493544e1637f0158f5

Here, I pushed the fixed hooks version.

michael-franke commented 5 years ago

Thanks for clarifying. But this is not quite the required behavior yet. The stimulus should disappear after 500ms after all. However, the response should be enabled (and RT clocking should start) at the moment the stimulus appears.

The desired behavior is implemented (without hooks and corrected mistakes in RT measurement) in branch mf_fixes. But I would love to know how to do this with hooks.

On 12. Apr 2019, at 21:04, JannisBush notifications@github.com wrote:

This behavior works perfectly fine and was (almost) already there.

The problem that the stimulus hides after a short time was introduced here: hide of stimulus added, this also makes it only possible to answer after the stimulus hides (see here for explanation of the hook/trial life cycle)

The problem that the response was enabled to early was introduced here: response enabled to early

The RT measurement was actually incorrect, because only the pause was subtracted and not the fixation time and the stim duration. I now changed it, to only start measuring the RT after the response is enabled, this means we don't have to subtract anything.

babe-project/SimonTask@3f01f3d

Here, I pushed the fixed hooks version.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

JannisBush commented 5 years ago

Okay, then we can't use the stimulus hide step of the trial life cycle. But we can just do the same thing it does in the after_response_enabled hook. I pushed the changes (also added the reminder) to the hook branch.

The problem (related to this #53 issue) is, that we have no after response given hook, therefore I had to clear the timeouts in the custom view/handleResponse.

Also, I realized we have no before_pause hook, which could be useful and be realized in connection to the unlimited number of hooks.