fixes quizzes not showing "File size for download" value properly
Summary
This PR fixes quizzes not showing "File size for download" value properly Closes #12163
Before
After
…
References
#12163
…
Reviewer guidance
Create quiz > add resources > save quiz > click start quiz
…
Testing checklist
- [x] Contributor has fully tested the PR manually
- [ ] 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
- [ ] 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 (
yarnandpip) - Documentation is updated
- Contributor is in AUTHORS.md
Build Artifacts
| Asset type | Download link |
|---|---|
| PEX file | kolibri-.pex |
| Windows Installer (EXE) | kolibri-0.16.2b2.dev0+git.1148.ge4d87dd3-windows-setup-unsigned.exe |
| Debian Package | kolibri_0.16.2b2.dev0+git.1148.ge4d87dd3-0ubuntu1_all.deb |
| Mac Installer (DMG) | kolibri-0.16.2b2.dev0+git.1148.ge4d87dd3-0.4.2.dmg |
| Android Package (APK) | kolibri-0.16.2b2.dev0+git.1148.ge4d87dd3-0.1.3-debug.apk |
| TAR file | kolibri-0.16.2b2.dev0+git.1148.ge4d87dd3.tar.gz |
| WHL file | kolibri-0.16.2b2.dev0+git.1148.ge4d87dd3-py2.py3-none-any.whl |
Thanks @AllanOXDi.
It seems that the motivation for your fix was the need to have the whole object available here, is that right?
<p>{{ coachString('fileSizeToDownload', { size: modalQuizId.size_string }) }}</p>
I haven't tested, just from the code, modalQuizId now seems to hold an object on some occasions, and a value on another:
Line 91
@click="showOpenConfirmationModal = true; modalQuizId = tableRow"
Line 99
@click="showCloseConfirmationModal = true; modalQuizId = tableRow.id;"
I think that will be causing issues with handleOpenQuiz and handleCloseQuiz that expect ID in their only parameter.
You could perhaps rename modalQuizId to modalQuiz and save tableRow into it, so that you can then read modalQuiz.size_string, and also pass modalQuiz.id to handleOpenQuiz/handleCloseQuiz.
Would also recommend double-checking all usages of modalQuizId, I only looked into this particular place.