Skip to content

RHSCSTeam/cs-points

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
app
 
 
 
 
 
 

RHS CS Practice Problem System (PPS)

layman-script

Team members use this tool to solve questions and get points for solving them. Users select a practice problem from [UVa Online Judge](https://uva.onlinejudge.org/), copy and paste the problem into program, and run their solution through the program.

Feel free to use this in your setting too.

Dependencies

Installation

  • clone the repo
  • cd into the app directory
  • run npm install to install the dependancies
  • edit your settings.js file to have incorporate your Firebase keys
  • run npm start to start

settings.js

This has all of your Firebase credentials. Maybe in the future, more customizable settings or plugins will come.

It should look like this:

window.settings = {
  FirebaseCredentials:{
    apiKey: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    authDomain: "XXXXXXXXXXXXXX.firebaseapp.com",
    databaseURL: "https://XXXXXXXXXXXXXXXXX.firebaseio.com",
    storageBucket: "XXXXXXXXXXXXXXXXXX.appspot.com",
  },

}

Remember to save it as settings.js

Setting up Firebase

  • Go to http://firebase.google.com
  • Click "Get started for free"
  • Create a new Firebase Project
  • Once in the dashboard, navigate to the Auth section
  • In the sign-in method tab, enable the "Email/Password" signin method. This is how cs-points authenticates the user
  • Now, go to the database section
  • Click on the rules tab, and add these rules
{
  "rules": {
    "featured_problems":{
      ".read":true,
      ".write":false
    },
    "solved_problems":{
      ".read":true,
      ".write":true
    },
    "users": {
      "$uid": {
        ".write": "$uid === auth.uid",
        ".read":true
      }
    }
  }
}
  • Now you're done!

Adding Featured Problems

cs-points allows you to feature problems and assign weight to the problem. To do this, go to the Firebase console and navigate to the database tab.

This is where you would add your featured problems. (Any collapsed item is automatically generated by the app)

Firebase Database Screenshot

To add a featured_problem click on the plus button on the root parent of the heirarchy

Firebase Database Screenshot

Then type featured_problems in the Name field and press the + button on the right Firebase Database Screenshot

Type a Unique ID for the problem in the Name field and press the plus button to add the child properties Firebase Database Screenshot

Featured problem properties:

  • unique ID
    • name - The exact name of the problem that is shown on UVa
    • url - The UVa URL of the problem
    • weight - The number of points given to the user if they solve the problem

PR's much appreciated

About

Point tracker for the RHS CS team (DEPRECATED: NOW USE CODESCRIM)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published