Skip to content

Commit

Permalink
selfVoicing -> voicing, see phetsims/tasks#1083
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Mar 24, 2021
1 parent 125884a commit 1c05473
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions js/view/GravityForceLabAlertManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ import GravityForceLabModel from '../model/GravityForceLabModel.js';
const constantRadiusThinkDensityPatternString = gravityForceLabStrings.a11y.controls.constantRadiusThinkDensityPattern;
const massAndForceClausesPatternString = gravityForceLabStrings.a11y.qualitative.massAndForceClausesPattern;
const sentencePatternString = gravityForceLabStrings.a11y.sentencePattern;
const selfVoicingBriefMassChangeForceAlertWithValuePatternString = gravityForceLabStrings.a11y.voicing.briefMassChangeForceAlertWithValuePattern;
const selfVoicingBriefMassChangeForceAlertPatternString = gravityForceLabStrings.a11y.voicing.briefMassChangeForceAlertPattern;
const selfVoicingBiggerString = inverseSquareLawCommonStrings.a11y.voicing.bigger;
const selfVoicingSmallerString = inverseSquareLawCommonStrings.a11y.voicing.smaller;
const selfVoicingBriefMassPushAlertPatternString = gravityForceLabStrings.a11y.voicing.briefMassPushAlertPattern;
const voicingBriefMassChangeForceAlertWithValuePatternString = gravityForceLabStrings.a11y.voicing.briefMassChangeForceAlertWithValuePattern;
const voicingBriefMassChangeForceAlertPatternString = gravityForceLabStrings.a11y.voicing.briefMassChangeForceAlertPattern;
const voicingBiggerString = inverseSquareLawCommonStrings.a11y.voicing.bigger;
const voicingSmallerString = inverseSquareLawCommonStrings.a11y.voicing.smaller;
const voicingBriefMassPushAlertPatternString = gravityForceLabStrings.a11y.voicing.briefMassPushAlertPattern;
const briefDensityChangeForceAlertPatternString = gravityForceLabStrings.a11y.voicing.briefDensityChangeForceAlertPattern;
const selfVoicingMoreString = gravityForceLabStrings.a11y.voicing.more;
const selfVoicingLessString = gravityForceLabStrings.a11y.voicing.less;
const voicingMoreString = gravityForceLabStrings.a11y.voicing.more;
const voicingLessString = gravityForceLabStrings.a11y.voicing.less;
const briefMassChangeAlertPatternString = gravityForceLabStrings.a11y.voicing.briefMassChangeAlertPattern;
const selfVoicingBriefNewForcePatternString = gravityForceLabStrings.a11y.voicing.briefNewForcePattern;
const selfVoicingBriefPositionChangeInteractionPatternString = gravityForceLabStrings.a11y.voicing.briefPositionChangeInteractionPattern;
const voicingBriefNewForcePatternString = gravityForceLabStrings.a11y.voicing.briefNewForcePattern;
const voicingBriefPositionChangeInteractionPatternString = gravityForceLabStrings.a11y.voicing.briefPositionChangeInteractionPattern;

