Giter Site home page Giter Site logo

xiaohong-deng / mooqita-icccg Goto Github PK

View Code? Open in Web Editor NEW
1.0 4.0 1.0 494 KB

An online web game for understanding human comprehension

Home Page: https://iccg-team-green.herokuapp.com/

License: BSD 3-Clause "New" or "Revised" License

Ruby 74.29% JavaScript 3.83% CSS 1.84% HTML 11.83% CoffeeScript 3.28% Shell 2.72% Gherkin 2.21%
ruby-on-rails artificial-intelligence action-cable ruby cucumber rspec teaspoon agile-development postgresql heroku-apps

mooqita-icccg's Introduction

Iterative Crowdsourcing Comprehension Challenge Game

TravisCI Maintainability Test Coverage Waffle.io - Columns and their card count

This is a Rails implementation of the ICCG game based on the paper Paritosh, P., & Marcus, G. (2016). Toward a comprehension challenge, using crowdsourcing as a tool. AI Magazine, 37(1), 23-31.

Project Setup with Physical Machine (Recommended)

Note the ruby and node.js versions in this project are locked to 2.4.1 and 8.10.0. If you choose to use gemset with rvm or rbenv the gemset name is locked to iccg. You are welcomed to try the versions you want at your own risk.

Set Up Rails Environment

If you haven't already, please set up your Ruby on Rails development environment. Here is a good reference link Setup Ruby on Rails

Note to install postgresql. This is the database this project uses in development and production environment.

Install Gems

To avoid polluting your default gemset you can either bundle install --path vendor or use gemset functionality that rvm or rbenv provides. Add vendor/ruby to .gitignore if you choose the former. You can choose other directories inside your project root path to install required gems if you like.

Set Up Database

bundle exec rails db:create
bundle exec rails db:migrate
bundle exec rails db:seed

If gems are installed to system default path bundle exec can be omitted.

Install Redis, Yarn and Javascript Dependencies

brew install redis
brew install yarn
bundle exec rails yarn:install

For Mac user remember brew services start redis

If rails yarn:install complains about node version, one way is to do the following

brew install nvm
nvm install VERSION_NUMBER

nvm is node.js version manager that allows you to install multiple versions of node.js

Run Tests

bundle exec rspec
bundle exec cucumber
bundle exec teaspoon

If you install ruby gems inside the project directory you might want to skip the folder such that simplecov does not generate a large report file. You need to add add_filter "FOLDER_OR_FILE_TO_IGNORE" to the block in ./.simplecov. We have done it for you if you choose vendor as the gem install directory.

Run Project Locally in Development Environment

bundle exec rails s

then go to localhost:3000 in your web browser.

Project Setup with Virtual Machine

To ease up the start of the development process, you can use the the project's virtual development environment based on Vagrant.

First Run Usage

  1. Install in your computer the software listed the requirements section.
  2. Clone the repository into your machine.
  3. Run vagrant up and wait for the machine to be built.
  4. When the machine is ready, run vagrant ssh to log into it.
  5. Move into the project directory with cd /vagrant.
  6. Install the project gems with bundle install.
  7. Install the required Node modules with rake yarn:install.
  8. Build the database structure with rails db:schema:load.
  9. Load seed data with rails db:seed.

Now check that everything works with rails s and opening http://localhost:3000 in your browser.

Software Requirements

Project Development

The trunk development style is used on this repo, so follow the next steps to work on new features and fixes:

  • If using the virtual development environment:
    • Start the project's box with 'vagrant up'.
    • Log into the box with vagrant ssh.
    • Move into the project directory with cd /vagrant.
  • Ensure dependencies are up to date:
    • bundle install
    • rake yarn:install
  • Run pending migrations and load seed data:
    • rails db:migrate
    • rails db:seed
  • Create a new branch from the master branch.
  • Try to work on atomic commits related to the feature.
  • Try to add TDD and/or BDD tests for your code.
  • On finish, send a push request targeting the master branch for review.

Testing

This project relies on RSpec, Cucumber, Jasmine and Capybara.

Test Coverage Report

Teaspoon is a JavaScript test runner with various perks. It can generate javascript coverage report. SimpleCov generates ruby coverage report automatically after running RSpec and Cucumber. Generated reports go into ./coverage

