Compare commits
3 Commits
ee4872ff38
...
0cab193d6c
Author | SHA1 | Date | |
---|---|---|---|
0cab193d6c | |||
4be5503af9 | |||
749d55c24f |
@ -129,7 +129,7 @@
|
|||||||
class:bg-dark={survey.corrected && score.count-score.corrected <= 0}
|
class:bg-dark={survey.corrected && score.count-score.corrected <= 0}
|
||||||
title="{score.count-score.corrected}/{score.count}"
|
title="{score.count-score.corrected}/{score.count}"
|
||||||
>
|
>
|
||||||
{#if score.count == 0 || survey.corrected}
|
{#if score.count == 0 || score.corrected == 0 || survey.corrected}
|
||||||
{score.count-score.corrected}
|
{score.count-score.corrected}
|
||||||
{:else}
|
{:else}
|
||||||
{Math.trunc((1-score.corrected/score.count)*100)} %
|
{Math.trunc((1-score.corrected/score.count)*100)} %
|
||||||
@ -142,6 +142,7 @@
|
|||||||
class:bg-info={score.score < 18 && score.score >= 15}
|
class:bg-info={score.score < 18 && score.score >= 15}
|
||||||
class:bg-warning={score.score < 15 && score.score >= 9}
|
class:bg-warning={score.score < 15 && score.score >= 9}
|
||||||
class:bg-danger={score.score < 9}
|
class:bg-danger={score.score < 9}
|
||||||
|
class:bg-dark={score.score == "N/A"}
|
||||||
>
|
>
|
||||||
{score.score}
|
{score.score}
|
||||||
</span>
|
</span>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<script context="module">
|
<script context="module">
|
||||||
|
import CorrectionPieChart from '$lib/components/CorrectionPieChart.svelte';
|
||||||
import { getSurvey } from '$lib/surveys';
|
import { getSurvey } from '$lib/surveys';
|
||||||
import { getUsers } from '$lib/users';
|
import { getUsers } from '$lib/users';
|
||||||
|
|
||||||
@ -27,6 +28,7 @@
|
|||||||
usersP = getUsers(s.promo, s.group);
|
usersP = getUsers(s.promo, s.group);
|
||||||
})
|
})
|
||||||
let edit = false;
|
let edit = false;
|
||||||
|
let exportview = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#await surveyP then survey}
|
{#await surveyP then survey}
|
||||||
@ -37,12 +39,19 @@
|
|||||||
class="ms-1 float-end"
|
class="ms-1 float-end"
|
||||||
on:update={() => goto(`surveys/${survey.id}/admin`)}
|
on:update={() => goto(`surveys/${survey.id}/admin`)}
|
||||||
/>
|
/>
|
||||||
|
<button
|
||||||
|
class="btn ms-1 float-end"
|
||||||
|
class:btn-dark={exportview}
|
||||||
|
class:btn-outline-dark={!exportview}
|
||||||
|
title="Éditer"
|
||||||
|
on:click={() => { exportview = !exportview; } }
|
||||||
|
><i class="bi bi-activity"></i></button>
|
||||||
{/if}
|
{/if}
|
||||||
<div class="d-flex align-items-center">
|
<div class="d-flex align-items-center">
|
||||||
<h2>
|
<h2>
|
||||||
<a href="surveys/{survey.id}" class="text-muted" style="text-decoration: none"><</a>
|
<a href="surveys/{survey.id}" class="text-muted" style="text-decoration: none"><</a>
|
||||||
{survey.title}
|
{survey.title}
|
||||||
<small class="text-muted">Corrections</small>
|
<small class="text-muted">{#if exportview}Réponses{:else}Corrections{/if}</small>
|
||||||
</h2>
|
</h2>
|
||||||
<SurveyBadge class="ms-2" {survey} />
|
<SurveyBadge class="ms-2" {survey} />
|
||||||
</div>
|
</div>
|
||||||
@ -57,6 +66,7 @@
|
|||||||
<span>Chargement des questions …</span>
|
<span>Chargement des questions …</span>
|
||||||
</div>
|
</div>
|
||||||
{:then questions}
|
{:then questions}
|
||||||
|
{#if !exportview}
|
||||||
<div class="card mt-3 mb-5">
|
<div class="card mt-3 mb-5">
|
||||||
<table class="table table-hover table-striped mb-0">
|
<table class="table table-hover table-striped mb-0">
|
||||||
<thead>
|
<thead>
|
||||||
@ -101,5 +111,26 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
{:else}
|
||||||
|
{#each questions as question (question.id)}
|
||||||
|
<h3>{question.title}</h3>
|
||||||
|
{#if question.kind == "text"}
|
||||||
|
{#await question.getResponses() then responses}
|
||||||
|
{#each responses as response (response.id)}
|
||||||
|
<div class="card mb-2">
|
||||||
|
<div class="card-body">
|
||||||
|
<p class="card-text" style:white-space="pre-line">
|
||||||
|
{response.value}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/each}
|
||||||
|
{/await}
|
||||||
|
{:else}
|
||||||
|
<CorrectionPieChart {question} />
|
||||||
|
{/if}
|
||||||
|
<hr class="mb-3">
|
||||||
|
{/each}
|
||||||
|
{/if}
|
||||||
{/await}
|
{/await}
|
||||||
{/await}
|
{/await}
|
||||||
|
Reference in New Issue
Block a user