Skip to content
Snippets Groups Projects
Commit 8c89a2ab authored by HUSS THEOPHILE's avatar HUSS THEOPHILE
Browse files

fix: Change show name quiz into id in community list

parent c5dc4e9b
1 merge request!56style: fix css in profile
Pipeline #304093 passed with stages
in 33 seconds
......@@ -9,13 +9,12 @@ import { filter } from 'rxjs';
templateUrl: './list-quiz.component.html',
styleUrls: ['./list-quiz.component.css', '../../../../styles.css'],
})
export class ListQuizComponent implements OnInit {
//listQuizDataSource = new MatTableDataSource();
quizzes: any[] = [] //list from database
quizList: any[] = []; //list to display
quizzes: any[] = []; //list from database
quizList: any[] = []; //list to display
//displayedColumns = ['Component'];
constructor(private communityService: CommunityService) { }
constructor(private communityService: CommunityService) {}
codeQuiz: string = '';
skip: number = 0;
take: number = 10;
......@@ -41,13 +40,15 @@ export class ListQuizComponent implements OnInit {
//this.listQuizDataSource.data = data;
this.quizzes = data;
this.totalQuiz = data.length;
this.quizzes.map((quiz => {
this.quizzes.map((quiz) => {
this.quizList.push({
title: !quiz.name ? 'Untitled' : quiz.name,
content: `${quiz.questions.length} QUESTIONS | ${quiz.difficulty.name} | ${!quiz.author ? 'Anonymous' : quiz.author}`,
id: quiz.id
})
}))
title: quiz.id ?? 'NO ID FOUND',
content: `${quiz.questions.length} QUESTIONS | ${quiz.difficulty.name} | ${
!quiz.author ? 'Anonymous' : quiz.author
}`,
id: quiz.id,
});
});
},
});
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment