dodanie koła ratunkowego przy tworzeniu pytania + wyświetlanie 50:50 przy rozwiązywaniu testu
This commit is contained in:
parent
0dfe602ac7
commit
efdc612c84
@ -34,3 +34,10 @@
|
|||||||
.align {
|
.align {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.check
|
||||||
|
{
|
||||||
|
height: 35px;
|
||||||
|
width: 35px;
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
@ -17,6 +17,11 @@
|
|||||||
<input type="number" step="1" min="0" name="time" class="form-control" [(ngModel)]="time" required/>
|
<input type="number" step="1" min="0" name="time" class="form-control" [(ngModel)]="time" required/>
|
||||||
</label>
|
</label>
|
||||||
<br />
|
<br />
|
||||||
|
<label class="block">
|
||||||
|
<input type="checkbox" name="{{ help }}" class ="check" [checked]="help" (change)="changeHelp()"/> <p> Zezwól na skorzystanie z koła ratunkowego</p>
|
||||||
|
</label>
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
<p>Wpisz możliwe odpowiedzi i zaznacz prawidłową:</p>
|
<p>Wpisz możliwe odpowiedzi i zaznacz prawidłową:</p>
|
||||||
<div>
|
<div>
|
||||||
<div *ngFor="let answer of answersCorrect; let i = index" class="row">
|
<div *ngFor="let answer of answersCorrect; let i = index" class="row">
|
||||||
|
@ -12,6 +12,7 @@ export class SingleChoiceQuestionComponent implements OnInit {
|
|||||||
@Input() edit: Boolean;
|
@Input() edit: Boolean;
|
||||||
|
|
||||||
isChecked: Boolean = false;
|
isChecked: Boolean = false;
|
||||||
|
help: Boolean = false;
|
||||||
answers: Array<Object> = [];
|
answers: Array<Object> = [];
|
||||||
answersCorrect: Array<Object> = [];
|
answersCorrect: Array<Object> = [];
|
||||||
newAttribute: any = {
|
newAttribute: any = {
|
||||||
@ -45,6 +46,7 @@ export class SingleChoiceQuestionComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.points = this.content['content']['points'];
|
this.points = this.content['content']['points'];
|
||||||
|
this.help = this.content['content']['help'];
|
||||||
} else {
|
} else {
|
||||||
this.content = {};
|
this.content = {};
|
||||||
this.content['content'] = {
|
this.content['content'] = {
|
||||||
@ -53,7 +55,8 @@ export class SingleChoiceQuestionComponent implements OnInit {
|
|||||||
question: '',
|
question: '',
|
||||||
answers: [],
|
answers: [],
|
||||||
points: 1,
|
points: 1,
|
||||||
time: 0
|
time: 0,
|
||||||
|
help: this.help
|
||||||
};
|
};
|
||||||
this.content['edit'] = false;
|
this.content['edit'] = false;
|
||||||
}
|
}
|
||||||
@ -110,6 +113,10 @@ export class SingleChoiceQuestionComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
changeHelp(): void {
|
||||||
|
this.help = !this.help;
|
||||||
|
}
|
||||||
|
|
||||||
addTable(): void {
|
addTable(): void {
|
||||||
if ((this.question === undefined) || (this.question.trim().length === 0)) {
|
if ((this.question === undefined) || (this.question.trim().length === 0)) {
|
||||||
this.snackBar.open('Pytanie nie może być puste!', null,
|
this.snackBar.open('Pytanie nie może być puste!', null,
|
||||||
@ -161,6 +168,7 @@ export class SingleChoiceQuestionComponent implements OnInit {
|
|||||||
this.content['content']['answers'] = this.answers;
|
this.content['content']['answers'] = this.answers;
|
||||||
this.content['content']['points'] = this.points;
|
this.content['content']['points'] = this.points;
|
||||||
this.content['content']['time'] = this.time;
|
this.content['content']['time'] = this.time;
|
||||||
|
this.content['content']['help'] = this.help;
|
||||||
if (this.edit) {
|
if (this.edit) {
|
||||||
this.editing.emit(this.content);
|
this.editing.emit(this.content);
|
||||||
} else {
|
} else {
|
||||||
@ -189,6 +197,7 @@ export class SingleChoiceQuestionComponent implements OnInit {
|
|||||||
this.isChecked = false;
|
this.isChecked = false;
|
||||||
this.question = '';
|
this.question = '';
|
||||||
this.time = 0;
|
this.time = 0;
|
||||||
|
this.help = false;
|
||||||
this.answers = [];
|
this.answers = [];
|
||||||
this.answersCorrect = [];
|
this.answersCorrect = [];
|
||||||
this.newAttribute = {};
|
this.newAttribute = {};
|
||||||
|
@ -6,6 +6,12 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fifty
|
||||||
|
{
|
||||||
|
margin-right: auto;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
.radio-answer
|
.radio-answer
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
<form #f="ngForm" (ngSubmit)="nextQuestion(f)" novalidate>
|
<form #f="ngForm" (ngSubmit)="nextQuestion(f)" novalidate>
|
||||||
<div class="alert alert-grey question">
|
<div class="alert alert-grey question">
|
||||||
Pytanie za {{question.points}}pkt. <br /><span *ngIf="timeLeft > 0">Czas: {{ timeLeft }} sek. </span><span *ngIf="question.time === 0">Czas: bez limitu</span>
|
Pytanie za {{question.points}}pkt. <br /><span *ngIf="timeLeft > 0">Czas: {{ timeLeft }} sek. </span><span *ngIf="question.time === 0">Czas: bez limitu</span>
|
||||||
<div class="pytanie">{{question.question}} </div>
|
<div *ngIf="question.help" class="fifty"><img src="./././././assets/50-50.png" width="80px" height="50px"></div>
|
||||||
|
<div class="pytanie">{{question.question}} </div>
|
||||||
<div class="answers">
|
<div class="answers">
|
||||||
<div *ngFor="let item of question.answers" >
|
<div *ngFor="let item of question.answers" >
|
||||||
|
|
||||||
|
@ -162,7 +162,8 @@ export class TestMakerComponent implements OnInit {
|
|||||||
time: this.test[i]['content']['time'],
|
time: this.test[i]['content']['time'],
|
||||||
answers: this.test[i]['content']['answers'],
|
answers: this.test[i]['content']['answers'],
|
||||||
points: this.test[i]['content']['points'],
|
points: this.test[i]['content']['points'],
|
||||||
id: this.test[i]['content']['id']
|
id: this.test[i]['content']['id'],
|
||||||
|
help: this.test[i]['content']['help']
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
toSend['body'] = body;
|
toSend['body'] = body;
|
||||||
|
BIN
FrontEnd/src/assets/50-50.png
Normal file
BIN
FrontEnd/src/assets/50-50.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 149 KiB |
Loading…
Reference in New Issue
Block a user