Merge branch 'master' of https://git.wmi.amu.edu.pl/s416178/Punktonerzy into wejscieDoTestu

This commit is contained in:
Marcin Szczepański 2020-01-16 17:22:03 +01:00
commit 88c5a9e9f3
7 changed files with 32 additions and 3 deletions

View File

@ -34,3 +34,10 @@
.align {
text-align: center;
}
.check
{
height: 35px;
width: 35px;
margin-right: 20px;
}

View File

@ -17,6 +17,11 @@
<input type="number" step="1" min="0" name="time" class="form-control" [(ngModel)]="time" required/>
</label>
<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>
<div>
<div *ngFor="let answer of answersCorrect; let i = index" class="row">

View File

@ -12,6 +12,7 @@ export class SingleChoiceQuestionComponent implements OnInit {
@Input() edit: Boolean;
isChecked: Boolean = false;
help: Boolean = false;
answers: Array<Object> = [];
answersCorrect: Array<Object> = [];
newAttribute: any = {
@ -45,6 +46,7 @@ export class SingleChoiceQuestionComponent implements OnInit {
});
}
this.points = this.content['content']['points'];
this.help = this.content['content']['help'];
} else {
this.content = {};
this.content['content'] = {
@ -53,7 +55,8 @@ export class SingleChoiceQuestionComponent implements OnInit {
question: '',
answers: [],
points: 1,
time: 0
time: 0,
help: this.help
};
this.content['edit'] = false;
}
@ -110,6 +113,10 @@ export class SingleChoiceQuestionComponent implements OnInit {
}
}
changeHelp(): void {
this.help = !this.help;
}
addTable(): void {
if ((this.question === undefined) || (this.question.trim().length === 0)) {
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']['points'] = this.points;
this.content['content']['time'] = this.time;
this.content['content']['help'] = this.help;
if (this.edit) {
this.editing.emit(this.content);
} else {
@ -189,6 +197,7 @@ export class SingleChoiceQuestionComponent implements OnInit {
this.isChecked = false;
this.question = '';
this.time = 0;
this.help = false;
this.answers = [];
this.answersCorrect = [];
this.newAttribute = {};

View File

@ -6,6 +6,12 @@
}
.fifty
{
margin-right: auto;
margin-left: auto;
margin-bottom: 20px;
}
.radio-answer
{

View File

@ -1,7 +1,8 @@
<form #f="ngForm" (ngSubmit)="nextQuestion(f)" novalidate>
<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>
<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 *ngFor="let item of question.answers" >

View File

@ -162,7 +162,8 @@ export class TestMakerComponent implements OnInit {
time: this.test[i]['content']['time'],
answers: this.test[i]['content']['answers'],
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;

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB