Thanks @tlyi for reporting the bugs found! There are 2 bugs in master:
The /questions/:questionId/history page cannot be rendered. This is due to we miss to add the HistoryProvider to that page when we remove HistoryProvider from our centralised providers.tsx component.
The attempted question list shown in the dashboard table might not render in order, meaning that it is still possible that the question that you just attempted one second ago appear in the last page of the history table instead of the first page first row.
Consider the use of HistoryProvider is quite extensive, I proposed that we keep HistoryProvider in our centralised providers.tsx component. (For your information, HistoryProvider is used in dashboard, history table page, and individual question history page, so instead of creating 3 separate layout.tsx, putting in the providers.tsx is more efficient.
Please also note that for the sorting, we are only able to have an "overall sorting" for time, not for "complexity" or "question name" since we want an efficient sorting algorithm.
Related Issue(s)
Changes Made
fix the 2 bugs mentioned above by moving HistoryProvider back to providers.tsx
fix the sorting logics for history table
slight modification to individual question history page, so instead of saying "You have completed", changed to "You have attempted"
Screenshots (if applicable)
From the screenshots above, we can clearly see that even with pagination, the history are in order:
Checklist
[x] I have checked that the changes included in the PR are intended to merge to master or any destination branch.
[x] I have verified that the new changes do not break any existing functionalities, unless the new changes are intended and have approved by the team.
[x] I will take care of the merging and delete the side-branch after the PR is merged.
Pull Request
Description
Thanks @tlyi for reporting the bugs found! There are 2 bugs in master:
/questions/:questionId/history
page cannot be rendered. This is due to we miss to add theHistoryProvider
to that page when we removeHistoryProvider
from our centralisedproviders.tsx
component.Consider the use of
HistoryProvider
is quite extensive, I proposed that we keepHistoryProvider
in our centralisedproviders.tsx
component. (For your information,HistoryProvider
is used in dashboard, history table page, and individual question history page, so instead of creating 3 separatelayout.tsx
, putting in theproviders.tsx
is more efficient.Please also note that for the sorting, we are only able to have an "overall sorting" for time, not for "complexity" or "question name" since we want an efficient sorting algorithm.
Related Issue(s)
Changes Made
HistoryProvider
back toproviders.tsx
Screenshots (if applicable)
From the screenshots above, we can clearly see that even with pagination, the history are in order:
Checklist
master
or any destination branch.Additional Notes/References