Deployment

Manually Deploy to Heroku

First set up Heroku account and Heroku CLI. Then in terminal, login, add SSH keys, and create your app.

heroku login
heroku keys:add
heroku create PROJECT_NAME
heroku addons:add redistogo

Before pushing to heroku, set up your consumer configuration. First run heroku config:set RAILS_HOST=YOUR_APP_URL. In ./config/environments/production.rb do the following

config.action_cable.url = "wss://#{ENV['RAILS_HOST']}/cable"
config.web_socket_server_url = "wss://#{ENV['RAILS_HOST']}/cable"
config.action_cable.allowed_request_origins = [
'127.0.0.1',
/(http|https):\/\/#{ENV['RAILS_HOST']}.*/
]

Then push to heroku and initialize the database.

git push heroku master
heroku run rails db:migrate
heroku run rails db:seed

Try to visit PROJECT_NAME.herokuapp.com to see if everything works.

Automatic Deployment through CI Services

Please refer to the documentation from the service provider of your choice.


mooqita-icccg's People

Contributors

rojo avatar xiaohong-deng avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

waffle-iron

mooqita-icccg's Issues

Better error handling for ajax http request

now we have two controller actions for ajax calls which in successful cases don't serve a html page back, just a html snippet for inserting or a state indicating success.

now the problem is if something wrong happens, what we can do to inform the user something is wrong? redirect_to is not going to work. I haven't tried render and I doubt that would be any better.

one is Answers#update

  def update
    authorize @answer
    if @answer.make_judge_identified!
      ActionCable.server.broadcast "game-#{@answer.question.game_id}: info", { message: "Judge made his choice", message_type: "info" }
      head :ok
    else
      # send from a remote call, so no redirect_to actually
      flash[:alert] = "Judge choice has not been updated."
      redirect_to root_path
    end
  end

note that if authorize @answer fails the error gets handled by a general purpose method, which uses redirect_to

the other is Games#judge

  def judge
    authorize @game
    render layout: false
  end

Question and Answer Models

The tables look like this:
Screen Shot 2017-08-29 at 12.30.54 PM.png

Question public API
n/a

Answer public API

.judge_identified_answer_for(question_object)

  • returns the answer that is judge_identified

#judge_identify!

  • This method will mark the answer as judge_identified
  • Should not allow two answers of the same question to be marked.

#judge_identified? Returns boolean

Game Flow Chart

It will be helpful if one of us can draw a flow chart of the game steps or just write a list of the steps.

authorization steps for all the roles

depending on the player's role, he may or may not see certain info from the game page. he may or may not have access to certain actions in controllers. he may or may not do certain things on the game page. authorization steps based on user roles can be done with gem called pundit

other things also fall in the scope of authorization steps though maybe not the scope of pundit. such as:

  1. hide question and answer displaying areas before any answer is available
  2. hide question and answer input forms after they are sent once
  3. next round button should not be visible before judge chooses the answer he or she thinks is correct.

Allow player to leave a game

On the waiting for players screen, if a player clicks on leave game, the user's clable connection is closed...

image

...and the browser returns to the start game screen.

image

auto set questioner between game cycles

it should happen right after judge gives his call, before any of the guesser and reader enters the next round. auto set it before game starts is easier because players will start the 1st round at the same time. but I gave players the freedom to step to the next round whenever they want. so it can not happen in the controller.

should take caution on this one.

Random Document

To play ICCCG, we need a document to play with.

Here is my suggestion:
The Document should have a method get_random(game) which takes a game instance.

get_random should return a random document that none of the game.players have seen unless it does not have any documents besides that.

allow judge to choose from the answers

judge should be able to choose the 2 answers broadcasted though the game channel.

the choice made should be updated to the entry in database corresponding to the chosen answer

the points gained/lost may or may not be updated. it's not clear to me now. for reader and guesser they can check if their answers from the last round was chosen when they enter the next round. for judge, it may be troublesome to check the last round role of the chosen answer.

model structures may be altered

should present a selecting form to judge

How should model `Game` be implemented?

Anyone is against the idea of having a model called Game?

What your idea on it? Like what attributes it should have. What associations it should have? One association is clear. That is, has_many: users. What about others?

