Code Monkey home page Code Monkey logo

quizdb's Introduction

QuizDB

Welcome to QuizDB!

This guide will explain the technical aspects of QuizDB. If you'd like to learn more about QuizDB itself, please read the About guide.

Information

All releases of QuizDB are listed under the release tab. The current version is 1.0.0 (the beta!). I will try and use semver (if I remember...)

The backend runs on Rails, and the client runs on React. Deployment uses Heroku with a PostgresQL database.

The modern web interface for QuizDB lives at https://www.quizdb.org and the admin portal lives at https://www.quizdb.org/admin.

After installing both the backend and frontend, you can run both simultaneously by running rake start, which launches the backend at localhost:3000 and the frontend at localhost:8080.

Installation

To install the backend of Ruby 2.4 and Rails 5.0, use the following guide and select your OS. Run bundle install to install all the missing gems.

Then, install the Heroku CLI to run the backend server locally. Do so by using the download instructions on the following link and reading your OS specific instructions.

Afterwards, install Node 8 following this guide according to your system. To install all the dependencies, run npm install.

Backend

The backend acts as the public API for QuizDB, and additionally manages the Admin Portal. The root of this repo acts as the backend.

You must have Ruby 2.4 and Rails 5.0 installed to run the application. Consult the Gemfile for a list of dependencies. It's assumed that you have experience installing Rails applications -- contact me for help if needed.

As mentioned above, you can run the backend by running rake start, but you can also run the backend individually with rails s -p 3000.

Frontend

The frontend consists of the modern web client that pings the API to display questions. It also includes Moxon, an online question reader in active development. The frontend lives entirely in a subfolder in /client, so if you're not interested in backend work, you can entirely work in that folder.

You must have Node 8 installed to run the application. I recommend using NVM. Consult the package.json for a list of dependencies. It's assumed that you have experience installing React applications -- contact me for help if needed.

As mentioned above, you can run the frontend by running rake start, but you can also run the frontend individually with npm start. (These launch the app in development mode: you can also prefix NODE_ENV=production for production, or run npm build to build the application.)

Contribution

To contribute, please fork the repository and initiate a pull request. All PRs should include the following information:

  • Why: What the PR is fixing/implementing
  • What: How the PR is implementing it
  • Who: If I've never seen you before, some background info on who you are / what your relationship to the QB community is, so I can have some level of trust in your code.

I don't really care about tests or anything like that, but I will need to personally read over all PRs, so please keep your changes readable.

I don't really expect that many people to contribute--I'll work harder on getting that done on the admin side--so anything is really appreciated!

quizdb's People

Contributors

ulyssesinvictus avatar noahbres avatar circador avatar innoviox avatar

Stargazers

 avatar Omer Mujawar avatar Ben avatar Sky Hong avatar  avatar  avatar Matias Grioni avatar Yoni Singer avatar Nick Griffey avatar Alejandro avatar Colton Sowers avatar sarthak avatar Lawrence Pang avatar  avatar Andrei Racila avatar Max Wallace avatar Ahmed Elgohary Ghoneim avatar  avatar Nick Nazari avatar Andrew Mao avatar carl colglazier avatar Ryan Rosenberg avatar Albert Zhang avatar Ashwin Ramaswami avatar Arnav Sastry avatar Ophir Lifshitz avatar

Watchers

Ophir Lifshitz avatar James Cloos avatar Alejandro avatar  avatar

quizdb's Issues

Bonus export does not have column for content

When exporting bonuses from the admin interface, we get bonus questions which are missing their content (prompts and answers). For example:

This bonus has content in the admin interface:
Screenshot of sample bonus in interface

But a CSV file, when downloaded, only has the content:

Id | Number | Round | Quinterest | Leadin | Created at | Updated at | Formatted leadin
-- | -- | -- | -- | -- | -- | -- | --
45448 | 4 | Tiebreakers |   | Name these mythological characters who inspired structures in the Roman Forum, for 10 points each. | 2020-09-17 23:31:22 UTC | 2020-09-17 23:31:22 UTC | Name these mythological characters who inspired structures in the Roman Forum, for 10 points each.

This is a small sample of only 1 question, but I've manually gone through this process for around 30 bonuses (each from different tournaments and with a large variance of time period) and every bonus had this issue.

