diff --git a/FrontEnd/src/app/tests/test-details/question-view/gaps/gaps.component.html b/FrontEnd/src/app/tests/test-details/question-view/gaps/gaps.component.html index 7489590..c651806 100644 --- a/FrontEnd/src/app/tests/test-details/question-view/gaps/gaps.component.html +++ b/FrontEnd/src/app/tests/test-details/question-view/gaps/gaps.component.html @@ -1,6 +1,6 @@
- {{question.question}} ({{question.points}}pkt.)
Czas: {{ timeLeft }} sek. Czas: bez limitu + {{question.question}} ({{question.points}}pkt.)
Czas: {{ timeLeft }} sek. Czas: bez limitu
{{item.content}} diff --git a/FrontEnd/src/app/tests/test-details/question-view/gaps/gaps.component.ts b/FrontEnd/src/app/tests/test-details/question-view/gaps/gaps.component.ts index 5947c47..be89f3c 100644 --- a/FrontEnd/src/app/tests/test-details/question-view/gaps/gaps.component.ts +++ b/FrontEnd/src/app/tests/test-details/question-view/gaps/gaps.component.ts @@ -11,8 +11,7 @@ import { NgForm } from '@angular/forms'; styleUrls: ['./gaps.component.css'] }) export class GapsComponent implements OnInit, OnDestroy { - @Input() - question; + private _question; @Output() emitNextQuestionRequest = new EventEmitter(); private id; private verifyAnswerSubscription: ISubscription; @@ -48,15 +47,26 @@ export class GapsComponent implements OnInit, OnDestroy { }, 1000); } - ngOnInit() { + public get question() { + return this._question; + } + + @Input('question') + public set question(data) { + this._question = data; + this.ngOnDestroy(); this.timeLeft = this.question.time; if (this.timeLeft > 0) { this.startTimer(); } } + ngOnInit() {} + ngOnDestroy() { - clearInterval(this.interval); + if (this.interval) { + clearInterval(this.interval); + } if (this.verifyAnswerSubscription) { this.verifyAnswerSubscription.unsubscribe(); } diff --git a/FrontEnd/src/app/tests/test-details/question-view/multiple-choice/multiple-choice.component.html b/FrontEnd/src/app/tests/test-details/question-view/multiple-choice/multiple-choice.component.html index 11e3a3b..5c1c327 100644 --- a/FrontEnd/src/app/tests/test-details/question-view/multiple-choice/multiple-choice.component.html +++ b/FrontEnd/src/app/tests/test-details/question-view/multiple-choice/multiple-choice.component.html @@ -1,6 +1,6 @@
- {{question.question}} ({{question.points}}pkt.)
Czas: {{ timeLeft }} sek. Czas: bez limitu + {{question.question}} ({{question.points}}pkt.)
Czas: {{ timeLeft }} sek. Czas: bez limitu
{{item.content}} diff --git a/FrontEnd/src/app/tests/test-details/question-view/multiple-choice/multiple-choice.component.ts b/FrontEnd/src/app/tests/test-details/question-view/multiple-choice/multiple-choice.component.ts index 4aa31f0..ab14ebb 100644 --- a/FrontEnd/src/app/tests/test-details/question-view/multiple-choice/multiple-choice.component.ts +++ b/FrontEnd/src/app/tests/test-details/question-view/multiple-choice/multiple-choice.component.ts @@ -11,8 +11,7 @@ import { NgForm } from '@angular/forms'; styleUrls: ['./multiple-choice.component.css'] }) export class MultipleChoiceComponent implements OnInit, OnDestroy{ - @Input() - question; + private _question; @Output() emitNextQuestionRequest = new EventEmitter(); private id; private verifyAnswerSubscription: ISubscription; @@ -45,15 +44,26 @@ export class MultipleChoiceComponent implements OnInit, OnDestroy{ }, 1000); } - ngOnInit() { + public get question() { + return this._question; + } + + @Input('question') + public set question(data) { + this._question = data; + this.ngOnDestroy(); this.timeLeft = this.question.time; if (this.timeLeft > 0) { this.startTimer(); } } + ngOnInit() {} + ngOnDestroy() { - clearInterval(this.interval); + if (this.interval) { + clearInterval(this.interval); + } if (this.verifyAnswerSubscription) { this.verifyAnswerSubscription.unsubscribe(); } diff --git a/FrontEnd/src/app/tests/test-details/question-view/pairs/pairs.component.html b/FrontEnd/src/app/tests/test-details/question-view/pairs/pairs.component.html index 4e4a31a..3b25b0e 100644 --- a/FrontEnd/src/app/tests/test-details/question-view/pairs/pairs.component.html +++ b/FrontEnd/src/app/tests/test-details/question-view/pairs/pairs.component.html @@ -1,5 +1,5 @@
- {{question.question}} ({{question.points}}pkt.)
Czas: {{ timeLeft }} sek. Czas: bez limitu + {{question.question}} ({{question.points}}pkt.)
Czas: {{ timeLeft }} sek. Czas: bez limitu

Dostępne lewe strony:

diff --git a/FrontEnd/src/app/tests/test-details/question-view/pairs/pairs.component.ts b/FrontEnd/src/app/tests/test-details/question-view/pairs/pairs.component.ts index 232a03e..dd7b508 100644 --- a/FrontEnd/src/app/tests/test-details/question-view/pairs/pairs.component.ts +++ b/FrontEnd/src/app/tests/test-details/question-view/pairs/pairs.component.ts @@ -10,8 +10,7 @@ import { ISubscription } from 'rxjs/Subscription'; styleUrls: ['./pairs.component.css'] }) export class PairsComponent implements OnInit, OnChanges, OnDestroy { - @Input() - question; + private _question; @Output() emitNextQuestionRequest = new EventEmitter(); private id; private verifyAnswerSubscription: ISubscription; @@ -91,7 +90,14 @@ export class PairsComponent implements OnInit, OnChanges, OnDestroy { }); } - ngOnInit() { + public get question() { + return this._question; + } + + @Input('question') + public set question(data) { + this._question = data; + this.ngOnDestroy(); this.timeLeft = this.question.time; this.prepareLists(); if (this.timeLeft > 0) { @@ -99,12 +105,16 @@ export class PairsComponent implements OnInit, OnChanges, OnDestroy { } } + ngOnInit() {} + ngOnChanges() { this.prepareLists(); } ngOnDestroy() { - clearInterval(this.interval); + if (this.interval) { + clearInterval(this.interval); + } if (this.verifyAnswerSubscription) { this.verifyAnswerSubscription.unsubscribe(); } diff --git a/FrontEnd/src/app/tests/test-details/question-view/puzzle/puzzle.component.html b/FrontEnd/src/app/tests/test-details/question-view/puzzle/puzzle.component.html index 18a2695..e9b7b67 100644 --- a/FrontEnd/src/app/tests/test-details/question-view/puzzle/puzzle.component.html +++ b/FrontEnd/src/app/tests/test-details/question-view/puzzle/puzzle.component.html @@ -1,5 +1,5 @@
- {{question.question}} ({{question.points}}pkt.)
Czas: {{ timeLeft }} sek. Czas: bez limitu + {{question.question}} ({{question.points}}pkt.)
Czas: {{ timeLeft }} sek. Czas: bez limitu

Dostępne elementy rozsypanki:

diff --git a/FrontEnd/src/app/tests/test-details/question-view/puzzle/puzzle.component.ts b/FrontEnd/src/app/tests/test-details/question-view/puzzle/puzzle.component.ts index 0958812..ec8edfc 100644 --- a/FrontEnd/src/app/tests/test-details/question-view/puzzle/puzzle.component.ts +++ b/FrontEnd/src/app/tests/test-details/question-view/puzzle/puzzle.component.ts @@ -10,8 +10,7 @@ import { ISubscription } from 'rxjs/Subscription'; styleUrls: ['./puzzle.component.css'] }) export class PuzzleComponent implements OnInit, OnChanges, OnDestroy { - @Input() - question; + private _question; @Output() emitNextQuestionRequest = new EventEmitter(); private id; private verifyAnswerSubscription: ISubscription; @@ -78,7 +77,14 @@ export class PuzzleComponent implements OnInit, OnChanges, OnDestroy { }); } - ngOnInit() { + public get question() { + return this._question; + } + + @Input('question') + public set question(data) { + this._question = data; + this.ngOnDestroy(); this.timeLeft = this.question.time; this.prepareLists(); if (this.timeLeft > 0) { @@ -86,12 +92,16 @@ export class PuzzleComponent implements OnInit, OnChanges, OnDestroy { } } + ngOnInit() {} + ngOnChanges() { this.prepareLists(); } ngOnDestroy() { - clearInterval(this.interval); + if (this.interval) { + clearInterval(this.interval); + } if (this.verifyAnswerSubscription) { this.verifyAnswerSubscription.unsubscribe(); } diff --git a/FrontEnd/src/app/tests/test-details/question-view/single-choice/single-choice.component.html b/FrontEnd/src/app/tests/test-details/question-view/single-choice/single-choice.component.html index eab9c50..2b10b6c 100644 --- a/FrontEnd/src/app/tests/test-details/question-view/single-choice/single-choice.component.html +++ b/FrontEnd/src/app/tests/test-details/question-view/single-choice/single-choice.component.html @@ -1,7 +1,11 @@
+<<<<<<< HEAD Pytanie za {{question.points}}pkt.
Czas: {{ timeLeft }} sek. Czas: bez limitu
{{question.question}}
+======= + {{question.question}} ({{question.points}}pkt.)
Czas: {{ timeLeft }} sek. Czas: bez limitu +>>>>>>> d8c503bda71c21574ee646fe2cf8c3cb2f8546bd
diff --git a/FrontEnd/src/app/tests/test-details/question-view/single-choice/single-choice.component.ts b/FrontEnd/src/app/tests/test-details/question-view/single-choice/single-choice.component.ts index 7af0b8f..32c02a2 100644 --- a/FrontEnd/src/app/tests/test-details/question-view/single-choice/single-choice.component.ts +++ b/FrontEnd/src/app/tests/test-details/question-view/single-choice/single-choice.component.ts @@ -11,8 +11,7 @@ import { NgForm } from '@angular/forms'; styleUrls: ['./single-choice.component.css'] }) export class SingleChoiceComponent implements OnInit, OnDestroy { - @Input() - question; + private _question; private answer; @Output() emitNextQuestionRequest = new EventEmitter(); private id; @@ -46,15 +45,26 @@ export class SingleChoiceComponent implements OnInit, OnDestroy { }, 1000); } - ngOnInit() { + public get question() { + return this._question; + } + + @Input('question') + public set question(data) { + this._question = data; + this.ngOnDestroy(); this.timeLeft = this.question.time; if (this.timeLeft > 0) { this.startTimer(); } } + ngOnInit() {} + ngOnDestroy() { - clearInterval(this.interval); + if (this.interval) { + clearInterval(this.interval); + } if (this.verifyAnswerSubscription) { this.verifyAnswerSubscription.unsubscribe(); } diff --git a/FrontEnd/src/app/tests/test-details/question-view/true-false/true-false.component.html b/FrontEnd/src/app/tests/test-details/question-view/true-false/true-false.component.html index 154392f..05e1631 100644 --- a/FrontEnd/src/app/tests/test-details/question-view/true-false/true-false.component.html +++ b/FrontEnd/src/app/tests/test-details/question-view/true-false/true-false.component.html @@ -1,5 +1,5 @@
- {{question.question}} ({{question.points}}pkt.)
Czas: {{ timeLeft }} sek. Czas: bez limitu + {{question.question}} ({{question.points}}pkt.)
Czas: {{ timeLeft }} sek. Czas: bez limitu