<commit_before><h1 align="center">ETMobile</h1>
<p align="center">A simple mobile interface for the Energy Transition Model.</p>

<p align="center">
  <a href="https://travis-ci.org/quintel/etmobile"><img alt="Master branch build status" src="https://img.shields.io/travis/quintel/etmobile/master.svg" /></a>

  <a href="https://codecov.io/gh/quintel/etmobile"><img alt="Code coverage status" src="https://img.shields.io/codecov/c/github/quintel/etmobile/master.svg" /></a>
</p>

## Quick start guide

1. The development version of ETMobile requires that you have Node.js installed.
   macOS users with [Homebrew][homebrew] can install Node.js easily:

   ```sh
   brew update
   brew install node
   ```

   If you already have Node.js installed, please check the version by running
   `node -v`; version 6 or newer is required. Older versions may be updated by
   running:

   ```sh
   brew update
   brew upgrade node
   ```

2. Install [Yarn][yarn]:

   ```sh
   npm install yarn -g
   ```

3. Finally, using Yarn, install the ETMobile dependencies:

   ```sh
   yarn
   ```

   You may re-run this command in the future to install any new or updated
   dependencies (which will show up as "Module not found: ...") error messages
   in the application.

You may now run the development version of ETMobile with `npm start`. The tests
can be performed with `npm test` and `npm run coverage`.

Developers may refer to the [Create React App documentation][cra].

## Adding, updating, and removing questions

The list of questions and choices which are presented to visitors can be found
in **src/data/questions.js**.

ETMobile pre-calculates the outcome to each choice which a visitor may select,
storing the results in **src/data/answers.js**. This file is not meant to be
directly edited, but is generated by running `npm run build-answers`.

The following actions require that `answers.js` be rebuilt:

* Adding or removing a new question
* Adding, removing, or reordering choices for a question
* Changing the `inputs`, or `inputs` values for a choice

### Adding a question

Visitors are shown questions in a random order, so new questions should be
inserted at the bottom of the file. A question is defined like so:

```js
{
  code: 'unique_key',
  name: 'Question title',
  choices: [
    {
      name: 'Choice A',
      icon: 'imageName',
      inputs: {
        input_key_one: 2.0,
        input_key_two: 4.0
      }
    },
    {
      name: 'Choice B',
      icon: 'imageName',
      inputs: {
        input_key_three: 8.0
      }
    }
  ],
  description: {
    __html: `
      <p>
        A description of the question; this text is shown under the icons on the
        question page, immediately preceding the two choice buttons.
      </p>
    `
  }
}
```

#### Question `code`, `name`, and `description`

The question `code` should uniquely identify the question; you may choose any
value. `name` and `description` are texts shown to the visitor on the question
page.

#### Choice `name`

The choice name appears on the button, which the visitor may press to make their
selection.

#### Choice `icon`

Each choice has an `icon` field defining which image should be shown to
represent the choice. These images can be found in **src/images/choices**. The
value of the `icon` field should match the name of one of these images,
*without* the ".svg" extension and changing under_score_names to camelCaseNames.

For example, if you wish to show "electric_vehicle.svg", the `icon` value should
be "electricVehicle".

If you add a new icon, be sure to add it's name to
**src/images/choices/index.js**.

#### Choice `inputs`

A map of ETSource input keys and values which are applied to the scenario when
the visitor makes their choice.

[homebrew]: http://brew.sh
[yarn]: https://yarnpkg.com
[cra]: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md<commit_msg>Grammar fix in README<commit_after><h1 align="center">ETMobile</h1>
<p align="center">A simple mobile interface for the Energy Transition Model.</p>

<p align="center">
  <a href="https://travis-ci.org/quintel/etmobile"><img alt="Master branch build status" src="https://img.shields.io/travis/quintel/etmobile/master.svg" /></a>

  <a href="https://codecov.io/gh/quintel/etmobile"><img alt="Code coverage status" src="https://img.shields.io/codecov/c/github/quintel/etmobile/master.svg" /></a>
</p>

## Quick start guide

1. The development version of ETMobile requires that you have Node.js installed.
   macOS users with [Homebrew][homebrew] can install Node.js easily:

   ```sh
   brew update
   brew install node
   ```

   If you already have Node.js installed, please check the version by running
   `node -v`; version 6 or newer is required. Older versions may be updated by
   running:

   ```sh
   brew update
   brew upgrade node
   ```

2. Install [Yarn][yarn]:

   ```sh
   npm install yarn -g
   ```

3. Finally, using Yarn, install the ETMobile dependencies:

   ```sh
   yarn
   ```

   You may re-run this command in the future to install any new or updated
   dependencies (which will show up as "Module not found: ...") error messages
   in the application.

You may now run the development version of ETMobile with `npm start`. The tests
can be performed with `npm test` and `npm run coverage`.

Developers may refer to the [Create React App documentation][cra].

## Adding, updating, and removing questions

The list of questions and choices which are presented to visitors can be found
in **src/data/questions.js**.

ETMobile pre-calculates the outcome to each choice which a visitor may select,
storing the results in **src/data/answers.js**. This file is not meant to be
directly edited, but is generated by running `npm run build-answers`.

The following actions require that `answers.js` be rebuilt:

* Adding or removing a new question
* Adding, removing, or reordering choices for a question
* Changing the `inputs`, or `inputs` values for a choice

### Adding a question

Visitors are shown questions in a random order, so new questions should be
inserted at the bottom of the file. A question is defined like so:

```js
{
  code: 'unique_key',
  name: 'Question title',
  choices: [
    {
      name: 'Choice A',
      icon: 'imageName',
      inputs: {
        input_key_one: 2.0,
        input_key_two: 4.0
      }
    },
    {
      name: 'Choice B',
      icon: 'imageName',
      inputs: {
        input_key_three: 8.0
      }
    }
  ],
  description: {
    __html: `
      <p>
        A description of the question; this text is shown under the icons on the
        question page, immediately preceding the two choice buttons.
      </p>
    `
  }
}
```

#### Question `code`, `name`, and `description`

The question `code` should uniquely identify the question; you may choose any
value. `name` and `description` are texts shown to the visitor on the question
page.

#### Choice `name`

The choice name appears on the button, which the visitor may press to make their
selection.

#### Choice `icon`

Each choice has an `icon` field defining which image should be shown to
represent the choice. These images can be found in **src/images/choices**. The
value of the `icon` field should match the name of one of these images,
*without* the ".svg" extension and changing under_score_names to camelCaseNames.

For example, if you wish to show "electric_vehicle.svg", the `icon` value should
be "electricVehicle".

If you add a new icon, be sure to add its name to
**src/images/choices/index.js**.

#### Choice `inputs`

A map of ETSource input keys and values which are applied to the scenario when
the visitor makes their choice.

[homebrew]: http://brew.sh
[yarn]: https://yarnpkg.com
[cra]: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md
{'fraction_non_alphanumeric': 0.10291311537972268, 'fraction_numerical': 0.0030530466861722425, 'mean_word_length': 3.497711670480549, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2158200', 'n_tokens_mistral': 2355, 'n_tokens_neox': 2267, 'n_words': 984}