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)
78
78
/// </summary>
79
79
public void Begin ( )
80
80
{
81
+ if ( session . InTrial ) session . CurrentTrial . End ( ) ;
82
+
81
83
session . currentTrialNum = number ;
82
84
session . currentBlockNum = block . number ;
83
85
Original file line number Diff line number Diff line change @@ -81,6 +81,26 @@ public void TestEndMultipleTimes()
81
81
session . End ( ) ;
82
82
}
83
83
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
+
84
104
Tuple < Session , FileSaver > CreateSession ( string ppidExtra )
85
105
{
86
106
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