{#if $user && $user.is_admin}
updateSurvey()}
on:end={() => { if (confirm("Sûr ?")) ws.send('{"action":"end"}') }}
/>
{/if}
<
{survey.title}
Administration
{#if asks.length}
{/if}
{#if survey.direct !== null}
{#if ws_up}Connecté{:else}Déconnecté{/if}
{:else}
{/if}
{#if survey.direct === null}
{:else}
{#await req_questions}
Chargement des questions …
{:then questions}
{/await}
{#if edit_question !== null}
deleteQuestion(edit_question)}
/>
{/if}
{ ws.send('{"action":"get_asks", "value": ""}'); asks = []; }}
title="Rafraîchir les réponses"
>
{ ws.send('{"action":"get_asks", "value": "unanswered"}'); asks = []; }}
title="Rafraîchir les réponses, en rapportant les réponses déjà répondues"
>
{ ws.send('{"action":"mark_answered", "value": "all"}'); asks = [] }}
>
Questions
{#if asks.length}
{asks.length} question{#if asks.length > 1}s{/if}
{/if}
{#if asks.length}
{#each asks as ask (ask.id)}
{/each}
{:else}
Pas de question pour l'instant.
{/if}
{ ws.send('{"action":"get_responses"}') }}
title="Rafraîchir les réponses"
>
Réponses
{#if Object.keys(responses).length}
{#each Object.keys(responses) as q, qid (qid)}
{#await req_questions then questions}
{#each questions as question}
{#if question.id == q}
{question.title}
{#if question.kind == 'ucq'}
{#await question.getProposals()}
Chargement des propositions …
{:then proposals}
{#if current_question == question.id}
{:else}
{/if}
{#each proposals as proposal (proposal.id)}
{proposal.label}
{responsesbyid[q].filter((e) => e == proposal.id.toString()).length}/{responsesbyid[q].length}
{Math.trunc(responsesbyid[q].filter((e) => e == proposal.id.toString()).length / responsesbyid[q].length * 1000)/10} %
{/each}
{/await}
{:else if question.kind == 'mcq'}
{#await question.getProposals()}
Chargement des propositions …
{:then proposals}
{#if current_question == question.id}
{:else}
{/if}
{#each proposals as proposal (proposal.id)}
{proposal.label}
{responsesbyid[q].filter((e) => e.indexOf(proposal.id.toString()) >= 0).length}/{responsesbyid[q].length}
{Math.trunc(responsesbyid[q].filter((e) => e.indexOf(proposal.id.toString()) >= 0).length / responsesbyid[q].length * 1000)/10} %
{/each}
{/await}
{:else if question.kind && question.kind.startsWith('list')}
{:else}
{/if}
{/if}
{/each}
{/await}
{/each}
{/if}
{ ws.send('{"action":"get_stats"}') }}
title="Rafraîchir les stats"
>
{ scroll_states = {}; ws.send('{"action":"where_are_you"}')} }
title="Rapporter l'avancement"
>
Connectés
{#if wsstats}
{wsstats.nb_clients} utilisateurs
{/if}
{#if scroll_mean}
= 0 && scroll_mean < 0.2}
class:text-warning={scroll_mean >= 0.2 && scroll_mean < 0.6}
class:text-info={scroll_mean >= 0.6 && scroll_mean < 0.9}
class:text-success={scroll_mean >= 0.9}
>Avancement global : {Math.trunc(scroll_mean*10000)/100} %
{/if}
{#if wsstats && wsstats.users}
{#each wsstats.users as user, lid (lid)}
{#if user.myscroll != null}
{/if}
{/each}
{/if}
{/if}