protected override IEnumerable <Stage> Following() { if (_remainingTrialCount <= 0) { return(null); } var target = _randomBoolSequence.Next(); var stages = new[] { new Stage { Cue = target ? "YES" : "NO", Marker = MarkerDefinitions.TrialStartMarker, Duration = _testConfig.TrialDuration, Tag = target }, new Stage { Marker = MarkerDefinitions.TrialEndMarker, Duration = _testConfig.InterStimulusInterval }, }; _remainingTrialCount--; return(stages); }
protected override IEnumerable <Stage> Following() { if (_completed) { return(null); } var target = _randomBoolSequence.Next(); var cue = target ? NonTargetChars.ElementAt(_r.Next(NonTargetChars.Length)).ToString() : "X"; if (_testConfig.Still) { var stage = new Stage { Cue = cue, Duration = _remaining }; _completed = true; return(new[] { stage }); } var stages = new Stage[2]; var marker = target ? CptParadigm.TargetDisplayMarker : CptParadigm.NonTargetDisplayMarker; stages[0] = new CptStage { Cue = cue, IsTarget = target, Duration = _testConfig.LetterDuration, Marker = marker }; stages[1] = new Stage { Cue = "", Duration = _testConfig.InterStimulusInterval, Marker = CptParadigm.IntervalMarker }; if (_remaining < _testConfig.LetterDuration + _testConfig.InterStimulusInterval) { _completed = true; } else { _remaining -= _testConfig.LetterDuration + _testConfig.InterStimulusInterval; if (_remaining < _testConfig.LetterDuration) { _completed = true; } } return(stages); }