Display responses number percentage
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
nemunaire 2022-09-20 19:54:53 +02:00
parent 2365674a97
commit 862fbef1ee

View File

@ -1,5 +1,6 @@
<script context="module">
import { getSurvey } from '../../../../lib/surveys';
import { getUsers } from '../../../../lib/users';
export async function load({ params, stuff }) {
return {
@ -21,6 +22,10 @@
import { getQuestions } from '../../../../lib/questions';
export let surveyP;
let usersP = null;
surveyP.then((s) => {
usersP = getUsers(s.promo, s.group);
})
let edit = false;
</script>
@ -75,6 +80,10 @@
{#if responses}
{responses.filter((r) => !r.time_scored || (r.time_reported && r.time_reported >= r.time_scored)).length} /
{responses.length}
{#await usersP then users}
<br>
{Math.trunc(responses.length/users.length*1000)/10}&nbsp;%
{/await}
{:else}
0
{/if}