-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[#12894] Per-recipient stats are calculated based on student name, not email #12981
[#12894] Per-recipient stats are calculated based on student name, not email #12981
Conversation
hi @Hkovin, thank you for the PR, do fix the failing tests before we proceed to review it, thank you! |
12d5614
to
24ffc2c
Compare
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.
Hey, the component testing is still failing, do look into it. Feel free to ping me if you encounter any difficulty.
Currently, the component test "MsqQuestionStatisticsComponent" in the file "src/web/app/components/question-types/question-statistics/msq-question-statistics.component.spec.ts" is failing. This is due to the code changes I made, which index the recipients based on email rather than name - which was needed in order to uniquely identify students. Unfortunately, with the logic needed to resolve this issue, I won't be able to pass this test. |
hi @Hkovin, since you changed the logic, the tests have to change accordingly to reflect the change in logic as well, do go ahead and update the tests |
Hi @cedricongjh, we did attempt to change the logic in the tests, however the CI build still runs on the old tests that use the old logic. |
the CI will run the latest version of the tests, including those in this PR, it appears that there are not any tests in the PR, do remember to push them, thank you |
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.
regarding your test changes
the names in expectedPerRecipientResponsesWithOther
are not changed to emails
but everything passes and works, tested locally and on CI
https://github.com/Andy-W-Developer/teammates/actions/runs/9248847879
component testing is by default set to run on the master and release branch only, so you might be looking at the test results for the unchanged master branch
continue; | ||
} | ||
perRecipientResponse[response.recipientEmail] = perRecipientResponse[response.recipientEmail] || {}; | ||
const responseEmail = response.recipientEmail; |
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.
for consistency, responseEmail could be moved above and used in perRecipientResponse
Closing due to inactivity |
Fixes #12894
Outline of Solution
This PR is ready for review. We solved the issue by modifying msq-question-statistics.calculation.ts. Instead of using "response.recipient" to index into perRecipientResponse we used "response.recipientEmail." We also created another variable to store the recipient names in order to populate the recipient property of the perRecipientResponses object.