class GravityForceLabAlertManager extends ISLCAlertManager {

Expand Down Expand Up @@ -109,12 +109,12 @@ class GravityForceLabAlertManager extends ISLCAlertManager {
else { // value specific assumption
this.alertMassValueChanged( objectEnum, true );

if ( ISLCQueryParameters.selfVoicing === 'paradigm1' ) {
if ( ISLCQueryParameters.voicing === 'paradigm1' ) {
if ( cursorSpeakerModel.getInteractiveModeBrief() ) {
webSpeaker.speak( this.getSelfVoicingForceChangeFromMassWithPushAlert( objectEnum ) );
}
}
else if ( ISLCQueryParameters.selfVoicing === 'paradigm2' || ISLCQueryParameters.selfVoicing === 'paradigm3' ) {
else if ( ISLCQueryParameters.voicing === 'paradigm2' || ISLCQueryParameters.voicing === 'paradigm3' ) {
const valueText = this.massDescriber.getMassAndUnit( objectEnum );
const massChangedUtterance = this.getMassValueChangedAlert( objectEnum );
const response = levelSpeakerModel.collectResponses( valueText, massChangedUtterance.alert, null );
Expand Down Expand Up @@ -186,14 +186,14 @@ class GravityForceLabAlertManager extends ISLCAlertManager {
getSelfVoicingForceChangeFromMassAlert( objectEnum, currentMass, oldMass, otherObjectLabel ) {
let alert;

const biggerSmallerChangeString = currentMass > oldMass ? selfVoicingBiggerString : selfVoicingSmallerString;
const biggerSmallerChangeString = currentMass > oldMass ? voicingBiggerString : voicingSmallerString;
const valueString = this.forceDescriber.getFormattedForce();

const constantSize = this.model.constantRadiusProperty.get();
const forceValuesShown = this.model.showForceValuesProperty.get();

if ( constantSize ) {
const moreLessChangeString = currentMass > oldMass ? selfVoicingMoreString : selfVoicingLessString;
const moreLessChangeString = currentMass > oldMass ? voicingMoreString : voicingLessString;
const densityChangeString = StringUtils.fillIn( briefDensityChangeForceAlertPatternString, {
densityChange: moreLessChangeString,
forceChange: biggerSmallerChangeString
Expand All @@ -206,7 +206,7 @@ class GravityForceLabAlertManager extends ISLCAlertManager {
else {

// forces are shown, read the new force value too
const newForceString = StringUtils.fillIn( selfVoicingBriefNewForcePatternString, {
const newForceString = StringUtils.fillIn( voicingBriefNewForcePatternString, {
value: valueString
} );
alert = StringUtils.fillIn( briefMassChangeAlertPatternString, {
Expand All @@ -217,13 +217,13 @@ class GravityForceLabAlertManager extends ISLCAlertManager {
}
else {
if ( forceValuesShown ) {
alert = StringUtils.fillIn( selfVoicingBriefMassChangeForceAlertWithValuePatternString, {
alert = StringUtils.fillIn( voicingBriefMassChangeForceAlertWithValuePatternString, {
forceChange: biggerSmallerChangeString,
value: valueString
} );
}
else {
alert = StringUtils.fillIn( selfVoicingBriefMassChangeForceAlertPatternString, {
alert = StringUtils.fillIn( voicingBriefMassChangeForceAlertPatternString, {
forceChange: biggerSmallerChangeString
} );
}
Expand All @@ -247,26 +247,26 @@ class GravityForceLabAlertManager extends ISLCAlertManager {

let newForceString;
if ( forceValuesShown ) {
newForceString = StringUtils.fillIn( selfVoicingBriefMassChangeForceAlertWithValuePatternString, {
forceChange: selfVoicingBiggerString,
newForceString = StringUtils.fillIn( voicingBriefMassChangeForceAlertWithValuePatternString, {
forceChange: voicingBiggerString,
value: valueString
} );
}
else {
newForceString = StringUtils.fillIn( selfVoicingBriefMassChangeForceAlertPatternString, {
forceChange: selfVoicingBiggerString
newForceString = StringUtils.fillIn( voicingBriefMassChangeForceAlertPatternString, {
forceChange: voicingBiggerString
} );
}

const pushAlertString = StringUtils.fillIn( selfVoicingBriefMassPushAlertPatternString, {
const pushAlertString = StringUtils.fillIn( voicingBriefMassPushAlertPatternString, {
object1: this.forceDescriber.getObjectLabelFromEnum( objectEnum ),
object2: this.forceDescriber.getOtherObjectLabelFromEnum( objectEnum ),
direction: this.massDescriber.getPushDirectionText( ISLCObjectEnum.getOtherObjectEnum( objectEnum ) ),
forceAlert: newForceString
} );

const valueText = this.massDescriber.getMassAndUnit( objectEnum );
return StringUtils.fillIn( selfVoicingBriefPositionChangeInteractionPatternString, {
return StringUtils.fillIn( voicingBriefPositionChangeInteractionPatternString, {
valueText: valueText,
forceAlert: pushAlertString
} );
Expand Down

0 comments on commit 1c05473

Please sign in to comment.