Display responses number percentage
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
2365674a97
commit
862fbef1ee
@ -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} %
|
||||
{/await}
|
||||
{:else}
|
||||
0
|
||||
{/if}
|
||||
|
Reference in New Issue
Block a user