|
157 | 157 | while the loading screen is up (< 10 seconds) or if there
|
158 | 158 | is a corrupted file.
|
159 | 159 | */
|
160 |
| - /* TODO Contact? Hack in error message? */ |
161 | 160 | alert('A fatal error has occurred. Please log-in to the wifi! Error 407.\n\n' +
|
162 | 161 | 'Please contact ' + 'saschlac' + '@udel' + '.edu' + ' if this problem persists.');
|
163 | 162 | this.loadingState--;
|
|
230 | 229 | }
|
231 | 230 |
|
232 | 231 | if(data.correct === 'true') {
|
233 |
| - this.scoreManager.correct(RIGHT_ANSWER_POINTS); |
| 232 | + this.scoreManager.correct(data.score - this.scoreManager.score); |
234 | 233 | this.nextQuestion();
|
235 | 234 | } else {
|
236 |
| - this.scoreManager.incorrect(WRONG_ANSWER_POINTS); |
| 235 | + this.scoreManager.incorrect(data.score - this.scoreManager.score); |
237 | 236 | $('#scoreChange, #' + this.currentAnswer).addClass('incorrect');
|
238 | 237 | }
|
239 |
| - $('#scoreChange').text(this.scoreManager.text()).addClass('flashInOut') |
| 238 | + $('#scoreChange').text(this.scoreManager.text()).addClass('flashInOut'); |
240 | 239 | };
|
241 | 240 |
|
242 | 241 | GameScreen.prototype.pollAnswer = function(userAnswer, currentQuestion) {
|
|
256 | 255 | $('#finalScore').text('Final Score: ' + response.final_score);
|
257 | 256 | $('#rank').text('Rank: #' + response.rank);
|
258 | 257 | $('#gameCompletedUI').addClass('in active');
|
| 258 | + |
| 259 | + this.scoreManager.correct(response.final_score - this.scoreManager.score); |
| 260 | + setTimeout( |
| 261 | + function( ref ) { |
| 262 | + $('#scoreChange').text('+Time: ' + ref.scoreManager.text()).addClass('flashInOut long'); |
| 263 | + }, |
| 264 | + 1000, this); |
259 | 265 | }
|
260 | 266 | disableButtons( );
|
261 | 267 | this.scene.remove(this.currentQuestion[ QUESTION_MOLECULE ]);
|
262 | 268 | this.currentQuestion = undefined;
|
263 | 269 | this.timer.stop( );
|
264 |
| - $('#scoreChange') |
265 |
| - .stop(true, true) |
266 |
| - .animate({ |
267 |
| - opacity: 0 |
268 |
| - }, |
269 |
| - 300); |
270 | 270 | FCCommunicationManager.endFlashcardGame(UserData.auth,
|
271 | 271 | this.gameData.game_session_id,
|
272 | 272 | this.timer.getElapsedMs(),
|
|
292 | 292 | });
|
293 | 293 |
|
294 | 294 | $('#scoreChange').on('animationend webkitAnimationEnd ', function() {
|
295 |
| - $(this).removeClass('flashInOut incorrect'); |
| 295 | + $(this).removeClass('flashInOut incorrect long'); |
296 | 296 | });
|
297 | 297 | }
|
298 | 298 |
|
|
0 commit comments