I raise this issue because it's necessary to have a Game model at an early stage. When a user starts a game, a corresponding object should be created. Or should it? Should we create a such object until the game actually is active instead of being waiting others to join?

That also affects the state attribute a Game object has. A game should be in one of waiting, alive, dead states or just alive, dead?

UI bugs

  1. After log in, the drop down menu doesn't show when clicking Account in the upper right corner.
  2. Flash messages are not styled correctly.

Page jumps automated or manually handled by players?

It's a UX question. I tended to choose the latter. I believe Jacob intended the former.

in the game cycles when inputs are synchronized should we redirect players to the next pages automatically or let them click a button to do so? the reason I tend to choose the latter is what if a player leaves his computer for a while and doesn't see what the other players' input?

allow users to resume unfinished game on home page

display a list on home page. it contains all the started but not finished games the user participated in the past. maybe divide the screen to two columns. one for new game button, one for old games list.

What should happen when a player leaves a game in course?

@jwald1 @Xiaohong-Deng I've been poking around a noticed that when a player leaves a game that has already started (currently by requesting other URL on the browser address bar), the other players remain on the game screen.

Also, if the player that left clicks the start game button, it will take him/her to the waiting screen to start a new game. (Which seems OK.)

So the questions are:

  • What should happen on the remaining players' screens when a player leaves (or loses connection)?
  • How can we handle a player rejoining a game? (Should other be able to player take its place?).

enter the gaming cycle

Once there are 3 players in the waiting room, they should be auto redirected to the 1st page of the gaming cycle.

The roles should be assigned to players once they arrive the page, and the questioner should be assigned. Questioner should have input text area on the page. Judge and reader should have doc shown on the page.

The feature is done once 3 players reach the correct pages for them respectively.

Create static home page

It should have game name on the header. It should show login and signup entrances to the users. It should show welcoming messages in the html body.

database level uniqueness

I tried to add unique index to schema by add_index :answers, [:question_id, :judge_choice], unique: true, where: "judge_choice = true". sqlite3 complained no such column: true. changing to judge_choice is true returned the same error.

my version of sqlite3 should correspond to sqlite 3.8.10+ which means it should support partial index.

my intention is when the answer to be updated or created in database, if judge_choice = true, we try to check through unique index if there is already an answer with the same question_id and judge_choice in database. if not then create a unique index for our answer to be updated or created. if yes, then it's violation of uniqueness. database refuses it.

actually I think add_index :answers, :question_id, unique: true, where: "judge_choice = true" suffices because in that case we only add index to :question_id for judge_choice = true. false ones don't have index on their :question_id. so if we find duplicated index it must have judge_choice = true

sad I can't verify this.

btw, you can not omit judge_choice when imposing model level uniqueness using validates. because when the answer meets the condition, it validates against all the answers, including those whose judge_choice = false.

set up cucumber test framework and write test for game-waiting-room if possible

I just learned from other senior rails developers about how to do integration tests on ActionCable. I need to set up the environment and dependencies. This time I want to do it in cucumber. The process could be long and verbose. Doing it in RSpec may be difficult for others to understand.

I'll try to write test for game-waiting-room to see if the framework is set correctly.

javascript callbacks are triggered twice

specifically, it's the code in channels/game.coffee where game channel js client code lives.

All the callbacks are triggered twice. in other words, the fucntions to be executed after callbacks are triggered are called twice. including channel subscription and $(document).ready.

this only happens in test and production environment, not in development environment.

I removed turbolinks cleanly in 3 steps as you can find by searching online. include jquery and rails-ujs exactly once, no jquery-ujs, in application.js. no public/assets exists

Weird redis queue non-emptive behavior in game_waiting_room with my local dev env

Well, for a long time on my local dev env it is when 3 players in the room then it shows 3 on the page. Until today I spotted that my redis queue didn't have a fresh start with size 0 when I ran rails s.

Today when I started a game as the first user, it showed 2 players in the room. I manually emptied it. then I added 3 players. something that never happened happened. one player jumped to another page. the other 2 stayed in waiting room, showing 0 players in the room.

strange thing is before today, each time I enter the room as a player the number shown was always right, just it didn't jump when the room was full.

