kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Exam report: Avoid loading on question change

Open AlexVelezLl opened this issue 10 months ago • 3 comments

Summary

Avoid fetching exam resources again if they are already loaded.

References

Closes #12062

Screenshots

https://github.com/learningequality/kolibri/assets/51239030/954b6fe8-de64-4dec-b425-2f3589e9fe6b

Reviewer guidance

  1. Take an exam as a learner.
  2. Review different exam reports and check that everything is loading correctly.
  3. Switch between questions, attempts and question interactions and the loading state should not appear

Testing checklist

  • [x] Contributor has fully tested the PR manually
  • [x] If there are any front-end changes, before/after screenshots are included
  • [ ] Critical user journeys are covered by Gherkin stories
  • [ ] Critical and brittle code paths are covered by unit tests

PR process

  • [x] PR has the correct target branch and milestone
  • [x] PR has 'needs review' or 'work-in-progress' label
  • [x] If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • [ ] If this is an important user-facing change, PR or related issue has a 'changelog' label
  • [ ] If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

AlexVelezLl avatar Apr 12 '24 16:04 AlexVelezLl

Thanks @AlexVelezLl I confirm that the loading state of the quiz report when viewed as a learner is fixed now. However, while regression testing I noticed that this is not fixed at Coach > Reports so it will be great if you could fix it there as well:

https://github.com/learningequality/kolibri/assets/79847249/790c7c74-74f9-4fe5-9bad-38cfb161bddf

pcenov avatar Apr 23 '24 13:04 pcenov

Hi @marcellamaki. This regression comes from here. The reason why the scroll is reset is because we have this conditional rendering, this way the ExamReport is unmounted from the DOM and mounted again.

Previously, although the data was reloaded and the references were updated, the ExamReport was always visible. And since we loaded the same data it still looked the same.

We could keep the same behavior of reloading the data, and make the ExamReport always visible, but perhaps with some opacity while the circular loader is shown, and revert the change to look if it is loaded in vue, If that is safer.

AlexVelezLl avatar Apr 24 '24 14:04 AlexVelezLl