#!/usr/bin/env python # -*- coding: utf-8 -*- """ This experiment was created using PsychoPy3 Experiment Builder (v3.0.6), on avril 02, 2019, at 14:23 If you publish work using this script please cite the PsychoPy publications: Peirce, JW (2007) PsychoPy - Psychophysics software in Python. Journal of Neuroscience Methods, 162(1-2), 8-13. Peirce, JW (2009) Generating stimuli for neuroscience using PsychoPy. Frontiers in Neuroinformatics, 2:10. doi: 10.3389/neuro.11.010.2008 """ from __future__ import absolute_import, division from psychopy import locale_setup, sound, gui, visual, core, data, event, logging, clock from psychopy.constants import (NOT_STARTED, STARTED, PLAYING, PAUSED, STOPPED, FINISHED, PRESSED, RELEASED, FOREVER) import numpy as np # whole numpy lib is available, prepend 'np.' from numpy import (sin, cos, tan, log, log10, pi, average, sqrt, std, deg2rad, rad2deg, linspace, asarray) from numpy.random import random, randint, normal, shuffle import os # handy system and path functions import sys # to get file system encoding # Ensure that relative paths start from the same directory as this script _thisDir = os.path.dirname(os.path.abspath(__file__)) os.chdir(_thisDir) # Store info about the experiment session psychopyVersion = '3.0.6' expName = 'Derivation_flexion' # from the Builder filename that created this script expInfo = {'participant': '', 'session': '001'} dlg = gui.DlgFromDict(dictionary=expInfo, title=expName) if dlg.OK == False: core.quit() # user pressed cancel expInfo['date'] = data.getDateStr() # add a simple timestamp expInfo['expName'] = expName expInfo['psychopyVersion'] = psychopyVersion # Data file name stem = absolute path + name; later add .psyexp, .csv, .log, etc filename = _thisDir + os.sep + u'data/%s_%s_%s' % (expInfo['participant'], expName, expInfo['date']) # An ExperimentHandler isn't essential but helps with data saving thisExp = data.ExperimentHandler(name=expName, version='', extraInfo=expInfo, runtimeInfo=None, originPath='C:\\Users\\marie\\Documents\\UQAM\\PsychoPy\\MORPHO\\Epreuves_morpho.py', savePickle=True, saveWideText=True, dataFileName=filename) # save a log file for detail verbose info logFile = logging.LogFile(filename+'.log', level=logging.EXP) logging.console.setLevel(logging.WARNING) # this outputs to the screen, not a file endExpNow = False # flag for 'escape' or other condition => quit the exp # Start Code - component code to be run before the window creation # Setup the Window win = visual.Window( size=[1536, 864], fullscr=True, screen=0, allowGUI=False, allowStencil=False, monitor='testMonitor', color='white', colorSpace='rgb', blendMode='avg', useFBO=True, units='height') # store frame rate of monitor if we can measure it expInfo['frameRate'] = win.getActualFrameRate() if expInfo['frameRate'] != None: frameDur = 1.0 / round(expInfo['frameRate']) else: frameDur = 1.0 / 60.0 # could not measure, so guess # Initialize components for Routine "Accueil_Derivation_flexion" Accueil_Derivation_flexionClock = core.Clock() text_Accueil_Derivation_flexion = visual.TextStim(win=win, name='text_Accueil_Derivation_flexion', text='PREMIÈRE ÉPREUVE', font='Arial', pos=(0, 0), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Consignes_Derivation_flexion" Consignes_Derivation_flexionClock = core.Clock() text_Consignes_Derivation_flexion = visual.TextStim(win=win, name='text_Consignes_Derivation_flexion', text="Consignes :\n\nUn mot apparait en haut de l'écran.\n\nIl y a une phrase juste en dessous, mais il manque un mot dedans!\n\nTu dois compléter la phrase en écrivant un mot qui ressemble à celui qui est en haut de l'écran, et qui rend la phrase correcte.\n\nQuand tu as fini d'écrire ton mot, appuie sur Entrée.", font='Arial', pos=(0, 0), height=0.03, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Accueil_Apprentissage" Accueil_ApprentissageClock = core.Clock() text_Accueil_Apprentissage = visual.TextStim(win=win, name='text_Accueil_Apprentissage', text='Un peu de pratique pour commencer!', font='Arial', pos=(0, 0), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Apprentissage_Derivation_flexion" Apprentissage_Derivation_flexionClock = core.Clock() Mot_Apprentissage_Derivation_flexion = visual.TextStim(win=win, name='Mot_Apprentissage_Derivation_flexion', text='default text', font='Arial', pos=(0, 0.3), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); inputText = "" Phrase_Apprentissage_Derivation_flexion = visual.TextStim(win=win, name='Phrase_Apprentissage_Derivation_flexion', text='default text', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-3.0); Reponse_Apprentissage_Derivation_flexion = visual.TextStim(win=win, name='Reponse_Apprentissage_Derivation_flexion', text='default text', font='Arial', pos=(0, -0.1), height=0.05, wrapWidth=None, ori=0, color=[1.0,-1,-1], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-4.0); # Initialize components for Routine "Apprentissage_Derivation_flexion_feedback" Apprentissage_Derivation_flexion_feedbackClock = core.Clock() Mot_Apprentissage_Derivation_flexion_feedback = visual.TextStim(win=win, name='Mot_Apprentissage_Derivation_flexion_feedback', text='default text', font='Arial', pos=(0, 0.3), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); Phrase_Apprentissage_Derivation_flexion_feedback = visual.TextStim(win=win, name='Phrase_Apprentissage_Derivation_flexion_feedback', text='default text', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-2.0); Reponse_Apprentissage_Derivation_flexion_feedback = visual.TextStim(win=win, name='Reponse_Apprentissage_Derivation_flexion_feedback', text='default text', font='Arial', pos=(0, -0.1), height=0.05, wrapWidth=None, ori=0, color=[1.0,-1,-1], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-3.0); Feedback_Apprentissage_Derivation_flexion_feedback = visual.TextStim(win=win, name='Feedback_Apprentissage_Derivation_flexion_feedback', text='default text', font='Arial', pos=(0, -0.2), height=0.05, wrapWidth=None, ori=0, color=[-1,1,-1], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-4.0); # Initialize components for Routine "Accueil_Epreuve" Accueil_EpreuveClock = core.Clock() text_Accueil_Epreuve = visual.TextStim(win=win, name='text_Accueil_Epreuve', text="L'épreuve va maintenant commencer.", font='Arial', pos=(0, 0), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Epreuve_Derivation_flexion" Epreuve_Derivation_flexionClock = core.Clock() Mot_Epreuve_Derivation_flexion = visual.TextStim(win=win, name='Mot_Epreuve_Derivation_flexion', text='default text', font='Arial', pos=(0, 0.3), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); inputText = "" Phrase_Derivation_flexion = visual.TextStim(win=win, name='Phrase_Derivation_flexion', text='default text', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-3.0); Reponse_Derivation_flexion = visual.TextStim(win=win, name='Reponse_Derivation_flexion', text='default text', font='Arial', pos=(0, -0.1), height=0.05, wrapWidth=None, ori=0, color=[1.0,-1,-1], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-4.0); # Initialize components for Routine "Accueil_Decomposition" Accueil_DecompositionClock = core.Clock() text_Accueil_Decomposition = visual.TextStim(win=win, name='text_Accueil_Decomposition', text='DEUXIÈME ÉPREUVE', font='Arial', pos=(0, 0), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Consignes_Decomposition" Consignes_DecompositionClock = core.Clock() text_Consignes_Decomposition = visual.TextStim(win=win, name='text_Consignes_Decomposition', text="Consignes :\n\nUn mot apparait en haut de l'écran.\n\nIl y a une phrase juste en dessous, mais il manque un mot dedans!\n\nTu dois compléter la phrase en écrivant un mot qui ressemble à celui qui est en haut de l'écran, et qui rend la phrase correcte.\n\nQuand tu as fini d'écrire ton mot, appuie sur Entrée.", font='Arial', pos=(0, 0), height=0.03, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Accueil_Apprentissage" Accueil_ApprentissageClock = core.Clock() text_Accueil_Apprentissage = visual.TextStim(win=win, name='text_Accueil_Apprentissage', text='Un peu de pratique pour commencer!', font='Arial', pos=(0, 0), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Apprentissage_Decomposition" Apprentissage_DecompositionClock = core.Clock() Mot_Apprentissage_Decomposition = visual.TextStim(win=win, name='Mot_Apprentissage_Decomposition', text='default text', font='Arial', pos=(0, 0.3), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); inputText = "" Phrase_Apprentissage_Decomposition = visual.TextStim(win=win, name='Phrase_Apprentissage_Decomposition', text='default text', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-3.0); Reponse_Apprentissage_Decomposition = visual.TextStim(win=win, name='Reponse_Apprentissage_Decomposition', text='default text', font='Arial', pos=(0, -0.1), height=0.05, wrapWidth=None, ori=0, color=[1.0,-1,-1], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-4.0); # Initialize components for Routine "Apprentissage_Decomposition_feedback" Apprentissage_Decomposition_feedbackClock = core.Clock() Mot_Apprentissage_Decomposition_feedback = visual.TextStim(win=win, name='Mot_Apprentissage_Decomposition_feedback', text='default text', font='Arial', pos=(0, 0.3), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); Phrase_Apprentissage_Decomposition_feedback = visual.TextStim(win=win, name='Phrase_Apprentissage_Decomposition_feedback', text='default text', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-3.0); Reponse_Apprentissage_Decomposition_feedback = visual.TextStim(win=win, name='Reponse_Apprentissage_Decomposition_feedback', text='default text', font='Arial', pos=(0, -0.1), height=0.05, wrapWidth=None, ori=0, color=[1.0,-1,-1], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-4.0); Feedback_Apprentissage_Decomposition_feedback = visual.TextStim(win=win, name='Feedback_Apprentissage_Decomposition_feedback', text='default text', font='Arial', pos=(0, -0.2), height=0.05, wrapWidth=None, ori=0, color=[-1,1,-1], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-5.0); # Initialize components for Routine "Accueil_Epreuve" Accueil_EpreuveClock = core.Clock() text_Accueil_Epreuve = visual.TextStim(win=win, name='text_Accueil_Epreuve', text="L'épreuve va maintenant commencer.", font='Arial', pos=(0, 0), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Epreuve_Decomposition" Epreuve_DecompositionClock = core.Clock() Mot_Epreuve_Decomposition = visual.TextStim(win=win, name='Mot_Epreuve_Decomposition', text='default text', font='Arial', pos=(0, 0.3), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); inputText = "" Phrase_Epreuve_Decomposition = visual.TextStim(win=win, name='Phrase_Epreuve_Decomposition', text='default text', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-3.0); Reponse_Epreuve_Decomposition = visual.TextStim(win=win, name='Reponse_Epreuve_Decomposition', text='default text', font='Arial', pos=(0, -0.1), height=0.05, wrapWidth=None, ori=0, color=[1.0,-1,-1], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-4.0); # Initialize components for Routine "Accueil_Paires_de_mots" Accueil_Paires_de_motsClock = core.Clock() text_Accueil_Paires_de_mots = visual.TextStim(win=win, name='text_Accueil_Paires_de_mots', text='TROISIÈME ÉPREUVE', font='Arial', pos=(0, 0), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Consignes_Paires_de_mots" Consignes_Paires_de_motsClock = core.Clock() text_Consignes_Paires_de_mots = visual.TextStim(win=win, name='text_Consignes_Paires_de_mots', text="Consignes :\n\nCertains mots sont de la même famille.\n\nPar exemple, école et écolier sont des mots de la même famille. Les mots curieux et curiosité sont de la même famille.\n\nPar contre, les mots bouche et boucherie se ressemblent, mais ne sont pas de la même famille. Ils n'ont pas de sens en commun.\n\nDeux mots seront présentés ensemble à l'écran.\n\nAppuie sur O, pour oui, quand ils sont de la même famille.\n\nAppuie sur N, pour non, quand ils ne sont pas de la même famille.", font='Arial', pos=(0, 0), height=0.03, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Accueil_Apprentissage" Accueil_ApprentissageClock = core.Clock() text_Accueil_Apprentissage = visual.TextStim(win=win, name='text_Accueil_Apprentissage', text='Un peu de pratique pour commencer!', font='Arial', pos=(0, 0), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Apprentissage_Paires_de_mots" Apprentissage_Paires_de_motsClock = core.Clock() Mot1_Apprentissage_Paires_de_mots = visual.TextStim(win=win, name='Mot1_Apprentissage_Paires_de_mots', text='default text', font='Arial', pos=(0, 0.3), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); Mot2_Apprentissage_Paires_de_mots = visual.TextStim(win=win, name='Mot2_Apprentissage_Paires_de_mots', text='default text', font='Arial', pos=(0, 0), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-2.0); # Initialize components for Routine "Apprentissage_Paires_de_mots_feedback" Apprentissage_Paires_de_mots_feedbackClock = core.Clock() Mot1_Apprentissage_Paires_de_mots_feedback = visual.TextStim(win=win, name='Mot1_Apprentissage_Paires_de_mots_feedback', text='default text', font='Arial', pos=(0, 0.3), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); Mot2_Apprentissage_Paires_de_mots_feedback = visual.TextStim(win=win, name='Mot2_Apprentissage_Paires_de_mots_feedback', text='default text', font='Arial', pos=(0, 0), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-2.0); Feedback_Apprentissage_Paires_de_mots_feedback = visual.TextStim(win=win, name='Feedback_Apprentissage_Paires_de_mots_feedback', text='default text', font='Arial', pos=(0, -0.3), height=0.05, wrapWidth=None, ori=0, color=[-1,1,-1], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-3.0); # Initialize components for Routine "Accueil_Epreuve" Accueil_EpreuveClock = core.Clock() text_Accueil_Epreuve = visual.TextStim(win=win, name='text_Accueil_Epreuve', text="L'épreuve va maintenant commencer.", font='Arial', pos=(0, 0), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Epreuve_Paires_de_mots" Epreuve_Paires_de_motsClock = core.Clock() Mot1_Epreuve_Paires_de_mots = visual.TextStim(win=win, name='Mot1_Epreuve_Paires_de_mots', text='default text', font='Arial', pos=(0, 0.3), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); Mot2_Epreuve_Paires_de_mots = visual.TextStim(win=win, name='Mot2_Epreuve_Paires_de_mots', text='default text', font='Arial', pos=(0, 0), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-2.0); # Initialize components for Routine "Accueil_Pseudo_mots_flexion" Accueil_Pseudo_mots_flexionClock = core.Clock() text_Accueil_Pseudo_mots_flexion = visual.TextStim(win=win, name='text_Accueil_Pseudo_mots_flexion', text='QUATRIÈME ÉPREUVE', font='Arial', pos=(0, 0), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Consignes_Pseudo_mots_flexion" Consignes_Pseudo_mots_flexionClock = core.Clock() text_Consignes_Pseudo_mots_flexion = visual.TextStim(win=win, name='text_Consignes_Pseudo_mots_flexion', text="Consignes :\n\nUne phrase va apparaitre. Dans cette phrase, il y a un mot qui manque.\n\nUne fois que tu as lu cette phrase, appuie sur Entrée.\n\nOn te demande alors de choisir la meilleure réponse entre les mots présentés, numérotés de 1 à 4.\n\nCe ne sont pas de vrais mots, mais ce n'est pas grave!\n\nTu dois taper le chiffre correspondant au mot qui rend la phrase correcte.", font='Arial', pos=(0, 0), height=0.03, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Accueil_Apprentissage" Accueil_ApprentissageClock = core.Clock() text_Accueil_Apprentissage = visual.TextStim(win=win, name='text_Accueil_Apprentissage', text='Un peu de pratique pour commencer!', font='Arial', pos=(0, 0), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Apprentissage_Pseudo_mots_flexion" Apprentissage_Pseudo_mots_flexionClock = core.Clock() Phrase_Apprentissage_Pseudo_mots_flexion = visual.TextStim(win=win, name='Phrase_Apprentissage_Pseudo_mots_flexion', text='default text', font='Arial', pos=(0, 0.3), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Apprentissage_Pseudo_mots_flexion_2" Apprentissage_Pseudo_mots_flexion_2Clock = core.Clock() Phrase_Apprentissage_Pseudo_mots_flexion_2 = visual.TextStim(win=win, name='Phrase_Apprentissage_Pseudo_mots_flexion_2', text='default text', font='Arial', pos=(0, 0.3), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); Mot1_Apprentissage_Pseudo_mots_flexion_2 = visual.TextStim(win=win, name='Mot1_Apprentissage_Pseudo_mots_flexion_2', text='default text', font='Arial', pos=(0, -0.09), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-2.0); Mot2_Apprentissage_Pseudo_mots_flexion_2 = visual.TextStim(win=win, name='Mot2_Apprentissage_Pseudo_mots_flexion_2', text='default text', font='Arial', pos=(0, -0.15), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-3.0); Mot3_Apprentissage_Pseudo_mots_flexion_2 = visual.TextStim(win=win, name='Mot3_Apprentissage_Pseudo_mots_flexion_2', text='default text', font='Arial', pos=(0, -0.21), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-4.0); Mot4_Apprentissage_Pseudo_mots_flexion_2 = visual.TextStim(win=win, name='Mot4_Apprentissage_Pseudo_mots_flexion_2', text='default text', font='Arial', pos=(0, -0.27), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-5.0); # Initialize components for Routine "Apprentissage_Pseudo_mots_flexion_feedback" Apprentissage_Pseudo_mots_flexion_feedbackClock = core.Clock() Phrase_Apprentissage_Pseudo_mots_flexion_feedback = visual.TextStim(win=win, name='Phrase_Apprentissage_Pseudo_mots_flexion_feedback', text='default text', font='Arial', pos=(0, 0.3), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); Mot1_Apprentissage_Pseudo_mots_flexion_feedback = visual.TextStim(win=win, name='Mot1_Apprentissage_Pseudo_mots_flexion_feedback', text='default text', font='Arial', pos=(0, -0.09), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-2.0); Mot2_Apprentissage_Pseudo_mots_flexion_feedback = visual.TextStim(win=win, name='Mot2_Apprentissage_Pseudo_mots_flexion_feedback', text='default text', font='Arial', pos=(0, -0.15), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-3.0); Mot3_Apprentissage_Pseudo_mots_flexion_feedback = visual.TextStim(win=win, name='Mot3_Apprentissage_Pseudo_mots_flexion_feedback', text='default text', font='Arial', pos=(0, -0.21), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-4.0); Mot4_Apprentissage_Pseudo_mots_flexion_feedback = visual.TextStim(win=win, name='Mot4_Apprentissage_Pseudo_mots_flexion_feedback', text='default text', font='Arial', pos=(0, -0.27), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-5.0); Feedback_Apprentissage_Pseudo_mots_flexion_feedback = visual.TextStim(win=win, name='Feedback_Apprentissage_Pseudo_mots_flexion_feedback', text='default text', font='Arial', pos=(0, -0.77), height=0.05, wrapWidth=None, ori=0, color=[-1,1,-1], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-4.0); # Initialize components for Routine "Accueil_Epreuve" Accueil_EpreuveClock = core.Clock() text_Accueil_Epreuve = visual.TextStim(win=win, name='text_Accueil_Epreuve', text="L'épreuve va maintenant commencer.", font='Arial', pos=(0, 0), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Epreuve_Pseudo_mots_flexion" Epreuve_Pseudo_mots_flexionClock = core.Clock() Phrase_Epreuve_Pseudo_mots_flexion = visual.TextStim(win=win, name='Phrase_Epreuve_Pseudo_mots_flexion', text='default text', font='Arial', pos=(0, 0.3), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Epreuve_Pseudo_mots_flexion_2" Epreuve_Pseudo_mots_flexion_2Clock = core.Clock() Phrase_Epreuve_Pseudo_mots_flexion_2 = visual.TextStim(win=win, name='Phrase_Epreuve_Pseudo_mots_flexion_2', text='default text', font='Arial', pos=(0, 0.3), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); Mot1_Epreuve_Pseudo_mots_flexion_2 = visual.TextStim(win=win, name='Mot1_Epreuve_Pseudo_mots_flexion_2', text='default text', font='Arial', pos=(0, -0.09), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-2.0); Mot2_Epreuve_Pseudo_mots_flexion_2 = visual.TextStim(win=win, name='Mot2_Epreuve_Pseudo_mots_flexion_2', text='default text', font='Arial', pos=(0, -0.15), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-3.0); Mot3_Epreuve_Pseudo_mots_flexion_2 = visual.TextStim(win=win, name='Mot3_Epreuve_Pseudo_mots_flexion_2', text='default text', font='Arial', pos=(0, -0.21), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-4.0); Mot4_Epreuve_Pseudo_mots_flexion_2 = visual.TextStim(win=win, name='Mot4_Epreuve_Pseudo_mots_flexion_2', text='default text', font='Arial', pos=(0, -0.27), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-5.0); # Initialize components for Routine "Accueil_Pseudo_mots_derivation" Accueil_Pseudo_mots_derivationClock = core.Clock() text_Accueil_Pseudo_mots_derivation = visual.TextStim(win=win, name='text_Accueil_Pseudo_mots_derivation', text='CINQUIÈME ÉPREUVE', font='Arial', pos=(0, 0), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Consignes_Pseudo_mots_derivation" Consignes_Pseudo_mots_derivationClock = core.Clock() text_Consignes_Pseudo_mots_derivation = visual.TextStim(win=win, name='text_Consignes_Pseudo_mots_derivation', text="Consignes :\n\nUne phrase va apparaitre. Dans cette phrase, il y a un mot qui manque.\n\nUne fois que tu as lu cette phrase, appuie sur Entrée.\n\nOn te demande alors de choisir la meilleure réponse entre les mots présentés, numérotés de 1 à 3.\n\nCe ne sont pas de vrais mots, mais ce n'est pas grave!\n\nTu dois taper le chiffre correspondant au mot qui rend la phrase correcte.", font='Arial', pos=(0, 0), height=0.03, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Accueil_Apprentissage" Accueil_ApprentissageClock = core.Clock() text_Accueil_Apprentissage = visual.TextStim(win=win, name='text_Accueil_Apprentissage', text='Un peu de pratique pour commencer!', font='Arial', pos=(0, 0), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Apprentissage_Pseudo_mots_derivation" Apprentissage_Pseudo_mots_derivationClock = core.Clock() Phrase_Apprentissage_Pseudo_mots_derivation = visual.TextStim(win=win, name='Phrase_Apprentissage_Pseudo_mots_derivation', text='default text', font='Arial', pos=(0, 0.3), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Apprentissage_Pseudo_mots_derivation_2" Apprentissage_Pseudo_mots_derivation_2Clock = core.Clock() Phrase_Apprentissage_Pseudo_mots_derivation_2 = visual.TextStim(win=win, name='Phrase_Apprentissage_Pseudo_mots_derivation_2', text='default text', font='Arial', pos=(0, 0.3), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); Mot1_Apprentissage_Pseudo_mots_derivation_2 = visual.TextStim(win=win, name='Mot1_Apprentissage_Pseudo_mots_derivation_2', text='default text', font='Arial', pos=(0, -0.09), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-2.0); Mot2_Apprentissage_Pseudo_mots_derivation_2 = visual.TextStim(win=win, name='Mot2_Apprentissage_Pseudo_mots_derivation_2', text='default text', font='Arial', pos=(0, -0.15), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-3.0); Mot3_Apprentissage_Pseudo_mots_derivation_2 = visual.TextStim(win=win, name='Mot3_Apprentissage_Pseudo_mots_derivation_2', text='default text', font='Arial', pos=(0, -0.21), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-4.0); # Initialize components for Routine "Apprentissage_Pseudo_mots_derivation_feedback" Apprentissage_Pseudo_mots_derivation_feedbackClock = core.Clock() Phrase_Apprentissage_Pseudo_mots_derivation_feedback = visual.TextStim(win=win, name='Phrase_Apprentissage_Pseudo_mots_derivation_feedback', text='default text', font='Arial', pos=(0, 0.3), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); Mot1_Apprentissage_Pseudo_mots_derivation_feedback = visual.TextStim(win=win, name='Mot1_Apprentissage_Pseudo_mots_derivation_feedback', text='default text', font='Arial', pos=(0, -0.09), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-2.0); Mot2_Apprentissage_Pseudo_mots_derivation_feedback = visual.TextStim(win=win, name='Mot2_Apprentissage_Pseudo_mots_derivation_feedback', text='default text', font='Arial', pos=(0, -0.15), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-3.0); Mot3_Apprentissage_Pseudo_mots_derivation_feedback = visual.TextStim(win=win, name='Mot3_Apprentissage_Pseudo_mots_derivation_feedback', text='default text', font='Arial', pos=(0, -0.21), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-4.0); Feedback_Apprentissage_Pseudo_mots_derivation_feedback = visual.TextStim(win=win, name='Feedback_Apprentissage_Pseudo_mots_derivation_feedback', text='default text', font='Arial', pos=(0, -0.71), height=0.05, wrapWidth=None, ori=0, color=[-1,1,-1], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-4.0); # Initialize components for Routine "Accueil_Epreuve" Accueil_EpreuveClock = core.Clock() text_Accueil_Epreuve = visual.TextStim(win=win, name='text_Accueil_Epreuve', text="L'épreuve va maintenant commencer.", font='Arial', pos=(0, 0), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Epreuve_Pseudo_mots_derivation" Epreuve_Pseudo_mots_derivationClock = core.Clock() Phrase_Epreuve_Pseudo_mots_derivation = visual.TextStim(win=win, name='Phrase_Epreuve_Pseudo_mots_derivation', text='default text', font='Arial', pos=(0, 0.3), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Epreuve_Pseudo_mots_derivation_2" Epreuve_Pseudo_mots_derivation_2Clock = core.Clock() Phrase_Epreuve_Pseudo_mots_derivation_2 = visual.TextStim(win=win, name='Phrase_Epreuve_Pseudo_mots_derivation_2', text='default text', font='Arial', pos=(0, 0.3), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); Mot1_Epreuve_Pseudo_mots_derivation_2 = visual.TextStim(win=win, name='Mot1_Epreuve_Pseudo_mots_derivation_2', text='default text', font='Arial', pos=(0, -0.09), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-2.0); Mot2_Epreuve_Pseudo_mots_derivation_2 = visual.TextStim(win=win, name='Mot2_Epreuve_Pseudo_mots_derivation_2', text='default text', font='Arial', pos=(0, -0.15), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-3.0); Mot3_Epreuve_Pseudo_mots_derivation_2 = visual.TextStim(win=win, name='Mot3_Epreuve_Pseudo_mots_derivation_2', text='default text', font='Arial', pos=(0, -0.21), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-4.0); # Initialize components for Routine "Accueil_Extraction" Accueil_ExtractionClock = core.Clock() text_Accueil_Extraction = visual.TextStim(win=win, name='text_Accueil_Extraction', text='SIXIÈME ÉPREUVE', font='Arial', pos=(0, 0), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Consignes_Extraction" Consignes_ExtractionClock = core.Clock() text_Consignes_Extraction = visual.TextStim(win=win, name='text_Consignes_Extraction', text='Consignes :\n\nUn mot apparait en haut de l’écran.\n\nParfois, ce ne sera pas un vrai mot, mais ce n’est pas grave!\n\nEssaie de trouver un mot plus petit à l’intérieur de ce mot.\n\nLe mot que tu écris doit être de la même famille que le mot présenté.\n\nSi tu ne trouves pas de mot plus petit, réécris le mot présenté.\n\nAppuie sur entrée pour passer au prochain mot.', font='Arial', pos=(0, 0), height=0.03, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Accueil_Apprentissage" Accueil_ApprentissageClock = core.Clock() text_Accueil_Apprentissage = visual.TextStim(win=win, name='text_Accueil_Apprentissage', text='Un peu de pratique pour commencer!', font='Arial', pos=(0, 0), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Apprentissage_Extraction" Apprentissage_ExtractionClock = core.Clock() Phrase_Apprentissage_Extraction = visual.TextStim(win=win, name='Phrase_Apprentissage_Extraction', text='default text', font='Arial', pos=(0, 0.3), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); inputText = "" Mot_Apprentissage_Extraction = visual.TextStim(win=win, name='Mot_Apprentissage_Extraction', text='default text', font='Arial', pos=(0, 0.0), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-3.0); Reponse_Apprentissage_Extraction = visual.TextStim(win=win, name='Reponse_Apprentissage_Extraction', text='default text', font='Arial', pos=(0, -0.1), height=0.05, wrapWidth=None, ori=0, color=[1.0,-1,-1], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-4.0); # Initialize components for Routine "Apprentissage_Extraction_feedback" Apprentissage_Extraction_feedbackClock = core.Clock() Phrase_Apprentissage_Extraction_feedback = visual.TextStim(win=win, name='Phrase_Apprentissage_Extraction_feedback', text='default text', font='Arial', pos=(0, 0.3), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); Mot_Apprentissage_Extraction_feedback = visual.TextStim(win=win, name='Mot_Apprentissage_Extraction_feedback', text='default text', font='Arial', pos=(0, 0.0), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-3.0); Reponse_Apprentissage_Extraction_feedback = visual.TextStim(win=win, name='Reponse_Apprentissage_Extraction_feedback', text='default text', font='Arial', pos=(0, -0.1), height=0.05, wrapWidth=None, ori=0, color=[1.0,-1,-1], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-4.0); Feedback_Apprentissage_Extraction_feedback = visual.TextStim(win=win, name='Feedback_Apprentissage_Extraction_feedback', text='default text', font='Arial', pos=(0, -0.2), height=0.05, wrapWidth=None, ori=0, color=[-1,1,-1], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-5.0); # Initialize components for Routine "Accueil_Epreuve" Accueil_EpreuveClock = core.Clock() text_Accueil_Epreuve = visual.TextStim(win=win, name='text_Accueil_Epreuve', text="L'épreuve va maintenant commencer.", font='Arial', pos=(0, 0), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); # Initialize components for Routine "Epreuve_Extraction" Epreuve_ExtractionClock = core.Clock() Phrase_Epreuve_Extraction = visual.TextStim(win=win, name='Phrase_Epreuve_Extraction', text='default text', font='Arial', pos=(0, 0.3), height=0.05, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=0.0); inputText = "" Mot_Epreuve_Extraction = visual.TextStim(win=win, name='Mot_Epreuve_Extraction', text='default text', font='Arial', pos=(0, 0.0), height=0.08, wrapWidth=None, ori=0, color=[0,0,0], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-3.0); Reponse_Epreuve_Extraction = visual.TextStim(win=win, name='Reponse_Epreuve_Extraction', text='default text', font='Arial', pos=(0, -0.1), height=0.05, wrapWidth=None, ori=0, color=[1.0,-1,-1], colorSpace='rgb', opacity=1, languageStyle='LTR', depth=-4.0); # Create some handy timers globalClock = core.Clock() # to track the time since experiment started routineTimer = core.CountdownTimer() # to track time remaining of each (non-slip) routine # ------Prepare to start Routine "Accueil_Derivation_flexion"------- t = 0 Accueil_Derivation_flexionClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat key_resp_Accueil_Derivation_flexion = event.BuilderKeyResponse() # keep track of which components have finished Accueil_Derivation_flexionComponents = [text_Accueil_Derivation_flexion, key_resp_Accueil_Derivation_flexion] for thisComponent in Accueil_Derivation_flexionComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Accueil_Derivation_flexion"------- while continueRoutine: # get current time t = Accueil_Derivation_flexionClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_Accueil_Derivation_flexion* updates if t >= 0.0 and text_Accueil_Derivation_flexion.status == NOT_STARTED: # keep track of start time/frame for later text_Accueil_Derivation_flexion.tStart = t text_Accueil_Derivation_flexion.frameNStart = frameN # exact frame index text_Accueil_Derivation_flexion.setAutoDraw(True) # *key_resp_Accueil_Derivation_flexion* updates if t >= 0.0 and key_resp_Accueil_Derivation_flexion.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Accueil_Derivation_flexion.tStart = t key_resp_Accueil_Derivation_flexion.frameNStart = frameN # exact frame index key_resp_Accueil_Derivation_flexion.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Accueil_Derivation_flexion.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Accueil_Derivation_flexionComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Accueil_Derivation_flexion"------- for thisComponent in Accueil_Derivation_flexionComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Accueil_Derivation_flexion" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # ------Prepare to start Routine "Consignes_Derivation_flexion"------- t = 0 Consignes_Derivation_flexionClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat key_resp_Consignes_Derivation_flexion = event.BuilderKeyResponse() # keep track of which components have finished Consignes_Derivation_flexionComponents = [text_Consignes_Derivation_flexion, key_resp_Consignes_Derivation_flexion] for thisComponent in Consignes_Derivation_flexionComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Consignes_Derivation_flexion"------- while continueRoutine: # get current time t = Consignes_Derivation_flexionClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_Consignes_Derivation_flexion* updates if t >= 0.0 and text_Consignes_Derivation_flexion.status == NOT_STARTED: # keep track of start time/frame for later text_Consignes_Derivation_flexion.tStart = t text_Consignes_Derivation_flexion.frameNStart = frameN # exact frame index text_Consignes_Derivation_flexion.setAutoDraw(True) # *key_resp_Consignes_Derivation_flexion* updates if t >= 5 and key_resp_Consignes_Derivation_flexion.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Consignes_Derivation_flexion.tStart = t key_resp_Consignes_Derivation_flexion.frameNStart = frameN # exact frame index key_resp_Consignes_Derivation_flexion.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Consignes_Derivation_flexion.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Consignes_Derivation_flexionComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Consignes_Derivation_flexion"------- for thisComponent in Consignes_Derivation_flexionComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Consignes_Derivation_flexion" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # ------Prepare to start Routine "Accueil_Apprentissage"------- t = 0 Accueil_ApprentissageClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat key_resp_Accueil_Apprentissage = event.BuilderKeyResponse() # keep track of which components have finished Accueil_ApprentissageComponents = [text_Accueil_Apprentissage, key_resp_Accueil_Apprentissage] for thisComponent in Accueil_ApprentissageComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Accueil_Apprentissage"------- while continueRoutine: # get current time t = Accueil_ApprentissageClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_Accueil_Apprentissage* updates if t >= 0.0 and text_Accueil_Apprentissage.status == NOT_STARTED: # keep track of start time/frame for later text_Accueil_Apprentissage.tStart = t text_Accueil_Apprentissage.frameNStart = frameN # exact frame index text_Accueil_Apprentissage.setAutoDraw(True) # *key_resp_Accueil_Apprentissage* updates if t >= 1 and key_resp_Accueil_Apprentissage.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Accueil_Apprentissage.tStart = t key_resp_Accueil_Apprentissage.frameNStart = frameN # exact frame index key_resp_Accueil_Apprentissage.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Accueil_Apprentissage.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Accueil_ApprentissageComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Accueil_Apprentissage"------- for thisComponent in Accueil_ApprentissageComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Accueil_Apprentissage" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # set up handler to look after randomisation of conditions etc Loop_Apprentissage_Derivation_flexion = data.TrialHandler(nReps=1, method='random', extraInfo=expInfo, originPath=-1, trialList=data.importConditions('Derivation_flexion_apprentissage.xlsx'), seed=None, name='Loop_Apprentissage_Derivation_flexion') thisExp.addLoop(Loop_Apprentissage_Derivation_flexion) # add the loop to the experiment thisLoop_Apprentissage_Derivation_flexion = Loop_Apprentissage_Derivation_flexion.trialList[0] # so we can initialise stimuli with some values # abbreviate parameter names if possible (e.g. rgb = thisLoop_Apprentissage_Derivation_flexion.rgb) if thisLoop_Apprentissage_Derivation_flexion != None: for paramName in thisLoop_Apprentissage_Derivation_flexion: exec('{} = thisLoop_Apprentissage_Derivation_flexion[paramName]'.format(paramName)) for thisLoop_Apprentissage_Derivation_flexion in Loop_Apprentissage_Derivation_flexion: currentLoop = Loop_Apprentissage_Derivation_flexion # abbreviate parameter names if possible (e.g. rgb = thisLoop_Apprentissage_Derivation_flexion.rgb) if thisLoop_Apprentissage_Derivation_flexion != None: for paramName in thisLoop_Apprentissage_Derivation_flexion: exec('{} = thisLoop_Apprentissage_Derivation_flexion[paramName]'.format(paramName)) # ------Prepare to start Routine "Apprentissage_Derivation_flexion"------- t = 0 Apprentissage_Derivation_flexionClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat Mot_Apprentissage_Derivation_flexion.setText(Mot) key_resp_Apprentissage_Derivation_flexion = event.BuilderKeyResponse() theseKeys=key_resp_Apprentissage_Derivation_flexion.keys shift_flag = False Phrase_Apprentissage_Derivation_flexion.setText(Phrase) # keep track of which components have finished Apprentissage_Derivation_flexionComponents = [Mot_Apprentissage_Derivation_flexion, key_resp_Apprentissage_Derivation_flexion, Phrase_Apprentissage_Derivation_flexion, Reponse_Apprentissage_Derivation_flexion] for thisComponent in Apprentissage_Derivation_flexionComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Apprentissage_Derivation_flexion"------- while continueRoutine: # get current time t = Apprentissage_Derivation_flexionClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Mot_Apprentissage_Derivation_flexion* updates if t >= 0.0 and Mot_Apprentissage_Derivation_flexion.status == NOT_STARTED: # keep track of start time/frame for later Mot_Apprentissage_Derivation_flexion.tStart = t Mot_Apprentissage_Derivation_flexion.frameNStart = frameN # exact frame index Mot_Apprentissage_Derivation_flexion.setAutoDraw(True) # *key_resp_Apprentissage_Derivation_flexion* updates if t >= 0.0 and key_resp_Apprentissage_Derivation_flexion.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Apprentissage_Derivation_flexion.tStart = t key_resp_Apprentissage_Derivation_flexion.frameNStart = frameN # exact frame index key_resp_Apprentissage_Derivation_flexion.status = STARTED # keyboard checking is just starting win.callOnFlip(key_resp_Apprentissage_Derivation_flexion.clock.reset) # t=0 on next screen flip if key_resp_Apprentissage_Derivation_flexion.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed key_resp_Apprentissage_Derivation_flexion.keys.extend(theseKeys) # storing all keys key_resp_Apprentissage_Derivation_flexion.rt.append(key_resp_Apprentissage_Derivation_flexion.clock.getTime()) n= len(theseKeys) i = 0 while i < n: if (theseKeys[i] == 'return' and inputText != ""): if inputText == Reponse: msg = "Bravo!" else: msg = "La réponse était « " + Reponse + " »!" continueRoutine = False break elif theseKeys[i] == 'return': i = 1 + 1 elif theseKeys[i] == 'backspace': inputText = inputText[:-1] i = i + 1 elif theseKeys[i] == 'space': inputText += ' ' i = i + 1 elif theseKeys[i] in ['lshift', 'rshift']: shift_flag = True i = i + 1 else: if len(theseKeys[i]) == 1: if shift_flag: inputText += chr( ord(theseKeys[i]) - ord(' ')) shift_flag = False else: inputText += theseKeys[i] i = i + 1 # *Phrase_Apprentissage_Derivation_flexion* updates if t >= 0.0 and Phrase_Apprentissage_Derivation_flexion.status == NOT_STARTED: # keep track of start time/frame for later Phrase_Apprentissage_Derivation_flexion.tStart = t Phrase_Apprentissage_Derivation_flexion.frameNStart = frameN # exact frame index Phrase_Apprentissage_Derivation_flexion.setAutoDraw(True) # *Reponse_Apprentissage_Derivation_flexion* updates if t >= 0.0 and Reponse_Apprentissage_Derivation_flexion.status == NOT_STARTED: # keep track of start time/frame for later Reponse_Apprentissage_Derivation_flexion.tStart = t Reponse_Apprentissage_Derivation_flexion.frameNStart = frameN # exact frame index Reponse_Apprentissage_Derivation_flexion.setAutoDraw(True) if Reponse_Apprentissage_Derivation_flexion.status == STARTED: # only update if drawing Reponse_Apprentissage_Derivation_flexion.setText(inputText, log=False) # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Apprentissage_Derivation_flexionComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Apprentissage_Derivation_flexion"------- for thisComponent in Apprentissage_Derivation_flexionComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # check responses if key_resp_Apprentissage_Derivation_flexion.keys in ['', [], None]: # No response was made key_resp_Apprentissage_Derivation_flexion.keys=None Loop_Apprentissage_Derivation_flexion.addData('key_resp_Apprentissage_Derivation_flexion.keys',key_resp_Apprentissage_Derivation_flexion.keys) if key_resp_Apprentissage_Derivation_flexion.keys != None: # we had a response Loop_Apprentissage_Derivation_flexion.addData('key_resp_Apprentissage_Derivation_flexion.rt', key_resp_Apprentissage_Derivation_flexion.rt) # the Routine "Apprentissage_Derivation_flexion" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # ------Prepare to start Routine "Apprentissage_Derivation_flexion_feedback"------- t = 0 Apprentissage_Derivation_flexion_feedbackClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat Mot_Apprentissage_Derivation_flexion_feedback.setText(Mot) key_resp_Apprentissage_Derivation_flexion_feedback = event.BuilderKeyResponse() Phrase_Apprentissage_Derivation_flexion_feedback.setText(Phrase) Feedback_Apprentissage_Derivation_flexion_feedback.setText(msg) # keep track of which components have finished Apprentissage_Derivation_flexion_feedbackComponents = [Mot_Apprentissage_Derivation_flexion_feedback, key_resp_Apprentissage_Derivation_flexion_feedback, Phrase_Apprentissage_Derivation_flexion_feedback, Reponse_Apprentissage_Derivation_flexion_feedback, Feedback_Apprentissage_Derivation_flexion_feedback] for thisComponent in Apprentissage_Derivation_flexion_feedbackComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Apprentissage_Derivation_flexion_feedback"------- while continueRoutine: # get current time t = Apprentissage_Derivation_flexion_feedbackClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Mot_Apprentissage_Derivation_flexion_feedback* updates if t >= 0.0 and Mot_Apprentissage_Derivation_flexion_feedback.status == NOT_STARTED: # keep track of start time/frame for later Mot_Apprentissage_Derivation_flexion_feedback.tStart = t Mot_Apprentissage_Derivation_flexion_feedback.frameNStart = frameN # exact frame index Mot_Apprentissage_Derivation_flexion_feedback.setAutoDraw(True) # *key_resp_Apprentissage_Derivation_flexion_feedback* updates if t >= 0.0 and key_resp_Apprentissage_Derivation_flexion_feedback.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Apprentissage_Derivation_flexion_feedback.tStart = t key_resp_Apprentissage_Derivation_flexion_feedback.frameNStart = frameN # exact frame index key_resp_Apprentissage_Derivation_flexion_feedback.status = STARTED # keyboard checking is just starting if key_resp_Apprentissage_Derivation_flexion_feedback.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # *Phrase_Apprentissage_Derivation_flexion_feedback* updates if t >= 0.0 and Phrase_Apprentissage_Derivation_flexion_feedback.status == NOT_STARTED: # keep track of start time/frame for later Phrase_Apprentissage_Derivation_flexion_feedback.tStart = t Phrase_Apprentissage_Derivation_flexion_feedback.frameNStart = frameN # exact frame index Phrase_Apprentissage_Derivation_flexion_feedback.setAutoDraw(True) # *Reponse_Apprentissage_Derivation_flexion_feedback* updates if t >= 0.0 and Reponse_Apprentissage_Derivation_flexion_feedback.status == NOT_STARTED: # keep track of start time/frame for later Reponse_Apprentissage_Derivation_flexion_feedback.tStart = t Reponse_Apprentissage_Derivation_flexion_feedback.frameNStart = frameN # exact frame index Reponse_Apprentissage_Derivation_flexion_feedback.setAutoDraw(True) if Reponse_Apprentissage_Derivation_flexion_feedback.status == STARTED: # only update if drawing Reponse_Apprentissage_Derivation_flexion_feedback.setText(inputText, log=False) # *Feedback_Apprentissage_Derivation_flexion_feedback* updates if t >= 0.0 and Feedback_Apprentissage_Derivation_flexion_feedback.status == NOT_STARTED: # keep track of start time/frame for later Feedback_Apprentissage_Derivation_flexion_feedback.tStart = t Feedback_Apprentissage_Derivation_flexion_feedback.frameNStart = frameN # exact frame index Feedback_Apprentissage_Derivation_flexion_feedback.setAutoDraw(True) # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Apprentissage_Derivation_flexion_feedbackComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Apprentissage_Derivation_flexion_feedback"------- for thisComponent in Apprentissage_Derivation_flexion_feedbackComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) inputText = "" # the Routine "Apprentissage_Derivation_flexion_feedback" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # completed 1 repeats of 'Loop_Apprentissage_Derivation_flexion' # ------Prepare to start Routine "Accueil_Epreuve"------- t = 0 Accueil_EpreuveClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat key_resp_Accueil_Epreuve = event.BuilderKeyResponse() # keep track of which components have finished Accueil_EpreuveComponents = [text_Accueil_Epreuve, key_resp_Accueil_Epreuve] for thisComponent in Accueil_EpreuveComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Accueil_Epreuve"------- while continueRoutine: # get current time t = Accueil_EpreuveClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_Accueil_Epreuve* updates if t >= 0.0 and text_Accueil_Epreuve.status == NOT_STARTED: # keep track of start time/frame for later text_Accueil_Epreuve.tStart = t text_Accueil_Epreuve.frameNStart = frameN # exact frame index text_Accueil_Epreuve.setAutoDraw(True) # *key_resp_Accueil_Epreuve* updates if t >= 1 and key_resp_Accueil_Epreuve.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Accueil_Epreuve.tStart = t key_resp_Accueil_Epreuve.frameNStart = frameN # exact frame index key_resp_Accueil_Epreuve.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Accueil_Epreuve.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Accueil_EpreuveComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Accueil_Epreuve"------- for thisComponent in Accueil_EpreuveComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Accueil_Epreuve" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # set up handler to look after randomisation of conditions etc Loop_Epreuve_Derivation_flexion = data.TrialHandler(nReps=1, method='random', extraInfo=expInfo, originPath=-1, trialList=data.importConditions('Derivation_flexion_epreuve.xlsx'), seed=None, name='Loop_Epreuve_Derivation_flexion') thisExp.addLoop(Loop_Epreuve_Derivation_flexion) # add the loop to the experiment thisLoop_Epreuve_Derivation_flexion = Loop_Epreuve_Derivation_flexion.trialList[0] # so we can initialise stimuli with some values # abbreviate parameter names if possible (e.g. rgb = thisLoop_Epreuve_Derivation_flexion.rgb) if thisLoop_Epreuve_Derivation_flexion != None: for paramName in thisLoop_Epreuve_Derivation_flexion: exec('{} = thisLoop_Epreuve_Derivation_flexion[paramName]'.format(paramName)) for thisLoop_Epreuve_Derivation_flexion in Loop_Epreuve_Derivation_flexion: currentLoop = Loop_Epreuve_Derivation_flexion # abbreviate parameter names if possible (e.g. rgb = thisLoop_Epreuve_Derivation_flexion.rgb) if thisLoop_Epreuve_Derivation_flexion != None: for paramName in thisLoop_Epreuve_Derivation_flexion: exec('{} = thisLoop_Epreuve_Derivation_flexion[paramName]'.format(paramName)) # ------Prepare to start Routine "Epreuve_Derivation_flexion"------- t = 0 Epreuve_Derivation_flexionClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat Mot_Epreuve_Derivation_flexion.setText(Mot) key_resp_Epreuve_Derivation_flexion = event.BuilderKeyResponse() theseKeys= key_resp_Epreuve_Derivation_flexion.keys shift_flag = False Phrase_Derivation_flexion.setText(Phrase) # keep track of which components have finished Epreuve_Derivation_flexionComponents = [Mot_Epreuve_Derivation_flexion, key_resp_Epreuve_Derivation_flexion, Phrase_Derivation_flexion, Reponse_Derivation_flexion] for thisComponent in Epreuve_Derivation_flexionComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Epreuve_Derivation_flexion"------- while continueRoutine: # get current time t = Epreuve_Derivation_flexionClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Mot_Epreuve_Derivation_flexion* updates if t >= 0.0 and Mot_Epreuve_Derivation_flexion.status == NOT_STARTED: # keep track of start time/frame for later Mot_Epreuve_Derivation_flexion.tStart = t Mot_Epreuve_Derivation_flexion.frameNStart = frameN # exact frame index Mot_Epreuve_Derivation_flexion.setAutoDraw(True) # *key_resp_Epreuve_Derivation_flexion* updates if t >= 0.0 and key_resp_Epreuve_Derivation_flexion.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Epreuve_Derivation_flexion.tStart = t key_resp_Epreuve_Derivation_flexion.frameNStart = frameN # exact frame index key_resp_Epreuve_Derivation_flexion.status = STARTED # keyboard checking is just starting win.callOnFlip(key_resp_Epreuve_Derivation_flexion.clock.reset) # t=0 on next screen flip if key_resp_Epreuve_Derivation_flexion.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed key_resp_Epreuve_Derivation_flexion.keys.extend(theseKeys) # storing all keys key_resp_Epreuve_Derivation_flexion.rt.append(key_resp_Epreuve_Derivation_flexion.clock.getTime()) n= len(theseKeys) i = 0 while i < n: if (theseKeys[i] == 'return' and inputText != ""): continueRoutine = False break elif theseKeys[i] == 'return': i = 1 + 1 elif theseKeys[i] == 'backspace': inputText = inputText[:-1] i = i + 1 elif theseKeys[i] == 'space': inputText += ' ' i = i + 1 elif theseKeys[i] in ['lshift', 'rshift']: shift_flag = True i = i + 1 else: if len(theseKeys[i]) == 1: if shift_flag: inputText += chr( ord(theseKeys[i]) - ord(' ')) shift_flag = False else: inputText += theseKeys[i] i = i + 1 # *Phrase_Derivation_flexion* updates if t >= 0.0 and Phrase_Derivation_flexion.status == NOT_STARTED: # keep track of start time/frame for later Phrase_Derivation_flexion.tStart = t Phrase_Derivation_flexion.frameNStart = frameN # exact frame index Phrase_Derivation_flexion.setAutoDraw(True) # *Reponse_Derivation_flexion* updates if t >= 0.0 and Reponse_Derivation_flexion.status == NOT_STARTED: # keep track of start time/frame for later Reponse_Derivation_flexion.tStart = t Reponse_Derivation_flexion.frameNStart = frameN # exact frame index Reponse_Derivation_flexion.setAutoDraw(True) if Reponse_Derivation_flexion.status == STARTED: # only update if drawing Reponse_Derivation_flexion.setText(inputText, log=False) # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Epreuve_Derivation_flexionComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Epreuve_Derivation_flexion"------- for thisComponent in Epreuve_Derivation_flexionComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # check responses if key_resp_Epreuve_Derivation_flexion.keys in ['', [], None]: # No response was made key_resp_Epreuve_Derivation_flexion.keys=None Loop_Epreuve_Derivation_flexion.addData('key_resp_Epreuve_Derivation_flexion.keys',key_resp_Epreuve_Derivation_flexion.keys) if key_resp_Epreuve_Derivation_flexion.keys != None: # we had a response Loop_Epreuve_Derivation_flexion.addData('key_resp_Epreuve_Derivation_flexion.rt', key_resp_Epreuve_Derivation_flexion.rt) thisExp.addData('inputText', inputText) inputText="" thisExp.addData('FirstKeyTime', key_resp_Epreuve_Derivation_flexion.rt[0]) thisExp.addData('LastKeyTime', key_resp_Epreuve_Derivation_flexion.rt[-1]) # the Routine "Epreuve_Derivation_flexion" was not non-slip safe, so reset the non-slip timer routineTimer.reset() thisExp.nextEntry() # completed 1 repeats of 'Loop_Epreuve_Derivation_flexion' # ------Prepare to start Routine "Accueil_Decomposition"------- t = 0 Accueil_DecompositionClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat key_resp_Accueil_Decomposition = event.BuilderKeyResponse() # keep track of which components have finished Accueil_DecompositionComponents = [text_Accueil_Decomposition, key_resp_Accueil_Decomposition] for thisComponent in Accueil_DecompositionComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Accueil_Decomposition"------- while continueRoutine: # get current time t = Accueil_DecompositionClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_Accueil_Decomposition* updates if t >= 0.0 and text_Accueil_Decomposition.status == NOT_STARTED: # keep track of start time/frame for later text_Accueil_Decomposition.tStart = t text_Accueil_Decomposition.frameNStart = frameN # exact frame index text_Accueil_Decomposition.setAutoDraw(True) # *key_resp_Accueil_Decomposition* updates if t >= 0.0 and key_resp_Accueil_Decomposition.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Accueil_Decomposition.tStart = t key_resp_Accueil_Decomposition.frameNStart = frameN # exact frame index key_resp_Accueil_Decomposition.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Accueil_Decomposition.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Accueil_DecompositionComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Accueil_Decomposition"------- for thisComponent in Accueil_DecompositionComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Accueil_Decomposition" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # ------Prepare to start Routine "Consignes_Decomposition"------- t = 0 Consignes_DecompositionClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat key_resp_Consignes_Decomposition = event.BuilderKeyResponse() # keep track of which components have finished Consignes_DecompositionComponents = [text_Consignes_Decomposition, key_resp_Consignes_Decomposition] for thisComponent in Consignes_DecompositionComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Consignes_Decomposition"------- while continueRoutine: # get current time t = Consignes_DecompositionClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_Consignes_Decomposition* updates if t >= 0.0 and text_Consignes_Decomposition.status == NOT_STARTED: # keep track of start time/frame for later text_Consignes_Decomposition.tStart = t text_Consignes_Decomposition.frameNStart = frameN # exact frame index text_Consignes_Decomposition.setAutoDraw(True) # *key_resp_Consignes_Decomposition* updates if t >= 5 and key_resp_Consignes_Decomposition.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Consignes_Decomposition.tStart = t key_resp_Consignes_Decomposition.frameNStart = frameN # exact frame index key_resp_Consignes_Decomposition.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Consignes_Decomposition.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Consignes_DecompositionComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Consignes_Decomposition"------- for thisComponent in Consignes_DecompositionComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Consignes_Decomposition" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # ------Prepare to start Routine "Accueil_Apprentissage"------- t = 0 Accueil_ApprentissageClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat key_resp_Accueil_Apprentissage = event.BuilderKeyResponse() # keep track of which components have finished Accueil_ApprentissageComponents = [text_Accueil_Apprentissage, key_resp_Accueil_Apprentissage] for thisComponent in Accueil_ApprentissageComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Accueil_Apprentissage"------- while continueRoutine: # get current time t = Accueil_ApprentissageClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_Accueil_Apprentissage* updates if t >= 0.0 and text_Accueil_Apprentissage.status == NOT_STARTED: # keep track of start time/frame for later text_Accueil_Apprentissage.tStart = t text_Accueil_Apprentissage.frameNStart = frameN # exact frame index text_Accueil_Apprentissage.setAutoDraw(True) # *key_resp_Accueil_Apprentissage* updates if t >= 1 and key_resp_Accueil_Apprentissage.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Accueil_Apprentissage.tStart = t key_resp_Accueil_Apprentissage.frameNStart = frameN # exact frame index key_resp_Accueil_Apprentissage.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Accueil_Apprentissage.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Accueil_ApprentissageComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Accueil_Apprentissage"------- for thisComponent in Accueil_ApprentissageComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Accueil_Apprentissage" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # set up handler to look after randomisation of conditions etc Loop_Apprentissage_Decomposition = data.TrialHandler(nReps=1, method='random', extraInfo=expInfo, originPath=-1, trialList=data.importConditions('Decomposition_apprentissage.xlsx'), seed=None, name='Loop_Apprentissage_Decomposition') thisExp.addLoop(Loop_Apprentissage_Decomposition) # add the loop to the experiment thisLoop_Apprentissage_Decomposition = Loop_Apprentissage_Decomposition.trialList[0] # so we can initialise stimuli with some values # abbreviate parameter names if possible (e.g. rgb = thisLoop_Apprentissage_Decomposition.rgb) if thisLoop_Apprentissage_Decomposition != None: for paramName in thisLoop_Apprentissage_Decomposition: exec('{} = thisLoop_Apprentissage_Decomposition[paramName]'.format(paramName)) for thisLoop_Apprentissage_Decomposition in Loop_Apprentissage_Decomposition: currentLoop = Loop_Apprentissage_Decomposition # abbreviate parameter names if possible (e.g. rgb = thisLoop_Apprentissage_Decomposition.rgb) if thisLoop_Apprentissage_Decomposition != None: for paramName in thisLoop_Apprentissage_Decomposition: exec('{} = thisLoop_Apprentissage_Decomposition[paramName]'.format(paramName)) # ------Prepare to start Routine "Apprentissage_Decomposition"------- t = 0 Apprentissage_DecompositionClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat Mot_Apprentissage_Decomposition.setText(Mot) key_resp_Apprentissage_Decomposition = event.BuilderKeyResponse() theseKeys=key_resp_Apprentissage_Decomposition.keys shift_flag = False Phrase_Apprentissage_Decomposition.setText(Phrase) # keep track of which components have finished Apprentissage_DecompositionComponents = [Mot_Apprentissage_Decomposition, key_resp_Apprentissage_Decomposition, Phrase_Apprentissage_Decomposition, Reponse_Apprentissage_Decomposition] for thisComponent in Apprentissage_DecompositionComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Apprentissage_Decomposition"------- while continueRoutine: # get current time t = Apprentissage_DecompositionClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Mot_Apprentissage_Decomposition* updates if t >= 0.0 and Mot_Apprentissage_Decomposition.status == NOT_STARTED: # keep track of start time/frame for later Mot_Apprentissage_Decomposition.tStart = t Mot_Apprentissage_Decomposition.frameNStart = frameN # exact frame index Mot_Apprentissage_Decomposition.setAutoDraw(True) # *key_resp_Apprentissage_Decomposition* updates if t >= 0.0 and key_resp_Apprentissage_Decomposition.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Apprentissage_Decomposition.tStart = t key_resp_Apprentissage_Decomposition.frameNStart = frameN # exact frame index key_resp_Apprentissage_Decomposition.status = STARTED # keyboard checking is just starting win.callOnFlip(key_resp_Apprentissage_Decomposition.clock.reset) # t=0 on next screen flip if key_resp_Apprentissage_Decomposition.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed key_resp_Apprentissage_Decomposition.keys.extend(theseKeys) # storing all keys key_resp_Apprentissage_Decomposition.rt.append(key_resp_Apprentissage_Decomposition.clock.getTime()) n= len(theseKeys) i = 0 while i < n: if (theseKeys[i] == 'return' and inputText != ""): if inputText == Reponse: msg = "Bravo!" else: msg = "La réponse était « " + Reponse + " »!" continueRoutine = False break elif theseKeys[i] == 'return': i = 1 + 1 elif theseKeys[i] == 'backspace': inputText = inputText[:-1] i = i + 1 elif theseKeys[i] == 'space': inputText += ' ' i = i + 1 elif theseKeys[i] in ['lshift', 'rshift']: shift_flag = True i = i + 1 else: if len(theseKeys[i]) == 1: if shift_flag: inputText += chr( ord(theseKeys[i]) - ord(' ')) shift_flag = False else: inputText += theseKeys[i] i = i + 1 # *Phrase_Apprentissage_Decomposition* updates if t >= 0.0 and Phrase_Apprentissage_Decomposition.status == NOT_STARTED: # keep track of start time/frame for later Phrase_Apprentissage_Decomposition.tStart = t Phrase_Apprentissage_Decomposition.frameNStart = frameN # exact frame index Phrase_Apprentissage_Decomposition.setAutoDraw(True) # *Reponse_Apprentissage_Decomposition* updates if t >= 0.0 and Reponse_Apprentissage_Decomposition.status == NOT_STARTED: # keep track of start time/frame for later Reponse_Apprentissage_Decomposition.tStart = t Reponse_Apprentissage_Decomposition.frameNStart = frameN # exact frame index Reponse_Apprentissage_Decomposition.setAutoDraw(True) if Reponse_Apprentissage_Decomposition.status == STARTED: # only update if drawing Reponse_Apprentissage_Decomposition.setText(inputText, log=False) # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Apprentissage_DecompositionComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Apprentissage_Decomposition"------- for thisComponent in Apprentissage_DecompositionComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # check responses if key_resp_Apprentissage_Decomposition.keys in ['', [], None]: # No response was made key_resp_Apprentissage_Decomposition.keys=None Loop_Apprentissage_Decomposition.addData('key_resp_Apprentissage_Decomposition.keys',key_resp_Apprentissage_Decomposition.keys) if key_resp_Apprentissage_Decomposition.keys != None: # we had a response Loop_Apprentissage_Decomposition.addData('key_resp_Apprentissage_Decomposition.rt', key_resp_Apprentissage_Decomposition.rt) # the Routine "Apprentissage_Decomposition" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # ------Prepare to start Routine "Apprentissage_Decomposition_feedback"------- t = 0 Apprentissage_Decomposition_feedbackClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat Mot_Apprentissage_Decomposition_feedback.setText(Mot) key_resp_Apprentissage_Decomposition_feedback = event.BuilderKeyResponse() Phrase_Apprentissage_Decomposition_feedback.setText(Phrase) Reponse_Apprentissage_Decomposition_feedback.setText(inputText) Feedback_Apprentissage_Decomposition_feedback.setText(msg) # keep track of which components have finished Apprentissage_Decomposition_feedbackComponents = [Mot_Apprentissage_Decomposition_feedback, key_resp_Apprentissage_Decomposition_feedback, Phrase_Apprentissage_Decomposition_feedback, Reponse_Apprentissage_Decomposition_feedback, Feedback_Apprentissage_Decomposition_feedback] for thisComponent in Apprentissage_Decomposition_feedbackComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Apprentissage_Decomposition_feedback"------- while continueRoutine: # get current time t = Apprentissage_Decomposition_feedbackClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Mot_Apprentissage_Decomposition_feedback* updates if t >= 0.0 and Mot_Apprentissage_Decomposition_feedback.status == NOT_STARTED: # keep track of start time/frame for later Mot_Apprentissage_Decomposition_feedback.tStart = t Mot_Apprentissage_Decomposition_feedback.frameNStart = frameN # exact frame index Mot_Apprentissage_Decomposition_feedback.setAutoDraw(True) # *key_resp_Apprentissage_Decomposition_feedback* updates if t >= 0.0 and key_resp_Apprentissage_Decomposition_feedback.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Apprentissage_Decomposition_feedback.tStart = t key_resp_Apprentissage_Decomposition_feedback.frameNStart = frameN # exact frame index key_resp_Apprentissage_Decomposition_feedback.status = STARTED # keyboard checking is just starting if key_resp_Apprentissage_Decomposition_feedback.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # *Phrase_Apprentissage_Decomposition_feedback* updates if t >= 0.0 and Phrase_Apprentissage_Decomposition_feedback.status == NOT_STARTED: # keep track of start time/frame for later Phrase_Apprentissage_Decomposition_feedback.tStart = t Phrase_Apprentissage_Decomposition_feedback.frameNStart = frameN # exact frame index Phrase_Apprentissage_Decomposition_feedback.setAutoDraw(True) # *Reponse_Apprentissage_Decomposition_feedback* updates if t >= 0.0 and Reponse_Apprentissage_Decomposition_feedback.status == NOT_STARTED: # keep track of start time/frame for later Reponse_Apprentissage_Decomposition_feedback.tStart = t Reponse_Apprentissage_Decomposition_feedback.frameNStart = frameN # exact frame index Reponse_Apprentissage_Decomposition_feedback.setAutoDraw(True) # *Feedback_Apprentissage_Decomposition_feedback* updates if t >= 0.0 and Feedback_Apprentissage_Decomposition_feedback.status == NOT_STARTED: # keep track of start time/frame for later Feedback_Apprentissage_Decomposition_feedback.tStart = t Feedback_Apprentissage_Decomposition_feedback.frameNStart = frameN # exact frame index Feedback_Apprentissage_Decomposition_feedback.setAutoDraw(True) # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Apprentissage_Decomposition_feedbackComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Apprentissage_Decomposition_feedback"------- for thisComponent in Apprentissage_Decomposition_feedbackComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) inputText = "" # the Routine "Apprentissage_Decomposition_feedback" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # completed 1 repeats of 'Loop_Apprentissage_Decomposition' # ------Prepare to start Routine "Accueil_Epreuve"------- t = 0 Accueil_EpreuveClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat key_resp_Accueil_Epreuve = event.BuilderKeyResponse() # keep track of which components have finished Accueil_EpreuveComponents = [text_Accueil_Epreuve, key_resp_Accueil_Epreuve] for thisComponent in Accueil_EpreuveComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Accueil_Epreuve"------- while continueRoutine: # get current time t = Accueil_EpreuveClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_Accueil_Epreuve* updates if t >= 0.0 and text_Accueil_Epreuve.status == NOT_STARTED: # keep track of start time/frame for later text_Accueil_Epreuve.tStart = t text_Accueil_Epreuve.frameNStart = frameN # exact frame index text_Accueil_Epreuve.setAutoDraw(True) # *key_resp_Accueil_Epreuve* updates if t >= 1 and key_resp_Accueil_Epreuve.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Accueil_Epreuve.tStart = t key_resp_Accueil_Epreuve.frameNStart = frameN # exact frame index key_resp_Accueil_Epreuve.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Accueil_Epreuve.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Accueil_EpreuveComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Accueil_Epreuve"------- for thisComponent in Accueil_EpreuveComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Accueil_Epreuve" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # set up handler to look after randomisation of conditions etc Loop_Epreuve_Decomposition = data.TrialHandler(nReps=1, method='random', extraInfo=expInfo, originPath=-1, trialList=data.importConditions('Decomposition_epreuve.xlsx'), seed=None, name='Loop_Epreuve_Decomposition') thisExp.addLoop(Loop_Epreuve_Decomposition) # add the loop to the experiment thisLoop_Epreuve_Decomposition = Loop_Epreuve_Decomposition.trialList[0] # so we can initialise stimuli with some values # abbreviate parameter names if possible (e.g. rgb = thisLoop_Epreuve_Decomposition.rgb) if thisLoop_Epreuve_Decomposition != None: for paramName in thisLoop_Epreuve_Decomposition: exec('{} = thisLoop_Epreuve_Decomposition[paramName]'.format(paramName)) for thisLoop_Epreuve_Decomposition in Loop_Epreuve_Decomposition: currentLoop = Loop_Epreuve_Decomposition # abbreviate parameter names if possible (e.g. rgb = thisLoop_Epreuve_Decomposition.rgb) if thisLoop_Epreuve_Decomposition != None: for paramName in thisLoop_Epreuve_Decomposition: exec('{} = thisLoop_Epreuve_Decomposition[paramName]'.format(paramName)) # ------Prepare to start Routine "Epreuve_Decomposition"------- t = 0 Epreuve_DecompositionClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat Mot_Epreuve_Decomposition.setText(Mot) key_resp_Epreuve_Decomposition = event.BuilderKeyResponse() theseKeys=key_resp_Epreuve_Decomposition.keys shift_flag = False Phrase_Epreuve_Decomposition.setText(Phrase) # keep track of which components have finished Epreuve_DecompositionComponents = [Mot_Epreuve_Decomposition, key_resp_Epreuve_Decomposition, Phrase_Epreuve_Decomposition, Reponse_Epreuve_Decomposition] for thisComponent in Epreuve_DecompositionComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Epreuve_Decomposition"------- while continueRoutine: # get current time t = Epreuve_DecompositionClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Mot_Epreuve_Decomposition* updates if t >= 0.0 and Mot_Epreuve_Decomposition.status == NOT_STARTED: # keep track of start time/frame for later Mot_Epreuve_Decomposition.tStart = t Mot_Epreuve_Decomposition.frameNStart = frameN # exact frame index Mot_Epreuve_Decomposition.setAutoDraw(True) # *key_resp_Epreuve_Decomposition* updates if t >= 0.0 and key_resp_Epreuve_Decomposition.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Epreuve_Decomposition.tStart = t key_resp_Epreuve_Decomposition.frameNStart = frameN # exact frame index key_resp_Epreuve_Decomposition.status = STARTED # keyboard checking is just starting win.callOnFlip(key_resp_Epreuve_Decomposition.clock.reset) # t=0 on next screen flip if key_resp_Epreuve_Decomposition.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed key_resp_Epreuve_Decomposition.keys.extend(theseKeys) # storing all keys key_resp_Epreuve_Decomposition.rt.append(key_resp_Epreuve_Decomposition.clock.getTime()) n= len(theseKeys) i = 0 while i < n: if (theseKeys[i] == 'return' and inputText != ""): continueRoutine = False break elif theseKeys[i] == 'return': i = 1 + 1 elif theseKeys[i] == 'backspace': inputText = inputText[:-1] i = i + 1 elif theseKeys[i] == 'space': inputText += ' ' i = i + 1 elif theseKeys[i] in ['lshift', 'rshift']: shift_flag = True i = i + 1 else: if len(theseKeys[i]) == 1: if shift_flag: inputText += chr( ord(theseKeys[i]) - ord(' ')) shift_flag = False else: inputText += theseKeys[i] i = i + 1 # *Phrase_Epreuve_Decomposition* updates if t >= 0.0 and Phrase_Epreuve_Decomposition.status == NOT_STARTED: # keep track of start time/frame for later Phrase_Epreuve_Decomposition.tStart = t Phrase_Epreuve_Decomposition.frameNStart = frameN # exact frame index Phrase_Epreuve_Decomposition.setAutoDraw(True) # *Reponse_Epreuve_Decomposition* updates if t >= 0.0 and Reponse_Epreuve_Decomposition.status == NOT_STARTED: # keep track of start time/frame for later Reponse_Epreuve_Decomposition.tStart = t Reponse_Epreuve_Decomposition.frameNStart = frameN # exact frame index Reponse_Epreuve_Decomposition.setAutoDraw(True) if Reponse_Epreuve_Decomposition.status == STARTED: # only update if drawing Reponse_Epreuve_Decomposition.setText(inputText, log=False) # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Epreuve_DecompositionComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Epreuve_Decomposition"------- for thisComponent in Epreuve_DecompositionComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # check responses if key_resp_Epreuve_Decomposition.keys in ['', [], None]: # No response was made key_resp_Epreuve_Decomposition.keys=None Loop_Epreuve_Decomposition.addData('key_resp_Epreuve_Decomposition.keys',key_resp_Epreuve_Decomposition.keys) if key_resp_Epreuve_Decomposition.keys != None: # we had a response Loop_Epreuve_Decomposition.addData('key_resp_Epreuve_Decomposition.rt', key_resp_Epreuve_Decomposition.rt) thisExp.addData('inputText', inputText) inputText="" thisExp.addData('FirstKeyTime', key_resp_Epreuve_Decomposition.rt[0]) thisExp.addData('LastKeyTime', key_resp_Epreuve_Decomposition.rt[-1]) # the Routine "Epreuve_Decomposition" was not non-slip safe, so reset the non-slip timer routineTimer.reset() thisExp.nextEntry() # completed 1 repeats of 'Loop_Epreuve_Decomposition' # ------Prepare to start Routine "Accueil_Paires_de_mots"------- t = 0 Accueil_Paires_de_motsClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat key_resp_Accueil_Paires_de_mots = event.BuilderKeyResponse() # keep track of which components have finished Accueil_Paires_de_motsComponents = [text_Accueil_Paires_de_mots, key_resp_Accueil_Paires_de_mots] for thisComponent in Accueil_Paires_de_motsComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Accueil_Paires_de_mots"------- while continueRoutine: # get current time t = Accueil_Paires_de_motsClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_Accueil_Paires_de_mots* updates if t >= 0.0 and text_Accueil_Paires_de_mots.status == NOT_STARTED: # keep track of start time/frame for later text_Accueil_Paires_de_mots.tStart = t text_Accueil_Paires_de_mots.frameNStart = frameN # exact frame index text_Accueil_Paires_de_mots.setAutoDraw(True) # *key_resp_Accueil_Paires_de_mots* updates if t >= 0.0 and key_resp_Accueil_Paires_de_mots.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Accueil_Paires_de_mots.tStart = t key_resp_Accueil_Paires_de_mots.frameNStart = frameN # exact frame index key_resp_Accueil_Paires_de_mots.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Accueil_Paires_de_mots.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Accueil_Paires_de_motsComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Accueil_Paires_de_mots"------- for thisComponent in Accueil_Paires_de_motsComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Accueil_Paires_de_mots" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # ------Prepare to start Routine "Consignes_Paires_de_mots"------- t = 0 Consignes_Paires_de_motsClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat key_resp_Consignes_Paires_de_mots = event.BuilderKeyResponse() # keep track of which components have finished Consignes_Paires_de_motsComponents = [text_Consignes_Paires_de_mots, key_resp_Consignes_Paires_de_mots] for thisComponent in Consignes_Paires_de_motsComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Consignes_Paires_de_mots"------- while continueRoutine: # get current time t = Consignes_Paires_de_motsClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_Consignes_Paires_de_mots* updates if t >= 0 and text_Consignes_Paires_de_mots.status == NOT_STARTED: # keep track of start time/frame for later text_Consignes_Paires_de_mots.tStart = t text_Consignes_Paires_de_mots.frameNStart = frameN # exact frame index text_Consignes_Paires_de_mots.setAutoDraw(True) # *key_resp_Consignes_Paires_de_mots* updates if t >= 5 and key_resp_Consignes_Paires_de_mots.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Consignes_Paires_de_mots.tStart = t key_resp_Consignes_Paires_de_mots.frameNStart = frameN # exact frame index key_resp_Consignes_Paires_de_mots.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Consignes_Paires_de_mots.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Consignes_Paires_de_motsComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Consignes_Paires_de_mots"------- for thisComponent in Consignes_Paires_de_motsComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Consignes_Paires_de_mots" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # ------Prepare to start Routine "Accueil_Apprentissage"------- t = 0 Accueil_ApprentissageClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat key_resp_Accueil_Apprentissage = event.BuilderKeyResponse() # keep track of which components have finished Accueil_ApprentissageComponents = [text_Accueil_Apprentissage, key_resp_Accueil_Apprentissage] for thisComponent in Accueil_ApprentissageComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Accueil_Apprentissage"------- while continueRoutine: # get current time t = Accueil_ApprentissageClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_Accueil_Apprentissage* updates if t >= 0.0 and text_Accueil_Apprentissage.status == NOT_STARTED: # keep track of start time/frame for later text_Accueil_Apprentissage.tStart = t text_Accueil_Apprentissage.frameNStart = frameN # exact frame index text_Accueil_Apprentissage.setAutoDraw(True) # *key_resp_Accueil_Apprentissage* updates if t >= 1 and key_resp_Accueil_Apprentissage.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Accueil_Apprentissage.tStart = t key_resp_Accueil_Apprentissage.frameNStart = frameN # exact frame index key_resp_Accueil_Apprentissage.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Accueil_Apprentissage.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Accueil_ApprentissageComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Accueil_Apprentissage"------- for thisComponent in Accueil_ApprentissageComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Accueil_Apprentissage" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # set up handler to look after randomisation of conditions etc Loop_Apprentissage_Paires_de_mots = data.TrialHandler(nReps=1, method='random', extraInfo=expInfo, originPath=-1, trialList=data.importConditions('Paires_de_mots_apprentissage.xlsx'), seed=None, name='Loop_Apprentissage_Paires_de_mots') thisExp.addLoop(Loop_Apprentissage_Paires_de_mots) # add the loop to the experiment thisLoop_Apprentissage_Paires_de_mot = Loop_Apprentissage_Paires_de_mots.trialList[0] # so we can initialise stimuli with some values # abbreviate parameter names if possible (e.g. rgb = thisLoop_Apprentissage_Paires_de_mot.rgb) if thisLoop_Apprentissage_Paires_de_mot != None: for paramName in thisLoop_Apprentissage_Paires_de_mot: exec('{} = thisLoop_Apprentissage_Paires_de_mot[paramName]'.format(paramName)) for thisLoop_Apprentissage_Paires_de_mot in Loop_Apprentissage_Paires_de_mots: currentLoop = Loop_Apprentissage_Paires_de_mots # abbreviate parameter names if possible (e.g. rgb = thisLoop_Apprentissage_Paires_de_mot.rgb) if thisLoop_Apprentissage_Paires_de_mot != None: for paramName in thisLoop_Apprentissage_Paires_de_mot: exec('{} = thisLoop_Apprentissage_Paires_de_mot[paramName]'.format(paramName)) # ------Prepare to start Routine "Apprentissage_Paires_de_mots"------- t = 0 Apprentissage_Paires_de_motsClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat Mot1_Apprentissage_Paires_de_mots.setText(Mot1) key_resp_Apprentissage_Paires_de_mots = event.BuilderKeyResponse() Mot2_Apprentissage_Paires_de_mots.setText(Mot2) # keep track of which components have finished Apprentissage_Paires_de_motsComponents = [Mot1_Apprentissage_Paires_de_mots, key_resp_Apprentissage_Paires_de_mots, Mot2_Apprentissage_Paires_de_mots] for thisComponent in Apprentissage_Paires_de_motsComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Apprentissage_Paires_de_mots"------- while continueRoutine: # get current time t = Apprentissage_Paires_de_motsClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Mot1_Apprentissage_Paires_de_mots* updates if t >= 0.0 and Mot1_Apprentissage_Paires_de_mots.status == NOT_STARTED: # keep track of start time/frame for later Mot1_Apprentissage_Paires_de_mots.tStart = t Mot1_Apprentissage_Paires_de_mots.frameNStart = frameN # exact frame index Mot1_Apprentissage_Paires_de_mots.setAutoDraw(True) # *key_resp_Apprentissage_Paires_de_mots* updates if t >= 0.0 and key_resp_Apprentissage_Paires_de_mots.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Apprentissage_Paires_de_mots.tStart = t key_resp_Apprentissage_Paires_de_mots.frameNStart = frameN # exact frame index key_resp_Apprentissage_Paires_de_mots.status = STARTED # keyboard checking is just starting win.callOnFlip(key_resp_Apprentissage_Paires_de_mots.clock.reset) # t=0 on next screen flip event.clearEvents(eventType='keyboard') if key_resp_Apprentissage_Paires_de_mots.status == STARTED: theseKeys = event.getKeys(keyList=['o', 'n']) # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed if key_resp_Apprentissage_Paires_de_mots.keys == []: # then this was the first keypress key_resp_Apprentissage_Paires_de_mots.keys = theseKeys[0] # just the first key pressed key_resp_Apprentissage_Paires_de_mots.rt = key_resp_Apprentissage_Paires_de_mots.clock.getTime() # was this 'correct'? if (key_resp_Apprentissage_Paires_de_mots.keys == str(CodeReponse)) or (key_resp_Apprentissage_Paires_de_mots.keys == CodeReponse): key_resp_Apprentissage_Paires_de_mots.corr = 1 else: key_resp_Apprentissage_Paires_de_mots.corr = 0 # a response ends the routine continueRoutine = False # *Mot2_Apprentissage_Paires_de_mots* updates if t >= 0.0 and Mot2_Apprentissage_Paires_de_mots.status == NOT_STARTED: # keep track of start time/frame for later Mot2_Apprentissage_Paires_de_mots.tStart = t Mot2_Apprentissage_Paires_de_mots.frameNStart = frameN # exact frame index Mot2_Apprentissage_Paires_de_mots.setAutoDraw(True) # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Apprentissage_Paires_de_motsComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Apprentissage_Paires_de_mots"------- for thisComponent in Apprentissage_Paires_de_motsComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # check responses if key_resp_Apprentissage_Paires_de_mots.keys in ['', [], None]: # No response was made key_resp_Apprentissage_Paires_de_mots.keys=None # was no response the correct answer?! if str(CodeReponse).lower() == 'none': key_resp_Apprentissage_Paires_de_mots.corr = 1; # correct non-response else: key_resp_Apprentissage_Paires_de_mots.corr = 0; # failed to respond (incorrectly) # store data for Loop_Apprentissage_Paires_de_mots (TrialHandler) Loop_Apprentissage_Paires_de_mots.addData('key_resp_Apprentissage_Paires_de_mots.keys',key_resp_Apprentissage_Paires_de_mots.keys) Loop_Apprentissage_Paires_de_mots.addData('key_resp_Apprentissage_Paires_de_mots.corr', key_resp_Apprentissage_Paires_de_mots.corr) if key_resp_Apprentissage_Paires_de_mots.keys != None: # we had a response Loop_Apprentissage_Paires_de_mots.addData('key_resp_Apprentissage_Paires_de_mots.rt', key_resp_Apprentissage_Paires_de_mots.rt) if key_resp_Apprentissage_Paires_de_mots.keys[0] == CodeReponse: msg = "Bravo!" else: msg = "La réponse était « " + Reponse + " »!" # the Routine "Apprentissage_Paires_de_mots" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # ------Prepare to start Routine "Apprentissage_Paires_de_mots_feedback"------- t = 0 Apprentissage_Paires_de_mots_feedbackClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat Mot1_Apprentissage_Paires_de_mots_feedback.setText(Mot1) key_resp_Apprentissage_Paires_de_mots_feedback = event.BuilderKeyResponse() Mot2_Apprentissage_Paires_de_mots_feedback.setText(Mot2) Feedback_Apprentissage_Paires_de_mots_feedback.setText(msg) # keep track of which components have finished Apprentissage_Paires_de_mots_feedbackComponents = [Mot1_Apprentissage_Paires_de_mots_feedback, key_resp_Apprentissage_Paires_de_mots_feedback, Mot2_Apprentissage_Paires_de_mots_feedback, Feedback_Apprentissage_Paires_de_mots_feedback] for thisComponent in Apprentissage_Paires_de_mots_feedbackComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Apprentissage_Paires_de_mots_feedback"------- while continueRoutine: # get current time t = Apprentissage_Paires_de_mots_feedbackClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Mot1_Apprentissage_Paires_de_mots_feedback* updates if t >= 0.0 and Mot1_Apprentissage_Paires_de_mots_feedback.status == NOT_STARTED: # keep track of start time/frame for later Mot1_Apprentissage_Paires_de_mots_feedback.tStart = t Mot1_Apprentissage_Paires_de_mots_feedback.frameNStart = frameN # exact frame index Mot1_Apprentissage_Paires_de_mots_feedback.setAutoDraw(True) # *key_resp_Apprentissage_Paires_de_mots_feedback* updates if t >= 0.0 and key_resp_Apprentissage_Paires_de_mots_feedback.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Apprentissage_Paires_de_mots_feedback.tStart = t key_resp_Apprentissage_Paires_de_mots_feedback.frameNStart = frameN # exact frame index key_resp_Apprentissage_Paires_de_mots_feedback.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Apprentissage_Paires_de_mots_feedback.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # *Mot2_Apprentissage_Paires_de_mots_feedback* updates if t >= 0.0 and Mot2_Apprentissage_Paires_de_mots_feedback.status == NOT_STARTED: # keep track of start time/frame for later Mot2_Apprentissage_Paires_de_mots_feedback.tStart = t Mot2_Apprentissage_Paires_de_mots_feedback.frameNStart = frameN # exact frame index Mot2_Apprentissage_Paires_de_mots_feedback.setAutoDraw(True) # *Feedback_Apprentissage_Paires_de_mots_feedback* updates if t >= 0.0 and Feedback_Apprentissage_Paires_de_mots_feedback.status == NOT_STARTED: # keep track of start time/frame for later Feedback_Apprentissage_Paires_de_mots_feedback.tStart = t Feedback_Apprentissage_Paires_de_mots_feedback.frameNStart = frameN # exact frame index Feedback_Apprentissage_Paires_de_mots_feedback.setAutoDraw(True) # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Apprentissage_Paires_de_mots_feedbackComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Apprentissage_Paires_de_mots_feedback"------- for thisComponent in Apprentissage_Paires_de_mots_feedbackComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Apprentissage_Paires_de_mots_feedback" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # completed 1 repeats of 'Loop_Apprentissage_Paires_de_mots' # ------Prepare to start Routine "Accueil_Epreuve"------- t = 0 Accueil_EpreuveClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat key_resp_Accueil_Epreuve = event.BuilderKeyResponse() # keep track of which components have finished Accueil_EpreuveComponents = [text_Accueil_Epreuve, key_resp_Accueil_Epreuve] for thisComponent in Accueil_EpreuveComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Accueil_Epreuve"------- while continueRoutine: # get current time t = Accueil_EpreuveClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_Accueil_Epreuve* updates if t >= 0.0 and text_Accueil_Epreuve.status == NOT_STARTED: # keep track of start time/frame for later text_Accueil_Epreuve.tStart = t text_Accueil_Epreuve.frameNStart = frameN # exact frame index text_Accueil_Epreuve.setAutoDraw(True) # *key_resp_Accueil_Epreuve* updates if t >= 1 and key_resp_Accueil_Epreuve.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Accueil_Epreuve.tStart = t key_resp_Accueil_Epreuve.frameNStart = frameN # exact frame index key_resp_Accueil_Epreuve.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Accueil_Epreuve.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Accueil_EpreuveComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Accueil_Epreuve"------- for thisComponent in Accueil_EpreuveComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Accueil_Epreuve" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # set up handler to look after randomisation of conditions etc Loop_Epreuve_Paires_de_mots = data.TrialHandler(nReps=1, method='random', extraInfo=expInfo, originPath=-1, trialList=data.importConditions('Paires_de_mots_epreuve.xlsx'), seed=None, name='Loop_Epreuve_Paires_de_mots') thisExp.addLoop(Loop_Epreuve_Paires_de_mots) # add the loop to the experiment thisLoop_Epreuve_Paires_de_mot = Loop_Epreuve_Paires_de_mots.trialList[0] # so we can initialise stimuli with some values # abbreviate parameter names if possible (e.g. rgb = thisLoop_Epreuve_Paires_de_mot.rgb) if thisLoop_Epreuve_Paires_de_mot != None: for paramName in thisLoop_Epreuve_Paires_de_mot: exec('{} = thisLoop_Epreuve_Paires_de_mot[paramName]'.format(paramName)) for thisLoop_Epreuve_Paires_de_mot in Loop_Epreuve_Paires_de_mots: currentLoop = Loop_Epreuve_Paires_de_mots # abbreviate parameter names if possible (e.g. rgb = thisLoop_Epreuve_Paires_de_mot.rgb) if thisLoop_Epreuve_Paires_de_mot != None: for paramName in thisLoop_Epreuve_Paires_de_mot: exec('{} = thisLoop_Epreuve_Paires_de_mot[paramName]'.format(paramName)) # ------Prepare to start Routine "Epreuve_Paires_de_mots"------- t = 0 Epreuve_Paires_de_motsClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat Mot1_Epreuve_Paires_de_mots.setText(Mot1) key_resp_Epreuve_Paires_de_mots = event.BuilderKeyResponse() Mot2_Epreuve_Paires_de_mots.setText(Mot2) # keep track of which components have finished Epreuve_Paires_de_motsComponents = [Mot1_Epreuve_Paires_de_mots, key_resp_Epreuve_Paires_de_mots, Mot2_Epreuve_Paires_de_mots] for thisComponent in Epreuve_Paires_de_motsComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Epreuve_Paires_de_mots"------- while continueRoutine: # get current time t = Epreuve_Paires_de_motsClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Mot1_Epreuve_Paires_de_mots* updates if t >= 0.0 and Mot1_Epreuve_Paires_de_mots.status == NOT_STARTED: # keep track of start time/frame for later Mot1_Epreuve_Paires_de_mots.tStart = t Mot1_Epreuve_Paires_de_mots.frameNStart = frameN # exact frame index Mot1_Epreuve_Paires_de_mots.setAutoDraw(True) # *key_resp_Epreuve_Paires_de_mots* updates if t >= 0.0 and key_resp_Epreuve_Paires_de_mots.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Epreuve_Paires_de_mots.tStart = t key_resp_Epreuve_Paires_de_mots.frameNStart = frameN # exact frame index key_resp_Epreuve_Paires_de_mots.status = STARTED # keyboard checking is just starting win.callOnFlip(key_resp_Epreuve_Paires_de_mots.clock.reset) # t=0 on next screen flip event.clearEvents(eventType='keyboard') if key_resp_Epreuve_Paires_de_mots.status == STARTED: theseKeys = event.getKeys(keyList=['o', 'n']) # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed if key_resp_Epreuve_Paires_de_mots.keys == []: # then this was the first keypress key_resp_Epreuve_Paires_de_mots.keys = theseKeys[0] # just the first key pressed key_resp_Epreuve_Paires_de_mots.rt = key_resp_Epreuve_Paires_de_mots.clock.getTime() # was this 'correct'? if (key_resp_Epreuve_Paires_de_mots.keys == str(CodeReponse)) or (key_resp_Epreuve_Paires_de_mots.keys == CodeReponse): key_resp_Epreuve_Paires_de_mots.corr = 1 else: key_resp_Epreuve_Paires_de_mots.corr = 0 # a response ends the routine continueRoutine = False # *Mot2_Epreuve_Paires_de_mots* updates if t >= 0.0 and Mot2_Epreuve_Paires_de_mots.status == NOT_STARTED: # keep track of start time/frame for later Mot2_Epreuve_Paires_de_mots.tStart = t Mot2_Epreuve_Paires_de_mots.frameNStart = frameN # exact frame index Mot2_Epreuve_Paires_de_mots.setAutoDraw(True) # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Epreuve_Paires_de_motsComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Epreuve_Paires_de_mots"------- for thisComponent in Epreuve_Paires_de_motsComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # check responses if key_resp_Epreuve_Paires_de_mots.keys in ['', [], None]: # No response was made key_resp_Epreuve_Paires_de_mots.keys=None # was no response the correct answer?! if str(CodeReponse).lower() == 'none': key_resp_Epreuve_Paires_de_mots.corr = 1; # correct non-response else: key_resp_Epreuve_Paires_de_mots.corr = 0; # failed to respond (incorrectly) # store data for Loop_Epreuve_Paires_de_mots (TrialHandler) Loop_Epreuve_Paires_de_mots.addData('key_resp_Epreuve_Paires_de_mots.keys',key_resp_Epreuve_Paires_de_mots.keys) Loop_Epreuve_Paires_de_mots.addData('key_resp_Epreuve_Paires_de_mots.corr', key_resp_Epreuve_Paires_de_mots.corr) if key_resp_Epreuve_Paires_de_mots.keys != None: # we had a response Loop_Epreuve_Paires_de_mots.addData('key_resp_Epreuve_Paires_de_mots.rt', key_resp_Epreuve_Paires_de_mots.rt) # the Routine "Epreuve_Paires_de_mots" was not non-slip safe, so reset the non-slip timer routineTimer.reset() thisExp.nextEntry() # completed 1 repeats of 'Loop_Epreuve_Paires_de_mots' # ------Prepare to start Routine "Accueil_Pseudo_mots_flexion"------- t = 0 Accueil_Pseudo_mots_flexionClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat key_resp_Accueil_Pseudo_mots_flexion = event.BuilderKeyResponse() # keep track of which components have finished Accueil_Pseudo_mots_flexionComponents = [text_Accueil_Pseudo_mots_flexion, key_resp_Accueil_Pseudo_mots_flexion] for thisComponent in Accueil_Pseudo_mots_flexionComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Accueil_Pseudo_mots_flexion"------- while continueRoutine: # get current time t = Accueil_Pseudo_mots_flexionClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_Accueil_Pseudo_mots_flexion* updates if t >= 0.0 and text_Accueil_Pseudo_mots_flexion.status == NOT_STARTED: # keep track of start time/frame for later text_Accueil_Pseudo_mots_flexion.tStart = t text_Accueil_Pseudo_mots_flexion.frameNStart = frameN # exact frame index text_Accueil_Pseudo_mots_flexion.setAutoDraw(True) # *key_resp_Accueil_Pseudo_mots_flexion* updates if t >= 0.0 and key_resp_Accueil_Pseudo_mots_flexion.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Accueil_Pseudo_mots_flexion.tStart = t key_resp_Accueil_Pseudo_mots_flexion.frameNStart = frameN # exact frame index key_resp_Accueil_Pseudo_mots_flexion.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Accueil_Pseudo_mots_flexion.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Accueil_Pseudo_mots_flexionComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Accueil_Pseudo_mots_flexion"------- for thisComponent in Accueil_Pseudo_mots_flexionComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Accueil_Pseudo_mots_flexion" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # ------Prepare to start Routine "Consignes_Pseudo_mots_flexion"------- t = 0 Consignes_Pseudo_mots_flexionClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat key_resp_Consignes_Pseudo_mots_flexion = event.BuilderKeyResponse() # keep track of which components have finished Consignes_Pseudo_mots_flexionComponents = [text_Consignes_Pseudo_mots_flexion, key_resp_Consignes_Pseudo_mots_flexion] for thisComponent in Consignes_Pseudo_mots_flexionComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Consignes_Pseudo_mots_flexion"------- while continueRoutine: # get current time t = Consignes_Pseudo_mots_flexionClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_Consignes_Pseudo_mots_flexion* updates if t >= 0 and text_Consignes_Pseudo_mots_flexion.status == NOT_STARTED: # keep track of start time/frame for later text_Consignes_Pseudo_mots_flexion.tStart = t text_Consignes_Pseudo_mots_flexion.frameNStart = frameN # exact frame index text_Consignes_Pseudo_mots_flexion.setAutoDraw(True) # *key_resp_Consignes_Pseudo_mots_flexion* updates if t >= 5 and key_resp_Consignes_Pseudo_mots_flexion.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Consignes_Pseudo_mots_flexion.tStart = t key_resp_Consignes_Pseudo_mots_flexion.frameNStart = frameN # exact frame index key_resp_Consignes_Pseudo_mots_flexion.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Consignes_Pseudo_mots_flexion.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Consignes_Pseudo_mots_flexionComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Consignes_Pseudo_mots_flexion"------- for thisComponent in Consignes_Pseudo_mots_flexionComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Consignes_Pseudo_mots_flexion" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # ------Prepare to start Routine "Accueil_Apprentissage"------- t = 0 Accueil_ApprentissageClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat key_resp_Accueil_Apprentissage = event.BuilderKeyResponse() # keep track of which components have finished Accueil_ApprentissageComponents = [text_Accueil_Apprentissage, key_resp_Accueil_Apprentissage] for thisComponent in Accueil_ApprentissageComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Accueil_Apprentissage"------- while continueRoutine: # get current time t = Accueil_ApprentissageClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_Accueil_Apprentissage* updates if t >= 0.0 and text_Accueil_Apprentissage.status == NOT_STARTED: # keep track of start time/frame for later text_Accueil_Apprentissage.tStart = t text_Accueil_Apprentissage.frameNStart = frameN # exact frame index text_Accueil_Apprentissage.setAutoDraw(True) # *key_resp_Accueil_Apprentissage* updates if t >= 1 and key_resp_Accueil_Apprentissage.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Accueil_Apprentissage.tStart = t key_resp_Accueil_Apprentissage.frameNStart = frameN # exact frame index key_resp_Accueil_Apprentissage.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Accueil_Apprentissage.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Accueil_ApprentissageComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Accueil_Apprentissage"------- for thisComponent in Accueil_ApprentissageComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Accueil_Apprentissage" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # set up handler to look after randomisation of conditions etc Loop_Apprentissage_Pseudo_mots_flexion = data.TrialHandler(nReps=1, method='random', extraInfo=expInfo, originPath=-1, trialList=data.importConditions('Choix_de_pseudo-mots_suffixes_Flexion_apprentissage.xlsx'), seed=None, name='Loop_Apprentissage_Pseudo_mots_flexion') thisExp.addLoop(Loop_Apprentissage_Pseudo_mots_flexion) # add the loop to the experiment thisLoop_Apprentissage_Pseudo_mots_flexion = Loop_Apprentissage_Pseudo_mots_flexion.trialList[0] # so we can initialise stimuli with some values # abbreviate parameter names if possible (e.g. rgb = thisLoop_Apprentissage_Pseudo_mots_flexion.rgb) if thisLoop_Apprentissage_Pseudo_mots_flexion != None: for paramName in thisLoop_Apprentissage_Pseudo_mots_flexion: exec('{} = thisLoop_Apprentissage_Pseudo_mots_flexion[paramName]'.format(paramName)) for thisLoop_Apprentissage_Pseudo_mots_flexion in Loop_Apprentissage_Pseudo_mots_flexion: currentLoop = Loop_Apprentissage_Pseudo_mots_flexion # abbreviate parameter names if possible (e.g. rgb = thisLoop_Apprentissage_Pseudo_mots_flexion.rgb) if thisLoop_Apprentissage_Pseudo_mots_flexion != None: for paramName in thisLoop_Apprentissage_Pseudo_mots_flexion: exec('{} = thisLoop_Apprentissage_Pseudo_mots_flexion[paramName]'.format(paramName)) # ------Prepare to start Routine "Apprentissage_Pseudo_mots_flexion"------- t = 0 Apprentissage_Pseudo_mots_flexionClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat Phrase_Apprentissage_Pseudo_mots_flexion.setText(Phrase) key_resp_Apprentissage_Pseudo_mots_flexion = event.BuilderKeyResponse() # keep track of which components have finished Apprentissage_Pseudo_mots_flexionComponents = [Phrase_Apprentissage_Pseudo_mots_flexion, key_resp_Apprentissage_Pseudo_mots_flexion] for thisComponent in Apprentissage_Pseudo_mots_flexionComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Apprentissage_Pseudo_mots_flexion"------- while continueRoutine: # get current time t = Apprentissage_Pseudo_mots_flexionClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Phrase_Apprentissage_Pseudo_mots_flexion* updates if t >= 0.0 and Phrase_Apprentissage_Pseudo_mots_flexion.status == NOT_STARTED: # keep track of start time/frame for later Phrase_Apprentissage_Pseudo_mots_flexion.tStart = t Phrase_Apprentissage_Pseudo_mots_flexion.frameNStart = frameN # exact frame index Phrase_Apprentissage_Pseudo_mots_flexion.setAutoDraw(True) # *key_resp_Apprentissage_Pseudo_mots_flexion* updates if t >= 0.0 and key_resp_Apprentissage_Pseudo_mots_flexion.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Apprentissage_Pseudo_mots_flexion.tStart = t key_resp_Apprentissage_Pseudo_mots_flexion.frameNStart = frameN # exact frame index key_resp_Apprentissage_Pseudo_mots_flexion.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Apprentissage_Pseudo_mots_flexion.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Apprentissage_Pseudo_mots_flexionComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Apprentissage_Pseudo_mots_flexion"------- for thisComponent in Apprentissage_Pseudo_mots_flexionComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Apprentissage_Pseudo_mots_flexion" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # ------Prepare to start Routine "Apprentissage_Pseudo_mots_flexion_2"------- t = 0 Apprentissage_Pseudo_mots_flexion_2Clock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat Phrase_Apprentissage_Pseudo_mots_flexion_2.setText(Phrase) key_resp_Apprentissage_Pseudo_mots_flexion_2 = event.BuilderKeyResponse() Mot1_Apprentissage_Pseudo_mots_flexion_2.setText(Choix1) Mot2_Apprentissage_Pseudo_mots_flexion_2.setText(Choix2) Mot3_Apprentissage_Pseudo_mots_flexion_2.setText(Choix3) Mot4_Apprentissage_Pseudo_mots_flexion_2.setText(Choix4) # keep track of which components have finished Apprentissage_Pseudo_mots_flexion_2Components = [Phrase_Apprentissage_Pseudo_mots_flexion_2, key_resp_Apprentissage_Pseudo_mots_flexion_2, Mot1_Apprentissage_Pseudo_mots_flexion_2, Mot2_Apprentissage_Pseudo_mots_flexion_2, Mot3_Apprentissage_Pseudo_mots_flexion_2, Mot4_Apprentissage_Pseudo_mots_flexion_2] for thisComponent in Apprentissage_Pseudo_mots_flexion_2Components: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Apprentissage_Pseudo_mots_flexion_2"------- while continueRoutine: # get current time t = Apprentissage_Pseudo_mots_flexion_2Clock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Phrase_Apprentissage_Pseudo_mots_flexion_2* updates if t >= 0.0 and Phrase_Apprentissage_Pseudo_mots_flexion_2.status == NOT_STARTED: # keep track of start time/frame for later Phrase_Apprentissage_Pseudo_mots_flexion_2.tStart = t Phrase_Apprentissage_Pseudo_mots_flexion_2.frameNStart = frameN # exact frame index Phrase_Apprentissage_Pseudo_mots_flexion_2.setAutoDraw(True) # *key_resp_Apprentissage_Pseudo_mots_flexion_2* updates if t >= 0.0 and key_resp_Apprentissage_Pseudo_mots_flexion_2.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Apprentissage_Pseudo_mots_flexion_2.tStart = t key_resp_Apprentissage_Pseudo_mots_flexion_2.frameNStart = frameN # exact frame index key_resp_Apprentissage_Pseudo_mots_flexion_2.status = STARTED # keyboard checking is just starting win.callOnFlip(key_resp_Apprentissage_Pseudo_mots_flexion_2.clock.reset) # t=0 on next screen flip event.clearEvents(eventType='keyboard') if key_resp_Apprentissage_Pseudo_mots_flexion_2.status == STARTED: theseKeys = event.getKeys(keyList=['1', '2', '3', '4']) # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed if key_resp_Apprentissage_Pseudo_mots_flexion_2.keys == []: # then this was the first keypress key_resp_Apprentissage_Pseudo_mots_flexion_2.keys = theseKeys[0] # just the first key pressed key_resp_Apprentissage_Pseudo_mots_flexion_2.rt = key_resp_Apprentissage_Pseudo_mots_flexion_2.clock.getTime() # was this 'correct'? if (key_resp_Apprentissage_Pseudo_mots_flexion_2.keys == str(CodeReponse)) or (key_resp_Apprentissage_Pseudo_mots_flexion_2.keys == CodeReponse): key_resp_Apprentissage_Pseudo_mots_flexion_2.corr = 1 else: key_resp_Apprentissage_Pseudo_mots_flexion_2.corr = 0 # a response ends the routine continueRoutine = False # *Mot1_Apprentissage_Pseudo_mots_flexion_2* updates if t >= 0.0 and Mot1_Apprentissage_Pseudo_mots_flexion_2.status == NOT_STARTED: # keep track of start time/frame for later Mot1_Apprentissage_Pseudo_mots_flexion_2.tStart = t Mot1_Apprentissage_Pseudo_mots_flexion_2.frameNStart = frameN # exact frame index Mot1_Apprentissage_Pseudo_mots_flexion_2.setAutoDraw(True) # *Mot2_Apprentissage_Pseudo_mots_flexion_2* updates if t >= 0.0 and Mot2_Apprentissage_Pseudo_mots_flexion_2.status == NOT_STARTED: # keep track of start time/frame for later Mot2_Apprentissage_Pseudo_mots_flexion_2.tStart = t Mot2_Apprentissage_Pseudo_mots_flexion_2.frameNStart = frameN # exact frame index Mot2_Apprentissage_Pseudo_mots_flexion_2.setAutoDraw(True) # *Mot3_Apprentissage_Pseudo_mots_flexion_2* updates if t >= 0.0 and Mot3_Apprentissage_Pseudo_mots_flexion_2.status == NOT_STARTED: # keep track of start time/frame for later Mot3_Apprentissage_Pseudo_mots_flexion_2.tStart = t Mot3_Apprentissage_Pseudo_mots_flexion_2.frameNStart = frameN # exact frame index Mot3_Apprentissage_Pseudo_mots_flexion_2.setAutoDraw(True) # *Mot4_Apprentissage_Pseudo_mots_flexion_2* updates if t >= 0.0 and Mot4_Apprentissage_Pseudo_mots_flexion_2.status == NOT_STARTED: # keep track of start time/frame for later Mot4_Apprentissage_Pseudo_mots_flexion_2.tStart = t Mot4_Apprentissage_Pseudo_mots_flexion_2.frameNStart = frameN # exact frame index Mot4_Apprentissage_Pseudo_mots_flexion_2.setAutoDraw(True) # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Apprentissage_Pseudo_mots_flexion_2Components: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Apprentissage_Pseudo_mots_flexion_2"------- for thisComponent in Apprentissage_Pseudo_mots_flexion_2Components: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # check responses if key_resp_Apprentissage_Pseudo_mots_flexion_2.keys in ['', [], None]: # No response was made key_resp_Apprentissage_Pseudo_mots_flexion_2.keys=None # was no response the correct answer?! if str(CodeReponse).lower() == 'none': key_resp_Apprentissage_Pseudo_mots_flexion_2.corr = 1; # correct non-response else: key_resp_Apprentissage_Pseudo_mots_flexion_2.corr = 0; # failed to respond (incorrectly) # store data for Loop_Apprentissage_Pseudo_mots_flexion (TrialHandler) Loop_Apprentissage_Pseudo_mots_flexion.addData('key_resp_Apprentissage_Pseudo_mots_flexion_2.keys',key_resp_Apprentissage_Pseudo_mots_flexion_2.keys) Loop_Apprentissage_Pseudo_mots_flexion.addData('key_resp_Apprentissage_Pseudo_mots_flexion_2.corr', key_resp_Apprentissage_Pseudo_mots_flexion_2.corr) if key_resp_Apprentissage_Pseudo_mots_flexion_2.keys != None: # we had a response Loop_Apprentissage_Pseudo_mots_flexion.addData('key_resp_Apprentissage_Pseudo_mots_flexion_2.rt', key_resp_Apprentissage_Pseudo_mots_flexion_2.rt) # the Routine "Apprentissage_Pseudo_mots_flexion_2" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # ------Prepare to start Routine "Apprentissage_Pseudo_mots_flexion_feedback"------- t = 0 Apprentissage_Pseudo_mots_flexion_feedbackClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat Phrase_Apprentissage_Pseudo_mots_flexion_feedback.setText(Phrase) key_resp_Apprentissage_Pseudo_mots_flexion_feedback = event.BuilderKeyResponse() Mot1_Apprentissage_Pseudo_mots_flexion_feedback.setText(Choix1) Mot2_Apprentissage_Pseudo_mots_flexion_feedback.setText(Choix2) Mot3_Apprentissage_Pseudo_mots_flexion_feedback.setText(Choix3) Mot4_Apprentissage_Pseudo_mots_flexion_feedback.setText(Choix4) Feedback_Apprentissage_Pseudo_mots_flexion_feedback.setText(msg) # keep track of which components have finished Apprentissage_Pseudo_mots_flexion_feedbackComponents = [Phrase_Apprentissage_Pseudo_mots_flexion_feedback, key_resp_Apprentissage_Pseudo_mots_flexion_feedback, Mot1_Apprentissage_Pseudo_mots_flexion_feedback, Mot2_Apprentissage_Pseudo_mots_flexion_feedback, Mot3_Apprentissage_Pseudo_mots_flexion_feedback, Mot4_Apprentissage_Pseudo_mots_flexion_feedback, Feedback_Apprentissage_Pseudo_mots_flexion_feedback] for thisComponent in Apprentissage_Pseudo_mots_flexion_feedbackComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Apprentissage_Pseudo_mots_flexion_feedback"------- while continueRoutine: # get current time t = Apprentissage_Pseudo_mots_flexion_feedbackClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Phrase_Apprentissage_Pseudo_mots_flexion_feedback* updates if t >= 0.0 and Phrase_Apprentissage_Pseudo_mots_flexion_feedback.status == NOT_STARTED: # keep track of start time/frame for later Phrase_Apprentissage_Pseudo_mots_flexion_feedback.tStart = t Phrase_Apprentissage_Pseudo_mots_flexion_feedback.frameNStart = frameN # exact frame index Phrase_Apprentissage_Pseudo_mots_flexion_feedback.setAutoDraw(True) # *key_resp_Apprentissage_Pseudo_mots_flexion_feedback* updates if t >= 0.0 and key_resp_Apprentissage_Pseudo_mots_flexion_feedback.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Apprentissage_Pseudo_mots_flexion_feedback.tStart = t key_resp_Apprentissage_Pseudo_mots_flexion_feedback.frameNStart = frameN # exact frame index key_resp_Apprentissage_Pseudo_mots_flexion_feedback.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Apprentissage_Pseudo_mots_flexion_feedback.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # *Mot1_Apprentissage_Pseudo_mots_flexion_feedback* updates if t >= 0.0 and Mot1_Apprentissage_Pseudo_mots_flexion_feedback.status == NOT_STARTED: # keep track of start time/frame for later Mot1_Apprentissage_Pseudo_mots_flexion_feedback.tStart = t Mot1_Apprentissage_Pseudo_mots_flexion_feedback.frameNStart = frameN # exact frame index Mot1_Apprentissage_Pseudo_mots_flexion_feedback.setAutoDraw(True) # *Mot2_Apprentissage_Pseudo_mots_flexion_feedback* updates if t >= 0.0 and Mot2_Apprentissage_Pseudo_mots_flexion_feedback.status == NOT_STARTED: # keep track of start time/frame for later Mot2_Apprentissage_Pseudo_mots_flexion_feedback.tStart = t Mot2_Apprentissage_Pseudo_mots_flexion_feedback.frameNStart = frameN # exact frame index Mot2_Apprentissage_Pseudo_mots_flexion_feedback.setAutoDraw(True) # *Mot3_Apprentissage_Pseudo_mots_flexion_feedback* updates if t >= 0.0 and Mot3_Apprentissage_Pseudo_mots_flexion_feedback.status == NOT_STARTED: # keep track of start time/frame for later Mot3_Apprentissage_Pseudo_mots_flexion_feedback.tStart = t Mot3_Apprentissage_Pseudo_mots_flexion_feedback.frameNStart = frameN # exact frame index Mot3_Apprentissage_Pseudo_mots_flexion_feedback.setAutoDraw(True) # *Mot4_Apprentissage_Pseudo_mots_flexion_feedback* updates if t >= 0.0 and Mot4_Apprentissage_Pseudo_mots_flexion_feedback.status == NOT_STARTED: # keep track of start time/frame for later Mot4_Apprentissage_Pseudo_mots_flexion_feedback.tStart = t Mot4_Apprentissage_Pseudo_mots_flexion_feedback.frameNStart = frameN # exact frame index Mot4_Apprentissage_Pseudo_mots_flexion_feedback.setAutoDraw(True) # *Feedback_Apprentissage_Pseudo_mots_flexion_feedback* updates if t >= 0.0 and Feedback_Apprentissage_Pseudo_mots_flexion_feedback.status == NOT_STARTED: # keep track of start time/frame for later Feedback_Apprentissage_Pseudo_mots_flexion_feedback.tStart = t Feedback_Apprentissage_Pseudo_mots_flexion_feedback.frameNStart = frameN # exact frame index Feedback_Apprentissage_Pseudo_mots_flexion_feedback.setAutoDraw(True) # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Apprentissage_Pseudo_mots_flexion_feedbackComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Apprentissage_Pseudo_mots_flexion_feedback"------- for thisComponent in Apprentissage_Pseudo_mots_flexion_feedbackComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Apprentissage_Pseudo_mots_flexion_feedback" was not non-slip safe, so reset the non-slip timer routineTimer.reset() thisExp.nextEntry() # completed 1 repeats of 'Loop_Apprentissage_Pseudo_mots_flexion' # ------Prepare to start Routine "Accueil_Epreuve"------- t = 0 Accueil_EpreuveClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat key_resp_Accueil_Epreuve = event.BuilderKeyResponse() # keep track of which components have finished Accueil_EpreuveComponents = [text_Accueil_Epreuve, key_resp_Accueil_Epreuve] for thisComponent in Accueil_EpreuveComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Accueil_Epreuve"------- while continueRoutine: # get current time t = Accueil_EpreuveClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_Accueil_Epreuve* updates if t >= 0.0 and text_Accueil_Epreuve.status == NOT_STARTED: # keep track of start time/frame for later text_Accueil_Epreuve.tStart = t text_Accueil_Epreuve.frameNStart = frameN # exact frame index text_Accueil_Epreuve.setAutoDraw(True) # *key_resp_Accueil_Epreuve* updates if t >= 1 and key_resp_Accueil_Epreuve.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Accueil_Epreuve.tStart = t key_resp_Accueil_Epreuve.frameNStart = frameN # exact frame index key_resp_Accueil_Epreuve.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Accueil_Epreuve.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Accueil_EpreuveComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Accueil_Epreuve"------- for thisComponent in Accueil_EpreuveComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Accueil_Epreuve" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # set up handler to look after randomisation of conditions etc Loop_Epreuve_Pseudo_mots_flexion = data.TrialHandler(nReps=1, method='random', extraInfo=expInfo, originPath=-1, trialList=data.importConditions('Choix_de_pseudo-mots_suffixes_Flexion_epreuve.xlsx'), seed=None, name='Loop_Epreuve_Pseudo_mots_flexion') thisExp.addLoop(Loop_Epreuve_Pseudo_mots_flexion) # add the loop to the experiment thisLoop_Epreuve_Pseudo_mots_flexion = Loop_Epreuve_Pseudo_mots_flexion.trialList[0] # so we can initialise stimuli with some values # abbreviate parameter names if possible (e.g. rgb = thisLoop_Epreuve_Pseudo_mots_flexion.rgb) if thisLoop_Epreuve_Pseudo_mots_flexion != None: for paramName in thisLoop_Epreuve_Pseudo_mots_flexion: exec('{} = thisLoop_Epreuve_Pseudo_mots_flexion[paramName]'.format(paramName)) for thisLoop_Epreuve_Pseudo_mots_flexion in Loop_Epreuve_Pseudo_mots_flexion: currentLoop = Loop_Epreuve_Pseudo_mots_flexion # abbreviate parameter names if possible (e.g. rgb = thisLoop_Epreuve_Pseudo_mots_flexion.rgb) if thisLoop_Epreuve_Pseudo_mots_flexion != None: for paramName in thisLoop_Epreuve_Pseudo_mots_flexion: exec('{} = thisLoop_Epreuve_Pseudo_mots_flexion[paramName]'.format(paramName)) # ------Prepare to start Routine "Epreuve_Pseudo_mots_flexion"------- t = 0 Epreuve_Pseudo_mots_flexionClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat Phrase_Epreuve_Pseudo_mots_flexion.setText(Phrase) key_resp_Epreuve_Pseudo_mots_flexion = event.BuilderKeyResponse() # keep track of which components have finished Epreuve_Pseudo_mots_flexionComponents = [Phrase_Epreuve_Pseudo_mots_flexion, key_resp_Epreuve_Pseudo_mots_flexion] for thisComponent in Epreuve_Pseudo_mots_flexionComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Epreuve_Pseudo_mots_flexion"------- while continueRoutine: # get current time t = Epreuve_Pseudo_mots_flexionClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Phrase_Epreuve_Pseudo_mots_flexion* updates if t >= 0.0 and Phrase_Epreuve_Pseudo_mots_flexion.status == NOT_STARTED: # keep track of start time/frame for later Phrase_Epreuve_Pseudo_mots_flexion.tStart = t Phrase_Epreuve_Pseudo_mots_flexion.frameNStart = frameN # exact frame index Phrase_Epreuve_Pseudo_mots_flexion.setAutoDraw(True) # *key_resp_Epreuve_Pseudo_mots_flexion* updates if t >= 0.0 and key_resp_Epreuve_Pseudo_mots_flexion.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Epreuve_Pseudo_mots_flexion.tStart = t key_resp_Epreuve_Pseudo_mots_flexion.frameNStart = frameN # exact frame index key_resp_Epreuve_Pseudo_mots_flexion.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Epreuve_Pseudo_mots_flexion.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Epreuve_Pseudo_mots_flexionComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Epreuve_Pseudo_mots_flexion"------- for thisComponent in Epreuve_Pseudo_mots_flexionComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Epreuve_Pseudo_mots_flexion" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # ------Prepare to start Routine "Epreuve_Pseudo_mots_flexion_2"------- t = 0 Epreuve_Pseudo_mots_flexion_2Clock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat Phrase_Epreuve_Pseudo_mots_flexion_2.setText(Phrase) key_resp_Epreuve_Pseudo_mots_flexion_2 = event.BuilderKeyResponse() Mot1_Epreuve_Pseudo_mots_flexion_2.setText(Choix1) Mot2_Epreuve_Pseudo_mots_flexion_2.setText(Choix2) Mot3_Epreuve_Pseudo_mots_flexion_2.setText(Choix3) Mot4_Epreuve_Pseudo_mots_flexion_2.setText(Choix4) # keep track of which components have finished Epreuve_Pseudo_mots_flexion_2Components = [Phrase_Epreuve_Pseudo_mots_flexion_2, key_resp_Epreuve_Pseudo_mots_flexion_2, Mot1_Epreuve_Pseudo_mots_flexion_2, Mot2_Epreuve_Pseudo_mots_flexion_2, Mot3_Epreuve_Pseudo_mots_flexion_2, Mot4_Epreuve_Pseudo_mots_flexion_2] for thisComponent in Epreuve_Pseudo_mots_flexion_2Components: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Epreuve_Pseudo_mots_flexion_2"------- while continueRoutine: # get current time t = Epreuve_Pseudo_mots_flexion_2Clock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Phrase_Epreuve_Pseudo_mots_flexion_2* updates if t >= 0.0 and Phrase_Epreuve_Pseudo_mots_flexion_2.status == NOT_STARTED: # keep track of start time/frame for later Phrase_Epreuve_Pseudo_mots_flexion_2.tStart = t Phrase_Epreuve_Pseudo_mots_flexion_2.frameNStart = frameN # exact frame index Phrase_Epreuve_Pseudo_mots_flexion_2.setAutoDraw(True) # *key_resp_Epreuve_Pseudo_mots_flexion_2* updates if t >= 0.0 and key_resp_Epreuve_Pseudo_mots_flexion_2.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Epreuve_Pseudo_mots_flexion_2.tStart = t key_resp_Epreuve_Pseudo_mots_flexion_2.frameNStart = frameN # exact frame index key_resp_Epreuve_Pseudo_mots_flexion_2.status = STARTED # keyboard checking is just starting win.callOnFlip(key_resp_Epreuve_Pseudo_mots_flexion_2.clock.reset) # t=0 on next screen flip event.clearEvents(eventType='keyboard') if key_resp_Epreuve_Pseudo_mots_flexion_2.status == STARTED: theseKeys = event.getKeys(keyList=['1', '2', '3', '4']) # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed if key_resp_Epreuve_Pseudo_mots_flexion_2.keys == []: # then this was the first keypress key_resp_Epreuve_Pseudo_mots_flexion_2.keys = theseKeys[0] # just the first key pressed key_resp_Epreuve_Pseudo_mots_flexion_2.rt = key_resp_Epreuve_Pseudo_mots_flexion_2.clock.getTime() # was this 'correct'? if (key_resp_Epreuve_Pseudo_mots_flexion_2.keys == str(CodeReponse)) or (key_resp_Epreuve_Pseudo_mots_flexion_2.keys == CodeReponse): key_resp_Epreuve_Pseudo_mots_flexion_2.corr = 1 else: key_resp_Epreuve_Pseudo_mots_flexion_2.corr = 0 # a response ends the routine continueRoutine = False # *Mot1_Epreuve_Pseudo_mots_flexion_2* updates if t >= 0.0 and Mot1_Epreuve_Pseudo_mots_flexion_2.status == NOT_STARTED: # keep track of start time/frame for later Mot1_Epreuve_Pseudo_mots_flexion_2.tStart = t Mot1_Epreuve_Pseudo_mots_flexion_2.frameNStart = frameN # exact frame index Mot1_Epreuve_Pseudo_mots_flexion_2.setAutoDraw(True) # *Mot2_Epreuve_Pseudo_mots_flexion_2* updates if t >= 0.0 and Mot2_Epreuve_Pseudo_mots_flexion_2.status == NOT_STARTED: # keep track of start time/frame for later Mot2_Epreuve_Pseudo_mots_flexion_2.tStart = t Mot2_Epreuve_Pseudo_mots_flexion_2.frameNStart = frameN # exact frame index Mot2_Epreuve_Pseudo_mots_flexion_2.setAutoDraw(True) # *Mot3_Epreuve_Pseudo_mots_flexion_2* updates if t >= 0.0 and Mot3_Epreuve_Pseudo_mots_flexion_2.status == NOT_STARTED: # keep track of start time/frame for later Mot3_Epreuve_Pseudo_mots_flexion_2.tStart = t Mot3_Epreuve_Pseudo_mots_flexion_2.frameNStart = frameN # exact frame index Mot3_Epreuve_Pseudo_mots_flexion_2.setAutoDraw(True) # *Mot4_Epreuve_Pseudo_mots_flexion_2* updates if t >= 0.0 and Mot4_Epreuve_Pseudo_mots_flexion_2.status == NOT_STARTED: # keep track of start time/frame for later Mot4_Epreuve_Pseudo_mots_flexion_2.tStart = t Mot4_Epreuve_Pseudo_mots_flexion_2.frameNStart = frameN # exact frame index Mot4_Epreuve_Pseudo_mots_flexion_2.setAutoDraw(True) # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Epreuve_Pseudo_mots_flexion_2Components: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Epreuve_Pseudo_mots_flexion_2"------- for thisComponent in Epreuve_Pseudo_mots_flexion_2Components: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # check responses if key_resp_Epreuve_Pseudo_mots_flexion_2.keys in ['', [], None]: # No response was made key_resp_Epreuve_Pseudo_mots_flexion_2.keys=None # was no response the correct answer?! if str(CodeReponse).lower() == 'none': key_resp_Epreuve_Pseudo_mots_flexion_2.corr = 1; # correct non-response else: key_resp_Epreuve_Pseudo_mots_flexion_2.corr = 0; # failed to respond (incorrectly) # store data for Loop_Epreuve_Pseudo_mots_flexion (TrialHandler) Loop_Epreuve_Pseudo_mots_flexion.addData('key_resp_Epreuve_Pseudo_mots_flexion_2.keys',key_resp_Epreuve_Pseudo_mots_flexion_2.keys) Loop_Epreuve_Pseudo_mots_flexion.addData('key_resp_Epreuve_Pseudo_mots_flexion_2.corr', key_resp_Epreuve_Pseudo_mots_flexion_2.corr) if key_resp_Epreuve_Pseudo_mots_flexion_2.keys != None: # we had a response Loop_Epreuve_Pseudo_mots_flexion.addData('key_resp_Epreuve_Pseudo_mots_flexion_2.rt', key_resp_Epreuve_Pseudo_mots_flexion_2.rt) # the Routine "Epreuve_Pseudo_mots_flexion_2" was not non-slip safe, so reset the non-slip timer routineTimer.reset() thisExp.nextEntry() # completed 1 repeats of 'Loop_Epreuve_Pseudo_mots_flexion' # ------Prepare to start Routine "Accueil_Pseudo_mots_derivation"------- t = 0 Accueil_Pseudo_mots_derivationClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat key_resp_Accueil_Pseudo_mots_derivation = event.BuilderKeyResponse() # keep track of which components have finished Accueil_Pseudo_mots_derivationComponents = [text_Accueil_Pseudo_mots_derivation, key_resp_Accueil_Pseudo_mots_derivation] for thisComponent in Accueil_Pseudo_mots_derivationComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Accueil_Pseudo_mots_derivation"------- while continueRoutine: # get current time t = Accueil_Pseudo_mots_derivationClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_Accueil_Pseudo_mots_derivation* updates if t >= 0.0 and text_Accueil_Pseudo_mots_derivation.status == NOT_STARTED: # keep track of start time/frame for later text_Accueil_Pseudo_mots_derivation.tStart = t text_Accueil_Pseudo_mots_derivation.frameNStart = frameN # exact frame index text_Accueil_Pseudo_mots_derivation.setAutoDraw(True) # *key_resp_Accueil_Pseudo_mots_derivation* updates if t >= 0.0 and key_resp_Accueil_Pseudo_mots_derivation.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Accueil_Pseudo_mots_derivation.tStart = t key_resp_Accueil_Pseudo_mots_derivation.frameNStart = frameN # exact frame index key_resp_Accueil_Pseudo_mots_derivation.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Accueil_Pseudo_mots_derivation.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Accueil_Pseudo_mots_derivationComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Accueil_Pseudo_mots_derivation"------- for thisComponent in Accueil_Pseudo_mots_derivationComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Accueil_Pseudo_mots_derivation" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # ------Prepare to start Routine "Consignes_Pseudo_mots_derivation"------- t = 0 Consignes_Pseudo_mots_derivationClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat key_resp_Consignes_Pseudo_mots_derivation = event.BuilderKeyResponse() # keep track of which components have finished Consignes_Pseudo_mots_derivationComponents = [text_Consignes_Pseudo_mots_derivation, key_resp_Consignes_Pseudo_mots_derivation] for thisComponent in Consignes_Pseudo_mots_derivationComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Consignes_Pseudo_mots_derivation"------- while continueRoutine: # get current time t = Consignes_Pseudo_mots_derivationClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_Consignes_Pseudo_mots_derivation* updates if t >= 0 and text_Consignes_Pseudo_mots_derivation.status == NOT_STARTED: # keep track of start time/frame for later text_Consignes_Pseudo_mots_derivation.tStart = t text_Consignes_Pseudo_mots_derivation.frameNStart = frameN # exact frame index text_Consignes_Pseudo_mots_derivation.setAutoDraw(True) # *key_resp_Consignes_Pseudo_mots_derivation* updates if t >= 5 and key_resp_Consignes_Pseudo_mots_derivation.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Consignes_Pseudo_mots_derivation.tStart = t key_resp_Consignes_Pseudo_mots_derivation.frameNStart = frameN # exact frame index key_resp_Consignes_Pseudo_mots_derivation.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Consignes_Pseudo_mots_derivation.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Consignes_Pseudo_mots_derivationComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Consignes_Pseudo_mots_derivation"------- for thisComponent in Consignes_Pseudo_mots_derivationComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Consignes_Pseudo_mots_derivation" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # ------Prepare to start Routine "Accueil_Apprentissage"------- t = 0 Accueil_ApprentissageClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat key_resp_Accueil_Apprentissage = event.BuilderKeyResponse() # keep track of which components have finished Accueil_ApprentissageComponents = [text_Accueil_Apprentissage, key_resp_Accueil_Apprentissage] for thisComponent in Accueil_ApprentissageComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Accueil_Apprentissage"------- while continueRoutine: # get current time t = Accueil_ApprentissageClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_Accueil_Apprentissage* updates if t >= 0.0 and text_Accueil_Apprentissage.status == NOT_STARTED: # keep track of start time/frame for later text_Accueil_Apprentissage.tStart = t text_Accueil_Apprentissage.frameNStart = frameN # exact frame index text_Accueil_Apprentissage.setAutoDraw(True) # *key_resp_Accueil_Apprentissage* updates if t >= 1 and key_resp_Accueil_Apprentissage.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Accueil_Apprentissage.tStart = t key_resp_Accueil_Apprentissage.frameNStart = frameN # exact frame index key_resp_Accueil_Apprentissage.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Accueil_Apprentissage.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Accueil_ApprentissageComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Accueil_Apprentissage"------- for thisComponent in Accueil_ApprentissageComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Accueil_Apprentissage" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # set up handler to look after randomisation of conditions etc Loop_Apprentissage_Pseudo_mots_derivation = data.TrialHandler(nReps=1, method='random', extraInfo=expInfo, originPath=-1, trialList=data.importConditions('Choix_de_pseudo-mots_suffixes_Derivation_apprentissage.xlsx'), seed=None, name='Loop_Apprentissage_Pseudo_mots_derivation') thisExp.addLoop(Loop_Apprentissage_Pseudo_mots_derivation) # add the loop to the experiment thisLoop_Apprentissage_Pseudo_mots_derivation = Loop_Apprentissage_Pseudo_mots_derivation.trialList[0] # so we can initialise stimuli with some values # abbreviate parameter names if possible (e.g. rgb = thisLoop_Apprentissage_Pseudo_mots_derivation.rgb) if thisLoop_Apprentissage_Pseudo_mots_derivation != None: for paramName in thisLoop_Apprentissage_Pseudo_mots_derivation: exec('{} = thisLoop_Apprentissage_Pseudo_mots_derivation[paramName]'.format(paramName)) for thisLoop_Apprentissage_Pseudo_mots_derivation in Loop_Apprentissage_Pseudo_mots_derivation: currentLoop = Loop_Apprentissage_Pseudo_mots_derivation # abbreviate parameter names if possible (e.g. rgb = thisLoop_Apprentissage_Pseudo_mots_derivation.rgb) if thisLoop_Apprentissage_Pseudo_mots_derivation != None: for paramName in thisLoop_Apprentissage_Pseudo_mots_derivation: exec('{} = thisLoop_Apprentissage_Pseudo_mots_derivation[paramName]'.format(paramName)) # ------Prepare to start Routine "Apprentissage_Pseudo_mots_derivation"------- t = 0 Apprentissage_Pseudo_mots_derivationClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat Phrase_Apprentissage_Pseudo_mots_derivation.setText(Phrase) key_resp_Apprentissage_Pseudo_mots_derivation = event.BuilderKeyResponse() # keep track of which components have finished Apprentissage_Pseudo_mots_derivationComponents = [Phrase_Apprentissage_Pseudo_mots_derivation, key_resp_Apprentissage_Pseudo_mots_derivation] for thisComponent in Apprentissage_Pseudo_mots_derivationComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Apprentissage_Pseudo_mots_derivation"------- while continueRoutine: # get current time t = Apprentissage_Pseudo_mots_derivationClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Phrase_Apprentissage_Pseudo_mots_derivation* updates if t >= 0.0 and Phrase_Apprentissage_Pseudo_mots_derivation.status == NOT_STARTED: # keep track of start time/frame for later Phrase_Apprentissage_Pseudo_mots_derivation.tStart = t Phrase_Apprentissage_Pseudo_mots_derivation.frameNStart = frameN # exact frame index Phrase_Apprentissage_Pseudo_mots_derivation.setAutoDraw(True) # *key_resp_Apprentissage_Pseudo_mots_derivation* updates if t >= 0.0 and key_resp_Apprentissage_Pseudo_mots_derivation.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Apprentissage_Pseudo_mots_derivation.tStart = t key_resp_Apprentissage_Pseudo_mots_derivation.frameNStart = frameN # exact frame index key_resp_Apprentissage_Pseudo_mots_derivation.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Apprentissage_Pseudo_mots_derivation.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Apprentissage_Pseudo_mots_derivationComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Apprentissage_Pseudo_mots_derivation"------- for thisComponent in Apprentissage_Pseudo_mots_derivationComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Apprentissage_Pseudo_mots_derivation" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # ------Prepare to start Routine "Apprentissage_Pseudo_mots_derivation_2"------- t = 0 Apprentissage_Pseudo_mots_derivation_2Clock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat Phrase_Apprentissage_Pseudo_mots_derivation_2.setText(Phrase) key_resp_Apprentissage_Pseudo_mots_derivation_2 = event.BuilderKeyResponse() Mot1_Apprentissage_Pseudo_mots_derivation_2.setText(Choix1) Mot2_Apprentissage_Pseudo_mots_derivation_2.setText(Choix2) Mot3_Apprentissage_Pseudo_mots_derivation_2.setText(Choix3) # keep track of which components have finished Apprentissage_Pseudo_mots_derivation_2Components = [Phrase_Apprentissage_Pseudo_mots_derivation_2, key_resp_Apprentissage_Pseudo_mots_derivation_2, Mot1_Apprentissage_Pseudo_mots_derivation_2, Mot2_Apprentissage_Pseudo_mots_derivation_2, Mot3_Apprentissage_Pseudo_mots_derivation_2] for thisComponent in Apprentissage_Pseudo_mots_derivation_2Components: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Apprentissage_Pseudo_mots_derivation_2"------- while continueRoutine: # get current time t = Apprentissage_Pseudo_mots_derivation_2Clock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Phrase_Apprentissage_Pseudo_mots_derivation_2* updates if t >= 0.0 and Phrase_Apprentissage_Pseudo_mots_derivation_2.status == NOT_STARTED: # keep track of start time/frame for later Phrase_Apprentissage_Pseudo_mots_derivation_2.tStart = t Phrase_Apprentissage_Pseudo_mots_derivation_2.frameNStart = frameN # exact frame index Phrase_Apprentissage_Pseudo_mots_derivation_2.setAutoDraw(True) # *key_resp_Apprentissage_Pseudo_mots_derivation_2* updates if t >= 0.0 and key_resp_Apprentissage_Pseudo_mots_derivation_2.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Apprentissage_Pseudo_mots_derivation_2.tStart = t key_resp_Apprentissage_Pseudo_mots_derivation_2.frameNStart = frameN # exact frame index key_resp_Apprentissage_Pseudo_mots_derivation_2.status = STARTED # keyboard checking is just starting win.callOnFlip(key_resp_Apprentissage_Pseudo_mots_derivation_2.clock.reset) # t=0 on next screen flip event.clearEvents(eventType='keyboard') if key_resp_Apprentissage_Pseudo_mots_derivation_2.status == STARTED: theseKeys = event.getKeys(keyList=['1', '2', '3']) # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed if key_resp_Apprentissage_Pseudo_mots_derivation_2.keys == []: # then this was the first keypress key_resp_Apprentissage_Pseudo_mots_derivation_2.keys = theseKeys[0] # just the first key pressed key_resp_Apprentissage_Pseudo_mots_derivation_2.rt = key_resp_Apprentissage_Pseudo_mots_derivation_2.clock.getTime() # was this 'correct'? if (key_resp_Apprentissage_Pseudo_mots_derivation_2.keys == str(CodeReponse)) or (key_resp_Apprentissage_Pseudo_mots_derivation_2.keys == CodeReponse): key_resp_Apprentissage_Pseudo_mots_derivation_2.corr = 1 else: key_resp_Apprentissage_Pseudo_mots_derivation_2.corr = 0 # a response ends the routine continueRoutine = False # *Mot1_Apprentissage_Pseudo_mots_derivation_2* updates if t >= 0.0 and Mot1_Apprentissage_Pseudo_mots_derivation_2.status == NOT_STARTED: # keep track of start time/frame for later Mot1_Apprentissage_Pseudo_mots_derivation_2.tStart = t Mot1_Apprentissage_Pseudo_mots_derivation_2.frameNStart = frameN # exact frame index Mot1_Apprentissage_Pseudo_mots_derivation_2.setAutoDraw(True) # *Mot2_Apprentissage_Pseudo_mots_derivation_2* updates if t >= 0.0 and Mot2_Apprentissage_Pseudo_mots_derivation_2.status == NOT_STARTED: # keep track of start time/frame for later Mot2_Apprentissage_Pseudo_mots_derivation_2.tStart = t Mot2_Apprentissage_Pseudo_mots_derivation_2.frameNStart = frameN # exact frame index Mot2_Apprentissage_Pseudo_mots_derivation_2.setAutoDraw(True) # *Mot3_Apprentissage_Pseudo_mots_derivation_2* updates if t >= 0.0 and Mot3_Apprentissage_Pseudo_mots_derivation_2.status == NOT_STARTED: # keep track of start time/frame for later Mot3_Apprentissage_Pseudo_mots_derivation_2.tStart = t Mot3_Apprentissage_Pseudo_mots_derivation_2.frameNStart = frameN # exact frame index Mot3_Apprentissage_Pseudo_mots_derivation_2.setAutoDraw(True) # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Apprentissage_Pseudo_mots_derivation_2Components: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Apprentissage_Pseudo_mots_derivation_2"------- for thisComponent in Apprentissage_Pseudo_mots_derivation_2Components: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # check responses if key_resp_Apprentissage_Pseudo_mots_derivation_2.keys in ['', [], None]: # No response was made key_resp_Apprentissage_Pseudo_mots_derivation_2.keys=None # was no response the correct answer?! if str(CodeReponse).lower() == 'none': key_resp_Apprentissage_Pseudo_mots_derivation_2.corr = 1; # correct non-response else: key_resp_Apprentissage_Pseudo_mots_derivation_2.corr = 0; # failed to respond (incorrectly) # store data for Loop_Apprentissage_Pseudo_mots_derivation (TrialHandler) Loop_Apprentissage_Pseudo_mots_derivation.addData('key_resp_Apprentissage_Pseudo_mots_derivation_2.keys',key_resp_Apprentissage_Pseudo_mots_derivation_2.keys) Loop_Apprentissage_Pseudo_mots_derivation.addData('key_resp_Apprentissage_Pseudo_mots_derivation_2.corr', key_resp_Apprentissage_Pseudo_mots_derivation_2.corr) if key_resp_Apprentissage_Pseudo_mots_derivation_2.keys != None: # we had a response Loop_Apprentissage_Pseudo_mots_derivation.addData('key_resp_Apprentissage_Pseudo_mots_derivation_2.rt', key_resp_Apprentissage_Pseudo_mots_derivation_2.rt) if key_resp_Apprentissage_Pseudo_mots_derivation_2.keys[0] == CodeReponse: msg = "Bravo!" else: msg = "La réponse était " + CodeReponse + "!" # the Routine "Apprentissage_Pseudo_mots_derivation_2" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # ------Prepare to start Routine "Apprentissage_Pseudo_mots_derivation_feedback"------- t = 0 Apprentissage_Pseudo_mots_derivation_feedbackClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat Phrase_Apprentissage_Pseudo_mots_derivation_feedback.setText(Phrase) key_resp_Apprentissage_Pseudo_mots_derivation_feedback = event.BuilderKeyResponse() Mot1_Apprentissage_Pseudo_mots_derivation_feedback.setText(Choix1) Mot2_Apprentissage_Pseudo_mots_derivation_feedback.setText(Choix2) Mot3_Apprentissage_Pseudo_mots_derivation_feedback.setText(Choix3) Feedback_Apprentissage_Pseudo_mots_derivation_feedback.setText(msg) # keep track of which components have finished Apprentissage_Pseudo_mots_derivation_feedbackComponents = [Phrase_Apprentissage_Pseudo_mots_derivation_feedback, key_resp_Apprentissage_Pseudo_mots_derivation_feedback, Mot1_Apprentissage_Pseudo_mots_derivation_feedback, Mot2_Apprentissage_Pseudo_mots_derivation_feedback, Mot3_Apprentissage_Pseudo_mots_derivation_feedback, Feedback_Apprentissage_Pseudo_mots_derivation_feedback] for thisComponent in Apprentissage_Pseudo_mots_derivation_feedbackComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Apprentissage_Pseudo_mots_derivation_feedback"------- while continueRoutine: # get current time t = Apprentissage_Pseudo_mots_derivation_feedbackClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Phrase_Apprentissage_Pseudo_mots_derivation_feedback* updates if t >= 0.0 and Phrase_Apprentissage_Pseudo_mots_derivation_feedback.status == NOT_STARTED: # keep track of start time/frame for later Phrase_Apprentissage_Pseudo_mots_derivation_feedback.tStart = t Phrase_Apprentissage_Pseudo_mots_derivation_feedback.frameNStart = frameN # exact frame index Phrase_Apprentissage_Pseudo_mots_derivation_feedback.setAutoDraw(True) # *key_resp_Apprentissage_Pseudo_mots_derivation_feedback* updates if t >= 0.0 and key_resp_Apprentissage_Pseudo_mots_derivation_feedback.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Apprentissage_Pseudo_mots_derivation_feedback.tStart = t key_resp_Apprentissage_Pseudo_mots_derivation_feedback.frameNStart = frameN # exact frame index key_resp_Apprentissage_Pseudo_mots_derivation_feedback.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Apprentissage_Pseudo_mots_derivation_feedback.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # *Mot1_Apprentissage_Pseudo_mots_derivation_feedback* updates if t >= 0.0 and Mot1_Apprentissage_Pseudo_mots_derivation_feedback.status == NOT_STARTED: # keep track of start time/frame for later Mot1_Apprentissage_Pseudo_mots_derivation_feedback.tStart = t Mot1_Apprentissage_Pseudo_mots_derivation_feedback.frameNStart = frameN # exact frame index Mot1_Apprentissage_Pseudo_mots_derivation_feedback.setAutoDraw(True) # *Mot2_Apprentissage_Pseudo_mots_derivation_feedback* updates if t >= 0.0 and Mot2_Apprentissage_Pseudo_mots_derivation_feedback.status == NOT_STARTED: # keep track of start time/frame for later Mot2_Apprentissage_Pseudo_mots_derivation_feedback.tStart = t Mot2_Apprentissage_Pseudo_mots_derivation_feedback.frameNStart = frameN # exact frame index Mot2_Apprentissage_Pseudo_mots_derivation_feedback.setAutoDraw(True) # *Mot3_Apprentissage_Pseudo_mots_derivation_feedback* updates if t >= 0.0 and Mot3_Apprentissage_Pseudo_mots_derivation_feedback.status == NOT_STARTED: # keep track of start time/frame for later Mot3_Apprentissage_Pseudo_mots_derivation_feedback.tStart = t Mot3_Apprentissage_Pseudo_mots_derivation_feedback.frameNStart = frameN # exact frame index Mot3_Apprentissage_Pseudo_mots_derivation_feedback.setAutoDraw(True) # *Feedback_Apprentissage_Pseudo_mots_derivation_feedback* updates if t >= 0.0 and Feedback_Apprentissage_Pseudo_mots_derivation_feedback.status == NOT_STARTED: # keep track of start time/frame for later Feedback_Apprentissage_Pseudo_mots_derivation_feedback.tStart = t Feedback_Apprentissage_Pseudo_mots_derivation_feedback.frameNStart = frameN # exact frame index Feedback_Apprentissage_Pseudo_mots_derivation_feedback.setAutoDraw(True) # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Apprentissage_Pseudo_mots_derivation_feedbackComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Apprentissage_Pseudo_mots_derivation_feedback"------- for thisComponent in Apprentissage_Pseudo_mots_derivation_feedbackComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Apprentissage_Pseudo_mots_derivation_feedback" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # completed 1 repeats of 'Loop_Apprentissage_Pseudo_mots_derivation' # ------Prepare to start Routine "Accueil_Epreuve"------- t = 0 Accueil_EpreuveClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat key_resp_Accueil_Epreuve = event.BuilderKeyResponse() # keep track of which components have finished Accueil_EpreuveComponents = [text_Accueil_Epreuve, key_resp_Accueil_Epreuve] for thisComponent in Accueil_EpreuveComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Accueil_Epreuve"------- while continueRoutine: # get current time t = Accueil_EpreuveClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_Accueil_Epreuve* updates if t >= 0.0 and text_Accueil_Epreuve.status == NOT_STARTED: # keep track of start time/frame for later text_Accueil_Epreuve.tStart = t text_Accueil_Epreuve.frameNStart = frameN # exact frame index text_Accueil_Epreuve.setAutoDraw(True) # *key_resp_Accueil_Epreuve* updates if t >= 1 and key_resp_Accueil_Epreuve.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Accueil_Epreuve.tStart = t key_resp_Accueil_Epreuve.frameNStart = frameN # exact frame index key_resp_Accueil_Epreuve.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Accueil_Epreuve.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Accueil_EpreuveComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Accueil_Epreuve"------- for thisComponent in Accueil_EpreuveComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Accueil_Epreuve" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # set up handler to look after randomisation of conditions etc Loop_Epreuve_Pseudo_mots_derivation = data.TrialHandler(nReps=1, method='random', extraInfo=expInfo, originPath=-1, trialList=data.importConditions('Choix_de_pseudo-mots_suffixes_Derivation_epreuve.xlsx'), seed=None, name='Loop_Epreuve_Pseudo_mots_derivation') thisExp.addLoop(Loop_Epreuve_Pseudo_mots_derivation) # add the loop to the experiment thisLoop_Epreuve_Pseudo_mots_derivation = Loop_Epreuve_Pseudo_mots_derivation.trialList[0] # so we can initialise stimuli with some values # abbreviate parameter names if possible (e.g. rgb = thisLoop_Epreuve_Pseudo_mots_derivation.rgb) if thisLoop_Epreuve_Pseudo_mots_derivation != None: for paramName in thisLoop_Epreuve_Pseudo_mots_derivation: exec('{} = thisLoop_Epreuve_Pseudo_mots_derivation[paramName]'.format(paramName)) for thisLoop_Epreuve_Pseudo_mots_derivation in Loop_Epreuve_Pseudo_mots_derivation: currentLoop = Loop_Epreuve_Pseudo_mots_derivation # abbreviate parameter names if possible (e.g. rgb = thisLoop_Epreuve_Pseudo_mots_derivation.rgb) if thisLoop_Epreuve_Pseudo_mots_derivation != None: for paramName in thisLoop_Epreuve_Pseudo_mots_derivation: exec('{} = thisLoop_Epreuve_Pseudo_mots_derivation[paramName]'.format(paramName)) # ------Prepare to start Routine "Epreuve_Pseudo_mots_derivation"------- t = 0 Epreuve_Pseudo_mots_derivationClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat Phrase_Epreuve_Pseudo_mots_derivation.setText(Phrase) key_resp_Epreuve_Pseudo_mots_derivation = event.BuilderKeyResponse() # keep track of which components have finished Epreuve_Pseudo_mots_derivationComponents = [Phrase_Epreuve_Pseudo_mots_derivation, key_resp_Epreuve_Pseudo_mots_derivation] for thisComponent in Epreuve_Pseudo_mots_derivationComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Epreuve_Pseudo_mots_derivation"------- while continueRoutine: # get current time t = Epreuve_Pseudo_mots_derivationClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Phrase_Epreuve_Pseudo_mots_derivation* updates if t >= 0.0 and Phrase_Epreuve_Pseudo_mots_derivation.status == NOT_STARTED: # keep track of start time/frame for later Phrase_Epreuve_Pseudo_mots_derivation.tStart = t Phrase_Epreuve_Pseudo_mots_derivation.frameNStart = frameN # exact frame index Phrase_Epreuve_Pseudo_mots_derivation.setAutoDraw(True) # *key_resp_Epreuve_Pseudo_mots_derivation* updates if t >= 0.0 and key_resp_Epreuve_Pseudo_mots_derivation.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Epreuve_Pseudo_mots_derivation.tStart = t key_resp_Epreuve_Pseudo_mots_derivation.frameNStart = frameN # exact frame index key_resp_Epreuve_Pseudo_mots_derivation.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Epreuve_Pseudo_mots_derivation.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Epreuve_Pseudo_mots_derivationComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Epreuve_Pseudo_mots_derivation"------- for thisComponent in Epreuve_Pseudo_mots_derivationComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Epreuve_Pseudo_mots_derivation" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # ------Prepare to start Routine "Epreuve_Pseudo_mots_derivation_2"------- t = 0 Epreuve_Pseudo_mots_derivation_2Clock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat Phrase_Epreuve_Pseudo_mots_derivation_2.setText(Phrase) key_resp_Epreuve_Pseudo_mots_derivation_2 = event.BuilderKeyResponse() Mot1_Epreuve_Pseudo_mots_derivation_2.setText(Choix1) Mot2_Epreuve_Pseudo_mots_derivation_2.setText(Choix2) Mot3_Epreuve_Pseudo_mots_derivation_2.setText(Choix3) # keep track of which components have finished Epreuve_Pseudo_mots_derivation_2Components = [Phrase_Epreuve_Pseudo_mots_derivation_2, key_resp_Epreuve_Pseudo_mots_derivation_2, Mot1_Epreuve_Pseudo_mots_derivation_2, Mot2_Epreuve_Pseudo_mots_derivation_2, Mot3_Epreuve_Pseudo_mots_derivation_2] for thisComponent in Epreuve_Pseudo_mots_derivation_2Components: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Epreuve_Pseudo_mots_derivation_2"------- while continueRoutine: # get current time t = Epreuve_Pseudo_mots_derivation_2Clock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Phrase_Epreuve_Pseudo_mots_derivation_2* updates if t >= 0.0 and Phrase_Epreuve_Pseudo_mots_derivation_2.status == NOT_STARTED: # keep track of start time/frame for later Phrase_Epreuve_Pseudo_mots_derivation_2.tStart = t Phrase_Epreuve_Pseudo_mots_derivation_2.frameNStart = frameN # exact frame index Phrase_Epreuve_Pseudo_mots_derivation_2.setAutoDraw(True) # *key_resp_Epreuve_Pseudo_mots_derivation_2* updates if t >= 0.0 and key_resp_Epreuve_Pseudo_mots_derivation_2.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Epreuve_Pseudo_mots_derivation_2.tStart = t key_resp_Epreuve_Pseudo_mots_derivation_2.frameNStart = frameN # exact frame index key_resp_Epreuve_Pseudo_mots_derivation_2.status = STARTED # keyboard checking is just starting win.callOnFlip(key_resp_Epreuve_Pseudo_mots_derivation_2.clock.reset) # t=0 on next screen flip event.clearEvents(eventType='keyboard') if key_resp_Epreuve_Pseudo_mots_derivation_2.status == STARTED: theseKeys = event.getKeys(keyList=['1', '2', '3']) # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed if key_resp_Epreuve_Pseudo_mots_derivation_2.keys == []: # then this was the first keypress key_resp_Epreuve_Pseudo_mots_derivation_2.keys = theseKeys[0] # just the first key pressed key_resp_Epreuve_Pseudo_mots_derivation_2.rt = key_resp_Epreuve_Pseudo_mots_derivation_2.clock.getTime() # was this 'correct'? if (key_resp_Epreuve_Pseudo_mots_derivation_2.keys == str(CodeReponse)) or (key_resp_Epreuve_Pseudo_mots_derivation_2.keys == CodeReponse): key_resp_Epreuve_Pseudo_mots_derivation_2.corr = 1 else: key_resp_Epreuve_Pseudo_mots_derivation_2.corr = 0 # a response ends the routine continueRoutine = False # *Mot1_Epreuve_Pseudo_mots_derivation_2* updates if t >= 0.0 and Mot1_Epreuve_Pseudo_mots_derivation_2.status == NOT_STARTED: # keep track of start time/frame for later Mot1_Epreuve_Pseudo_mots_derivation_2.tStart = t Mot1_Epreuve_Pseudo_mots_derivation_2.frameNStart = frameN # exact frame index Mot1_Epreuve_Pseudo_mots_derivation_2.setAutoDraw(True) # *Mot2_Epreuve_Pseudo_mots_derivation_2* updates if t >= 0.0 and Mot2_Epreuve_Pseudo_mots_derivation_2.status == NOT_STARTED: # keep track of start time/frame for later Mot2_Epreuve_Pseudo_mots_derivation_2.tStart = t Mot2_Epreuve_Pseudo_mots_derivation_2.frameNStart = frameN # exact frame index Mot2_Epreuve_Pseudo_mots_derivation_2.setAutoDraw(True) # *Mot3_Epreuve_Pseudo_mots_derivation_2* updates if t >= 0.0 and Mot3_Epreuve_Pseudo_mots_derivation_2.status == NOT_STARTED: # keep track of start time/frame for later Mot3_Epreuve_Pseudo_mots_derivation_2.tStart = t Mot3_Epreuve_Pseudo_mots_derivation_2.frameNStart = frameN # exact frame index Mot3_Epreuve_Pseudo_mots_derivation_2.setAutoDraw(True) # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Epreuve_Pseudo_mots_derivation_2Components: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Epreuve_Pseudo_mots_derivation_2"------- for thisComponent in Epreuve_Pseudo_mots_derivation_2Components: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # check responses if key_resp_Epreuve_Pseudo_mots_derivation_2.keys in ['', [], None]: # No response was made key_resp_Epreuve_Pseudo_mots_derivation_2.keys=None # was no response the correct answer?! if str(CodeReponse).lower() == 'none': key_resp_Epreuve_Pseudo_mots_derivation_2.corr = 1; # correct non-response else: key_resp_Epreuve_Pseudo_mots_derivation_2.corr = 0; # failed to respond (incorrectly) # store data for Loop_Epreuve_Pseudo_mots_derivation (TrialHandler) Loop_Epreuve_Pseudo_mots_derivation.addData('key_resp_Epreuve_Pseudo_mots_derivation_2.keys',key_resp_Epreuve_Pseudo_mots_derivation_2.keys) Loop_Epreuve_Pseudo_mots_derivation.addData('key_resp_Epreuve_Pseudo_mots_derivation_2.corr', key_resp_Epreuve_Pseudo_mots_derivation_2.corr) if key_resp_Epreuve_Pseudo_mots_derivation_2.keys != None: # we had a response Loop_Epreuve_Pseudo_mots_derivation.addData('key_resp_Epreuve_Pseudo_mots_derivation_2.rt', key_resp_Epreuve_Pseudo_mots_derivation_2.rt) # the Routine "Epreuve_Pseudo_mots_derivation_2" was not non-slip safe, so reset the non-slip timer routineTimer.reset() thisExp.nextEntry() # completed 1 repeats of 'Loop_Epreuve_Pseudo_mots_derivation' # ------Prepare to start Routine "Accueil_Extraction"------- t = 0 Accueil_ExtractionClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat key_resp_Accueil_Extraction = event.BuilderKeyResponse() # keep track of which components have finished Accueil_ExtractionComponents = [text_Accueil_Extraction, key_resp_Accueil_Extraction] for thisComponent in Accueil_ExtractionComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Accueil_Extraction"------- while continueRoutine: # get current time t = Accueil_ExtractionClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_Accueil_Extraction* updates if t >= 0.0 and text_Accueil_Extraction.status == NOT_STARTED: # keep track of start time/frame for later text_Accueil_Extraction.tStart = t text_Accueil_Extraction.frameNStart = frameN # exact frame index text_Accueil_Extraction.setAutoDraw(True) # *key_resp_Accueil_Extraction* updates if t >= 0.0 and key_resp_Accueil_Extraction.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Accueil_Extraction.tStart = t key_resp_Accueil_Extraction.frameNStart = frameN # exact frame index key_resp_Accueil_Extraction.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Accueil_Extraction.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Accueil_ExtractionComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Accueil_Extraction"------- for thisComponent in Accueil_ExtractionComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Accueil_Extraction" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # ------Prepare to start Routine "Consignes_Extraction"------- t = 0 Consignes_ExtractionClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat key_resp_Consignes_Extraction = event.BuilderKeyResponse() # keep track of which components have finished Consignes_ExtractionComponents = [text_Consignes_Extraction, key_resp_Consignes_Extraction] for thisComponent in Consignes_ExtractionComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Consignes_Extraction"------- while continueRoutine: # get current time t = Consignes_ExtractionClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_Consignes_Extraction* updates if t >= 0 and text_Consignes_Extraction.status == NOT_STARTED: # keep track of start time/frame for later text_Consignes_Extraction.tStart = t text_Consignes_Extraction.frameNStart = frameN # exact frame index text_Consignes_Extraction.setAutoDraw(True) # *key_resp_Consignes_Extraction* updates if t >= 5 and key_resp_Consignes_Extraction.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Consignes_Extraction.tStart = t key_resp_Consignes_Extraction.frameNStart = frameN # exact frame index key_resp_Consignes_Extraction.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Consignes_Extraction.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Consignes_ExtractionComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Consignes_Extraction"------- for thisComponent in Consignes_ExtractionComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Consignes_Extraction" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # ------Prepare to start Routine "Accueil_Apprentissage"------- t = 0 Accueil_ApprentissageClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat key_resp_Accueil_Apprentissage = event.BuilderKeyResponse() # keep track of which components have finished Accueil_ApprentissageComponents = [text_Accueil_Apprentissage, key_resp_Accueil_Apprentissage] for thisComponent in Accueil_ApprentissageComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Accueil_Apprentissage"------- while continueRoutine: # get current time t = Accueil_ApprentissageClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_Accueil_Apprentissage* updates if t >= 0.0 and text_Accueil_Apprentissage.status == NOT_STARTED: # keep track of start time/frame for later text_Accueil_Apprentissage.tStart = t text_Accueil_Apprentissage.frameNStart = frameN # exact frame index text_Accueil_Apprentissage.setAutoDraw(True) # *key_resp_Accueil_Apprentissage* updates if t >= 1 and key_resp_Accueil_Apprentissage.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Accueil_Apprentissage.tStart = t key_resp_Accueil_Apprentissage.frameNStart = frameN # exact frame index key_resp_Accueil_Apprentissage.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Accueil_Apprentissage.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Accueil_ApprentissageComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Accueil_Apprentissage"------- for thisComponent in Accueil_ApprentissageComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Accueil_Apprentissage" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # set up handler to look after randomisation of conditions etc Loop_Apprentissage_Extraction = data.TrialHandler(nReps=1, method='random', extraInfo=expInfo, originPath=-1, trialList=data.importConditions('Extraction_base_apprentissage.xlsx'), seed=None, name='Loop_Apprentissage_Extraction') thisExp.addLoop(Loop_Apprentissage_Extraction) # add the loop to the experiment thisLoop_Apprentissage_Extraction = Loop_Apprentissage_Extraction.trialList[0] # so we can initialise stimuli with some values # abbreviate parameter names if possible (e.g. rgb = thisLoop_Apprentissage_Extraction.rgb) if thisLoop_Apprentissage_Extraction != None: for paramName in thisLoop_Apprentissage_Extraction: exec('{} = thisLoop_Apprentissage_Extraction[paramName]'.format(paramName)) for thisLoop_Apprentissage_Extraction in Loop_Apprentissage_Extraction: currentLoop = Loop_Apprentissage_Extraction # abbreviate parameter names if possible (e.g. rgb = thisLoop_Apprentissage_Extraction.rgb) if thisLoop_Apprentissage_Extraction != None: for paramName in thisLoop_Apprentissage_Extraction: exec('{} = thisLoop_Apprentissage_Extraction[paramName]'.format(paramName)) # ------Prepare to start Routine "Apprentissage_Extraction"------- t = 0 Apprentissage_ExtractionClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat Phrase_Apprentissage_Extraction.setText('Si possible, trouve un mot plus petit à l’intérieur du mot présenté. Sinon, réécris le mot présenté. ') key_resp_Apprentissage_Extraction = event.BuilderKeyResponse() theseKeys=key_resp_Apprentissage_Extraction.keys shift_flag = False Mot_Apprentissage_Extraction.setText(Mot) # keep track of which components have finished Apprentissage_ExtractionComponents = [Phrase_Apprentissage_Extraction, key_resp_Apprentissage_Extraction, Mot_Apprentissage_Extraction, Reponse_Apprentissage_Extraction] for thisComponent in Apprentissage_ExtractionComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Apprentissage_Extraction"------- while continueRoutine: # get current time t = Apprentissage_ExtractionClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Phrase_Apprentissage_Extraction* updates if t >= 0.0 and Phrase_Apprentissage_Extraction.status == NOT_STARTED: # keep track of start time/frame for later Phrase_Apprentissage_Extraction.tStart = t Phrase_Apprentissage_Extraction.frameNStart = frameN # exact frame index Phrase_Apprentissage_Extraction.setAutoDraw(True) # *key_resp_Apprentissage_Extraction* updates if t >= 0.0 and key_resp_Apprentissage_Extraction.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Apprentissage_Extraction.tStart = t key_resp_Apprentissage_Extraction.frameNStart = frameN # exact frame index key_resp_Apprentissage_Extraction.status = STARTED # keyboard checking is just starting win.callOnFlip(key_resp_Apprentissage_Extraction.clock.reset) # t=0 on next screen flip if key_resp_Apprentissage_Extraction.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed key_resp_Apprentissage_Extraction.keys.extend(theseKeys) # storing all keys key_resp_Apprentissage_Extraction.rt.append(key_resp_Apprentissage_Extraction.clock.getTime()) n= len(theseKeys) i = 0 while i < n: if (theseKeys[i] == 'return' and inputText != ""): if inputText == Reponse: msg = "Bravo!" else: msg = "La réponse était « " + Reponse + " »!" continueRoutine = False break elif theseKeys[i] == 'return': i = 1 + 1 elif theseKeys[i] == 'backspace': inputText = inputText[:-1] i = i + 1 elif theseKeys[i] == 'space': inputText += ' ' i = i + 1 elif theseKeys[i] in ['lshift', 'rshift']: shift_flag = True i = i + 1 else: if len(theseKeys[i]) == 1: if shift_flag: inputText += chr( ord(theseKeys[i]) - ord(' ')) shift_flag = False else: inputText += theseKeys[i] i = i + 1 # *Mot_Apprentissage_Extraction* updates if t >= 0.0 and Mot_Apprentissage_Extraction.status == NOT_STARTED: # keep track of start time/frame for later Mot_Apprentissage_Extraction.tStart = t Mot_Apprentissage_Extraction.frameNStart = frameN # exact frame index Mot_Apprentissage_Extraction.setAutoDraw(True) # *Reponse_Apprentissage_Extraction* updates if t >= 0.0 and Reponse_Apprentissage_Extraction.status == NOT_STARTED: # keep track of start time/frame for later Reponse_Apprentissage_Extraction.tStart = t Reponse_Apprentissage_Extraction.frameNStart = frameN # exact frame index Reponse_Apprentissage_Extraction.setAutoDraw(True) if Reponse_Apprentissage_Extraction.status == STARTED: # only update if drawing Reponse_Apprentissage_Extraction.setText(inputText, log=False) # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Apprentissage_ExtractionComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Apprentissage_Extraction"------- for thisComponent in Apprentissage_ExtractionComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # check responses if key_resp_Apprentissage_Extraction.keys in ['', [], None]: # No response was made key_resp_Apprentissage_Extraction.keys=None Loop_Apprentissage_Extraction.addData('key_resp_Apprentissage_Extraction.keys',key_resp_Apprentissage_Extraction.keys) if key_resp_Apprentissage_Extraction.keys != None: # we had a response Loop_Apprentissage_Extraction.addData('key_resp_Apprentissage_Extraction.rt', key_resp_Apprentissage_Extraction.rt) # the Routine "Apprentissage_Extraction" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # ------Prepare to start Routine "Apprentissage_Extraction_feedback"------- t = 0 Apprentissage_Extraction_feedbackClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat Phrase_Apprentissage_Extraction_feedback.setText('Si possible, trouve un mot plus petit à l’intérieur du mot présenté. Sinon, réécris le mot présenté. ') key_resp_Apprentissage_Extraction_feedback = event.BuilderKeyResponse() Mot_Apprentissage_Extraction_feedback.setText(Mot) Reponse_Apprentissage_Extraction_feedback.setText(inputText) Feedback_Apprentissage_Extraction_feedback.setText(msg) # keep track of which components have finished Apprentissage_Extraction_feedbackComponents = [Phrase_Apprentissage_Extraction_feedback, key_resp_Apprentissage_Extraction_feedback, Mot_Apprentissage_Extraction_feedback, Reponse_Apprentissage_Extraction_feedback, Feedback_Apprentissage_Extraction_feedback] for thisComponent in Apprentissage_Extraction_feedbackComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Apprentissage_Extraction_feedback"------- while continueRoutine: # get current time t = Apprentissage_Extraction_feedbackClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Phrase_Apprentissage_Extraction_feedback* updates if t >= 0.0 and Phrase_Apprentissage_Extraction_feedback.status == NOT_STARTED: # keep track of start time/frame for later Phrase_Apprentissage_Extraction_feedback.tStart = t Phrase_Apprentissage_Extraction_feedback.frameNStart = frameN # exact frame index Phrase_Apprentissage_Extraction_feedback.setAutoDraw(True) # *key_resp_Apprentissage_Extraction_feedback* updates if t >= 0.0 and key_resp_Apprentissage_Extraction_feedback.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Apprentissage_Extraction_feedback.tStart = t key_resp_Apprentissage_Extraction_feedback.frameNStart = frameN # exact frame index key_resp_Apprentissage_Extraction_feedback.status = STARTED # keyboard checking is just starting if key_resp_Apprentissage_Extraction_feedback.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # *Mot_Apprentissage_Extraction_feedback* updates if t >= 0.0 and Mot_Apprentissage_Extraction_feedback.status == NOT_STARTED: # keep track of start time/frame for later Mot_Apprentissage_Extraction_feedback.tStart = t Mot_Apprentissage_Extraction_feedback.frameNStart = frameN # exact frame index Mot_Apprentissage_Extraction_feedback.setAutoDraw(True) # *Reponse_Apprentissage_Extraction_feedback* updates if t >= 0.0 and Reponse_Apprentissage_Extraction_feedback.status == NOT_STARTED: # keep track of start time/frame for later Reponse_Apprentissage_Extraction_feedback.tStart = t Reponse_Apprentissage_Extraction_feedback.frameNStart = frameN # exact frame index Reponse_Apprentissage_Extraction_feedback.setAutoDraw(True) # *Feedback_Apprentissage_Extraction_feedback* updates if t >= 0.0 and Feedback_Apprentissage_Extraction_feedback.status == NOT_STARTED: # keep track of start time/frame for later Feedback_Apprentissage_Extraction_feedback.tStart = t Feedback_Apprentissage_Extraction_feedback.frameNStart = frameN # exact frame index Feedback_Apprentissage_Extraction_feedback.setAutoDraw(True) # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Apprentissage_Extraction_feedbackComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Apprentissage_Extraction_feedback"------- for thisComponent in Apprentissage_Extraction_feedbackComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) inputText = "" # the Routine "Apprentissage_Extraction_feedback" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # completed 1 repeats of 'Loop_Apprentissage_Extraction' # ------Prepare to start Routine "Accueil_Epreuve"------- t = 0 Accueil_EpreuveClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat key_resp_Accueil_Epreuve = event.BuilderKeyResponse() # keep track of which components have finished Accueil_EpreuveComponents = [text_Accueil_Epreuve, key_resp_Accueil_Epreuve] for thisComponent in Accueil_EpreuveComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Accueil_Epreuve"------- while continueRoutine: # get current time t = Accueil_EpreuveClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_Accueil_Epreuve* updates if t >= 0.0 and text_Accueil_Epreuve.status == NOT_STARTED: # keep track of start time/frame for later text_Accueil_Epreuve.tStart = t text_Accueil_Epreuve.frameNStart = frameN # exact frame index text_Accueil_Epreuve.setAutoDraw(True) # *key_resp_Accueil_Epreuve* updates if t >= 1 and key_resp_Accueil_Epreuve.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Accueil_Epreuve.tStart = t key_resp_Accueil_Epreuve.frameNStart = frameN # exact frame index key_resp_Accueil_Epreuve.status = STARTED # keyboard checking is just starting event.clearEvents(eventType='keyboard') if key_resp_Accueil_Epreuve.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Accueil_EpreuveComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Accueil_Epreuve"------- for thisComponent in Accueil_EpreuveComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # the Routine "Accueil_Epreuve" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # set up handler to look after randomisation of conditions etc Loop_Epreuve_Extraction = data.TrialHandler(nReps=1, method='random', extraInfo=expInfo, originPath=-1, trialList=data.importConditions('Extraction_base_epreuve.xlsx'), seed=None, name='Loop_Epreuve_Extraction') thisExp.addLoop(Loop_Epreuve_Extraction) # add the loop to the experiment thisLoop_Epreuve_Extraction = Loop_Epreuve_Extraction.trialList[0] # so we can initialise stimuli with some values # abbreviate parameter names if possible (e.g. rgb = thisLoop_Epreuve_Extraction.rgb) if thisLoop_Epreuve_Extraction != None: for paramName in thisLoop_Epreuve_Extraction: exec('{} = thisLoop_Epreuve_Extraction[paramName]'.format(paramName)) for thisLoop_Epreuve_Extraction in Loop_Epreuve_Extraction: currentLoop = Loop_Epreuve_Extraction # abbreviate parameter names if possible (e.g. rgb = thisLoop_Epreuve_Extraction.rgb) if thisLoop_Epreuve_Extraction != None: for paramName in thisLoop_Epreuve_Extraction: exec('{} = thisLoop_Epreuve_Extraction[paramName]'.format(paramName)) # ------Prepare to start Routine "Epreuve_Extraction"------- t = 0 Epreuve_ExtractionClock.reset() # clock frameN = -1 continueRoutine = True # update component parameters for each repeat Phrase_Epreuve_Extraction.setText('Si possible, trouve un mot plus petit à l’intérieur du mot présenté. Sinon, réécris le mot présenté. ') key_resp_Epreuve_Extraction = event.BuilderKeyResponse() theseKeys=key_resp_Epreuve_Extraction.keys shift_flag = False Mot_Epreuve_Extraction.setText(Mot) # keep track of which components have finished Epreuve_ExtractionComponents = [Phrase_Epreuve_Extraction, key_resp_Epreuve_Extraction, Mot_Epreuve_Extraction, Reponse_Epreuve_Extraction] for thisComponent in Epreuve_ExtractionComponents: if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # -------Start Routine "Epreuve_Extraction"------- while continueRoutine: # get current time t = Epreuve_ExtractionClock.getTime() frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Phrase_Epreuve_Extraction* updates if t >= 0.0 and Phrase_Epreuve_Extraction.status == NOT_STARTED: # keep track of start time/frame for later Phrase_Epreuve_Extraction.tStart = t Phrase_Epreuve_Extraction.frameNStart = frameN # exact frame index Phrase_Epreuve_Extraction.setAutoDraw(True) # *key_resp_Epreuve_Extraction* updates if t >= 0.0 and key_resp_Epreuve_Extraction.status == NOT_STARTED: # keep track of start time/frame for later key_resp_Epreuve_Extraction.tStart = t key_resp_Epreuve_Extraction.frameNStart = frameN # exact frame index key_resp_Epreuve_Extraction.status = STARTED # keyboard checking is just starting win.callOnFlip(key_resp_Epreuve_Extraction.clock.reset) # t=0 on next screen flip if key_resp_Epreuve_Extraction.status == STARTED: theseKeys = event.getKeys() # check for quit: if "escape" in theseKeys: endExpNow = True if len(theseKeys) > 0: # at least one key was pressed key_resp_Epreuve_Extraction.keys.extend(theseKeys) # storing all keys key_resp_Epreuve_Extraction.rt.append(key_resp_Epreuve_Extraction.clock.getTime()) n= len(theseKeys) i = 0 while i < n: if (theseKeys[i] == 'return' and inputText != ""): continueRoutine = False break elif theseKeys[i] == 'return': i = 1 + 1 elif theseKeys[i] == 'backspace': inputText = inputText[:-1] i = i + 1 elif theseKeys[i] == 'space': inputText += ' ' i = i + 1 elif theseKeys[i] in ['lshift', 'rshift']: shift_flag = True i = i + 1 else: if len(theseKeys[i]) == 1: if shift_flag: inputText += chr( ord(theseKeys[i]) - ord(' ')) shift_flag = False else: inputText += theseKeys[i] i = i + 1 # *Mot_Epreuve_Extraction* updates if t >= 0.0 and Mot_Epreuve_Extraction.status == NOT_STARTED: # keep track of start time/frame for later Mot_Epreuve_Extraction.tStart = t Mot_Epreuve_Extraction.frameNStart = frameN # exact frame index Mot_Epreuve_Extraction.setAutoDraw(True) # *Reponse_Epreuve_Extraction* updates if t >= 0.0 and Reponse_Epreuve_Extraction.status == NOT_STARTED: # keep track of start time/frame for later Reponse_Epreuve_Extraction.tStart = t Reponse_Epreuve_Extraction.frameNStart = frameN # exact frame index Reponse_Epreuve_Extraction.setAutoDraw(True) if Reponse_Epreuve_Extraction.status == STARTED: # only update if drawing Reponse_Epreuve_Extraction.setText(inputText, log=False) # check for quit (typically the Esc key) if endExpNow or event.getKeys(keyList=["escape"]): core.quit() # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Epreuve_ExtractionComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # -------Ending Routine "Epreuve_Extraction"------- for thisComponent in Epreuve_ExtractionComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) # check responses if key_resp_Epreuve_Extraction.keys in ['', [], None]: # No response was made key_resp_Epreuve_Extraction.keys=None Loop_Epreuve_Extraction.addData('key_resp_Epreuve_Extraction.keys',key_resp_Epreuve_Extraction.keys) if key_resp_Epreuve_Extraction.keys != None: # we had a response Loop_Epreuve_Extraction.addData('key_resp_Epreuve_Extraction.rt', key_resp_Epreuve_Extraction.rt) thisExp.addData('inputText', inputText) inputText="" # the Routine "Epreuve_Extraction" was not non-slip safe, so reset the non-slip timer routineTimer.reset() thisExp.nextEntry() # completed 1 repeats of 'Loop_Epreuve_Extraction' # these shouldn't be strictly necessary (should auto-save) thisExp.saveAsWideText(filename+'.csv') thisExp.saveAsPickle(filename) logging.flush() # make sure everything is closed down thisExp.abort() # or data files will save again on exit win.close() core.quit()