/*
    File:               ss_exp.c
    Author:             michael stevens
    Experiment:         Stroop vs Simon experiment
                        Simon & Berbaum 1990
                        
        Experiment

            instructions
            practice trials
            more instructions
            warmup trials
            experimental trials
            closing
*/

// include functions from ss_trial.c
#define SS_EXP_C
#include "ss_trial.c"


// information about the participans
int subj;
int sex;

void info()
{
    // subject n
    int x;
    do {
        ts_clrscr();
        x = ts_printf(-ax(.9), ay(.9), "Participant number (0-19): ");
        ts_scanf(-ax(.9) + x, ay(.9), "%d", &subj);
    } while (subj < 0 || subj > 19);

    // sex
    char tmp;
    do {
        ts_clrscr();
        x = ts_printf(-ax(.9), ay(.9), "sex (m/v): ");
        ts_scanf(-ax(.9) + x, ay(.9), "%c", &tmp);
    } while (tmp != 'm' && tmp != 'v');

    if (tmp == 'm')
        sex = 0;
    else
        sex = 1;

    ts_clrscr();
}

// instructions
void instructions1()
{
    ts_clrscr();
    ts_printf_centre(0, ay(.5), "practice");

    if (data[0].task == COLOR)
        ts_printf_centre(0, ay(.16), "COLOR relevant");
    else
        ts_printf_centre(0, ay(.16), "MEANING relevant");

    if (data[0].respmap == RR)
        ts_printf_centre(0, -ay(.16), "red right - green left");
    else
        ts_printf_centre(0, -ay(.16), "red left - green right");

    ts_button(0, -ay(.5));
    ts_clrscr();
}

void instructions2()
{
    ts_clrscr();
    ts_printf_centre(0, 0, "and now for real ...");
    ts_button(0, -ay(.5));
    ts_clrscr();
}


void bye()
{
    ts_clrscr();
    ts_printf_centre(0, 0, "That's all. Thanks.");
    ts_button(0, -ay(.5));
    ts_clrscr();
}

// run the whole experiment
int main()
{
    // screen setup
    ts_scrsize(XGA);
    ts_scrmode(FULLSCREEN);
    ts_font(COURIER, 20, BOLD);

    // activate response buttons
    ts_defkey(M1);
    ts_defkey(M2);
    ts_defkey(KEY_ESC);

    // get session info and randomize list
    info();
    randomize(subj, sex);

    // practic trials
    int i;
    instructions1();
    for (i = 0; i < NPRACT; i++)
        trial(i);

    // warmup and experimental trials
    instructions2();
    for (; i < NTRIALS; i++)
        trial(i);

    // write data and thank participant
    writedata();
    bye();
    return 0;
}

END_OF_MAIN();


top
Persoonlijke pagina Universiteit GentTscope
Allegro | Cygwin | Gcc
© See license.html for copyright information