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