PUNKT-65 Bug z fifty-fifty

This commit is contained in:
Marcin Szczepański 2020-01-18 11:48:09 +01:00
parent d690040b1d
commit 50aaf3c131
3 changed files with 11 additions and 7 deletions

View File

@ -20,7 +20,7 @@ export class MainNavigationComponent implements OnInit {
}
onOffMenuMobile() {
console.log(this.menu.nativeElement.style.display)
console.log(this.menu.nativeElement.style.display);
if (this.menu.nativeElement.style.display === '') {
this.menu.nativeElement.style.display = 'none';
this.btn.nativeElement.style.display = 'none';

View File

@ -19,5 +19,5 @@
</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>

View File

@ -28,10 +28,18 @@ export class SingleChoiceComponent implements OnInit, OnDestroy {
nextQuestion(f) {
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 => {
element.is_good = element.content === f.value.answer ? true : false;
});
const body = { id: this.question.id, type: 'single-choice', answers: answers };
this.verifyAnswerSubscription = this.testsService.verifyAnswer(this.id, body).subscribe(d => {
$('.answers').find('[type="radio"]').prop('checked', false);
@ -44,10 +52,6 @@ export class SingleChoiceComponent implements OnInit, OnDestroy {
this.lifebuoy.emit(false);
}
noHelp() {
this.fifty = false;
}
startTimer() {
this.interval = setInterval(() => {
if (this.timeLeft > 0) {