From e2d2bba1f775a9c275c072e2914de28763f2bcfa Mon Sep 17 00:00:00 2001 From: Tobias Baumann Date: Tue, 24 May 2022 15:20:50 +0000 Subject: [PATCH] =?UTF-8?q?Dateien=20hochladen=20nach=20=E2=80=9Escenarios?= =?UTF-8?q?/scripts=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenarios/scripts/p300-tactile-stimulator.lua | 30 +++++++++---------- scenarios/scripts/p300-tactile-target.lua | 17 ++++------- 2 files changed, 20 insertions(+), 27 deletions(-) diff --git a/scenarios/scripts/p300-tactile-stimulator.lua b/scenarios/scripts/p300-tactile-stimulator.lua index 9f8e4e3..60d8f98 100644 --- a/scenarios/scripts/p300-tactile-stimulator.lua +++ b/scenarios/scripts/p300-tactile-stimulator.lua @@ -49,23 +49,21 @@ function initialize(box) dofile(box:get_config("${Path_Data}") .. "/plugins/stimulation/lua-stimulator-stim-codes.lua") --load box settings - row_base = _G[box:get_setting(2)] - col_base = _G[box:get_setting(3)] - n_tactilos = box:get_setting(4) - n_repetitions = box:get_setting(5) - flash_duration = box:get_setting(7) - noflash_duration = box:get_setting(8) - inter_repetition_delay = box:get_setting(9) - inter_trial_delay = box:get_setting(10) - send_toggle = _G[box:get_setting(11)] - time_to_send = box:get_setting(13) + row_base = _G[box:get_setting(2)] + n_tactilos = box:get_setting(3) + n_repetitions = box:get_setting(4) + n_trials = box:get_setting(5) + flash_duration = box:get_setting(6) + noflash_duration = box:get_setting(7) + inter_repetition_delay = box:get_setting(8) + inter_trial_delay = box:get_setting(9) + send_toggle = _G[box:get_setting(10)] + free_spelling = box:get_setting(11) + time_to_send = box:get_setting(12) - if box:get_setting(12) == 'true' then - free_spelling = true + --Set number of trials to 1 in free spelling mode + if free_spelling == 'true' then n_trials = 1 - else - free_spelling = false - n_trials = box:get_setting(6) end --Lua variables @@ -116,7 +114,7 @@ function process(box) end - if not free_spelling then + if free_spelling == 'false' then -- end experiment if set to copy spelling box:send_stimulation(1, OVTK_StimulationId_ExperimentStop ,box:get_current_time() , 0) send = false diff --git a/scenarios/scripts/p300-tactile-target.lua b/scenarios/scripts/p300-tactile-target.lua index 28967ff..d00fd75 100644 --- a/scenarios/scripts/p300-tactile-target.lua +++ b/scenarios/scripts/p300-tactile-target.lua @@ -9,15 +9,11 @@ function initialize(box) dofile(box:get_config("${Path_Data}") .. "/plugins/stimulation/lua-stimulator-stim-codes.lua") math.randomseed(os.time()) - row_base = _G[box:get_setting(2)] - col_base = _G[box:get_setting(3)] - n_tactilos = box:get_setting(4) - delay = box:get_setting(5) - if box:get_setting(6) == 'true' then - free_spelling = true - else - free_spelling = false - end + row_base = _G[box:get_setting(2)] + n_tactilos = box:get_setting(3) + delay = box:get_setting(4) + free_spelling = box:get_setting(5) + end -- this function is called when the box is uninitialized @@ -41,12 +37,11 @@ function process(box) -- gets stimulation stimulation_id, stimulation_time, stimulation_duration = box:get_stimulation(1, 1) - if not free_spelling then + if free_spelling == 'false' then if stimulation_id == OVTK_StimulationId_RestStart then -- triggers the target box:send_stimulation(1, row_base+math.random(1,n_tactilos)-1, t+delay, 0) - box:send_stimulation(1, col_base, t+delay, 0) elseif stimulation_id == OVTK_StimulationId_ExperimentStop then