File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed
Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,8 @@ private void SetReferences(Block trialBlock)
7878 /// </summary>
7979 public void Begin ( )
8080 {
81+ if ( session . InTrial ) session . CurrentTrial . End ( ) ;
82+
8183 session . currentTrialNum = number ;
8284 session . currentBlockNum = block . number ;
8385
Original file line number Diff line number Diff line change @@ -81,6 +81,26 @@ public void TestEndMultipleTimes()
8181 session . End ( ) ;
8282 }
8383
84+ [ Test ]
85+ public void TestCurrentEndTrialOnBeginNext ( )
86+ {
87+ ( Session session , FileSaver fileSaver ) = CreateSession ( "endonbegin" ) ;
88+ session . endOnDestroy = true ;
89+
90+ foreach ( var t in session . Trials )
91+ {
92+ t . Begin ( ) ;
93+ }
94+
95+ foreach ( var t in session . Trials )
96+ {
97+ TrialStatus expectedStatus = t == session . LastTrial ? TrialStatus . InProgress : TrialStatus . Done ;
98+ Assert . AreEqual ( t . status , expectedStatus ) ;
99+ }
100+
101+ GameObject . DestroyImmediate ( session . gameObject ) ;
102+ }
103+
84104 Tuple < Session , FileSaver > CreateSession ( string ppidExtra )
85105 {
86106 GameObject gameObject = new GameObject ( ) ;
Original file line number Diff line number Diff line change 1- 2.0.5
1+ 2.1.0
You can’t perform that action at this time.
0 commit comments