/// <summary>
 /// Get currently active trial. When not in a trial, gets previous trial.
 /// </summary>
 /// <returns>Currently active trial.</returns>
 public Trial GetTrial()
 {
     if (currentTrialNum == 0)
     {
         throw new NoSuchTrialException("There is no trial zero. Did you try to perform operations on the current trial before the first one started? If you are the start of the experiment please use NextTrial to get the first trial. ");
     }
     return(Trials.ToList()[currentTrialNum - 1]);
 }
Esempio n. 2
0
 /// <summary>
 /// Get currently active trial. When not in a trial, gets previous trial.
 /// </summary>
 /// <returns>Currently active trial.</returns>
 public Trial GetTrial()
 {
     if (currentTrialNum == 0)
     {
         throw new NoSuchTrialException("There is no trial zero. If you are the start of the experiment please use nextTrial to get the first trial");
     }
     return(Trials.ToList()[currentTrialNum - 1]);
 }
 /// <summary>
 /// Get previous Trial.
 /// </summary>
 /// <returns></returns>
 Trial GetPrevTrial()
 {
     try
     {
         // non zero indexed
         return(Trials.ToList()[currentTrialNum - 2]);
     }
     catch (ArgumentOutOfRangeException)
     {
         throw new NoSuchTrialException("There is no previous trial. Probably, currently at the start of session.");
     }
 }
 /// <summary>
 /// Get next Trial
 /// </summary>
 /// <returns></returns>
 Trial GetNextTrial()
 {
     // non zero indexed
     try
     {
         return(Trials.ToList()[currentTrialNum]);
     }
     catch (ArgumentOutOfRangeException)
     {
         throw new NoSuchTrialException("There is no next trial. Reached the end of trial list. If you are at the start of the session, perhaps you tried to start the next trial before generating your trials? If you are at the end, you can use BeginNextTrialSafe to do nothing if there is no next trial.");
     }
 }
Esempio n. 5
0
 /// <summary>
 /// Get next Trial
 /// </summary>
 /// <returns></returns>
 Trial GetNextTrial()
 {
     // non zero indexed
     try
     {
         return(Trials.ToList()[currentTrialNum]);
     }
     catch (ArgumentOutOfRangeException)
     {
         throw new NoSuchTrialException("There is no next trial. Reached the end of trial list.");
     }
 }
 /// <summary>
 /// Get trial by trial number (non zero indexed)
 /// </summary>
 /// <returns></returns>
 public Trial GetTrial(int trialNumber)
 {
     return(Trials.ToList()[trialNumber - 1]);
 }