🐛 Fixed #82
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
let game_started = false;
|
||||
let quiz_data: QuizData;
|
||||
//let question_number = '0';
|
||||
let question_results = null;
|
||||
// let question_results = null;
|
||||
let final_results: Array<null> | Array<Array<PlayerAnswer>> = [null];
|
||||
let success = false;
|
||||
let dataexport_download_a;
|
||||
@@ -58,7 +58,7 @@
|
||||
errorMessage = $t('admin_page.already_registered_as_admin');
|
||||
});
|
||||
|
||||
socket.on('question_results', (int_data) => {
|
||||
/* socket.on('question_results', (int_data) => {
|
||||
try {
|
||||
int_data = JSON.parse(int_data);
|
||||
} catch (e) {
|
||||
@@ -66,7 +66,7 @@
|
||||
return;
|
||||
}
|
||||
question_results = int_data;
|
||||
});
|
||||
});*/
|
||||
socket.on('export_token', (int_data) => {
|
||||
warnToLeave = false;
|
||||
dataexport_download_a.href = `/api/v1/quiz/export_data/${int_data}?ts=${new Date().getTime()}&game_pin=${game_pin}`;
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
import { navbarVisible } from '$lib/stores';
|
||||
import ShowEndScreen from '$lib/play/end.svelte';
|
||||
import { QuizQuestionType } from '$lib/quiz_types';
|
||||
import { getLocalization } from '$lib/i18n';
|
||||
|
||||
const { t } = getLocalization();
|
||||
|
||||
// Exports
|
||||
export let data;
|
||||
@@ -83,7 +86,11 @@
|
||||
|
||||
socket.on('question_results', (data) => {
|
||||
restart();
|
||||
answer_results = JSON.parse(data);
|
||||
try {
|
||||
answer_results = JSON.parse(data);
|
||||
} catch {
|
||||
answer_results = null;
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('final_results', (data) => {
|
||||
@@ -124,12 +131,18 @@
|
||||
/>
|
||||
{/key}
|
||||
{:else if gameMeta.started && answer_results !== undefined}
|
||||
{#key unique}
|
||||
<ShowResults
|
||||
bind:results={answer_results}
|
||||
bind:game_data={gameData}
|
||||
bind:question_index
|
||||
/>
|
||||
{/key}
|
||||
{#if answer_results === null}
|
||||
<div class="w-full flex justify-center">
|
||||
<h1 class="text-3xl">{$t('admin_page.no_answers')}</h1>
|
||||
</div>
|
||||
{:else}
|
||||
{#key unique}
|
||||
<ShowResults
|
||||
bind:results={answer_results}
|
||||
bind:game_data={gameData}
|
||||
bind:question_index
|
||||
/>
|
||||
{/key}
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user