Giter Club home page Giter Club logo

it202's Introduction

it202's People

Contributors

herponriki avatar

Watchers

 avatar

it202's Issues

User can join active competitions

* Creates an entry in CompetitionParticipants
* Recalculate the Competitions.participants value based on the count of participants for this competition from the CompetitionParticipants table.
* Update the Competitions.reward based on the # of participants and the appropriate math from the competition requirements above
    * Best to do this based on a simple equation via the initial Competition data and participants
    * Do not just increment the reward
* Show proper error message if user is already registered
* Show proper confirmation if user registered successfully

Create a Homepage (index.php)

* Include a weekly, monthly, and lifetime scoreboard
    * Scoreboards will show username, score, timestamp of when the score was received
    * You may manually edit some score entries in the database to show proof each scoreboard output works
* Include a link to the game
* Include a description of your project/game
* Include a proper heading

Competitions table

  • Competitions table should have the following columns (id, name, duration, expires (value = now + duration), current_reward, starting_reward, join_fee, current_participants, min_participants, paid_out (boolean default false), did_calc (boolean default false), min_score, first_place_per, second_place_per, third_place_per, cost_to_create, created_by (user_id ref), created, modified)

Create function that calculates competition winners (clearly comment each step in the code)

* Get all expired and not paid_out and not did_calc competitions (limit to 10 at a time)
* For each competition
    * Compare the participant count against the minimum required
    * Get the top 3 winners
        * **Pick 1 (strike out the option you won’t do; do not delete):**
            * **Option 1: **Scores are calculated by the sum of the score from the Scores table where it was earned/created between Competition start and Competition expires timestamps
            * ~~**Option 2: **Where the individual score was earned/created between when the user joined the competition and when the Competition expires~~
    * Calculate the payout (reward * place_percent)
        * Round up the value (it’s ok to pay out an extra credit here and there)
    * Create entries for the Users in the CreditsHistory table
        * Apply the new values (SUM) to their credits column in the Users table after entry is added
        * Reason should be recorded as “Won {credits} credits for {place} place in Competition {name}”
    * Mark the competition as paid_out = true and did_calc = true
* Mark all invalid competitions as did_calc = true (i.e., where # of participants is less than the minimum)

Pick a simple game to implement

  • Pick a simple game to implement, anything that generates a score that’s more advanced than a simple random number generator (may build off of a sample from the site shared in class for the HTML5 HW)
    • What game will you be doing?
      • Shooter Game
    • Briefly describe it.
      • Shoot the enemy blocks to score points*
    • Note: For this milestone the game doesn’t need to be complete, just have something basic or a placeholder that can generate a score when played.

Basic Roles implemented

* Have a <span style="text-decoration:underline;">Roles</span> table	(id, name, description, is_active, modified, created)
* Have a <span style="text-decoration:underline;">User Roles</span> table (id, user_id, role_id, is_active, created, modified)
* Include a function to check if a user has a specific role (we won’t use it for this milestone but it should be usable in the future)

User will be able to create a competition

* Competitions will start at 1 credit (reward)
* User sets a name for the competition
* User determines % given for 1st, 2nd, and 3rd place winners
    * Combination must be equal to 100% (no more, no less)
* User determines if it’s free to join or the cost to join (min 0 for free)
* User determines the duration of the competition (in days)
* User can determine the minimum score to qualify (min 0)
* User determines minimum participants for payout (min 3)
* Show any user friendly error messages
* Show user friendly confirmation message that competition was created
* The cost to the creator of the competition will be (1 + starting reward value)
    * If they can’t afford it, the competition should not be created
    * If they can afford it, automatically add them to the competition as a participant but don’t trigger the Reward increase in the following step

Users will have credits associated with their account.

* Alter the User table to include credits with a default of 0.
    * This field must not be incremented/decremented directly, you must use the CreditHistory table to calculate it and set it each time the credits change (hint: using SQL sum())
* Credits should show on the user’s profile page
    * You may show credits elsewhere _as well_ if you wish

Basic security rules implemented

* Authentication:
    * Function to check if user is logged in
    * Function should be called on appropriate pages that only allow logged in users
* Roles/Authorization:
    * Have a roles table (see below)

User will be able to register a new account

* Form Fields
    * Username, email, password, confirm password(other fields optional)
    * Email is required and must be validated
    * Username is required
    * Confirm password’s match
* <span style="text-decoration:underline;">Users</span> Table
    * Id, username, email, password (60 characters), created, modified
* Password must be hashed (plain text passwords will lose points)
* Email should be unique
* Username should be unique
* System should let user know if username or email is taken and allow the user to correct the error without wiping/clearing the form
    * The only fields that may be cleared are the password fields

User will be able to logout

* Logging out will redirect to login page
* User should see a message that they’ve successfully logged out
* Session should be destroyed (so the back button doesn’t allow them access back in)

User will be able to see their competition history

* Limit to 10 results
* Paginate anything after 10
* If no results, show the appropriate message
* Show the competition name, participant count, reward, the expiry date if active otherwise “expired”, whether or not they are the creator

User will be able to login to their account (given they enter the correct credentials)

* Form
    * User can login with **email **or **username**
        * This can be done as a single field or as two separate fields
    * Password is required
* User should see friendly error messages when an account either doesn’t exist or if passwords don’t match
* Logging in should fetch the user’s details (and roles) and save them into the session.
* User will be directed to a landing page upon login
    * This is a protected page (non-logged in users shouldn’t have access)
    * This can be home, profile, a dashboard, etc

User will be able to edit their profile

* Changing username/email should properly check to see if it’s available before allowing the change
* Any other fields should be properly validated
* Allow password reset (only if the existing correct password is provided)
    * Hint: logic for the password check would be similar to login

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.