Example #1
0
 private static Trial BuildCurrentTrial(int index)
 {
  Trial t = new Trial();
  Figure c = GetCurrentFigure(index);
  t.Bottom = new Stimulus() { Image = new ImageStimulus(c.BottomImage), Type = c.BottomType };
  t.Top = new Stimulus() { Image = new ImageStimulus(c.TopImage), Type = c.TopType };
  t.Target = GetRandomTarget();
  return t;
 }
Example #2
0
  public UserActivityRecord(Trial trial, int timeTillResponse, Keys userSelection, double currentAB, double currentABV, double previousABV, double totalABV, double trialRTAverage)
  {

   this.Trial = trial;
   this.ResponseTime = timeTillResponse;
   this.Selection = userSelection;
   this.CurrentABV = currentABV;

   this.PreviousABV = previousABV;
   this.CurrentAB = currentAB;
   this.TotalABV = totalABV;
   this.TrialRTAverage = trialRTAverage;

  }
Example #3
0
  public static void Add(Trial trial, int timeTillResponse, System.Windows.Forms.Keys userSelection)
  {
   if (!IsCorrectSelection(trial, userSelection))
   {
    Trend = ABVTrend.Static;
    return;
   }

   //Add to trials and averages
   if (trial.TargetType == TargetType.Congruent)
   {
    CongruentTrials.Add(timeTillResponse);
    if (CongruentTrials.Count >= Settings.NumberOfTrialsInAB)
     CongruentAverages.Add(CongruentTrials.GetCurrentWindowAverage());
   }
   else
   {
    ICongruentTrials.Add(timeTillResponse);
    if (ICongruentTrials.Count >= Settings.NumberOfTrialsInAB)
     ICongruentAverages.Add(ICongruentTrials.GetCurrentWindowAverage());
   }

   //add to ABList
   //if (CongruentAverages.Any() && NuberOfMutualAverages > ABList.Count)
   //zigzag
   if (CongruentAverages.Any() && ICongruentAverages.Any())
   {
    CurrentAB = ICongruentAverages[ICongruentAverages.Count - 1] - CongruentAverages[CongruentAverages.Count - 1];
    ABList.Add(CurrentAB);
   }

   CalculateAllABVs();
   Trend = ResolveABVTrend();
  }
Example #4
0
 private static bool IsCorrectSelection(Trial trial, Keys userSelection)
 {
  return trial.Target.Input == userSelection;
 }
Example #5
0
 internal static void WriteTrial(Trial trial, int timeTillResponse, System.Windows.Forms.Keys userSelection, double currentAB, double currentABV, double previousABV, double totalABV, double trialRTAverage)
 {
  UserActivityRecord userActivityRecord = new UserActivityRecord(trial, timeTillResponse, userSelection, currentAB, currentABV, previousABV, totalABV, trialRTAverage);
  Records.Add(userActivityRecord);
 }