-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Dashboard with Topic and Skill Statistic
- Loading branch information
1 parent
da72589
commit 813e44c
Showing
6 changed files
with
103 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const topicSkillStatsUrl = `${process.env.NEXT_PUBLIC_QUEMISTRY_STATS_URL}/topic-skill` | ||
|
||
|
||
export const StatisticService = { | ||
getTopicSkillStatistics(pageNo: number, pageSize: number) { | ||
const params = new URLSearchParams({ pageno: pageNo.toString(), pagesize: pageSize.toString() }); | ||
//console.log("API URL: " + topicSkillStatsUrl + params.toString()); | ||
|
||
return fetch(`${topicSkillStatsUrl}?${params.toString()}`,{ | ||
credentials: 'include' | ||
}) | ||
.then(res => res.json()) | ||
.then(data => data as Statistics.StatisticsResponse<Statistics.TopicSkillStatistics[]>); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
declare namespace Statistics { | ||
interface StatisticsResponse<Type> { | ||
data: Type; | ||
pageNo: number; | ||
pageSize: number; | ||
totalRecords: number; | ||
} | ||
|
||
interface TopicSkillStatistics { | ||
topicId: number; | ||
topicName: string; | ||
skillId: number; | ||
skillName: string; | ||
cntAttempt: number; | ||
cntCorrectAnswer: number; | ||
} | ||
} |