Skip to content

26 key strokes copypaste detection#116

Open
tobidontplay wants to merge 29 commits into
judge0:masterfrom
HSU-Senior-Project-2026:26-key-strokes-copypaste-detection
Open

26 key strokes copypaste detection#116
tobidontplay wants to merge 29 commits into
judge0:masterfrom
HSU-Senior-Project-2026:26-key-strokes-copypaste-detection

Conversation

@tobidontplay

Copy link
Copy Markdown

📝 Overview
This PR sets up the initial backend logic for Ticket #2: Keystroke and Copy-Paste Tracking. Our goal was to secretly start tracking what students are doing in the editor, and give a way to download that tracker data so we can see it.

What was required and how we met it:

  1. Track student typing: We needed a way to log whenever a user types in the editor.
    • How we met it: We hooked into the Monaco Editor's built-in change detector. Every single time the text changes, we log the exact keystroke along with a timestamp to an array in the background.
  2. Track copy/pasting & deletions: We needed to tell if someone typed something normally or just copy-pasted a giant chunk of code.
    • How we met it: Based on the length of the text changing, we categorize the action. If it's > 1 character, it's logged as a "paste" along with the pasted text. If they delete text, it's logged as a "deletion" along with how many characters they deleted.
  3. A way to view the tracked data: We needed a way to pull the logs since we don't have a backend database set up to consume it yet.
    • How we met it: We added a "Download Activity Logs" button to the main dropdown menu. Clicking it packages up everything the student just did into a nicely formatted JSON file (keystroke_activity_log.json).

Note on the Download Button
For now, the "Download Activity Logs" button sits right in the main menu and is visible to everyone just so we can test it. Once the "Sign In and Personal Workspace" ticket is completed, we will hide this button and make it a feature that is only visible and accessible to professors.

How to test it

  1. Open the project in your browser, start typing some code, delete some lines, and copy-paste a big block of text into the editor.
  2. Click the new Download Activity Logs button in the dropdown menu.
  3. Open the downloaded JSON file and make sure everything you did was logged correctly with the right timestamps and labels (keystroke vs. paste vs. deletion).

NicoleTravers and others added 29 commits February 16, 2026 16:03
…clicked, whether code has changed, and whether the code is empty
…utton-fixes

Feature/compile button fixes
…utton-fixes

Feature/compile button fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants