Test pages types overhaul#2209
Open
jacbn wants to merge 7 commits into
Open
Conversation
b20310d to
c504e1d
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2209 +/- ##
==========================================
+ Coverage 43.54% 43.57% +0.02%
==========================================
Files 597 597
Lines 25217 25232 +15
Branches 8378 8380 +2
==========================================
+ Hits 10981 10994 +13
+ Misses 14187 14181 -6
- Partials 49 57 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Overhauls the test pages' types to drastically increase code readability and robustness.
Quizzes across these pages can either be simplified rubric summary objects (if you have not yet committed to starting the test), or full quiz objects (if viewing a past attempt, previewing, or coming from an assignment). Previously, we represented the difference with two entirely separate objects:
This is fairly nasty for multiple reasons:
QuizViewProps.viewcontains aDetailedQuizSummaryDTO(containing the rubric), whereasQuizAttemptProps.attemptcontains anIsaacQuizDTOwith this same information.DetailedQuizSummaryDTOis a strict subset ofIsaacQuizDTO, which implies a significantly neater strategy of sharing an object between the two.A majority of the changes in this PR migrate the above types into this new format:
We can use the type
QuizProps & FullQuizInfowhenever we require parameters to be those of a complete quiz, and similarly forQuizProps & QuizSummaryInfoif only the summary is required. We can also useQuizPropswithout a second modifier in the case we can use either; in particular, note thatQuizProps.quizis of typeIsaacQuizDTO | DetailedQuizSummaryDTO, for whichquiz.rubricis a valid property in both cases, and so never requires further type checking or complication.