top of page
TrajTracker Paradigms: Sample scripts
Basic number-to-position

Running a standard number-to-position task requires almost no coding: You only need to initialize the environment, set few configuration parameters, and call 4 functions to initialize and run the experiment.

import expyriment as xpy

 

import trajtracker as ttrk

import trajtrackerp as ttrkp

from trajtrackerp import num2pos, common

 

 

if not xpy.misc.is_android_running():

    xpy.control.defaults.window_mode = True

    ttrk.log_to_console = True

 

 

config = num2pos.Config("Num2Pos(0-100*2)", max_movement_time=2, max_numberline_value=100,

                        speed_guide_enabled=True, data_source=range(101) * 2)

 

 

#-- Initialize Expyriment

 

exp = ttrk.initialize()

xpy.control.start(exp)

 

if not xpy.misc.is_android_running():

    exp.mouse.show_cursor()

 

#-- Get subject info

(subj_id, subj_name) = ttrkp.common.get_subject_name_id()

 

#-- Run the experiment

exp_info = num2pos.ExperimentInfo(config, exp, subj_id, subj_name)

num2pos.create_experiment_objects(exp_info)

common.register_to_event_manager(exp_info)

num2pos.run_trials(exp_info)

 

#-- Shutdown Expyriment

xpy.control.end()

bottom of page