/*@
<body>
<h4>Stroop Interference</h4>

<p> Colored words or letter sequences are presented together with a
color name below.  The task is to respond with the YES-key if the
color name gives the name of the letter colors shown or with the NO-key if
not.  The colored letters or words words are either congruent to their color,
incongruent, or are neutral distractors.  
*/

Experiment() {

  Context() {

    AssignmentGroup() {
    new RED =   [ 13.37, 0.519, 0.268];
    new YELLOW =  [ 47.34, 0.429, 0.485];
    new GREEN = [ 20.20, 0.257, 0.442];
    new BLUE =  [ 16.44, 0.175, 0.155];
    new WHITE = [ 55.40, 0.313, 0.329];

    new R_JA = 0;
    new R_NEIN = 1;

    new Interference = 0;
    new NEUT = 0;
    new KON = 1;
    new INKON = 2;
    
	ExperimentName = lang2("Stroop Interference (short version)", "Stroop-Effekt (Kurversion)");
	SubjectCode = "pxlab"; 
	DataFileTrialFormat = "%SubjectCode% %TrialCounter% %Interference% %Trial.Feedback.Response% %Trial.TwoStrings.ResponseTime%";
	new TrialReplicator = 0;
    }

	Session() {
		Instruction() {
	        	Text = lang2(
			["Stroop-Interference", " ", 
			"Press any button to start a trial after the fixation mark is shown.",
			"There will appear a sequence of colored letters on the top and a color name on the bottom.", 
			"Your task is to decide whether the bottom color word names the letter colors on top. You should always ignore the word content of the top row.", 
			"If the bottom color word names the letter colors of the top row then press the left mouse button. If not then press the right mouse button.",
			"Your decision should be as fast as possible but you should not make any errors!",
			" ", "Press any key now to start the experiment!"], 
			["Experiment zum Stroop-Effekt", " ", 
			"Wenn das Kreuz erscheint, können Sie durch einen Tastendruck die Reizdarbietung auslösen.",
			"Oben erscheint dann eine Folge von farbigen Buchstaben und unten erscheint ein Farbwort.", 
			"Wenn das Farbwort die Farbe der Buchstaben benennt, drücken Sie 'ja' - die linke Maustaste, wenn das Farbwort nicht die Buchstabenfarbe benennt, dann drücken Sie 'nein' - die rechte Maustaste. ",
			"Urteilen Sie so schnell Sie können, aber versuchen Sie in jedem Fall falsche Antworten zu vermeiden!",
			" ", "Zum Starten bitte eine beliebige Taste drücken!"]);
		}
    	}	

	SessionEnd() {
		SessionEndMessage();
	}


    	Block(StoreData) {
		BlockStartMessage();
	}

    	BlockEnd() {
		BlockEndMessage();
	}

	Trial(TrialCounter, 
	    TrialReplicator, 
	    TwoStrings.SignalText,
	    TwoStrings.ProbeText,
	    TwoStrings.SignalColor,
	    Interference, 
	    Feedback.CorrectCode, 
	    Feedback.Response, 
	    TwoStrings.ResponseTime) {
		FixationMark() {
			Timer = de.pxlab.pxl.TimerCodes.RELEASE_RESPONSE_TIMER;
			LineWidth = 3;
		}
		ClearScreen:wait1() {
			Timer = de.pxlab.pxl.TimerCodes.CLOCK_TIMER;
			Duration = 500;
		}
		TwoStrings() {
			SOADuration = 100;
			SignalSize = 140;
			Duration = 5000;
			SignalLocationX = 0;
			SignalLocationY = -45;
			ProbeSize = 140;
			ProbeLocationX = 0;
			ProbeLocationY = 148;
			ResponseSet = [1, 3];
		}
		Feedback() {
			ResponseParameter = "Trial.TwoStrings.ResponseCode";
			CorrectText = "%Trial.TwoStrings.ResponseTime@i% ms";
			Evaluation = de.pxlab.pxl.EvaluationCodes.COMPARE_CODE;
			FalseText = lang2("False!", "Falsch!");
			Timer = de.pxlab.pxl.TimerCodes.CLOCK_TIMER;
			Duration = 1200;
			Visible = 1;
		}
		ClearScreen:wait2() {
			Timer = de.pxlab.pxl.TimerCodes.CLOCK_TIMER;
			Duration = 1000;
		}
	}

  }

  Procedure() {

    Session() {

      /* Übung: 4 x 12 = 48 trials */

      Block(0) {

	Trial(?, 1, <"GREEN", "BLUE">, "RED", RED, INKON, R_JA, ?, ?);
	Trial(?, 1, "YELLOW", <"YELLOW", "GREEN">, RED, INKON, R_NEIN, ?, ?);
/*
	Trial(?, 1, <"DRFG", "NSLG">, "RED", RED, NEUT, R_JA, ?, ?);
	Trial(?, 1, <"KNPL", "TTMM">, "YELLOW", RED, NEUT, R_NEIN, ?, ?);
	Trial(?, <1,2>, "RED", "RED", RED, KON, R_JA, ?, ?);
	Trial(?, 1, "RED", <"GREEN", "BLUE">, RED, KON, R_NEIN, ?, ?);

	Trial(?, 1, <"YELLOW", "RED">, "GREEN", GREEN, INKON, R_JA, ?, ?);
	Trial(?, 1, "BLUE", <"YELLOW", "BLUE">, GREEN, INKON, R_NEIN, ?, ?);
*/

	Trial(?, 1, <"TGZW", "LNVT">, "GREEN", GREEN, NEUT, R_JA, ?, ?);
	Trial(?, 1, <"NTFH", "CSNG">, "YELLOW", GREEN, NEUT, R_NEIN, ?, ?);
/*
	Trial(?, <1,2>, "GREEN", "GREEN", GREEN, KON, R_JA, ?, ?);
	Trial(?, 1, "GREEN", <"YELLOW", "BLUE">, GREEN, KON, R_NEIN, ?, ?);

	Trial(?, 1, <"RED", "GREEN">, "YELLOW", YELLOW, INKON, R_JA, ?, ?);
	Trial(?, 1, "BLUE", <"RED", "BLUE">, YELLOW, INKON, R_NEIN, ?, ?);
	Trial(?, 1, <"DNRH", "FRVN">, "YELLOW", YELLOW, NEUT, R_JA, ?, ?);
	Trial(?, 1, <"RDNR", "HFGL">, "RED", YELLOW, NEUT, R_NEIN, ?, ?);
*/

	Trial(?, <1,2>, "YELLOW", "YELLOW", YELLOW, KON, R_JA, ?, ?);
	Trial(?, 1, "YELLOW", <"GREEN", "BLUE">, YELLOW, KON, R_NEIN, ?, ?);
/*
	Trial(?, 1, <"GREEN", "YELLOW">, "BLUE", BLUE, INKON, R_JA, ?, ?);
	Trial(?, 1, "RED", <"RED", "YELLOW">, BLUE, INKON, R_NEIN, ?, ?);
	Trial(?, 1, <"RHSR", "PMRH">, "BLUE", BLUE, NEUT, R_JA, ?, ?);
	Trial(?, 1, <"NSRG", "GNDN">, "RED", BLUE, NEUT, R_NEIN, ?, ?);
	Trial(?, <1,2>, "BLUE", "BLUE", BLUE, KON, R_JA, ?, ?);
	Trial(?, 1, "BLUE", <"GREEN", "YELLOW">, BLUE, KON, R_NEIN, ?, ?);
*/

      }

/* --------------------------------------------------------------------------

      Block(1) {

	// Insgesamt: 4 x 54 = 216 trials

	// Farbe RED:  18 (inkon) + 18 (neutral) + 18 (kongruent) trials

	// inkongruent: 9 (ja) + 9 (nein) trials

	Trial(?, <1,2,3>, <"YELLOW", "GREEN", "BLUE">, "RED", RED, INKON, R_JA, ?, ?);
	Trial(?, 1, <"YELLOW", "GREEN", "BLUE">, <"YELLOW", "GREEN", "BLUE">, RED, INKON, R_NEIN, ?, ?);

	// neutral: 9 (ja) + 9 (nein) trials

	Trial(?, 1, <"DRFG", "NSLG", "TDNN">, "RED", RED, NEUT, R_JA, ?, ?);
	Trial(?, 1, <"BGSD", "RWNM", "MNGN">, "RED", RED, NEUT, R_JA, ?, ?);
	Trial(?, 1, <"SDNR", "DNST", "HTST">, "RED", RED, NEUT, R_JA, ?, ?);

	Trial(?, 1, <"KNPL", "TTMM", "NTKN">, "YELLOW", RED, NEUT, R_NEIN, ?, ?);
	Trial(?, 1, <"FNHC", "SYHP", "HCYS">, "GREEN", RED, NEUT, R_NEIN, ?, ?);
	Trial(?, 1, <"PRDM", "RFDR", "NTHC">, "BLUE", RED, NEUT, R_NEIN, ?, ?);

	// kongruent: 9 (ja) + 9 (nein) trials

	Trial(?, <1,2,3,4,5,6,7,8,9>, "RED", "RED", RED, KON, R_JA, ?, ?);
	Trial(?, <1,2,3>, "RED", <"YELLOW", "GREEN", "BLUE">, RED, KON, R_NEIN, ?, ?);


	// Farbe GREEN

	// inkongruent

	Trial(?, <1,2,3>, <"YELLOW", "RED", "BLUE">, "GREEN", GREEN, INKON, R_JA, ?, ?);
	Trial(?, 1, <"YELLOW", "RED", "BLUE">, <"YELLOW", "RED", "BLUE">, GREEN, INKON, R_NEIN, ?, ?);

	// neutral

	Trial(?, 1, <"TGZW", "LNVT", "LTRD">, "GREEN", GREEN, NEUT, R_JA, ?, ?);
	Trial(?, 1, <"NSLS", "NBGG", "LDNR">, "GREEN", GREEN, NEUT, R_JA, ?, ?);
	Trial(?, 1, <"GLMR", "FNND", "HTMN">, "GREEN", GREEN, NEUT, R_JA, ?, ?);

	Trial(?, 1, <"NSDD", "NTFH", "CSNG">, "YELLOW", GREEN, NEUT, R_NEIN, ?, ?);
	Trial(?, 1, <"NLKS", "RDRH", "TNDN">,  "RED", GREEN, NEUT, R_NEIN, ?, ?);
	Trial(?, 1, <"NSRG", "RVTK", "JBSG">, "BLUE", GREEN, NEUT, R_NEIN, ?, ?);

	// kongruent

	Trial(?, <1,2,3,4,5,6,7,8,9>, "GREEN", "GREEN", GREEN, KON, R_JA, ?, ?);
	Trial(?, <1,2,3>, "GREEN", <"YELLOW", "RED", "BLUE">, GREEN, KON, R_NEIN, ?, ?);

	// Farbe YELLOW

	// inkongruent

	Trial(?, <1,2,3>, <"RED", "GREEN", "BLUE">, "YELLOW", YELLOW, INKON, R_JA, ?, ?);
	Trial(?, 1, <"RED", "GREEN", "BLUE">, <"RED", "GREEN", "BLUE">, YELLOW, INKON, R_NEIN, ?, ?);

	// neutral

	Trial(?, 1, <"NSMR", "DNRH", "FRVN">, "YELLOW", YELLOW, NEUT, R_JA, ?, ?);
	Trial(?, 1, <"LTKC", "WTNR", "SMSN">, "YELLOW", YELLOW, NEUT, R_JA, ?, ?);
	Trial(?, 1, <"TNMR", "KDWN", "RHFN">, "YELLOW", YELLOW, NEUT, R_JA, ?, ?);

	Trial(?, 1, <"GNSM", "RDNR", "HFGL">, "RED", YELLOW, NEUT, R_NEIN, ?, ?);
	Trial(?, 1, <"NDZT", "NGNZ", "THCS">, "GREEN", YELLOW, NEUT, R_NEIN, ?, ?);
	Trial(?, 1, <"RSGT", "KRDS", "ZGDD">, "BLUE", YELLOW, NEUT, R_NEIN, ?, ?);

	// kongruent

	Trial(?, <1,2,3,4,5,6,7,8,9>, "YELLOW", "YELLOW", YELLOW, KON, R_JA, ?, ?);
	Trial(?, <1,2,3>, "YELLOW", <"RED", "GREEN", "BLUE">, YELLOW, KON, R_NEIN, ?, ?);

	// Farbe BLUE

	// inkongruent

	Trial(?, <1,2,3>, <"RED", "GREEN", "YELLOW">, "BLUE", BLUE, INKON, R_JA, ?, ?);
	Trial(?, 1, <"RED", "GREEN", "YELLOW">, <"RED", "GREEN", "YELLOW">, BLUE, INKON, R_NEIN, ?, ?);

	// neutral

	Trial(?, 1, <"DNFB", "RHSR", "PMRH">, "BLUE", BLUE, NEUT, R_JA, ?, ?);
	Trial(?, 1, <"RLHZ", "GLDN", "RGRD">, "BLUE", BLUE, NEUT, R_JA, ?, ?);
	Trial(?, 1, <"FNTT", "RPRT", "NSDT">, "BLUE", BLUE, NEUT, R_JA, ?, ?);

	Trial(?, 1, <"TRST", "NSRG", "GNDN">, "RED", BLUE, NEUT, R_NEIN, ?, ?);
	Trial(?, 1, <"FPMR", "FZTS", "SNMG">, "GREEN", BLUE, NEUT, R_NEIN, ?, ?);
	Trial(?, 1, <"SLLM", "RFSM", "DTTH">, "YELLOW", BLUE, NEUT, R_NEIN, ?, ?);

	// kongruent

	Trial(?, <1,2,3,4,5,6,7,8,9>, "BLUE", "BLUE", BLUE, KON, R_JA, ?, ?);
	Trial(?, <1,2,3>, "BLUE", <"RED", "GREEN", "YELLOW">, BLUE, KON, R_NEIN, ?, ?);
      }

---------------------------------------------------------------------------------------- */

    }
  }
}
/*@</body>*/

