<commit_before># Mindleaps Tracker
[![Build Status](https://travis-ci.org/MindLeaps/tracker.svg?branch=master)](https://travis-ci.org/MindLeaps/tracker) [![security](https://hakiri.io/github/MindLeaps/tracker/master.svg)](https://hakiri.io/github/MindLeaps/tracker/master)
[![Coverage Status](https://coveralls.io/repos/github/MindLeaps/tracker/badge.svg?branch=master)](https://coveralls.io/github/MindLeaps/tracker?branch=master)

This software is responsible for keeping track of Students and Groups and for facilitating grading.

## Getting started

1. Install [rvm](https://rvm.io/)
    ```sh
    gpg --keyserver hkp://keys.gnupg.net --recv-keys <KEY>
    curl -sSL https://get.rvm.io | bash -s stable
    ```

2. Clone the Repo
    ```sh
    git clone https://github.com/MindLeaps/tracker.git
    ```
    
3. Install Ruby version required by MindLeaps Tracker
    ```bash
    cd tracker
    rvm install `cat ./.ruby-version`
    ```

4. Install Bundler
    ```sh
    gem install bundler
    ```
    
5. Install all gems
    ```sh
    bundle install
    ```
    
6. Install Postgres and Phantomjs. On OS X you can use [brew](http://brew.sh/)
    ```sh
    brew install postgresql
    brew install phantomjs
    ```

7. Create and seed the database
    ```sh
    rake db:create
    rake db:seed
    ```

8. Uncomment the following in BaseController to skip auth in development

    ```
    /app/controllers/base_controller.rb
    
      # Uncomment this to skip authentication in development
      # def authenticate_user!
      #   return true if Rails.env.development?
      #
      #   raise SecurityError
      # end
      #
      # def current_user
      #   raise SecurityError unless Rails.env.development?
      #
      #   user = User.find_or_create_by!(email: '<EMAIL>')
      #   user.add_role :super_admin
      #   user
      # end
    ```
    
9. Start the app with
    ```sh
        > rails s
    ```
    
10. Alternatively, if you have google authentication set up, you don't have to skip authentication and Start the rails server with Google client ID and secret in the environment for OAuth.
    ```sh
    GOOGLE_CLIENT_ID={your_google_client_id} GOOGLE_CLIENT_SECRET={your_google_client_secret} rails s
    ``` 
    
Finally, point your browser to http://localhost:3000

You can test the application by running:
```sh
rake test
```
<commit_msg>Added instructions for running analytics<commit_after># Mindleaps Tracker
[![Build Status](https://travis-ci.org/MindLeaps/tracker.svg?branch=master)](https://travis-ci.org/MindLeaps/tracker) [![security](https://hakiri.io/github/MindLeaps/tracker/master.svg)](https://hakiri.io/github/MindLeaps/tracker/master)
[![Coverage Status](https://coveralls.io/repos/github/MindLeaps/tracker/badge.svg?branch=master)](https://coveralls.io/github/MindLeaps/tracker?branch=master)

This software is responsible for keeping track of Students and Groups and for facilitating grading.

## Getting started

1. Install [rvm](https://rvm.io/)
    ```sh
    gpg --keyserver hkp://keys.gnupg.net --recv-keys <KEY>
    curl -sSL https://get.rvm.io | bash -s stable
    ```

2. Clone the Repo
    ```sh
    git clone https://github.com/MindLeaps/tracker.git
    ```
    
3. Install Ruby version required by MindLeaps Tracker
    ```bash
    cd tracker
    rvm install `cat ./.ruby-version`
    ```

4. Install Bundler
    ```sh
    gem install bundler
    ```
    
5. Install all gems
    ```sh
    bundle install
    ```
    
6. Install Postgres and Phantomjs. On OS X you can use [brew](http://brew.sh/)
    ```sh
    brew install postgresql
    brew install phantomjs
    ```

7. Create and seed the database
    ```sh
    rake db:create
    rake db:seed
    ```

8. Uncomment the following in BaseController to skip auth in development

    ```
    /app/controllers/base_controller.rb
    
      # Uncomment this to skip authentication in development
      # def authenticate_user!
      #   return true if Rails.env.development?
      #
      #   raise SecurityError
      # end
      #
      # def current_user
      #   raise SecurityError unless Rails.env.development?
      #
      #   user = User.find_or_create_by!(email: '<EMAIL>')
      #   user.add_role :super_admin
      #   user
      # end
    ```
    
9. Start the app with
    ```sh
        > rails s
    ```
    
10. Alternatively, if you have google authentication set up, you don't have to skip authentication and Start the rails server with Google client ID and secret in the environment for OAuth.
    ```sh
    GOOGLE_CLIENT_ID={your_google_client_id} GOOGLE_CLIENT_SECRET={your_google_client_secret} rails s
    ``` 
    
Finally, point your browser to http://localhost:3000

You can test the application by running:
```sh
rake test
```

## Running MindLeaps Tracker with Analytics

Analytics engine is located in a separate repository:

1. Clone the Analytics repository (put it somewhere outside of tracker repo): https://github.com/MindLeaps/Tracker-Analytics

2. Start Tracker by running

    ```sh
        MINDLEAPS_ANALYTICS_PATH={path to where you cloned analytics repo} bundle exec rails s
    ```

{'fraction_non_alphanumeric': 0.1111111111111111, 'fraction_numerical': 0.006237816764132553, 'mean_word_length': 2.890068233510235, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 19, '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': '388264', 'n_tokens_mistral': 1657, 'n_tokens_neox': 1559, 'n_words': 463}