-
Notifications
You must be signed in to change notification settings - Fork 3
Performance fix #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
adham667
wants to merge
7
commits into
master
Choose a base branch
from
performance-fix
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Performance fix #17
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
05a8492
fixed verification issue using puppeteer real browser and changed the…
adham667 6648f8f
fix:forbidden error work around & making excel sheet as output
adham667 e623759
change delay times to make it more optimal and fixed empty code case
adham667 38d915e
retry login approach
adham667 5298a07
files approach completed
adham667 75c12d9
added guide to operate cheating detector
adham667 3630ec3
speed up detector by using puppeteer-real-browser only for login
adham667 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,10 @@ | ||
| PORT=3000 | ||
| PORT=3030 | ||
| CF_HANDLE= | ||
| CF_PASSWORD= | ||
| CF_KEY= | ||
| CF_SECRET= | ||
| RETRIES= | ||
| JOBS_PER_TIME_FRAME= | ||
| TIME_FRAME= | ||
| RETRIES=3 | ||
| JOBS_PER_TIME_FRAME=30 | ||
| TIME_FRAME=3000 | ||
| BASIC_AUTH_USERNAME= | ||
| BASIC_AUTH_PASSWORD= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,4 +93,7 @@ typings/ | |
| # DynamoDB Local files | ||
| .dynamodb/ | ||
|
|
||
| # | ||
| *.xlsx | ||
|
|
||
| # End of https://www.gitignore.io/api/node | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,2 +1,120 @@ | ||||||
| # Codeforces Cheating Detector | ||||||
| # Codeforces Cheating Detector - Setup & Operation Guide | ||||||
|
|
||||||
| ## 📋 Prerequisites | ||||||
| - Manager access to the Codeforces contest | ||||||
| - Node.js installed on your system | ||||||
| - Git installed on your system | ||||||
|
|
||||||
| ## 🚀 Setup Steps | ||||||
|
|
||||||
| ### Step 1: Configure Codeforces API Access | ||||||
| 1. Go to your manager account on Codeforces | ||||||
| 2. Ensure you're marked as manager on the intended contest (VIP) | ||||||
| 3. Create a new API key: | ||||||
| - Go to API section in your profile | ||||||
| - Generate a new API key | ||||||
| - **Save both the API key and secret** for later use | ||||||
|
|
||||||
| ### Step 2: Clone and Prepare the Repository | ||||||
| ```bash | ||||||
| # Clone the cheating detector repository | ||||||
| git clone https://github.com/acmASCIS/cf-cheating-detector.git | ||||||
|
|
||||||
| # Navigate to the project directory | ||||||
| cd cf-cheating-detector | ||||||
|
|
||||||
| # Pull the file approach branch | ||||||
| git pull origin file-approach | ||||||
| ``` | ||||||
|
|
||||||
| ### Step 3: Environment Configuration | ||||||
| 1. Create a `.env` file in the root directory: | ||||||
|
|
||||||
| 2. Copy the contents from `.env.example` and paste into your new `.env` file | ||||||
|
|
||||||
| 3. Configure your `.env` file with your credentials: | ||||||
| ```env | ||||||
| PORT=3030 | ||||||
| CF_HANDLE="your_codeforces_handle" | ||||||
| CF_PASSWORD="your_codeforces_password" | ||||||
| CF_KEY="your_api_key_here" | ||||||
| CF_SECRET="your_api_secret_here" | ||||||
| RETRIES=1 | ||||||
| JOBS_PER_TIME_FRAME=1 | ||||||
| TIME_FRAME=3000 | ||||||
| BASIC_AUTH_USERNAME= | ||||||
| BASIC_AUTH_PASSWORD= | ||||||
| ``` | ||||||
|
|
||||||
| ### Step 4: Install Dependencies | ||||||
| ```bash | ||||||
| # Install backend dependencies | ||||||
| cd src | ||||||
| npm install | ||||||
|
|
||||||
| # Install frontend dependencies | ||||||
| cd ../client/src | ||||||
| npm install | ||||||
| ``` | ||||||
|
|
||||||
| ## 🏃♂️ Running the Application | ||||||
|
|
||||||
| ### Step 5: Start Both Services | ||||||
| Open **two separate command terminals**: | ||||||
|
|
||||||
| **Terminal 1 - Backend Server:** | ||||||
| ```bash | ||||||
| cd cf-cheating-detector/src | ||||||
| npm run start | ||||||
| ``` | ||||||
|
|
||||||
| **Terminal 2 - Frontend Client:** | ||||||
| ```bash | ||||||
| cd cf-cheating-detector/client/src | ||||||
| npm run start | ||||||
| ``` | ||||||
|
|
||||||
| ### Step 6: Configure Detection Parameters | ||||||
| 1. The frontend will open in your browser | ||||||
| 2. Fill in the required information: | ||||||
| - **Contest ID**: The ID of the contest you're monitoring | ||||||
| - **Group ID**: The group associated with the contest | ||||||
| - **Blacklist Problems**: Problems you don't want to detect cheating on | ||||||
| - **Matching Percentage Threshold**: Number between 0 and 1 (submissions below this threshold won't be flagged) | ||||||
|
|
||||||
| 3. Click **Submit** | ||||||
|
|
||||||
| ### Step 7: Authentication | ||||||
| - A new window will open directing you to Codeforces | ||||||
| - Click on the enter button to go to Login page | ||||||
| - it will automatically write the username and password and submit | ||||||
| - The detection process will begin automatically | ||||||
|
|
||||||
| ## ⚠️ Troubleshooting & Important Notes | ||||||
|
|
||||||
| ### Handling Forbidden Errors | ||||||
| If you encounter forbidden page after processing some submissions: | ||||||
|
|
||||||
| 1. Close the detection window | ||||||
| 2. Go to the server terminal (Terminal 1) and Press `Ctrl+C` to stop the server | ||||||
| 3. Check Codeforces in your normal browser to see if the ban is lifted | ||||||
| 4. Once unbanned: | ||||||
| - Go to the server terminal (Terminal 1) | ||||||
| - Restart with `npm run start` | ||||||
| - Return to the frontend and submit again to continue | ||||||
|
|
||||||
| ### Starting Fresh on a New Contest | ||||||
| **Important**: If this is not your first time running the detector and you're analyzing a new contest: | ||||||
|
|
||||||
| 1. Navigate to the `submissions.json` file in the cd-cheating-detector directoy | ||||||
|
||||||
| 1. Navigate to the `submissions.json` file in the cd-cheating-detector directoy | |
| 1. Navigate to the `submissions.json` file in the cf-cheating-detector directory |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'directoy' to 'directory'.