TypeError: no implicit conversion of String into Integer

After installing all of the dependencies using bundle install, I tried running the backend using rake start. At which point I received the error: TypeError: no implicit conversion of String into Integer.

Here is the complete output

rake aborted!
TypeError: no implicit conversion of String into Integer
/usr/local/lib/ruby/gems/3.0.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/usr/local/lib/ruby/gems/3.0.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/usr/local/lib/ruby/gems/3.0.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:83:in `register'
/usr/local/lib/ruby/gems/3.0.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/usr/local/lib/ruby/gems/3.0.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/usr/local/lib/ruby/gems/3.0.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
/usr/local/lib/ruby/gems/3.0.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
/usr/local/lib/ruby/gems/3.0.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
/usr/local/lib/ruby/gems/3.0.0/gems/bootsnap-1.4.0/lib/bootsnap/compile_cache/iseq.rb:1:in `<top (required)>'
/usr/local/lib/ruby/gems/3.0.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/usr/local/lib/ruby/gems/3.0.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/usr/local/lib/ruby/gems/3.0.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:83:in `register'
/usr/local/lib/ruby/gems/3.0.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/usr/local/lib/ruby/gems/3.0.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/usr/local/lib/ruby/gems/3.0.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
/usr/local/lib/ruby/gems/3.0.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
/usr/local/lib/ruby/gems/3.0.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
/usr/local/lib/ruby/gems/3.0.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:44:in `require_relative'
/usr/local/lib/ruby/gems/3.0.0/gems/bootsnap-1.4.0/lib/bootsnap/compile_cache.rb:6:in `setup'
/usr/local/lib/ruby/gems/3.0.0/gems/bootsnap-1.4.0/lib/bootsnap.rb:30:in `setup'
/usr/local/lib/ruby/gems/3.0.0/gems/bootsnap-1.4.0/lib/bootsnap/setup.rb:27:in `<top (required)>'
/Users/dhruv/quiz-training/QuizDB/config/boot.rb:4:in `require'
/Users/dhruv/quiz-training/QuizDB/config/boot.rb:4:in `<top (required)>'
/Users/dhruv/quiz-training/QuizDB/config/application.rb:1:in `require_relative'
/Users/dhruv/quiz-training/QuizDB/config/application.rb:1:in `<top (required)>'
/Users/dhruv/quiz-training/QuizDB/Rakefile:4:in `require_relative'
/Users/dhruv/quiz-training/QuizDB/Rakefile:4:in `<top (required)>'

Bonuses jsons do not have questions or answers

A bonus json contains the following:

{
id: 41561,
number: 12,
round: "04_fichte09",
category_id: 25,
subcategory_id: 66,
quinterest_id: null,
tournament_id: 144,
leadin: "Answer the following about these very “human” works of philosophy. For 10 points each –",
created_at: "2019-10-15T23:47:46.076Z",
updated_at: "2019-10-15T23:47:46.076Z",
errors_count: 0,
formatted_leadin: "Answer the following about these very “human” works of philosophy. For 10 points each –"
}

but there is no actual question or answer?

Exporting often leads to application error

Searching or randoming then exporting a lot of questions to anything often leads us to the Heroku application error page...

This is probably a heroku error?

Probably should be doing the exporting from blobs client-side generated from props.questions[tossups/bonuses], anyway

CORS compliant API

I'm working on an application that would benefit from using QuizDB as an API. I looked at the requests sent from the native website and copied the request URL here.

However, the backend does not support the CORS standard and actually getting the data is impossible. The backend should change to include the proper response headers and I believe a OPTIONS request? so that using QuizDB as a API is possible.

Mozilla CORS docs <-- Useful article

P.S. I know nothing about Ruby so I wouldn't know how to alter the backend to work with this, but I have used the CORS standard before.

Thanks!

"Load all" hangs if tournaments are removed

Steps to reproduce:

  1. Enter and search the following query:
    Category: mythology
    Tournament: 2019 ACF Regionals, 2018 ACF Regionals
    This should give you 29 tossups
  2. Drop both tournaments from the query
  3. Hit "Load all"

This causes quizdb to get stuck loading the questions

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.