-
Notifications
You must be signed in to change notification settings - Fork 4
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
Go beyond edge context responses & special hint responses at edges #457
Comments
@zepumph, please note that the above strings do not reflect other specific changes to context responses that we have already discussed for Voicing, e.g., removing the distance-region when Tick Marks are shown. |
I think this issue is also directly related to #432 where you are implementing the Both Hands. |
I didn't get to a commit point unfortunately. Index: js/create/view/CreateScreenView.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/create/view/CreateScreenView.ts b/js/create/view/CreateScreenView.ts
--- a/js/create/view/CreateScreenView.ts (revision 201a45e2a80657853f6cf93cda6e5eaec3e4016d)
+++ b/js/create/view/CreateScreenView.ts (date 1650297704743)
@@ -50,9 +50,12 @@
const tickMarkRangeComboBoxParent = new Node();
- this.tickMarkRangeComboBoxNode = new TickMarkRangeComboBoxNode( this.tickMarkRangeProperty, tickMarkRangeComboBoxParent, this.tickMarkViewProperty );
+ this.tickMarkRangeComboBoxNode = new TickMarkRangeComboBoxNode( this.tickMarkRangeProperty,
+ tickMarkRangeComboBoxParent, this.tickMarkViewProperty );
- const handPositionsDescriber = new HandPositionsDescriber( model.ratio.tupleProperty, new TickMarkDescriber( this.tickMarkRangeProperty, this.tickMarkViewProperty ), model.inProportionProperty );
+ const handPositionsDescriber = new HandPositionsDescriber( model.ratio.tupleProperty,
+ new TickMarkDescriber( this.tickMarkRangeProperty, this.tickMarkViewProperty ),
+ model.inProportionProperty, model.ratio.enabledRatioTermsRangeProperty );
this.createScreenSummaryNode = new CreateScreenSummaryNode(
model.ratioFitnessProperty,
Index: js/common/view/describers/HandPositionsDescriber.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/common/view/describers/HandPositionsDescriber.ts b/js/common/view/describers/HandPositionsDescriber.ts
--- a/js/common/view/describers/HandPositionsDescriber.ts (revision 201a45e2a80657853f6cf93cda6e5eaec3e4016d)
+++ b/js/common/view/describers/HandPositionsDescriber.ts (date 1650303323310)
@@ -14,6 +14,7 @@
* @author Michael Kauzmann (PhET Interactive Simulations)
*/
+import Range from '../../../../../dot/js/Range.js';
import StringUtils from '../../../../../phetcommon/js/util/StringUtils.js';
import ratioAndProportion from '../../../ratioAndProportion.js';
import ratioAndProportionStrings from '../../../ratioAndProportionStrings.js';
@@ -26,6 +27,7 @@
import IReadOnlyProperty from '../../../../../axon/js/IReadOnlyProperty.js';
import DistanceResponseType from './DistanceResponseType.js';
import optionize from '../../../../../phet-core/js/optionize.js';
+import RatioInputModality from './RatioInputModality.js';
const leftHandLowerString = ratioAndProportionStrings.a11y.leftHandLower;
const rightHandLowerString = ratioAndProportionStrings.a11y.rightHandLower;
@@ -131,18 +133,24 @@
private previousDistance: number;
static POSITION_REGIONS_DATA: PositionRegionsData[];
+ private previousEdgeCheckTuple: RAPRatioTuple;
+ enabledRatioTermsRangeProperty: IReadOnlyProperty<Range>;
- constructor( ratioTupleProperty: Property<RAPRatioTuple>, tickMarkDescriber: TickMarkDescriber, inProportionProperty: IReadOnlyProperty<boolean> ) {
+ constructor( ratioTupleProperty: Property<RAPRatioTuple>, tickMarkDescriber: TickMarkDescriber,
+ inProportionProperty: IReadOnlyProperty<boolean>, enabledRatioTermsRangeProperty: IReadOnlyProperty<Range> ) {
this.ratioTupleProperty = ratioTupleProperty;
this.tickMarkDescriber = tickMarkDescriber;
this.inProportionProperty = inProportionProperty;
+ this.enabledRatioTermsRangeProperty = enabledRatioTermsRangeProperty;
this.previousDistanceRegionSingle = null;
this.previousDistanceRegionBoth = null;
this.previousDistance = ratioTupleProperty.value.getDistance();
+ this.previousEdgeCheckTuple = ratioTupleProperty.value;
+
ratioTupleProperty.lazyLink( ( newValue, oldValue ) => {
if ( oldValue ) {
this.previousDistance = oldValue.getDistance();
@@ -412,11 +420,68 @@
return distanceProgressString;
}
+ getGoBeyondContextResponse( currentTuple: RAPRatioTuple, inputModality: RatioInputModality ): string | null {
+
+ const enabledRange = this.enabledRatioTermsRangeProperty.value;
+
+ const previousAntecedentAtMin = this.previousEdgeCheckTuple.antecedent === enabledRange.min;
+ const previousAntecedentAtMax = this.previousEdgeCheckTuple.antecedent === enabledRange.max;
+ const previousConsequentAtMin = this.previousEdgeCheckTuple.consequent === enabledRange.min;
+ const previousConsequentAtMax = this.previousEdgeCheckTuple.consequent === enabledRange.max;
+
+ let handAtExtremity = null; // what hand?
+ let extremityPosition = null; // where are we now?
+ let direction = null; // where to go from here?
+
+ if ( this.ratioTupleProperty.value.antecedent === enabledRange.min ) {
+ if ( previousAntecedentAtMin ) {
+ handAtExtremity = ratioAndProportionStrings.a11y.leftHand;
+ extremityPosition = ratioAndProportionStrings.a11y.handPosition.nearBottom;
+ direction = ratioAndProportionStrings.a11y.up;
+ }
+ }
+ else if ( this.ratioTupleProperty.value.antecedent === enabledRange.max ) {
+ if ( previousAntecedentAtMax ) {
+ handAtExtremity = ratioAndProportionStrings.a11y.leftHand;
+ extremityPosition = ratioAndProportionStrings.a11y.handPosition.atTop;
+ direction = ratioAndProportionStrings.a11y.down;
+ }
+ }
+ else if ( this.ratioTupleProperty.value.consequent === enabledRange.min ) {
+ if ( previousConsequentAtMin ) {
+ handAtExtremity = ratioAndProportionStrings.a11y.rightHand;
+ extremityPosition = ratioAndProportionStrings.a11y.handPosition.nearBottom;
+ direction = ratioAndProportionStrings.a11y.up;
+ }
+ }
+ else if ( this.ratioTupleProperty.value.consequent === enabledRange.max ) {
+ if ( previousConsequentAtMax ) {
+ handAtExtremity = ratioAndProportionStrings.a11y.rightHand;
+ extremityPosition = ratioAndProportionStrings.a11y.handPosition.atTop;
+ direction = ratioAndProportionStrings.a11y.down;
+ }
+ }
+
+ this.previousEdgeCheckTuple = currentTuple;
+
+ // Detect if we are at the edge of the range
+ if ( handAtExtremity && extremityPosition && direction ) {
+ return StringUtils.fillIn( ratioAndProportionStrings.a11y.ratio.ratioLockedEdgeContextResponse, {
+ position: extremityPosition,
+ hand: handAtExtremity,
+ direction: direction
+ } );
+ }
+
+ return null;
+ }
+
reset(): void {
this.previousDistanceRegionSingle = null;
this.previousDistanceRegionBoth = null;
this.previousDistance = this.ratioTupleProperty.value.getDistance();
+ this.previousEdgeCheckTuple = this.ratioTupleProperty.value;
}
}
Index: js/common/view/describers/BothHandsDescriber.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/common/view/describers/BothHandsDescriber.ts b/js/common/view/describers/BothHandsDescriber.ts
--- a/js/common/view/describers/BothHandsDescriber.ts (revision 201a45e2a80657853f6cf93cda6e5eaec3e4016d)
+++ b/js/common/view/describers/BothHandsDescriber.ts (date 1650297704726)
@@ -45,7 +45,7 @@
this.enabledRatioTermsRangeProperty = enabledRatioTermsRangeProperty;
this.tickMarkViewProperty = tickMarkViewProperty;
this.ratioDescriber = ratioDescriber;
- this.handPositionsDescriber = new HandPositionsDescriber( ratioTupleProperty, tickMarkDescriber, inProportionProperty );
+ this.handPositionsDescriber = new HandPositionsDescriber( ratioTupleProperty, tickMarkDescriber, inProportionProperty, enabledRatioTermsRangeProperty );
this.ratioLockedProperty = ratioLockedProperty;
this.previousAntecedentAtExtremity = false;
this.previousConsequentAtExtremity = false;
Index: js/discover/view/DiscoverScreenView.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/discover/view/DiscoverScreenView.ts b/js/discover/view/DiscoverScreenView.ts
--- a/js/discover/view/DiscoverScreenView.ts (revision 201a45e2a80657853f6cf93cda6e5eaec3e4016d)
+++ b/js/discover/view/DiscoverScreenView.ts (date 1650297704748)
@@ -49,7 +49,9 @@
this.addChild( comboBoxListBoxParent );
this.pdomPlayAreaNode.pdomOrder = this.pdomPlayAreaNode.pdomOrder!.concat( [ this.comboBoxContainer, comboBoxListBoxParent ] );
- const handPositionsDescriber = new HandPositionsDescriber( model.ratio.tupleProperty, new TickMarkDescriber( this.tickMarkRangeProperty, this.tickMarkViewProperty ), model.inProportionProperty );
+ const handPositionsDescriber = new HandPositionsDescriber( model.ratio.tupleProperty,
+ new TickMarkDescriber( this.tickMarkRangeProperty, this.tickMarkViewProperty ), model.inProportionProperty,
+ model.ratio.enabledRatioTermsRangeProperty );
// set this after the supertype has initialized the view code needed to create the screen summary
this.discoverScreenSummaryNode = new DiscoverScreenSummaryNode(
Index: js/common/view/RatioHalf.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/common/view/RatioHalf.ts b/js/common/view/RatioHalf.ts
--- a/js/common/view/RatioHalf.ts (revision 201a45e2a80657853f6cf93cda6e5eaec3e4016d)
+++ b/js/common/view/RatioHalf.ts (date 1650297704738)
@@ -154,8 +154,8 @@
this.ratio = options.ratio;
const tickMarkDescriber = new TickMarkDescriber( options.tickMarkRangeProperty, options.tickMarkViewProperty );
- this.descriptionHandPositionsDescriber = new HandPositionsDescriber( this.ratio.tupleProperty, tickMarkDescriber, options.inProportionProperty );
- this.voicingHandPositionsDescriber = new HandPositionsDescriber( this.ratio.tupleProperty, tickMarkDescriber, options.inProportionProperty );
+ this.descriptionHandPositionsDescriber = new HandPositionsDescriber( this.ratio.tupleProperty, tickMarkDescriber, options.inProportionProperty, this.ratio.enabledRatioTermsRangeProperty );
+ this.voicingHandPositionsDescriber = new HandPositionsDescriber( this.ratio.tupleProperty, tickMarkDescriber, options.inProportionProperty, this.ratio.enabledRatioTermsRangeProperty );
this.tickMarkViewProperty = options.tickMarkViewProperty;
this.ratioTerm = options.ratioTerm;
|
A challenging case for this is to convey what input value changed if both hands are at extremities. At the moment I am just going to go down the list "was left at top, if so alert that as the go beyond", "was right at top. . . .". But if left is at top, and right is at bottom, and then I move right down, it would alert as if I press "up" on the left. |
I will be quite hard to convey "I tried to move the X hand" from input -> node -> describer -> context response. I'll have to think more about this part as I do the easier stuff. |
I have the above case (#457 (comment)) working where edge responses know what term was most recently moved. Here are two more challenging cases that we aren't currently supporting:
|
@terracoda please review. Summary of changes:
The code changes weren't terrible, but I do feel like there is still a lot of room for regressions and bugs because of how many factors effect the response: When input modality, whether that input modality is controlling one or both terms of the ratio at the same time (like when ratio is locked), the previous value of the ratio when the context response was last asked for. Anyway, let me know if you find anything that seems off to you. |
Tests with VOICINGBoth Hands unlocked & keyboard:
Indy Slider unlocked & keyboard:
Both Hands with ratio locked & keyboard:
Indy Hands with ratio locked & keyboard (arrow keys only):
Mouse Input
Sometimes hearing distance-progress:
|
Testing with VoiceOverBoth Hands unlocked & keyboard:
Indy Slider unlocked & keyboard:
Both Hands with ratio locked & keyboard:
Indy Hands with ratio locked & keyboard (arrow keys only):
@zepumph, I think it might be best to leave out the beyond edge responses when a hand cannot get to the edge position. They all seem to be working consistently for the other hand that can actually reach the edge. The responses with mouse input on Voicing are concerning because they are very inconsistent. maybe we can discuss the best solution there...like maybe no go beyond responses at all for mouse input. |
You need to check both indy sliders and when the hands are locked - the hints at the top are not the special hints. |
Alright. I found the bug. It is the exact same javascript imprecise number bug, but this time in the function when we are snapping to a tick mark. It basically mapped the number 1 -> .999999, after (in the code) when the dragListener ensured the value was correctly 1 :) I am witnessing good coverage for mouse input go-beyond alerts now. Do you see any other issues? |
You got it @zepumph! I am closing this issue! |
Apologies I closed prematurely. @zepumph, for mouse input, I am getting the hint on mouse up (end of interaction) at the edge, and when I mouse down and a hand is starting at an edge. Maybe I am miss-understanding something, but I thought for pointer input, we only hear the response on mouse down when starting at an edge, and we won't hear it at end of drag when ending at an edge. For mouse input, when ending at an edge, we have no hint response, though we will have position like "at top" or "near bottom" as part of the last context response. |
We really are almost there, @zepumph... in comment #457 (comment) We agreed that was possible to not hear the special go-beyond-edge hint response when ending a mouse drag at an edge. |
Let me know if you need to pair to wrap this issue up. |
@zepumph, the issue only happens when hands are locked at challenge ratio. The special hints for the indy sliders are working find with pointer input. This is why I missed it on my first pass :-) |
And it is happening in the context response, not the hint response. OK, best to document this again... Mouse Input
I think everything else for mouse input is working correctly. |
Ok. I found the bug, we were removing the go-beyond edge response for the indy hints manually, but not when the ratio was locked. We are now. Let me know if you see any other weirdness. |
Verified Both Hands (ratio locked) for mouse all 3 modes are voicing correctly (No Tick Marks, Tick Marks and Numbered Tick Marks). Thanks @zepumph. We did it! Closing this issue. |
In #452 @zepumph and I verified that there are no special responses when a learner tries to go beyond the top or bottom of the visual Play Area when using the keyboard for Interactive Description. I just verified that this is the case for the Both Hands and the Indy Sliders - no special responses at the edges.
A hint about changing directions is only provided when ratio is locked. I think this is because a learner can't actually get to the bottom or get to Tick Mark zero (good indications that and edge has been reached) when the ratio is locked.
I think it would be worthwhile to stream line the designs for alternative input (focus-based input) when the Ratio is not locked, and to do the same for both Interactive Description and Voicing.
For Alternative Input (both Interactive Description & Voicing) we use the same strings to hint at changing directions. Instead of repeating that they are at the top (on Tick Mark 10) or at the bottom (on Tick Mark 0), we can provide a similar response that was suggested in #452 (comment)
I don't think the wording can be exactly the same because when the ratio is NOT locked, the user is moving an individual hand. I think this could work across all interactions and for both Interactive Description and Voicing:
This would result is 4 possible beyond-edge context responses for Interactive Description, and 4 hint responses for Voicing:
I think the same responses work regardless if Tick Marks are shown or hidden because on the last step that actually reaches the edge but does not go beyond, the response will description the dist and position of the hands like this:
Left hand slider reaches bottom or Tick Mark 0
Left hand of Both Hands reaches bottom or Tick Mark 0
In all cases if the learner presses the Down Arrow or the W key (Both Hands), a shorter helpful response will let them know they need to change directions to do anything potentially productive. Of course they could just move their focus to the Right Hand and move it, or do something else entirely, but they won't keep trying to move the Left Hand down if they hear:
When the ratio is locked, the logic is the same, but the second part of the phrase says "Move hands" rather than "Move hand".
@zepumph, is this straight forward to implement for both Interactive Description and Voicing?
The text was updated successfully, but these errors were encountered: