PUNKT-20 Update czasy w pytaniach

This commit is contained in:
Marcin Szczepański 2019-12-01 16:52:23 +01:00
parent c7eba40e53
commit 58ef09ea74
13 changed files with 15 additions and 6 deletions

View File

@ -1,6 +1,6 @@
<form #f="ngForm" (ngSubmit)="nextQuestion(f)" novalidate>
<div class="alert alert-grey question">
{{question.question}} ({{question.points}}pkt.) <span *ngIf="timeLeft > 0">Czas: {{ timeLeft }} </span>
{{question.question}} ({{question.points}}pkt.) <br /><span *ngIf="timeLeft > 0">Czas: {{ timeLeft }} sek. </span><span *ngIf="timeLeft === 0">Czas: bez limitu</span>
<div class="answers">
<div *ngFor="let item of question.answers">
<span *ngIf="!item.is_gap">{{item.content}}</span>

View File

@ -49,6 +49,7 @@ export class GapsComponent implements OnInit, OnDestroy {
}
ngOnInit() {
this.timeLeft = this.question.time;
if (this.timeLeft > 0) {
this.startTimer();
}

View File

@ -1,6 +1,6 @@
<form #f="ngForm" (ngSubmit)="nextQuestion(f)" novalidate>
<div class="alert alert-grey question">
{{question.question}} ({{question.points}}pkt.) <span *ngIf="timeLeft > 0">Czas: {{ timeLeft }} </span>
{{question.question}} ({{question.points}}pkt.) <br /><span *ngIf="timeLeft > 0">Czas: {{ timeLeft }} sek. </span><span *ngIf="timeLeft === 0">Czas: bez limitu</span>
<div class="answers">
<div *ngFor="let item of question.answers">
<input type="checkbox" [name]="item.id" [value]="item" ngModel /> {{item.content}}

View File

@ -46,6 +46,7 @@ export class MultipleChoiceComponent implements OnInit, OnDestroy{
}
ngOnInit() {
this.timeLeft = this.question.time;
if (this.timeLeft > 0) {
this.startTimer();
}

View File

@ -1,5 +1,5 @@
<div>
{{question.question}} ({{question.points}}pkt.) <span *ngIf="timeLeft > 0">Czas: {{ timeLeft }} </span>
{{question.question}} ({{question.points}}pkt.) <br /><span *ngIf="timeLeft > 0">Czas: {{ timeLeft }} sek. </span><span *ngIf="timeLeft === 0">Czas: bez limitu</span>
<h3>Dostępne lewe strony:</h3>
<div class="puzzles-container">
<div class='puzzle' *ngFor="let item of leftSides; let i = index" (click)="leftSideClick(item,i)" [ngClass]="{'active': (selectedLeftSide.leftSideText === item && selectedLeftSide.indexOfLeftSide === i && selectedLeftSide.from === 'leftSides'), 'empty': (item === undefined || item === '')}">

View File

@ -92,6 +92,7 @@ export class PairsComponent implements OnInit, OnChanges, OnDestroy {
}
ngOnInit() {
this.timeLeft = this.question.time;
this.prepareLists();
if (this.timeLeft > 0) {
this.startTimer();

View File

@ -1,5 +1,5 @@
<div>
{{question.question}} ({{question.points}}pkt.) <span *ngIf="timeLeft > 0">Czas: {{ timeLeft }} </span>
{{question.question}} ({{question.points}}pkt.) <br /><span *ngIf="timeLeft > 0">Czas: {{ timeLeft }} sek. </span><span *ngIf="timeLeft === 0">Czas: bez limitu</span>
<h3>Dostępne elementy rozsypanki:</h3>
<div class="puzzles-container">
<div class='puzzle' *ngFor="let item of puzzles; let i = index" (click)="puzzleClick(item,i)" [ngClass]="{'active': (selectedPuzzle.puzzleText === item && selectedPuzzle.indexOfPuzzle === i && selectedPuzzle.from === 'puzzles'), 'empty': (item === undefined || item === '')}">

View File

@ -79,6 +79,7 @@ export class PuzzleComponent implements OnInit, OnChanges, OnDestroy {
}
ngOnInit() {
this.timeLeft = this.question.time;
this.prepareLists();
if (this.timeLeft > 0) {
this.startTimer();

View File

@ -1,6 +1,6 @@
<form #f="ngForm" (ngSubmit)="nextQuestion(f)" novalidate>
<div class="alert alert-grey question">
{{question.question}} ({{question.points}}pkt.) <span *ngIf="timeLeft > 0">Czas: {{ timeLeft }} </span>
{{question.question}} ({{question.points}}pkt.) <br /><span *ngIf="timeLeft > 0">Czas: {{ timeLeft }} sek. </span><span *ngIf="timeLeft === 0">Czas: bez limitu</span>
<div class="answers">
<div *ngFor="let item of question.answers">
<input type="radio" name="answer" [value]="item.content" ngModel> {{item.content}}

View File

@ -47,6 +47,7 @@ export class SingleChoiceComponent implements OnInit, OnDestroy {
}
ngOnInit() {
this.timeLeft = this.question.time;
if (this.timeLeft > 0) {
this.startTimer();
}

View File

@ -1,5 +1,5 @@
<div class="alert alert-grey question">
{{question.question}} ({{question.points}}pkt.) <span *ngIf="timeLeft > 0">Czas: {{ timeLeft }} </span>
{{question.question}} ({{question.points}}pkt.) <br /><span *ngIf="timeLeft > 0">Czas: {{ timeLeft }} sek. </span><span *ngIf="timeLeft === 0">Czas: bez limitu</span>
<div class="btn-group btn-group-toggle" data-toggle="buttons">
<label class="btn btn-study-cave mr-2" (click)="chooseAnswer('Prawda')">

View File

@ -50,6 +50,7 @@ export class TrueFalseComponent implements OnInit, OnDestroy {
}
ngOnInit() {
this.timeLeft = this.question.time;
if (this.timeLeft > 0) {
this.startTimer();
}

View File

@ -50,6 +50,7 @@
<th>Lp.</th>
<th>Typ</th>
<th class="mobile">Punkty</th>
<th class="mobile">Czas na odpowiedź</th>
<th class="mobile">Pytanie</th>
<th>Usuń</th>
<th class="mobile">Przenieś</th>
@ -72,6 +73,8 @@
*ngIf='question.content.type == "pairs"'>Łączenie w pary</td>
<td (click)='showComponents(question.content.type, question.nr)'
class="mobile">{{ question.content.points }}</td>
<td (click)='showComponents(question.content.type, question.nr)'
class="mobile">{{ question.content.time }}</td>
<td (click)='showComponents(question.content.type, question.nr)'
class="mobile">{{ question.shortcut }}</td>
<td><button class="btn btn-study-cave" (click)="delete(question.nr)"><i class="fas fa-trash-alt"></i> Usuń</button></td>