[#12894] Per-recipient stats are calculated based on student name, not email
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.
hi @Hkovin, thank you for the PR, do fix the failing tests before we proceed to review it, thank you!
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.
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
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
Closing due to inactivity