Add grade filter by category
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
9ad021fa65
commit
19a759536b
@ -1,8 +1,10 @@
|
||||
<script>
|
||||
import { getCategories } from '$lib/categories';
|
||||
import { getSurveys } from '$lib/surveys';
|
||||
import { getUsers, getGrades, getPromos } from '$lib/users';
|
||||
|
||||
export let promo = null;
|
||||
export let category = null;
|
||||
</script>
|
||||
|
||||
{#await getPromos() then promos}
|
||||
@ -15,6 +17,18 @@
|
||||
</select>
|
||||
</div>
|
||||
{/await}
|
||||
{#await getCategories() then categories}
|
||||
<div class="float-end me-2">
|
||||
<select class="form-select" bind:value={category}>
|
||||
<option value={null}>toutes</option>
|
||||
{#each categories as categ (categ.id)}
|
||||
{#if !promo || categ.promo == promo}
|
||||
<option value={categ.id}>{categ.label}</option>
|
||||
{/if}
|
||||
{/each}
|
||||
</select>
|
||||
</div>
|
||||
{/await}
|
||||
<h2>
|
||||
Étudiants {#if promo !== null}{promo}{/if}
|
||||
<small class="text-muted">Notes</small>
|
||||
@ -39,7 +53,7 @@
|
||||
<th>ID</th>
|
||||
<th>Login</th>
|
||||
{#each surveys as survey}
|
||||
{#if survey.corrected && (!promo || survey.promo == promo)}
|
||||
{#if survey.corrected && (!promo || survey.promo == promo) && (!category || survey.id_category == category)}
|
||||
<th>
|
||||
{#if survey.kind == "survey"}
|
||||
<a href="surveys/{survey.id}" style="text-decoration: none">{survey.title}</a>
|
||||
@ -68,7 +82,7 @@
|
||||
<td><a href="users/{user.id}" style="text-decoration: none">{user.id}</a></td>
|
||||
<td><a href="users/{user.login}" style="text-decoration: none">{user.login}</a></td>
|
||||
{#each surveys as survey}
|
||||
{#if survey.corrected && (!promo || survey.promo == promo)}
|
||||
{#if survey.corrected && (!promo || survey.promo == promo) && (!category || survey.id_category == category)}
|
||||
<td>
|
||||
{grades[user.id] && grades[user.id][survey.kind + "." + survey.id]?grades[user.id][survey.kind + "." + survey.id]:""}
|
||||
</td>
|
||||
|
6
ui/src/routes/grades/[promo]/[cid]/+page.js
Normal file
6
ui/src/routes/grades/[promo]/[cid]/+page.js
Normal file
@ -0,0 +1,6 @@
|
||||
export async function load({ params }) {
|
||||
return {
|
||||
promo: parseInt(params.promo),
|
||||
cid: parseInt(params.cid),
|
||||
};
|
||||
}
|
7
ui/src/routes/grades/[promo]/[cid]/+page.svelte
Normal file
7
ui/src/routes/grades/[promo]/[cid]/+page.svelte
Normal file
@ -0,0 +1,7 @@
|
||||
<script>
|
||||
import StudentGrades from '$lib/components/StudentGrades.svelte';
|
||||
|
||||
export let data;
|
||||
</script>
|
||||
|
||||
<StudentGrades promo={data.promo} category={data.cid} />
|
Reference in New Issue
Block a user