{#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}
{#each questions as question (question.id)} {/each}
Question {#if timer_end}
s
{:else}
s
{/if}
Réponses
{#if responses[question.id]} {question.title} {:else} {question.title} {/if} {#if responses[question.id]} {Object.keys(responses[question.id]).length} {:else} 0 {/if} {#if wsstats}/ {wsstats.nb_clients}{/if}
{/await} {#if edit_question !== null} deleteQuestion(edit_question)} /> {/if}

Questions {#if asks.length} {asks.length} question{#if asks.length > 1}s{/if} {/if}

{#if asks.length} {#each asks as ask (ask.id)}

{ask.content}

{/each} {:else}
Pas de question pour l'instant.
{/if}

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)} {/each}
{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} %
{/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)} {/each}
{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} %
{/await} {:else if question.kind && question.kind.startsWith('list')} {:else}
{/if} {/if} {/each} {/await} {/each} {/if}

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)}
{user.login} {#if user.myscroll != null} {/if}
{/each}
{/if} {/if}