Skip to content

Commit 6a1ff6c

Browse files
committed
add style to score #13
1 parent e06af6f commit 6a1ff6c

File tree

3 files changed

+33
-10
lines changed

3 files changed

+33
-10
lines changed

frontend/src/app/gestion/suivi-id/gestion-id-suivi.component.html

+10-8
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,22 @@
2020

2121
</div>
2222
<div id="tableparent" class="d-flex justify-content-center flex-column col-10 w-100 h-100 p-2 m-2">
23-
<table class="table-responsive-lg w-100">
24-
<thead>
23+
<table class="table-responsive-lg text-center w-100">
24+
<thead id="theader">
2525
<tr>
2626
<th *ngFor="let head of headElements" scope="col">{{head}}</th>
2727
</tr>
2828
</thead>
2929
<tbody>
30-
<tr *ngFor="let el of quizHistory">
31-
<td>{{el.name}}</td>
32-
<td>{{el.stats.correct}}/{{el.stats.total}}</td>
33-
<td>{{el.recap.correct}}/{{el.recap.total}}</td>
34-
<td>
30+
<tr id="trquestion" class="" *ngFor="let el of quizHistory">
31+
32+
<td class="text-left">{{el.name}}</td>
33+
<td class="">{{el.stats.correct}}/{{el.stats.total}}</td>
34+
<td class="">{{el.recap.correct}}/{{el.recap.total}}</td>
35+
<td class="">
3536
<div class="epsilon">
36-
<button (click)="enableDisableQuestion(el.id, user.ignoredQuestions.includes(el.id))" class="
37+
<button (click)="enableDisableQuestion(el.id, user.ignoredQuestions.includes(el.id))"
38+
class="
3739
btn btn-xs btn-red">
3840
{{user.ignoredQuestions.includes(el.id) ? "Ajouter" : "Retirer"}}
3941
</button>

frontend/src/app/gestion/suivi-id/gestion-id-suivi.component.scss

+20
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,23 @@
1212
#tableparent{
1313
//max-width: unset;
1414
}
15+
16+
17+
#theader {
18+
//try this :
19+
//https://css-tricks.com/restricting-a-pseudo-element-to-its-parents-border-box/
20+
background: linear-gradient(to bottom, #fef086, #fde635);
21+
border-top-left-radius: inherit;
22+
border-top-right-radius: inherit;
23+
padding: 0.4em 1em;
24+
width: 100%;
25+
}
26+
27+
#trquestion{
28+
background-color: #FFFFFF;
29+
padding: 4px;
30+
}
31+
32+
tbody{
33+
background-color: #DDDDDD;
34+
}

frontend/src/app/gestion/suivi-id/gestion-id-suivi.component.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class GestionIdSuiviComponent implements OnInit
3030
public resultsDisplayed: boolean[] = [];
3131
public changeFilterScores: FormGroup;
3232
public allAttempts: { [quizId: number]: AttemptResult[] } = {};
33-
public headElements = ["Question", "Échecs/ tentatives", "Échecs/tentatives récap", "Retirer"];
33+
public headElements = ["Question", "Échecs/ tentatives", "Échecs/tentatives récap", ""];
3434
private userId: number = 1;
3535
private recaps: RecapResult[] = [];
3636
private attempts: AttemptResult[] = [];
@@ -63,7 +63,8 @@ export class GestionIdSuiviComponent implements OnInit
6363
});
6464
this.userService.getAllAttempts(this.userId).subscribe(a =>
6565
{
66-
this.quizHistory =a;
66+
this.quizHistory = a;
67+
this.quizHistory.sort((a, b) => (b.stats.correct / b.stats.total) - (a.stats.correct / a.stats.total));
6768
});
6869
}
6970

0 commit comments

Comments
 (0)