🐛 Fixed saving results not working if results were downloaded before
This commit is contained in:
@@ -229,7 +229,6 @@
|
||||
"get_results": "Get results",
|
||||
"get_results_and_stop_time": "Get results and stop time",
|
||||
"get_final_results": "Get final results",
|
||||
"export_results": "Export results",
|
||||
"show_next_question": "Show next question",
|
||||
"start_by_showing_first_question": "Start by showing the first question.",
|
||||
"no_answers": "No answers!",
|
||||
@@ -239,7 +238,9 @@
|
||||
"show_results": "Show results",
|
||||
"stop_time_and_solutions": "Stop time and show solutions",
|
||||
"enter_answer_into_field": "Enter your answer into the input field!",
|
||||
"answers_submitted": "{{answer_count}} Answers submitted"
|
||||
"answers_submitted": "{{answer_count}} Answers submitted",
|
||||
"request_export_results": "Request result download",
|
||||
"download_export_results": "Download results"
|
||||
},
|
||||
"password_reset_page": {
|
||||
"reset_password": "Reset password"
|
||||
|
||||
@@ -28,7 +28,8 @@
|
||||
// };
|
||||
export let data;
|
||||
let game_mode;
|
||||
let { game_pin, auto_connect, game_token } = data;
|
||||
let { auto_connect, game_token } = data;
|
||||
const game_pin = data.game_pin;
|
||||
|
||||
let players: Array<Player> = [];
|
||||
let player_scores = {};
|
||||
@@ -42,6 +43,7 @@
|
||||
let success = false;
|
||||
let dataexport_download_a;
|
||||
let warnToLeave = true;
|
||||
let export_token = undefined;
|
||||
|
||||
const connect = async () => {
|
||||
socket.emit('register_as_admin', {
|
||||
@@ -91,8 +93,7 @@
|
||||
});*/
|
||||
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}`;
|
||||
dataexport_download_a.click();
|
||||
export_token = int_data;
|
||||
|
||||
setTimeout(() => {
|
||||
warnToLeave = true;
|
||||
@@ -151,9 +152,17 @@
|
||||
{#if control_visible}
|
||||
<div class="w-screen flex justify-center mt-16">
|
||||
<div class="w-fit">
|
||||
{#if export_token === undefined}
|
||||
<GrayButton on:click={request_answer_export}
|
||||
>{$t('admin_page.export_results')}</GrayButton
|
||||
>{$t('admin_page.request_export_results')}</GrayButton
|
||||
>
|
||||
{:else}
|
||||
<GrayButton
|
||||
target="_blank"
|
||||
href="/api/v1/quiz/export_data/{export_token}?ts={new Date().getTime()}&game_pin={game_pin}"
|
||||
>{$t('admin_page.download_export_results')}</GrayButton
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-screen flex justify-center mt-2">
|
||||
@@ -183,9 +192,6 @@
|
||||
<FinalResults bind:data={player_scores} bind:show_final_results />
|
||||
{/if}
|
||||
{#if !success}
|
||||
<input placeholder="game id" bind:value={game_token} />
|
||||
<input placeholder="game pin" bind:value={game_pin} />
|
||||
<button on:click={connect}>{$t('words.connect')}!</button>
|
||||
{#if errorMessage !== ''}
|
||||
<p class="text-red-700">{errorMessage}</p>
|
||||
{/if}
|
||||
@@ -199,7 +205,7 @@
|
||||
{:else}
|
||||
<SomeAdminScreen
|
||||
bind:final_results
|
||||
bind:game_pin
|
||||
{game_pin}
|
||||
bind:game_token
|
||||
bind:quiz_data
|
||||
bind:game_mode
|
||||
@@ -212,6 +218,8 @@
|
||||
<a
|
||||
on:click|preventDefault={request_answer_export}
|
||||
href="#"
|
||||
target="_blank"
|
||||
bind:this={dataexport_download_a}
|
||||
download=""
|
||||
class="absolute -top-3/4 -left-3/4 opacity-0">Download</a
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user