diff --git a/public/CONGRATS.png b/public/CONGRATS.png new file mode 100644 index 0000000000000000000000000000000000000000..0a6c27296184feeb9840c413d17c7b62ac845017 Binary files /dev/null and b/public/CONGRATS.png differ diff --git a/src/app/modules/home/play-quiz/play-quiz.component.css b/src/app/modules/home/play-quiz/play-quiz.component.css index 90ab79c5b5e241924d02de0248e4a753456aa24c..b7d3e9025a8a77109f6f43dde0fe51cf2f323b05 100644 --- a/src/app/modules/home/play-quiz/play-quiz.component.css +++ b/src/app/modules/home/play-quiz/play-quiz.component.css @@ -17,6 +17,16 @@ background-attachment: fixed; } +mat-icon { + width: auto; + height: auto; + margin: 0; + font-size: 8vmin; + font-style: normal; + font-weight: 500; + color: #FFFFFF; +} + .header { top: 0; margin: 0; diff --git a/src/app/modules/home/play-quiz/play-quiz.component.html b/src/app/modules/home/play-quiz/play-quiz.component.html index 1a7c71fa02ec6565fd854ab0e230abb84e9aa92a..92ca9818105b9e658db8a50b35063a2408314d58 100644 --- a/src/app/modules/home/play-quiz/play-quiz.component.html +++ b/src/app/modules/home/play-quiz/play-quiz.component.html @@ -3,7 +3,7 @@ <mat-icon (click)="goHome()">home</mat-icon> <div class="title"> <h4>Question {{ actualQuestionIndex + 1 }}/{{ quiz.questions.length }}</h4> - <h5>Score : {{ score }}</h5> + <h5>Score : {{ score }}/{{ quiz.questions.length }}</h5> <h5>Category : {{ actualQuestion.category.name }}</h5> <h2>{{ actualQuestion.text }}</h2> </div> diff --git a/src/app/modules/home/play-quiz/play-quiz.component.ts b/src/app/modules/home/play-quiz/play-quiz.component.ts index bb1821c4736163b9caa9b4587c965f3f76711c90..b90f3658f5ff761f4e1800bc3ffbc93dd07f2d41 100644 --- a/src/app/modules/home/play-quiz/play-quiz.component.ts +++ b/src/app/modules/home/play-quiz/play-quiz.component.ts @@ -15,7 +15,7 @@ export class PlayQuizComponent implements OnInit { private activatedRoute: ActivatedRoute, private router: Router, private cdr: ChangeDetectorRef - ) {} + ) { } isLoading: boolean = false; quiz: any = []; actualQuestion: any; @@ -40,13 +40,18 @@ export class PlayQuizComponent implements OnInit { nextQuestion() { if (this.actualQuestionIndex === this.quiz.questionIndex - 1 + this.quiz.questions.length - 1) { Swal.fire({ - title: 'Quiz finished !', - text: 'Want a rematch ?', + title: 'CONGRATS !', + text: 'You finished the test with a score of ' + this.score + ' / ' + this.quiz.questions.length, + // imageUrl: "url(../../../../../public/CONGRATS.png)", + // imageWidth: 400, + // imageHeight: 200, + // imageAlt: "Custom image", + showDenyButton: true, showCancelButton: false, confirmButtonText: 'Play again', - confirmButtonColor: '#7e3f97', - denyButtonColor: '#D6BAEC', + confirmButtonColor: '#2B73FE', + denyButtonColor: '#00B3F4', denyButtonText: `Back home`, }).then((result) => { if (result.isConfirmed) {