Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions MultiTaskBattery/task_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,12 @@ def show_stim(self):
def run_trial(self,trial):
# get current time (self.t0)
self.screen.fixation_cross()
send_event = getattr(self.const, 'send_event', None)
if send_event:
send_event('block_start_rest', self.ttl_clock.get_time(), task=self.name)
self.ttl_clock.wait_until(self.start_time + trial['trial_dur'])
if send_event:
send_event('block_end', self.ttl_clock.get_time(), task=self.name)
return trial

class VerbGeneration(Task):
Expand Down
5 changes: 5 additions & 0 deletions docs/custom_experiments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ defaults are used.
- ``False``
- If ``True``, writes a BIDS ``events.tsv`` for each scan into
``<subj_id>/events/`` (see Output files).
* - ``send_event``
- ``None``
- A function the rest task calls when its fixation cross appears and when
it ends, as ``send_event(name, time, task='rest')`` with ``name``
``'block_start_rest'`` or ``'block_end'``, e.g. to send MEG triggers.
* - ``task_modules``
- ``[]``
- List of imported Python modules that hold custom Task and TaskFile
Expand Down
Loading