-
Notifications
You must be signed in to change notification settings - Fork 762
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
Only show attempts column in lesson reports for practice quizzes #13046
Only show attempts column in lesson reports for practice quizzes #13046
Conversation
anyTries() { | ||
return this.entries.some(entry => !isUndefined(entry.statusObj.tries)); | ||
}, | ||
// Presumes this is a Lesson report table as quizId is only present in quiz routes |
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.
This got me a bit confused initially, thought this might help future-me (or someone else) because I was trying to use this.exam
to get the currently-viewed resource and didn't realize the need to handle varying route params
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.
So, what you're doing as your approach is using a combination of the modality and the params to find where you are. If there's an exerciseId, you're in a lesson report table, and if it's a quizId, the same exercise is a "quiz". And if you're in a lesson, check the modality to see if it's a practice quiz, in which case show the tries, otherwise, nothing. Right?
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.
Yep!
Build Artifacts
|
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.
Thanks @nucleogenesis - I confirm that this is implemented as specified above.
Summary
Modifies the condition in the ReportsLearnersTable for showing the attempts column so that it only shows if the currently viewed piece of content is a practice quiz.
Only affects the case in which the report is viewing a particular piece of content in a lesson.
References
Fixes #13011
Reviewer guidance
Edge case: When you have a practice quiz but no attempts then in this case there should be no attempts column.