-
Notifications
You must be signed in to change notification settings - Fork 707
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
Prevent access to undefined AttemptLogs while looking at reports #12723
Merged
rtibbles
merged 4 commits into
learningequality:release-v0.17.x
from
LianaHarris360:attempt-log-undefined
Oct 24, 2024
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
1df1975
Update how the attemptLog for the current section and mobile selectio…
LianaHarris360 110070a
Display section number instead of empty string if section title is un…
LianaHarris360 d6af7cb
Show all KSelect question number options in AttemptLoglist
LianaHarris360 6b19bea
Add section_title field to annotateSections() func
LianaHarris360 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Hrm, is this happening when section.title is undefined rather than being an empty string? Perhaps we could just tweak the implementation here:
kolibri/packages/kolibri-common/strings/enhancedQuizManagementStrings.js
Line 224 in 3d12dae
section
is defined,section.title
is defined, andsection.title is not empty
?So could maybe update it to:
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.
Yes, this was happening because
displaySectionTitle()
is checking forsection.section_title
, but it seems that Attemptlogs for practice exercises havesection.title
instead. I did try this way, but had some issues with it not working when checking the attempt logs for exams.I could instead try
Edit: I get this console error with this way as well: Invalid prop: type check failed for prop "title". Expected String, got Undefined
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.
Hrm... I suspect that the discrepancy between section_title and title is the root issue here. So, maybe we should trace back where that is coming from and just rectify that instead?
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.
i.e. it should always be
section_title
for the title for a section, and nottitle
.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.
Hmm, I may have found where it's coming from. Possibly this annotateSections() util function.
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.
That looks rather like a bug, and one that I caused, looking at the git blame, so I'd be most obliged if you could fix it!
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.
It's fixed, now all sections annotated with
annotateSections()
have the fieldsection_title
Before:
After:
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.
Thank you!