Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/utils/clipboardTracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

import { ElMessage } from 'element-plus';

// Toggle copy-paste restrictions for students
// Set to false to allow students to paste from external sources
// Set to true to restrict students to only paste content copied within the IDE
const PASTE_RESTRICTIONS_ENABLED = false;

class ClipboardTracker {
constructor() {
this.allowedContentHashes = new Set();
Expand Down Expand Up @@ -128,9 +133,16 @@ class ClipboardTracker {
userRole: this.getCurrentUserRole(),
isStudent: this.isStudent(),
isProfessor: this.isProfessor(),
restrictionsEnabled: PASTE_RESTRICTIONS_ENABLED,
environment: window.location.origin
});

// Check if restrictions are disabled globally
if (!PASTE_RESTRICTIONS_ENABLED) {
console.log('[ClipboardTracker] Paste restrictions disabled - allowing all pastes');
return true;
}

// Always allow professors to paste anything
if (this.isProfessor()) {
console.log('[ClipboardTracker] Professor paste - allowed');
Expand Down