shivamxverma / shivamxverma/CodeSM

Prevent users from submitting duplicate code (Plagiarism Detection)

Open
#45 0 comments 0 reactions 1 assignee View on GitHub

@shivamxverma is already working on this.

Since Apr 5, 2026.

Dominant language
JavaScript
Stars
3
Forks
3
PR merge metrics
No merged PRs in 30d

Description

Description:
Currently, users can submit the same code multiple times without restriction. This can lead to spam, unfair usage, and potential plagiarism.

We need to implement a system that detects and prevents duplicate code submissions by the same user.

Proposed Solution:

Generate a hash (e.g., SHA-256) of submitted code
Store the hash in the database along with user_id
Add a unique constraint (user_id + code_hash)
Reject submission if the same hash already exists

Optional Enhancements:

Normalize code before hashing (remove whitespace/comments)
Add time-based restriction (e.g., prevent duplicates within 30 days)
Extend to cross-user plagiarism detection (future scope)

Acceptance Criteria:

User cannot submit identical code more than once
System efficiently checks duplicates even at scale
Proper error message is returned on duplicate submission

Tech Considerations:

Use indexed database fields for fast lookup
Ensure hashing is consistent and collision-safe
Backend validation only (not frontend)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.