Skip to content
GradeCraft is a gameful learning management system, intended to help motivate students to be more engaged in their own learning.
Ruby HTML CoffeeScript CSS JavaScript Dockerfile
Branch: master
Clone or download
ebarroso7 Merge pull request #4356 from UM-USElab/README-ubuntu-installation-in…
…structions

Add installation instructions for Ubuntu in README.md
Latest commit 7b6e8f4 Aug 22, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Update PULL_REQUEST_TEMPLATE.md Mar 21, 2017
app Merge pull request #4350 from UM-USElab/student-logged-grade-no-optio… Aug 22, 2019
bin Run app:update, add bootsnap Aug 2, 2018
config
coverage/assets/0.10.0 updated gitignore Jul 21, 2015
db Changed db/schema.rb to show only changes for current migration Jul 9, 2019
doc Move public images to asset pipeline Aug 2, 2018
lib Also send log message for job to Rollbar Dec 20, 2018
log Initial rails install Nov 9, 2011
make
public Move public images to asset pipeline Aug 2, 2018
script And Mar 2, 2016
spec Merge pull request #4283 from UM-USElab/student-progress-bar-customiz… Aug 6, 2019
test/mailers/previews adding in work from shameeks notification branch Nov 9, 2018
vendor/assets Proxima Nova license & other fun things 🥟 Aug 21, 2018
.autotest Switch from single to double quotes Feb 25, 2016
.codeclimate.yml Ignore breadcrumb_trail Feb 15, 2018
.csslintrc Code climate CLI Dec 13, 2015
.env.sample Add recaptcha to trial creation form Mar 26, 2018
.eslintrc Code climate CLI Dec 13, 2015
.gitconfig Updates to student dashboard and submission process Jul 16, 2013
.gitignore WORK IN PROGRESS, added some tests, changed some models Nov 9, 2018
.rspec Require spec_helper instead of base_spec_helper Oct 27, 2015
.rubocop.yml
Dockerfile Update Dockerfile Feb 7, 2019
Gemfile Updates mini_magick gem version Jul 18, 2019
Gemfile.lock Updates mini_magick gem version Jul 18, 2019
LICENSE Added license Nov 1, 2012
Procfile Remove deprecated argument Jun 5, 2018
README.md Changed installation instructions for mongodb, redis and postgresql t… Aug 20, 2019
Rakefile Set persist true on scheduled job Jan 26, 2018
ReleaseNotes.md
coffeelint.json coffescript cleanup Feb 7, 2017
config.ru Switch from single to double quotes Feb 25, 2016
root refactored grade_status concern spec Apr 4, 2017
run.sh Remove references to old config files Oct 18, 2016

README.md

Gradecraft is a gameful learning management system.

Codeship Status for UM-USElab/gradecraft-development

Test Coverage

Code Climate

Current features:

  • Badges
  • Teams (course-long memberships)
  • Groups (single-assignment memberships)
  • Assignments
  • Assignment Submissions
  • Assignment Unlocks
  • Student Dashboard
  • Interactive Grade Predictor
  • Interactive Course Timeline
  • Grading Rubrics
  • Export students and final grades
  • User analytics
  • Team analytics
  • Learning analytics suite
  • Custom, multi-component leveling system
  • Assignment stats
  • Student-logged assignment scoring
  • Multipliers (students decide assignment weight)

Pre-reqs:

  • Ruby 2.5.3
  • PostgreSQL
  • MongoDB
  • Redis

Installation Notes for running locally

  1. Clone the repository
# clone to current directory; change dir
git clone https://github.com/UM-USElab/gradecraft-development.git
cd gradecraft-development
  1. Copy configuration files
# Note: ensure that you are in the newly cloned /gradecraft-development dir
cp config/database.yml.sample config/database.yml
cp config/mongoid.yml.sample config/mongoid.yml
cp .env.sample .env

# obtain and replace required credentials for .env (AWS, etc.)

# comment out ALL SAML and IDP-related lines
  1. Install Homebrew (Optional: brew update)

  2. Install a Ruby version manager of your choice and set current version to project version (Steps below pertain to rbenv)

  • Use brew install rbenv to install rbenv on MacOS and run the following

  • Use these instructions instead of the method above for installing rbenv if using Ubuntu and run the following

