Skip to content

Commit 00060dd

Browse files
committed
Fixed typo in index; You are now kicked back to the main menu if you disconnect while playing, no score is submitted. Issue #12
1 parent 7dcc5ab commit 00060dd

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

public_html/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ <h1>Oops!</h1>
117117
</p>
118118
<p class = 'errorText'>
119119
If this problem persists, contact <span id = 'contact'></span>,
120-
and let them know Error <span id = 'errorCode'>404</span> has occurred.
120+
and let him know Error <span id = 'errorCode'>404</span> has occurred.
121121
</p>
122122
<p class = 'errorText'>
123123
Press the button below to try again. <span id = 'retryCount'></span>

public_html/src/js/GameScreen.js

+16-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,22 @@
223223

224224
GameScreen.prototype.answerQuestion = function(data) {
225225
if( !this.timer.running ) {
226-
this.timer.start();
226+
//this.timer.start();
227+
/* This code is executed if there was a connection error mid-game, kick to menu on reload */
228+
/* Must call change event async */
229+
setTimeout(
230+
function( ref, QUESTION_MOLECULE ) {
231+
FCCommunicationManager.errorCallback = undefined;
232+
disableButtons( );
233+
ref.scene.remove(ref.currentQuestion[ QUESTION_MOLECULE ]);
234+
ref.currentQuestion = undefined;
235+
ref.timer.stop( );
236+
$('#gameUI').trigger(new ScreenChangeEvent('menu'));
237+
},
238+
1, this, QUESTION_MOLECULE
239+
);
240+
241+
return;
227242
}
228243

229244
if(data.correct === 'true') {

0 commit comments

Comments
 (0)