brainworkshop icon indicating copy to clipboard operation
brainworkshop copied to clipboard

How to only count "Correct" and ignore misses

Open addeps3 opened this issue 6 years ago • 4 comments

Hi, I need to set up BW to only count correct answers and ignore "misses" (when there was no input) because negative feedback was frustrating, lol.

Ive been [toying with] the code but [after making changes and testing] the program crashes on finishing a session.

I don't really know where to start, line 3202 in ***.pyw is: # this controls the statistics which display upon completion of a session. but so far commenting out lines with "wrongs" breaks the code. Any assistance would be much appreciated.

Also this section seems to define no input I believe:

def check_match(input_type, check_missed = False):
    current = 0
    back_data = ''
    operation = 0
    # FIXME:  I'm not going to think about whether crab_back will work with
    # cfg.VARIABLE_NBACK yet, since I don't actually understand how the latter works

    if mode.flags[mode.mode]['crab'] == 1:
        back = 1 + 2*((mode.trial_number-1) % mode.back)
    else:
        back = mode.back

    if cfg.VARIABLE_NBACK:
        nback_trial = mode.trial_number - mode.variable_list[mode.trial_number - back - 1] - 1
    else:
        nback_trial = mode.trial_number - back - 1

    if len(stats.session['position1']) < mode.back:
        return 'unknown'

    if   input_type in ('visvis', 'visaudio', 'image'):
        current = mode.current_stim['vis']
    elif input_type in ('audiovis', ):
        current = mode.current_stim['audio']
    if   input_type in ('visvis', 'audiovis', 'image'):
        back_data = 'vis'
    elif input_type in ('visaudio', ):
        back_data = 'audio'
    elif input_type is 'arithmetic':
        current = mode.current_stim['number']
        back_data = stats.session['numbers'][nback_trial]
        operation = mode.current_operation
    else:
        current = mode.current_stim[input_type]
        back_data = input_type

    if input_type == 'arithmetic':
        if operation == 'add':
            correct_answer = back_data + current
        elif operation == 'subtract':
            correct_answer = back_data - current
        elif operation == 'multiply':
            correct_answer = back_data * current
        elif operation == 'divide':
            correct_answer = Decimal(back_data) / Decimal(current)
        if correct_answer == arithmeticAnswerLabel.parse_answer():
            return 'correct'
    else:
        # Catch accesses past list end
        try:
            if current == stats.session[back_data][nback_trial]:
                if check_missed:
                    return 'missed'
                else:
                    return 'correct'
        except Exception as e:
            print(e)
            return 'incorrect'
    return 'incorrect'

What I wanted at the time was no negative feedback on incorrect guesses (the text blinking in red] and that the incorrect guesses didnt add to the final score.

addeps3 avatar Jul 06 '18 12:07 addeps3