update players scores

one good time point for doing this is right after the players click the button "Next Round". remember to flash the player about whether he or she lost or gained a point.

ActionCable related problems

All ac problems go here.

The probelms I have now are

  1. if we have many chat rooms and only one defined message_channel and stream_from 'messages', how do we make sure only users in chatroom A see messages from users in the room, not from users of other rooms. Also how they ensure they don't send their messages to other rooms?
  2. What are the important variables or objects in a particular channel? In which methods i can access them? For example I want to access 'messages' from stream_from 'messages' that sits in redis.

Game Round

A Game has_many rounds. This model will handle the round

show "user is typing" message

to make the game more engaging, we can implement this slack feature for the game.

it's straight forward to implement, just monitor all keystrokes, and fire actioncable broadcast.

message should be "question is being typed" or "answer is being typed".

show the status of players in the game

on the game page, show a list of players with their status like this
guesser (online or offline or busy)
judge (online or offline or busy)
reader (online or offline or busy)

since the game can be played asynchronously, surely players want to know if other players are with them or not to avoid unnecessary idle time.

First deploy on Heroku

The first attempt to do a deploy on Heroku failed. Seems to be a problem related to the use of yarn. Will open a fix branch and work on it later, but here is the console output:

± % git push heroku master                                                                                                                                                                               !46
Counting objects: 771, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (434/434), done.
Writing objects: 100% (771/771), 112.23 KiB | 0 bytes/s, done.
Total 771 (delta 391), reused 597 (delta 288)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote:  !     Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
remote: 			Detected buildpacks: Ruby,Node.js
remote: 			See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.4.1
remote: -----> Installing dependencies using bundler 1.15.2
remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote:        Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.15.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote:        Fetching gem metadata from https://rubygems.org/.........
remote:        Fetching version metadata from https://rubygems.org/..
remote:        Fetching dependency metadata from https://rubygems.org/.
remote:        Fetching rake 12.0.0
remote:        Fetching concurrent-ruby 1.0.5
remote:        Fetching i18n 0.8.6
remote:        Installing i18n 0.8.6
remote:        Installing rake 12.0.0
remote:        Installing concurrent-ruby 1.0.5
remote:        Fetching minitest 5.10.3
remote:        Fetching thread_safe 0.3.6
remote:        Installing minitest 5.10.3
remote:        Installing thread_safe 0.3.6
remote:        Fetching builder 3.2.3
remote:        Fetching erubi 1.6.1
remote:        Installing erubi 1.6.1
remote:        Installing builder 3.2.3
remote:        Fetching mini_portile2 2.2.0
remote:        Installing mini_portile2 2.2.0
remote:        Fetching rack 2.0.3
remote:        Fetching nio4r 2.1.0
remote:        Fetching websocket-extensions 0.1.2
remote:        Installing nio4r 2.1.0 with native extensions
remote:        Installing websocket-extensions 0.1.2
remote:        Fetching mime-types-data 3.2016.0521
remote:        Installing rack 2.0.3
remote:        Installing mime-types-data 3.2016.0521
remote:        Fetching arel 8.0.0
remote:        Installing arel 8.0.0
remote:        Fetching execjs 2.7.0
remote:        Fetching bcrypt 3.1.11
remote:        Installing execjs 2.7.0
remote:        Installing bcrypt 3.1.11 with native extensions
remote:        Fetching rb-fsevent 0.10.2
remote:        Installing rb-fsevent 0.10.2
remote:        Fetching ffi 1.9.18
remote:        Installing ffi 1.9.18 with native extensions
remote:        Using bundler 1.15.2
remote:        Fetching coffee-script-source 1.12.2
remote:        Installing coffee-script-source 1.12.2
remote:        Fetching method_source 0.8.2
remote:        Installing method_source 0.8.2
remote:        Fetching thor 0.19.4
remote:        Installing thor 0.19.4
remote:        Fetching orm_adapter 0.5.0
remote:        Installing orm_adapter 0.5.0
remote:        Fetching pg 0.21.0
remote:        Installing pg 0.21.0 with native extensions
remote:        Fetching puma 3.9.1
remote:        Installing puma 3.9.1 with native extensions
remote:        Fetching redis 3.3.3
remote:        Installing redis 3.3.3
remote:        Fetching tilt 2.0.8
remote:        Installing tilt 2.0.8
remote:        Fetching tzinfo 1.2.3
remote:        Installing tzinfo 1.2.3
remote:        Fetching nokogiri 1.8.0
remote:        Installing nokogiri 1.8.0 with native extensions
remote:        Fetching websocket-driver 0.6.5
remote:        Installing websocket-driver 0.6.5 with native extensions
remote:        Fetching mime-types 3.1
remote:        Installing mime-types 3.1
remote:        Fetching rack-test 0.6.3
remote:        Installing rack-test 0.6.3
remote:        Fetching warden 1.2.7
remote:        Installing warden 1.2.7
remote:        Fetching sprockets 3.7.1
remote:        Installing sprockets 3.7.1
remote:        Fetching autoprefixer-rails 7.1.2.6
remote:        Installing autoprefixer-rails 7.1.2.6
remote:        Fetching uglifier 3.2.0
remote:        Installing uglifier 3.2.0
remote:        Fetching coffee-script 2.4.1
remote:        Installing coffee-script 2.4.1
remote:        Fetching rb-inotify 0.9.10
remote:        Installing rb-inotify 0.9.10
remote:        Fetching redis-unique-queue 1.0.3
remote:        Installing redis-unique-queue 1.0.3
remote:        Fetching activesupport 5.1.3
remote:        Installing activesupport 5.1.3
remote:        Fetching mail 2.6.6
remote:        Installing mail 2.6.6
remote:        Fetching sass-listen 4.0.0
remote:        Installing sass-listen 4.0.0
remote:        Fetching globalid 0.4.0
remote:        Installing globalid 0.4.0
remote:        Fetching activemodel 5.1.3
remote:        Installing activemodel 5.1.3
remote:        Fetching sass 3.5.1
remote:        Installing sass 3.5.1
remote:        Fetching activejob 5.1.3
remote:        Installing activejob 5.1.3
remote:        Fetching activerecord 5.1.3
remote:        Installing activerecord 5.1.3
remote:        Fetching bootstrap-sass 3.3.7
remote:        Installing bootstrap-sass 3.3.7
remote:        Fetching rails-dom-testing 2.0.3
remote:        Fetching loofah 2.0.3
remote:        Installing rails-dom-testing 2.0.3
remote:        Installing loofah 2.0.3
remote:        Fetching rails-html-sanitizer 1.0.3
remote:        Installing rails-html-sanitizer 1.0.3
remote:        Fetching actionview 5.1.3
remote:        Installing actionview 5.1.3
remote:        Fetching actionpack 5.1.3
remote:        Installing actionpack 5.1.3
remote:        Fetching actioncable 5.1.3
remote:        Fetching actionmailer 5.1.3
remote:        Fetching railties 5.1.3
remote:        Installing actionmailer 5.1.3
remote:        Installing actioncable 5.1.3
remote:        Fetching sprockets-rails 3.2.0
remote:        Installing railties 5.1.3
remote:        Installing sprockets-rails 3.2.0
remote:        Fetching simple_form 3.5.0
remote:        Installing simple_form 3.5.0
remote:        Fetching coffee-rails 4.2.2
remote:        Fetching responders 2.4.0
remote:        Fetching font-awesome-rails 4.7.0.2
remote:        Installing coffee-rails 4.2.2
remote:        Installing responders 2.4.0
remote:        Fetching rails 5.1.3
remote:        Fetching sass-rails 5.0.6
remote:        Installing font-awesome-rails 4.7.0.2
remote:        Installing sass-rails 5.0.6
remote:        Installing rails 5.1.3
remote:        Fetching devise 4.3.0
remote:        Installing devise 4.3.0
remote:        Bundle complete! 26 Gemfile dependencies, 63 gems now installed.
remote:        Gems in the groups development and test were not installed.
remote:        Bundled gems are installed into ./vendor/bundle.
remote:        The latest bundler is 1.15.4, but you are currently running 1.15.2.
remote:        To update, run `gem install bundler`
remote:        Bundle completed (32.58s)
remote:        Cleaning up the bundler cache.
remote:        Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.15.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote:        The latest bundler is 1.15.4, but you are currently running 1.15.2.
remote:        To update, run `gem install bundler`
remote: -----> Installing node-v6.11.1-linux-x64
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        Yarn executable was not detected in the system.
remote:        Download Yarn at https://yarnpkg.com/en/docs/install
remote:        rake aborted!
remote:        Sprockets::FileNotFound: couldn't find file 'jquery' with type 'application/javascript'
remote:        Checked in these paths:
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/app/assets/config
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/app/assets/images
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/app/assets/javascripts
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/app/assets/stylesheets
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/font-awesome-rails-4.7.0.2/app/assets/fonts
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/font-awesome-rails-4.7.0.2/app/assets/stylesheets
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/coffee-rails-4.2.2/lib/assets/javascripts
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/actioncable-5.1.3/lib/assets/compiled
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/actionview-5.1.3/lib/assets/compiled
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/node_modules
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/bootstrap-sass-3.3.7/assets/stylesheets
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/bootstrap-sass-3.3.7/assets/javascripts
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/bootstrap-sass-3.3.7/assets/fonts
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/bootstrap-sass-3.3.7/assets/images
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/app/assets/javascripts/application.js:13
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/resolve.rb:65:in `resolve!'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/directive_processor.rb:399:in `resolve'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/directive_processor.rb:207:in `process_require_directive'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/directive_processor.rb:180:in `block in process_directives'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/directive_processor.rb:178:in `each'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/directive_processor.rb:178:in `process_directives'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/directive_processor.rb:83:in `_call'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/directive_processor.rb:68:in `call'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:75:in `call_processor'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in `reverse_each'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in `call_processors'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:134:in `load_from_unloaded'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:60:in `block in load'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:44:in `load'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:20:in `block in initialize'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:47:in `load'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/bundle.rb:23:in `block in call'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/utils.rb:200:in `dfs'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/bundle.rb:24:in `call'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:75:in `call_processor'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in `reverse_each'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in `call_processors'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:134:in `load_from_unloaded'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:60:in `block in load'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:44:in `load'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:20:in `block in initialize'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:47:in `load'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/base.rb:66:in `find_asset'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/base.rb:73:in `find_all_linked_assets'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:142:in `block in find'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:228:in `block in stat_tree'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:212:in `block in stat_directory'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:209:in `each'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:209:in `stat_directory'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:227:in `stat_tree'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:105:in `each'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:105:in `block in logical_paths'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:104:in `each'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:104:in `logical_paths'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:140:in `find'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:185:in `compile'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:68:in `block (3 levels) in define'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/rake/sprocketstask.rb:147:in `with_logger'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:67:in `block (2 levels) in define'
remote:        /tmp/build_accb86056660277e88ce60d1b5714034/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/exe/rake:27:in `'
remote:        Tasks: TOP => assets:precompile
remote:        (See full trace by running task with --trace)
remote:  !
remote:  !     Precompiling assets failed.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !	Push rejected to iccg-team-green.
remote: 
To https://git.heroku.com/iccg-team-green.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/iccg-team-green.git'

Refine README.md

Update README file on testing, deploying, etc. Potentially create another documentation file if needs be.

make "Next Round" secure

an important attribute of the game is the round attribute of the game players. now it was updated once the players click the "Next Round" button. to make it secure, players should not be able to change this attribute a too large or too small number. they should be able to change it only when it's the right time.

Add user authentication

My plan is to use devise, which gives you nice login and signup features by default. It also can be completed by manually implementing, but require more man hours.

Of course, before that I should create a model User

hacky implementation for sending message through actioncable

currently I use a hacky implementation for sending questions and answers to channel.

in game.coffee, I use a form to allow users to input data. but I don't use the form to submit the data. instead I use jquery callbacks to grab the data and send it through ActionCable subscriptions. so the form serves as a text area. but form reuqires route to be there. so I have to put a route for the dummy form. currently I don't have questions_controller. route resources :questions [:create] is there just for some dummy form. this is bad style.

also, sending messages through subscription not the form bypasses the controller, not very nice to pundit. pundit performs better in controller. now I have to use a custom wrapper to let pundit function in channels. unnecessary complexity.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.