PUNKT-65 Bug z fifty-fifty
This commit is contained in:
parent
d690040b1d
commit
50aaf3c131
@ -20,7 +20,7 @@ export class MainNavigationComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onOffMenuMobile() {
|
onOffMenuMobile() {
|
||||||
console.log(this.menu.nativeElement.style.display)
|
console.log(this.menu.nativeElement.style.display);
|
||||||
if (this.menu.nativeElement.style.display === '') {
|
if (this.menu.nativeElement.style.display === '') {
|
||||||
this.menu.nativeElement.style.display = 'none';
|
this.menu.nativeElement.style.display = 'none';
|
||||||
this.btn.nativeElement.style.display = 'none';
|
this.btn.nativeElement.style.display = 'none';
|
||||||
|
@ -19,5 +19,5 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button class="btn btn-study-cave" type="submit" (click)="noHelp()"><i class="fas fa-arrow-right"></i> Dalej</button>
|
<button class="btn btn-study-cave" type="submit"><i class="fas fa-arrow-right"></i> Dalej</button>
|
||||||
</form>
|
</form>
|
||||||
|
@ -28,10 +28,18 @@ export class SingleChoiceComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
nextQuestion(f) {
|
nextQuestion(f) {
|
||||||
this.id = this.route.snapshot.params.id;
|
this.id = this.route.snapshot.params.id;
|
||||||
const answers = this.question.answers;
|
let answers = [];
|
||||||
|
if (this.fifty) {
|
||||||
|
this.fifty = false;
|
||||||
|
answers = this.question.answers_help;
|
||||||
|
} else {
|
||||||
|
answers = this.question.answers;
|
||||||
|
}
|
||||||
|
|
||||||
answers.forEach(element => {
|
answers.forEach(element => {
|
||||||
element.is_good = element.content === f.value.answer ? true : false;
|
element.is_good = element.content === f.value.answer ? true : false;
|
||||||
});
|
});
|
||||||
|
|
||||||
const body = { id: this.question.id, type: 'single-choice', answers: answers };
|
const body = { id: this.question.id, type: 'single-choice', answers: answers };
|
||||||
this.verifyAnswerSubscription = this.testsService.verifyAnswer(this.id, body).subscribe(d => {
|
this.verifyAnswerSubscription = this.testsService.verifyAnswer(this.id, body).subscribe(d => {
|
||||||
$('.answers').find('[type="radio"]').prop('checked', false);
|
$('.answers').find('[type="radio"]').prop('checked', false);
|
||||||
@ -44,10 +52,6 @@ export class SingleChoiceComponent implements OnInit, OnDestroy {
|
|||||||
this.lifebuoy.emit(false);
|
this.lifebuoy.emit(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
noHelp() {
|
|
||||||
this.fifty = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
startTimer() {
|
startTimer() {
|
||||||
this.interval = setInterval(() => {
|
this.interval = setInterval(() => {
|
||||||
if (this.timeLeft > 0) {
|
if (this.timeLeft > 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user