Skip to content
Snippets Groups Projects
Commit cedb6555 authored by D3B1RUM4N's avatar D3B1RUM4N
Browse files

fix: added function to decode

parent 1b16f3e0
Branches
1 merge request!52Fix/53 last min fixes
Pipeline #303732 passed with stages
in 47 seconds
......@@ -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);
......
......@@ -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({
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment