Skip to content

Commit

Permalink
remove "centers exactly. . ." quantitative clause for BASICS, phetsim…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Feb 2, 2019
1 parent d577814 commit a171287
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
8 changes: 7 additions & 1 deletion js/ISLCA11yStrings.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,14 @@ define( require => {
summaryInteractionHintPattern: {
value: 'Change position and {{massOrCharge}} of spheres to explore.'
},
quantitativeAndQualitativePattern: {
value: '{{qualitativeClause}}{{quantitativeClause}}.'
},
distanceAndValueSummaryPattern: {
value: '{{object1Label}} and {{object2Label}} are {{qualitativeDistance}} each other, centers exactly {{distance}} {{units}} apart.'
value: '{{object1Label}} and {{object2Label}} are {{qualitativeDistance}} each other'
},
centersExactlyPattern: {
value: ', centers exactly {{distance}} {{units}} apart'
},

/******************
Expand Down
22 changes: 19 additions & 3 deletions js/view/describers/PositionDescriber.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ define( require => {

const objectLabelPositionPatternString = ISLCA11yStrings.objectLabelPositionPattern.value; // [object] position
const distanceAndValueSummaryPatternString = ISLCA11yStrings.distanceAndValueSummaryPattern.value;
const centersExactlyPatternString = ISLCA11yStrings.centersExactlyPattern.value;
const quantitativeAndQualitativePatternString = ISLCA11yStrings.quantitativeAndQualitativePattern.value;

const positionDistanceFromOtherObjectPatternString = ISLCA11yStrings.positionDistanceFromOtherObjectPattern.value;
const progressDistanceFromOtherObjectPatternString = ISLCA11yStrings.progressDistanceFromOtherObjectPattern.value;
Expand Down Expand Up @@ -118,14 +120,28 @@ define( require => {
* Returns the string used in the screen summary item displaying position information:
* '{{object1Label}} and {{object2Label}} are {{qualitativeDistance}} each other, centers exactly {{distance}} {{units}} apart.'
*
* @param {boolean} [withoutQuantitative] - whether or not to omit the quantitative clause
* @returns {string}
*/
getObjectDistanceSummary() {
getObjectDistanceSummary( withoutQuantitative ) {
const distance = this.convertedDistance;
const { object1Label, object2Label, qualitativeDistance, units } = this;
return StringUtils.fillIn(

console.log( this.distanceBetween );

const qualitativeClause = StringUtils.fillIn(
distanceAndValueSummaryPatternString,
{ object1Label, object2Label, qualitativeDistance, distance, units }
{ object1Label, object2Label, qualitativeDistance }
);
const quantitativeClause = StringUtils.fillIn(
centersExactlyPatternString,
{ distance, units }
);

return StringUtils.fillIn( quantitativeAndQualitativePatternString, {
qualitativeClause: qualitativeClause,
quantitativeClause: withoutQuantitative ? '' : quantitativeClause
}
);
}

Expand Down

0 comments on commit a171287

Please sign in to comment.