@@ -31,6 +31,9 @@ export class LearningPage implements OnInit, ViewWillEnter {
31
31
public correctCount : number = 0 ;
32
32
public skippedCount : number = 0 ;
33
33
34
+ public tempReadonly : boolean = false ;
35
+ public tempColor : string = "none" ;
36
+
34
37
@ViewChild ( 'answer' , { static : false } ) answer : IonInput | undefined ;
35
38
@ViewChild ( 'correction' , { static : false } ) correction : IonInput | undefined ;
36
39
@@ -144,11 +147,17 @@ export class LearningPage implements OnInit, ViewWillEnter {
144
147
let correct = this . getAnswer ( ) . trim ( ) ;
145
148
146
149
if ( answer == correct ) {
147
- this . status = Status . Ask ;
148
- this . correctCount ++ ;
149
- this . data [ this . index ] . correct = true ;
150
- this . apiService . updateUserStats ( this . id , this . data [ this . index ] . _id , "success" ) ;
151
- this . nextItem ( ) ;
150
+ this . tempColor = "success" ;
151
+ this . tempReadonly = true ;
152
+ setTimeout ( ( ) => {
153
+ this . tempColor = "none" ;
154
+ this . tempReadonly = false ;
155
+ this . status = Status . Ask ;
156
+ this . correctCount ++ ;
157
+ this . data [ this . index ] . correct = true ;
158
+ this . apiService . updateUserStats ( this . id , this . data [ this . index ] . _id , "success" ) ;
159
+ this . nextItem ( ) ;
160
+ } , 500 ) ;
152
161
} else {
153
162
this . status = Status . Answer ;
154
163
}
@@ -161,12 +170,18 @@ export class LearningPage implements OnInit, ViewWillEnter {
161
170
let correct = this . getAnswer ( ) . trim ( ) ;
162
171
163
172
if ( answer == correct ) {
164
- this . status = Status . Ask ;
165
- this . data [ this . index ] . wrong = true ;
166
- this . apiService . updateUserStats ( this . id , this . data [ this . index ] . _id , "wrong" ) ;
167
- this . correctionText = "" ;
168
- this . nextItem ( ) ;
169
- this . setFocus ( ) ;
173
+ this . tempColor = "danger" ;
174
+ this . tempReadonly = true ;
175
+ setTimeout ( ( ) => {
176
+ this . tempColor = "none" ;
177
+ this . tempReadonly = false ;
178
+ this . status = Status . Ask ;
179
+ this . data [ this . index ] . wrong = true ;
180
+ this . apiService . updateUserStats ( this . id , this . data [ this . index ] . _id , "wrong" ) ;
181
+ this . correctionText = "" ;
182
+ this . nextItem ( ) ;
183
+ this . setFocus ( ) ;
184
+ } , 2000 ) ;
170
185
}
171
186
}
172
187
0 commit comments