Grit is a android tablet based learning platform that is targeted as a complementary way of learning for kids that already attend school. We currently target 7" tablets and grit is running in landscape mode.
Grit is built using Apache Cordova. Grit provides an application launcher for a selected group of childrens education games. The games are organised into levels and students have to complete a maths quiz to unlock each level.
To contribute to Grit, introduce yourself on the mailing list https://groups.google.com/forum/?fromgroups#!forum/grit-learning
This repository contains the source code for the web app. The quiz content is in a separate repository.
Before you install grit you need to:
Install the android developer tools
Install node.js (version 0.10.0 or greater)
brew install node
If you are unsure which option is best or are unfamiliar with package management on your platform, you should use http://nodejs.org
Setup grunt
grunt-cli
globally by running npm install -g grunt-cli
(full instructions here: http://gruntjs.com/getting-started) node_modules
dir) so you shouldn't need anything else.grunt --help
and check that it runs without error. Also it's output tells you what tasks are available.Setup http-server
npm install -g http-server
to install a minimal http-server that you can invoke from the command line. We will use this web server to serve files from grit
to our browser for debugging etc. http-server --help
to see a summary of it's options.Setup bower (optional)
npm
. bower_components
directory in the grit
repository.Setup JSONLint (optional)
Grit is currently split across two git repositories. It is best explained by an example:
Let us say that you keep source code on your machine in /home/code
. You would do the following
Clone the grit
repository into a directory in /home/code
e.g.
$ cd /home/code
$ git clone https://github.com/GritLearning/grit
Next, clone the grit-khmer repository into a directory called content
within the wwwsrc repository e.g.
$ cd /home/code/grit/wwwsrc
$ git clone https://github.com/GritLearning/grit-khmer content
Build grit using grunt & cordova.
Now we need to build grit into the grit-android/assets/www
directory so we run grunt with a command line arg to tell it where to put the files.
$ cd /home/code/grit/wwwsrc
$ grunt # this builds the files from wwwsrc into www
$ cd ..
$ cordova build # this creates a debug APK for grit in platforms/android/bin/Grit-debug.apk
Grit should be ready to deploy to your device now. Read the cordova documentation to learn how to use the `cordova' command line tool.
In a separate terminal window, start a HTTP server to serve the files to the browser
$ cd /path/to/grit
$ http-server ./www
# http-server will output some text here including the URL it is listening on
http://localhost:8080
. You should now see the grit web app and be able to debug it as you would any other web app.To save yourself from having to run grunt every time you change a file, you can run grunt watch
which will notice file changes and re-run the build. From your terminal window, run grunt watch
from the project directory.
$ cd /path/to/grit
$ grunt watch
Now when you edit grit files. grunt watch
will notice those changes and re-build the project into the ./www
directory by default
You can pass some command line arguments to grunt
to customise how it builds the project. For example:
# these are the defaults options but you can override them.
$ grunt --env=development --platform=android --build-dir=./www
# For example, to
# build the project into a different directory (e.g. the assets directory of the
# android project) you could do something like:
$ grunt --env=development --platform=android --build-dir=../grit-android/assets/www
Have a look at Gruntfile.js
for the full list of options and their meanings.
To run the tests:
$ cd /path/to/grit
$ grunt unit # runs all unit tests through karma
$ grunt e2e # runs all end-to-end tests through protractor & webdriver
$ grunt test # run both unit tests and end-to-end tests