# run command and follow instructions, will likely be the next step where you edit ~/.bash_profile
rbenv init

# make rbenv start up with terminal
edit ~/.bash_profile and add eval "$(rbenv init -)"

# optional (rbenv doctor script to check installation)
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash

# install and set the current version
rbenv install 2.5.3 (or whatever version Gradecraft is on)
rbenv local 2.5.3 (or rbenv global 2.5.3 if preferred)

# Restart terminal for changes to fully take into effect and ensure that the command rbenv works
  1. Install databases
  • On MacOS use the following:
brew install mongodb
brew install redis
brew install postgresql
  • On Ubuntu use the following:
sudo apt-get install mongodb
sudo apt-get install redis
sudo apt-get install postgresql
  1. Ensure access to /data/db write directory for MongodDB
# create the directory, if it does not exist
sudo mkdir -p /data/db
sudo chown -R {user} /data/db (replace user; can ls -l to determine value)

# (optional) mongod command should bring up mongodb; close with ctrl+c before proceeding to step 5
  1. Install Bundler
# install Bundler version specified in Gemfile.lock to avoid conflicts
gem install bundler -v 1.17.3
  1. Install project dependencies
bundle (or bundle install)
  • When installing on Ubuntu, make sure dependencies for all the gems are installed first by running the following
# For timfel-krb5-auth
sudo apt-get install -y libpam-krb5 libkrb5-dev

# For pg
sudo apt-get install libpq-dev

# Ensuring there is an ExecJS runtime
sudo apt-get install nodejs 
  1. Start Postgres database and ensure it is running on port 5432 (Optional: Download and run with Postgres.app for Mac OS)
  • Use the following to start Postgres on Ubuntu
sudo /etc/init.d/postgresql start
  • Before starting the Postgres database on Ubuntu, ensure the pg_hba.conf file as located at /etc/postgresql/<version>/main/pg_hba.conf (where <version> is the version number of Postgres installed) has the following contents (the file has to be edited as root):
# Database administrative login by Unix domain socket
local   all             postgres                                peer

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres        127.0.0.1/32            md5
#host    replication     postgres        ::1/128                 md5
  • Restart the Postgres server using the following
sudo service postgresql restart

To edit the file use the following:

  1. Create and populate databases with sample data
bundle exec rails db:create

# optional
bundle exec rails db:sample
  1. Done! Run foreman start to begin

Additional Notes

  • Don't sudo gem install, as it will install gems in a way that does not work properly with rbenv. If using rbenv as the version manager, you may need to ensure that proper read/write permissions are granted for /Users/{user}/.rbenv

  • See db/samples.rb for dev usernames and passwords

Testing Emails Locally

  1. gem install mailcatcher
  2. Run mailcatcher in terminal
  3. Visit http://127.0.0.1:1080. Emails are routed through to the web interface.

Modify action_mailer config settings in development.rb if needed

Linting code

Note: Both rubocop and coffeelint are installed directly on your machine, as they are not required for development, and thus are not specified within the gemfile or node package.

To lint ruby:

Install rubocop:

gem install rubocop

then

$ rubocop [path/to/file.rb]

To lint coffeescript:

Install coffeelint:

npm install -g coffeelint

to lint all files in javascripts/

rake lint:js

to lint a directory:

coffeelint -f coffeelint.json path/to/directory

to lint a single file:

coffeelint -f coffeelint.json path/to/file.coffee

To lint javascript:

Install jslint:

npm install -g eslint

to lint the javacripts directory:

eslint ./app/assets/javascripts --ext .js

Running specs

To run all of the spec examples, you can run the following (this is also the default rake task):

bundle exec rails spec

To run all of the spec examples with code coverage, you can run the following:

bundle exec rails spec:coverage

Contributing

  1. Clone the repository git clone https://github.com/UM-USElab/gradecraft-development
  2. Create a feature branch git checkout -b my-awesome-feature
  3. Code!
  4. Commit your changes (small commits please)
  5. Push your new branch git push origin my-awesome-feature
  6. Create a pull request hub pull-request -b um-uselab:master -h um-uselab:my-awesome-feature
You can’t perform that action at this time.