-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add pagination, filters, and CSV download in participants & question #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: add pagination, filters, and CSV download in participants & question #76
Conversation
…stions reports - Implemented pagination in user participants - Added filters for participants (top 10, order by asc/desc) and questions (single, survey, all) - Integrated CSV download feature for both participants and questions reports
| Secret string `envconfig:"JWT_SECRET"` | ||
| WebUrl string `envconfig:"WEB_URL"` | ||
| JWTIssuer string `envconfig:"ISSUER"` | ||
| FilePath string `envconfig:"FILE_PATH"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mention which FilePath. means give proper var name
| SurveyString = "survey" | ||
| SingleString = "single" | ||
| AllString = "all" | ||
| SingleAnsField = "single answer" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
single answer is already there.
|
|
||
| // Analysis Download Queries | ||
| const ( | ||
| DownloadFileName = "quiz_analysis" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't able to find the use of DownloadFileName use. in this PR.
| return finalScoreBoardData, nil | ||
| } | ||
|
|
||
| func (model *FinalScoreBoardAdminModel) TotoalUsers(activeQuizId string) (int, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo in function name.
| ) | ||
|
|
||
| const ( | ||
| PageLimit = "user_limit" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why its value is user_limit,
| isTop10Users := strings.ToLower(c.Query(constants.IsTop10Users)) | ||
| userOrder := strings.ToLower(c.Query(constants.SortOrder)) | ||
|
|
||
| order := constants.DescOrder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use only one var for order.
| userOffset := ctx.Query(constants.PageOffset) | ||
| userSortOrder := strings.ToLower(ctx.Query(constants.SortOrder)) | ||
|
|
||
| if userLimit == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use one var for all query params.
| report := admin.Group("/reports") | ||
| report.Get("/list", quizController.ListQuizzesAnalysis) | ||
| report.Get(fmt.Sprintf("/:%s/analysis", constants.ActiveQuizId), middleware.KratosAuthenticated, quizController.GetQuizAnalysis) | ||
| report.Get(fmt.Sprintf("/:%s/download/analysis", constants.ActiveQuizId), middleware.KratosAuthenticated, quizController.DownloadReport) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
route is like analysis/download
|
|
||
| if (!api) return; | ||
|
|
||
| const response = await $fetch.raw(api, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use UseFetch function that is for nuxt3.
| if (!api) return; | ||
|
|
||
| const response = await $fetch.raw(api, { | ||
| method: "GET", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should be POST.
Fixes Issue
Closes #28
Changes proposed
Note to reviewers
top_10,order_by) correctly for participants download.