<commit_before>// Copyright 2002-2013, University of Colorado Boulder

/**
 * One page of paginator for the 'Build a Fraction'.
 * Contains buttons for choosing different levels.
 *
 * @author <NAME> (Mlearner)
 */

define( function( require ) {
  "use strict";

  // imports
  var inherit = require( 'PHET_CORE/inherit' ),
    Node = require( 'SCENERY/nodes/Node' ),
    HBox = require( 'SCENERY/nodes/HBox' ),
    VBox = require( 'SCENERY/nodes/VBox' ),
    LevelButtonNode = require( 'FRACTION_COMMON/paginator/LevelButtonNode' ),
    ShapeNode = require( 'FRACTION_COMMON/shapes/ShapeNode' );

  function Page1Node( pages, number, targetProperty, pageProperty, scoreArray ) {
    var self = this, hBoxTop = new HBox( {spacing: 20} ),
      hBoxBottom = new HBox( {spacing: 20} ),
      vBox = new VBox( {x: -25, spacing: 20, children: [hBoxTop, hBoxBottom]} );

    Node.call( this );
    this.addChild( vBox );

    // add level buttons
    for ( var i = 0; i < pages.length; i++ ) {
      var levelNumber = i + number * pages.length;
      (i >= pages.length / 2 ? hBoxBottom : hBoxTop).addChild( new LevelButtonNode( {
        width: pages[i].width || 90,
        height: pages[i].height || 150,
        starCount: number > 0 ? 4 : 3,
        label: pages[i].label,
        shape: new ShapeNode( _.assign( {
          numerator: 1,
          denominator: 1,
          x: 0,
          y: -5,
          width: 50,
          height: 50
        }, pages[i].shape ) ),
        callback: getCallback( targetProperty, pages[i].value )
      }, scoreArray[levelNumber]) );
      (i >= pages.length / 2 ? hBoxBottom : hBoxTop).updateLayout();
      vBox.updateLayout();
    }

    if ( pageProperty ) {
      pageProperty.link( function( page ) {
        self.setVisible( (page === number) );
      } );
    }
  }

  var getCallback = function( targetProperty, value ) {
    return function() {targetProperty.set( value );};
  };

  return inherit( Node, Page1Node );
} );<commit_msg>internal QA, change paginator blocks positions<commit_after>// Copyright 2002-2013, University of Colorado Boulder

/**
 * One page of paginator for the 'Build a Fraction'.
 * Contains buttons for choosing different levels.
 *
 * @author <NAME> (Mlearner)
 */

define( function( require ) {
  "use strict";

  // imports
  var inherit = require( 'PHET_CORE/inherit' ),
    Node = require( 'SCENERY/nodes/Node' ),
    HBox = require( 'SCENERY/nodes/HBox' ),
    VBox = require( 'SCENERY/nodes/VBox' ),
    LevelButtonNode = require( 'FRACTION_COMMON/paginator/LevelButtonNode' ),
    ShapeNode = require( 'FRACTION_COMMON/shapes/ShapeNode' );

  function Page1Node( pages, number, targetProperty, pageProperty, scoreArray ) {
    var self = this, hBoxTop = new HBox( {spacing: 45} ),
      hBoxBottom = new HBox( {spacing: 45} ),
      vBox = new VBox( {x: -25, spacing: 30, children: [hBoxTop, hBoxBottom]} );

    Node.call( this );
    this.addChild( vBox );

    // add level buttons
    for ( var i = 0; i < pages.length; i++ ) {
      var levelNumber = i + number * pages.length;
      (i >= pages.length / 2 ? hBoxBottom : hBoxTop).addChild( new LevelButtonNode( {
        width: pages[i].width || 90,
        height: pages[i].height || 150,
        starCount: number > 0 ? 4 : 3,
        label: pages[i].label,
        shape: new ShapeNode( _.assign( {
          numerator: 1,
          denominator: 1,
          x: 0,
          y: -5,
          width: 50,
          height: 50
        }, pages[i].shape ) ),
        callback: getCallback( targetProperty, pages[i].value )
      }, scoreArray[levelNumber]) );
      (i >= pages.length / 2 ? hBoxBottom : hBoxTop).updateLayout();
      vBox.updateLayout();
    }

    if ( pageProperty ) {
      pageProperty.link( function( page ) {
        self.setVisible( (page === number) );
      } );
    }
  }

  var getCallback = function( targetProperty, value ) {
    return function() {targetProperty.set( value );};
  };

  return inherit( Node, Page1Node );
} );
{'fraction_non_alphanumeric': 0.14085564173129847, 'fraction_numerical': 0.018513885414060547, 'mean_word_length': 2.569642857142857, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7358878', 'n_tokens_mistral': 1345, 'n_tokens_neox': 1260, 'n_words': 341}