Skip to content

Commit

Permalink
Implementing feedback quiz / knowledge quiz #107
Browse files Browse the repository at this point in the history
- add quiz type in quiz list
- add translation for quiz type column
  • Loading branch information
razvantudorache committed Apr 16, 2022
1 parent 12ec3c1 commit 1639457
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/app/admin/components/quiz-list/quiz-list.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,26 @@
height: 100%;
display: flex;
flex-direction: column;

.knowledge-quiz, .feedback-quiz {
justify-content: center;
.icon {
font-size: 20px;
&:before {
font-family: 'Material Icons';
}
}
}

.knowledge-quiz {
.icon:before {
content: '\e885';
}
}

.feedback-quiz {
.icon:before {
content: '\e8dd';
}
}
}
15 changes: 15 additions & 0 deletions src/app/admin/components/quiz-list/quiz-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { PlaceholderFormatService } from 'src/app/shared/services/format/placeho
import { QuizListService } from './quiz-list.service';
import { PreviewQuizDialogComponent } from "../preview-quiz-dialog/preview-quiz-dialog.component";
import { MatDialog } from "@angular/material/dialog";
import { QUIZ_TYPE } from "../new-quiz/quiz-settings/quiz-settings.component";

@Component({
selector: 'app-quiz-list',
Expand Down Expand Up @@ -84,6 +85,20 @@ export class QuizListComponent implements OnInit {
),
field: 'status',
},
{
headerName: this.customTranslateService.getTranslation(
'admin.quiz.list.quizType'
),
field: 'type',
maxWidth: 70,
minWidth: 70,
cellClass: (data) => data.type === QUIZ_TYPE.FEEDBACK_QUIZ ? 'feedback-quiz' : 'knowledge-quiz',
cellRenderer: (data) => `<span class='icon' title="${data.type === QUIZ_TYPE.FEEDBACK_QUIZ ? this.customTranslateService.getTranslation(
'admin.quiz.settings.quizTypeFeedback'
) : this.customTranslateService.getTranslation(
'admin.quiz.settings.quizTypeKnowledge'
)}"></span>`
},
{
headerName: this.customTranslateService.getTranslation(
'admin.quiz.list.numberOfQuestions'
Expand Down
1 change: 1 addition & 0 deletions src/assets/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@
"list": {
"quizName": "Nume chestionar",
"quizStatus": "Status",
"quizType": "Tip",
"numberOfQuestions": "Număr de întrebări",
"creationDate": "Data creării",
"lastUpdate": "Ultima actualizare",
Expand Down

0 comments on commit 1639457

Please sign in to comment.