{#await surveyP then survey} {#if $user && $user.is_admin} goto(`surveys/${survey.id}/admin`)} /> {#if exportview} {/if} {/if}

< {survey.title} {#if exportview}Réponses{:else}Corrections{/if}

{#if $user && $user.is_admin && edit} edit = false} /> {/if} {#await getQuestions(survey.id)}
Chargement des questions …
{:then questions} {#if !exportview}
{#each questions as question (question.id)} {#await question.getResponses()} {:then responses} {/await} {/each}
Question Réponses Moyenne
{question.title}
Chargement …
{#if responses} {responses.filter((r) => !r.time_scored || (r.time_reported && r.time_reported >= r.time_scored)).length} / {responses.length} {#await usersP then users}
{Math.trunc(responses.length/users.length*1000)/10} % {/await} {:else} 0 {/if}
{#if responses && responses.filter((r) => r.time_scored).length} {Math.trunc(responses.reduce((p, c) => (p + (c.score?c.score:0)), 0)/responses.filter((r) => r.time_scored).length*10)/10} % {:else} -- % {/if}
{:else} {#each questions as question (question.id)}

{question.title}

{#if question.kind == "text" || (exportview_list && question.kind.indexOf("list") == 0)} {#await question.getResponses() then responses} {#each responses as response (response.id)}

{response.value}

{/each} {/await} {:else} {/if}
{/each} {/if} {/await} {/await}