@@ -81,6 +81,10 @@ export class LearningPage implements OnInit, ViewWillEnter {
8181 this . setFocus ( ) ;
8282 }
8383
84+ floor ( value : number ) {
85+ return Math . round ( value ) ;
86+ }
87+
8488 getQuestion ( ) {
8589 if ( this . data !== undefined ) {
8690 return this . data [ this . index ] . first ;
@@ -143,6 +147,8 @@ export class LearningPage implements OnInit, ViewWillEnter {
143147 }
144148
145149 checkAnswer ( ) {
150+ if ( this . tempReadonly ) return ;
151+
146152 let answer = this . getAnswerText ( ) . trim ( ) ;
147153 let correct = this . getAnswer ( ) . trim ( ) ;
148154
@@ -166,6 +172,8 @@ export class LearningPage implements OnInit, ViewWillEnter {
166172 }
167173
168174 enterAnswer ( ) {
175+ if ( this . tempReadonly ) return ;
176+
169177 let answer = this . getAnswerText ( ) . trim ( ) ;
170178 let correct = this . getAnswer ( ) . trim ( ) ;
171179
@@ -186,6 +194,8 @@ export class LearningPage implements OnInit, ViewWillEnter {
186194 }
187195
188196 skip ( ) {
197+ if ( this . tempReadonly ) return ;
198+
189199 this . status = Status . Ask ;
190200 this . skippedCount ++ ;
191201 this . apiService . updateUserStats ( this . id , this . data [ this . index ] . _id , "skip" ) ;
@@ -194,6 +204,8 @@ export class LearningPage implements OnInit, ViewWillEnter {
194204 }
195205
196206 changeWrong ( ) {
207+ if ( this . tempReadonly ) return ;
208+
197209 this . status = Status . Ask ;
198210 this . correctCount ++ ;
199211 this . data [ this . index ] . changed = true ;
@@ -204,6 +216,8 @@ export class LearningPage implements OnInit, ViewWillEnter {
204216 }
205217
206218 nextItem ( ) {
219+ if ( this . tempReadonly ) return ;
220+
207221 this . answerText = "" ;
208222
209223 this . index ++ ;
0 commit comments