Skip to content

Conversation

@viral-shingadia
Copy link

@viral-shingadia viral-shingadia commented Sep 3, 2025

Fixes Issue

Closes #28

Changes proposed

  • Added pagination support in user participants
  • Implemented filters in participants (Top 10, order by asc/desc)
  • Implemented filters in questions (single, survey, all)
  • Added CSV download feature for both participants and questions

Note to reviewers

  • Please review the new dropdown filter logic in the frontend.
  • Ensure backend API handles query params (top_10, order_by) correctly for participants download.

…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"`
Copy link
Contributor

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"
Copy link
Contributor

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"
Copy link
Contributor

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) {
Copy link
Contributor

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"
Copy link
Contributor

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
Copy link
Contributor

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 == "" {
Copy link
Contributor

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)
Copy link
Contributor

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, {
Copy link
Contributor

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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be POST.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Task 1 : Create Questions from UI Along with CSV

2 participants