Closed matt-tingen closed 2 years ago
Merging #252 (755a3c6) into master (f1a810c) will increase coverage by
0.10%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #252 +/- ##
==========================================
+ Coverage 96.16% 96.26% +0.10%
==========================================
Files 32 32
Lines 1121 1126 +5
Branches 202 205 +3
==========================================
+ Hits 1078 1084 +6
+ Misses 39 38 -1
Partials 4 4
Impacted Files | Coverage Δ | |
---|---|---|
src/defaultOptions.ts | 100.00% <ø> (ø) |
|
src/Quiz.ts | 95.83% <100.00%> (+0.05%) |
:arrow_up: |
src/strokeMatches.ts | 100.00% <100.00%> (+1.26%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update f1a810c...755a3c6. Read the comment docs.
:tada: This PR is included in version 3.3.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
The use case for this is to allow applications to notify a user when they make a backwards stroke (one which is correct except for the direction in which in which it's made) on a quiz. In such a case, the application will likely want to show some messaging to the user indicating the stroke was made in the wrong direction. The application may want to treat backwards strokes as correct or incorrect.
This change includes two API changes to fulfill the above use case:
checkBackwardsStrokes
ternary quiz option (defaulted off)onCorrectStroke
andonMistake
quiz handlers receive anisBackwards
boolean property on the stroke data.checkBackwardsStrokes
is ternary to allow avoiding the perf hit of checking backwards strokes if the application does not care about them.If
checkBackwardsStrokes
isfalse
, the handlers will always receiveisBackwards: false
since the backwards check is skipped. The alternative here is to return e.g.null
if the check was skipped. I opted against this to keep the API a bit simpler with a consistent type forisBackwards
.