Skip to content

Commit

Permalink
v1.0 (#13)
Browse files Browse the repository at this point in the history
* v1.0 (#4)

* Implemented Follow Feature

- Added /follow and /unfollow endpoints
- Added following to the User Class, DTO, and Schema
- Added Typings for the User object in the authenticated Request

* Implemented User Search

- Added GET users/search? Endpoint
- Added name to the index of the User Schema
- Added searchUsers to the UserRepository
- Change follow, unfollow Enpoints to POST Requests

* Implemented CFContests Endpoint

- Added CFContest Class / DTO / Schema
- Added createContest input validation
- Added CFContests Controller
- Added CREATE / READ / DELETE endpoints

* Implemented Sheets Analysis

- Added contest standings and contest status to CF Service
- Added Expiry time to user auth tokens
- Added problem index to Codeforces.Problem interface

* Implemented user confirmation for mentors

- Added isConfirmed member to User Class / DTO / Schema
- Added confirm endpoint in accounts controller
- Added Admin Role and changed Admin endpoints authorization

* Added GET unconfirmed users backend endpoint

- Added PUT to allowed method in server
- Fixed cf contest validation schema bug

* Prepared the App for deployment

- Added different ENV files for different Environments
- Added config file to load the appropriate ENV file

* Fixed env files loading bug

* Fixed env loading bug

- production env file typo in envConfig
- loading dev env file in tests

* v1.0: Added Procfile (#7)

* Implemented Follow Feature

- Added /follow and /unfollow endpoints
- Added following to the User Class, DTO, and Schema
- Added Typings for the User object in the authenticated Request

* Implemented User Search

- Added GET users/search? Endpoint
- Added name to the index of the User Schema
- Added searchUsers to the UserRepository
- Change follow, unfollow Enpoints to POST Requests

* Implemented CFContests Endpoint

- Added CFContest Class / DTO / Schema
- Added createContest input validation
- Added CFContests Controller
- Added CREATE / READ / DELETE endpoints

* Implemented Sheets Analysis

- Added contest standings and contest status to CF Service
- Added Expiry time to user auth tokens
- Added problem index to Codeforces.Problem interface

* Implemented user confirmation for mentors

- Added isConfirmed member to User Class / DTO / Schema
- Added confirm endpoint in accounts controller
- Added Admin Role and changed Admin endpoints authorization

* Added GET unconfirmed users backend endpoint

- Added PUT to allowed method in server
- Fixed cf contest validation schema bug

* Prepared the App for deployment

- Added different ENV files for different Environments
- Added config file to load the appropriate ENV file

* Fixed env files loading bug

* Fixed env loading bug

- production env file typo in envConfig
- loading dev env file in tests

* Added Procfile

* Fixing ENV files (#8)

* Implemented Follow Feature

- Added /follow and /unfollow endpoints
- Added following to the User Class, DTO, and Schema
- Added Typings for the User object in the authenticated Request

* Implemented User Search

- Added GET users/search? Endpoint
- Added name to the index of the User Schema
- Added searchUsers to the UserRepository
- Change follow, unfollow Enpoints to POST Requests

* Implemented CFContests Endpoint

- Added CFContest Class / DTO / Schema
- Added createContest input validation
- Added CFContests Controller
- Added CREATE / READ / DELETE endpoints

* Implemented Sheets Analysis

- Added contest standings and contest status to CF Service
- Added Expiry time to user auth tokens
- Added problem index to Codeforces.Problem interface

* Implemented user confirmation for mentors

- Added isConfirmed member to User Class / DTO / Schema
- Added confirm endpoint in accounts controller
- Added Admin Role and changed Admin endpoints authorization

* Added GET unconfirmed users backend endpoint

- Added PUT to allowed method in server
- Fixed cf contest validation schema bug

* Prepared the App for deployment

- Added different ENV files for different Environments
- Added config file to load the appropriate ENV file

* Fixed env files loading bug

* Fixed env loading bug

- production env file typo in envConfig
- loading dev env file in tests

* Added Procfile

* Removed env files

* Delete .env.dev

* Delete .env.prod

* Delete .env.staging

* Fixing Procfile (#9)

* Implemented Follow Feature

- Added /follow and /unfollow endpoints
- Added following to the User Class, DTO, and Schema
- Added Typings for the User object in the authenticated Request

* Implemented User Search

- Added GET users/search? Endpoint
- Added name to the index of the User Schema
- Added searchUsers to the UserRepository
- Change follow, unfollow Enpoints to POST Requests

* Implemented CFContests Endpoint

- Added CFContest Class / DTO / Schema
- Added createContest input validation
- Added CFContests Controller
- Added CREATE / READ / DELETE endpoints

* Implemented Sheets Analysis

- Added contest standings and contest status to CF Service
- Added Expiry time to user auth tokens
- Added problem index to Codeforces.Problem interface

* Implemented user confirmation for mentors

- Added isConfirmed member to User Class / DTO / Schema
- Added confirm endpoint in accounts controller
- Added Admin Role and changed Admin endpoints authorization

* Added GET unconfirmed users backend endpoint

- Added PUT to allowed method in server
- Fixed cf contest validation schema bug

* Prepared the App for deployment

- Added different ENV files for different Environments
- Added config file to load the appropriate ENV file

* Fixed env files loading bug

* Fixed env loading bug

- production env file typo in envConfig
- loading dev env file in tests

* Added Procfile

* Removed env files

* Fixed Procfile bug

* v1.0 (#10)

* Implemented Follow Feature

- Added /follow and /unfollow endpoints
- Added following to the User Class, DTO, and Schema
- Added Typings for the User object in the authenticated Request

* Implemented User Search

- Added GET users/search? Endpoint
- Added name to the index of the User Schema
- Added searchUsers to the UserRepository
- Change follow, unfollow Enpoints to POST Requests

* Implemented CFContests Endpoint

- Added CFContest Class / DTO / Schema
- Added createContest input validation
- Added CFContests Controller
- Added CREATE / READ / DELETE endpoints

* Implemented Sheets Analysis

- Added contest standings and contest status to CF Service
- Added Expiry time to user auth tokens
- Added problem index to Codeforces.Problem interface

* Implemented user confirmation for mentors

- Added isConfirmed member to User Class / DTO / Schema
- Added confirm endpoint in accounts controller
- Added Admin Role and changed Admin endpoints authorization

* Added GET unconfirmed users backend endpoint

- Added PUT to allowed method in server
- Fixed cf contest validation schema bug

* Prepared the App for deployment

- Added different ENV files for different Environments
- Added config file to load the appropriate ENV file

* Fixed env files loading bug

* Fixed env loading bug

- production env file typo in envConfig
- loading dev env file in tests

* Added Procfile

* Removed env files

* Fixed Procfile bug

* Procfile changes

* Specified node version in package.json

* Changed Procfile starting command

* Configured post install and start commands for Heroku

* Fixed CORS bug

* Fixed login response error code

* Delete Procfile

* v1.0 (#12)

* Implemented Follow Feature

- Added /follow and /unfollow endpoints
- Added following to the User Class, DTO, and Schema
- Added Typings for the User object in the authenticated Request

* Implemented User Search

- Added GET users/search? Endpoint
- Added name to the index of the User Schema
- Added searchUsers to the UserRepository
- Change follow, unfollow Enpoints to POST Requests

* Implemented CFContests Endpoint

- Added CFContest Class / DTO / Schema
- Added createContest input validation
- Added CFContests Controller
- Added CREATE / READ / DELETE endpoints

* Implemented Sheets Analysis

- Added contest standings and contest status to CF Service
- Added Expiry time to user auth tokens
- Added problem index to Codeforces.Problem interface

* Implemented user confirmation for mentors

- Added isConfirmed member to User Class / DTO / Schema
- Added confirm endpoint in accounts controller
- Added Admin Role and changed Admin endpoints authorization

* Added GET unconfirmed users backend endpoint

- Added PUT to allowed method in server
- Fixed cf contest validation schema bug

* Prepared the App for deployment

- Added different ENV files for different Environments
- Added config file to load the appropriate ENV file

* Fixed env files loading bug

* Fixed env loading bug

- production env file typo in envConfig
- loading dev env file in tests

* Added Procfile

* Removed env files

* Fixed Procfile bug

* Procfile changes

* Specified node version in package.json

* Changed Procfile starting command

* Configured post install and start commands for Heroku

* Fixed CORS bug

* Fixed login response error code

* Removing unused Procfile
  • Loading branch information
khaled-hamam authored Oct 22, 2018
1 parent d3fc7f0 commit 5b85808
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/services/AnalysisService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export default class AnalysisService {
.slice(0, limit);

return {
averageRank: Math.floor(averageRank / ratingChanges.length),
averageRatingChange: Math.floor(averageRatingChange / ratingChanges.length),
averageRank: Math.floor(averageRank / (ratingChanges.length || 1)),
averageRatingChange: Math.floor(averageRatingChange / (ratingChanges.length || 1)),
summary
};
}
Expand All @@ -64,6 +64,18 @@ export default class AnalysisService {
}

public analyseSolvingRate(submissions: Codeforces.Submission[]) {
// No submissions found
if (submissions.length === 0) {
return {
monthlyAverage: 0,
weeklyAverage: 0,
dailyAverage: 0,
pastMonth: 0,
pastWeek: 0,
pastDay: 0
};
}

const acceptedSubmissions = submissions.filter(submission => submission.verdict === Verdict.OK);

// Getting the months, weeks, days count from the first submission of the user
Expand Down

0 comments on commit 5b85808

Please sign in to comment.