help_text = "Elementy, które pojawiły się wyłącznie w jednym z dwóch górnych kwadratów" help_line = visual.TextStim(win=window, antialias=True, font=u'Arial', text=help_text, height=config['TEXT_SIZE'], wrapWidth=SCREEN_RES[0], color=u'black', pos=(0, -300)) clock_image = visual.ImageStim(win=window, image=join('images', 'clock.png'), interpolate=True, size=config['CLOCK_SIZE'], pos=config['CLOCK_POS']) response_clock = core.Clock() # TRAINING # show_info(window, join('.', 'messages', "instruction1.txt"), text_size=config['TEXT_SIZE'], screen_width=SCREEN_RES[0]) show_image(window, 'instruction.png', SCREEN_RES) #SCREEN_RES show_image(window, 'instruction_example.png', SCREEN_RES) show_image(window, 'instruction_example2.png', SCREEN_RES) pos_feedb = visual.TextStim(window, text=u'Poprawna odpowied\u017A', color='black', height=40) neg_feedb = visual.TextStim(window, text=u'Niepoprawna odpowied\u017A', color='black', height=40) no_feedb = visual.TextStim(window, text=u'Nie udzieli\u0142e\u015B odpowiedzi', color='black', height=40) i = 1 for elem in config['TRAINING_TRIALS']: print(elem) for trail in range(elem['n_trails']): acc, rt, stim_time, n = run_trial(n=elem['level']) RESULTS.append([i, 0, acc, rt, stim_time, n, 0, 0]) i += 1 ### FEEDBACK
color='Gainsboro', winType='pygame') FRAMES_PER_SEC = get_frame_rate(window) mouse = event.Mouse(visible=False) clock_image = visual.ImageStim(win=window, image=join('images', 'clock.png'), interpolate=True, size=config['CLOCK_SIZE'], pos=config['CLOCK_POS']) response_clock = core.Clock() # TRAINING # show_info(window, join('.', 'messages', "instruction1.txt"),text_size=config['TEXT_SIZE'], screen_width=SCREEN_RES[0]) show_image(window, 'instruction.png', SCREEN_RES) i = 1 for elem in config['TRAINING_TRIALS']: print(elem) for trail in range(elem['n_trails']): acc, rt, stim_time, n, answer_type = run_trial(n=elem['level']) RESULTS.append([i, 0, acc, rt, stim_time, n, 0, 0, answer_type]) i += 1 # EXPERIMENT show_info(window, join('.', 'messages', "instruction2.txt"), text_size=config['TEXT_SIZE'], screen_width=SCREEN_RES[0])
win, text=replace_polish("Masz pół minuty przerwy. Nie odchodź od komputera"), color='black', height=config['TEXT_SIZE'], pos=(0, 0)) # TRAINING mean_acc = 0 data_train = prepare_trials(config["training"], config["train_trials_randomize"]) training_nr = 0 while mean_acc < config["min_training_acc"]: # show_info(win, join('.', 'messages', "instruction1.txt"), text_size=config['TEXT_SIZE'], # screen_width=SCREEN_RES[0], key=config["exit_key"]) show_image(win, 'instruction1.png', SCREEN_RES) show_image(win, 'instruction2.png', SCREEN_RES) show_image(win, 'instruction3.png', SCREEN_RES) show_image(win, 'instruction4.png', SCREEN_RES) mean_acc = 0 training_nr += 1 i = 1 for k, n, ans_type in data_train: corr1, corr2, acc, rt1, rt2 = run_trial(win, k, n, ans_type, config, config["feedback_in_training"], feedb) RESULTS.append( [i, "train", k, n, ans_type, corr1, corr2, acc, rt1, rt2]) i += 1
in_trial_instruction = visual.TextStim( win=win, height=config['IN_TRIAL_INSTRUCTION_SIZE'], alignHoriz='center', alignVert='center', font=u'Arial', pos=config["IN_TRIAL_INSTRUCTION_POS"], text=read_text_from_file( join('.', 'messages', "in_trial_instruction.txt")), wrapWidth=win.size[0], color=config["IN_TRIAL_INSTRUCTION_COLOR"]) # TRAINING 1 # show_info(win, join('.', 'messages', "instruction1.txt"), text_size=config['TEXT_SIZE'], screen_width=SCREEN_RES[0]) show_image(win, "instruction_1.jpg", size=config["INSTRUCTION_SIZE_TRAINING_1"]) training = True training_trials_info = load_training_trials("training_1_trials.yaml") training_trials = create_training_trials(config, win, training_trials_info) train_clock = clock_image if config["SHOW_CLOCK_IN_TRAINING_1"] else None for i, t in enumerate(training_trials): chosen_answer, acc, rt = run_trial( trial=t, config=config, response_clock=response_clock, clock_image=train_clock, fixation=fixation, win=win, instruction=in_trial_instruction, training=training,
size=config['CLOCK_SIZE'], pos=config['CLOCK_POS']) accept_box = AcceptBox(win, config["ACCEPT_BOX_POS"], config["ACCEPT_BOX_SIZE"], config["ACCEPT_BOX_TEXT"], config["START_BOX_COLOR"], config["START_TEXT_COLOR"], config["END_BOX_COLOR"], config["END_TEXT_COLOR"]) mouse = event.Mouse() response_clock = core.Clock() trial_nr = 1 # TRAINING # show_info(win, join('.', 'messages', "instruction1.txt"), text_size=config['TEXT_SIZE'], screen_width=SCREEN_RES[0]) show_image(win, "instrukcja_1.jpg", size=SCREEN_RES) show_image(win, "instrukcja_2.jpg", size=SCREEN_RES) # show_image(window, 'instruction.png', SCREEN_RES) for item in config["TRAINING_TRIALS"]: text = read_text_from_file(join('.', 'messages', "feedback_positive.txt")) + \ read_text_from_file(join('.', 'messages', "feedback_info_{}.txt".format(item))) feedback_positive = visual.TextStim(win=win, text=text, antialias=True, font=u'Arial', height=config['FEEDBACK_SIZE'], wrapWidth=win.size[0], color=u'black', alignHoriz='center', alignVert='center', pos=config["FEEDBACK_POS"])