diff --git a/src/app/modules/home/play-quiz/multiple-choice/multiple-choice.component.ts b/src/app/modules/home/play-quiz/multiple-choice/multiple-choice.component.ts index b422e51666536414e7234d97c0575a9d18c689b8..fda5bf4125b232ef2b5a16e624a352a08d81835e 100644 --- a/src/app/modules/home/play-quiz/multiple-choice/multiple-choice.component.ts +++ b/src/app/modules/home/play-quiz/multiple-choice/multiple-choice.component.ts @@ -10,7 +10,7 @@ export class MultipleChoiceComponent implements OnInit { @Input() getAnswer!: (id_tested_answer: number) => Promise<number>; good_answers: boolean[] = []; answer_click: number = -1; - constructor() {} + constructor() { } ngOnChanges(changes: SimpleChanges): void { if (changes['answers']) { @@ -19,7 +19,13 @@ export class MultipleChoiceComponent implements OnInit { } } - ngOnInit(): void {} + decodeHtml(html: string): string { + const textArea = document.createElement('textarea'); + textArea.innerHTML = html; + return textArea.value; + } + + ngOnInit(): void { } async handleClick(id_answer: number, position: number) { const right_answer = await this.getAnswer(id_answer); 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 b90f3658f5ff761f4e1800bc3ffbc93dd07f2d41..71067f09389030b51a29319cfcf2c988eb3c57cc 100644 --- a/src/app/modules/home/play-quiz/play-quiz.component.ts +++ b/src/app/modules/home/play-quiz/play-quiz.component.ts @@ -37,6 +37,13 @@ export class PlayQuizComponent implements OnInit { }); } + decodeHtml(html: string): string { + const textArea = document.createElement('textarea'); + textArea.innerHTML = html; + return textArea.value; + } + + nextQuestion() { if (this.actualQuestionIndex === this.quiz.questionIndex - 1 + this.quiz.questions.length - 1) { Swal.fire({