Skip to content

Commit

Permalink
added code that allows autoAnswer to be used independently of asserti…
Browse files Browse the repository at this point in the history
…ons, but to still prevent it from appearing in a production release, see #111
  • Loading branch information
jbphet committed Nov 4, 2015
1 parent c10afc3 commit 520edd7
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 10 deletions.
3 changes: 2 additions & 1 deletion js/common/model/ArithmeticModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ define( function( require ) {
this.initAnswerSheet( this.levelModels[ level ].tableSize );
this.nextProblem();

if ( assert && window.phet.chipper.getQueryParameters().hasOwnProperty( 'autoAnswer' ) ) {
// enable auto answer if specified in the query params, but only if this is not a production release
if ( window.phet.joist.sim.version.indexOf( '-' ) > 0 && window.phet.chipper.getQueryParameter( 'autoAnswer' ) ) {
this.autoAnswer();
}
}
Expand Down
3 changes: 0 additions & 3 deletions js/divide/model/DivideModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ define( function( require ) {
* @protected
*/
autoAnswer: function() {
if ( !assert ) {
throw new Error( 'the autoAnswer function was called in a built version, this should never occur' );
}
var self = this;
var numQuestions = this.answerSheet.length * this.answerSheet[ 0 ].length;
var numQuestionsToAnswer = numQuestions - 1;
Expand Down
3 changes: 0 additions & 3 deletions js/factor/model/FactorModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ define( function( require ) {
* @protected
*/
autoAnswer: function() {
if ( !assert ) {
throw new Error( 'the autoAnswer function was called in a built version, this should never occur' );
}
var self = this;
var numQuestions = this.answerSheet.length * this.answerSheet[ 0 ].length;
var numQuestionsToAnswer = numQuestions - 1;
Expand Down
3 changes: 0 additions & 3 deletions js/multiply/model/MultiplyModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ define( function( require ) {
* @protected
*/
autoAnswer: function() {
if ( !assert ) {
throw new Error( 'the autoAnswer function was called in a built version, this should never occur' );
}
var self = this;
var numQuestions = this.answerSheet.length * this.answerSheet[ 0 ].length;
var numQuestionsToAnswer = numQuestions - 1;
Expand Down

0 comments on commit 520edd7

Please sign in to comment.