R1 += 1
            n1 += 1
            Cs1 += 1
            n2 = 0  #resets sequence from right

        if mouse.isPressedIn(rbox, buttons=[0]):
            rpressed = True
        if not mouse.isPressedIn(rbox, buttons=[0]) and rpressed == True:
            rpressed = False
            n1 = 0
            R2 += 1
            n2 += 1
            Cs2 += 1

        text.text = n1
        text.pos = (-0.5, +0.25)
        text.draw()

        text.text = n2
        text.pos = (+0.5, +0.25)
        text.draw()

    #processes terminal link schedule
    if n1 >= ratio or n2 >= ratio:

        #resets timer for the first time
        if initial == True:
            if schedule == 'ConcChFR20VI5/FR20FI5':
                interval_timer = CountdownTimer(exponential(interval))
            if schedule == 'ConcChFR20FI5/FR20VI5':
                interval_timer = CountdownTimer(interval)
Пример #2
0
    #process right schedule
    if mouse.isPressedIn(rbox, buttons=[0]):
        rpressed = True
    if not mouse.isPressedIn(rbox, buttons=[0]) and rpressed == True:
        rpressed = False
        R2 += 1
        if p == p_list[0]:
            score += 1

    lbox.draw()
    rbox.draw()

    #target
    text.text = u'Вы часто видите число 1?'
    text.pos = (0, -0.2)
    text.draw()

    #responses
    text.text = u'Да'
    text.pos = (-0.3, -0.6)
    text.draw()

    text.text = u'Нет'
    text.pos = (+0.3, -0.6)
    text.draw()

    #instructions
    if global_time.getTime() < 25:
        text.text = u'Отвечайте на вопрос, чтобы заработать очки'
    if global_time.getTime() > 25 and global_time.getTime() < 40:
Пример #3
0
                T2 = CountdownTimer(exponential(interval))

    #finishes script if 'escape' pressed
    if 'escape' in resp_key:
        break

    #record data
    tempArray = [global_time.getTime(), R1, R2, Rf1, Rf2, phase, schedule]
    data.append(tempArray)

    #drawer
    text.text, text.pos = score, (0, 0)
    text.draw()  #displays earned points
    if global_time.getTime() < 25.0:
        text.text = u'Кликайте внутри красных прямоугольников, чтобы заработать очки'
        text.pos = (0, +0.5)
        text.draw()

    win.flip()

final = CountdownTimer(25)

while final.getTime() > 0:
    text.text = u'Ваш результат - %i. Благодарим за участие в эксперименте. Окно закроется автоматически через %i сек.' % (
        score, round(final.getTime(), 0))
    text.pos = (0, 0)
    text.draw()

    #check of keyboard input
    resp_key = getKeys(['escape'])