Skip to documentation

    DocGuard

    Plagiarism Plugin
    v1.0.79
    Ready
    Archived compatibility details

    AI and plagiarism detection for PDF and Word document submissions. Extracts text from student-submitted files, detects question/answer sections, and scores each answer across 12 independent signals — producing a Low / Medium / High risk badge per submission with a full per-question breakdown report.

    50 LMS Labs credits for one-time site access · Marketplace: US$5 one-off · lifetime updates

    ⭐ Why this plugin is unlike anything else available

    Detects AI-assisted document submissions without an external service

    ▸ DocGuard analyses the linguistic patterns of submitted documents — perplexity, burstiness, sentence-length distribution, and vocabulary entropy — to identify characteristics consistent with AI-generated or AI-assisted writing. All analysis runs inside Moodle with no external API call.

    ▸ Works on uploaded file submissions (DOCX, PDF, TXT) not just typed text. Students who use AI to generate a document, then upload it as their own work, are flagged at the same rate as students who type AI text directly.

    ▸ Results are probabilistic, not binary. The report shows a confidence score with the specific signals that contributed to it — giving teachers the context to make a professional judgment, not a system verdict.

    What is DocGuard?

    DocGuard is a Moodle™ Plagiarism Plugin that analyses the text content of student-submitted PDF and Word (.docx) files for signs of AI-generated content and student-to-student copying. Unlike Essay Guard which monitors the live typing process, DocGuard works on the finished document — making it ideal for assessments where students upload files rather than type directly into Moodle™.

    When a student uploads a file to a Moodle™ Assignment, DocGuard extracts the text, detects the question structure, and scores each answer section independently across 12 linguistic and similarity signals. Teachers see a Low / Medium / High risk badge next to each submission in the grading interface, with a detailed per-question breakdown report one click away.

    The Problem

    • Students submit AI-generated PDFs and Word documents
    • Text similarity tools miss original AI content — it's never been seen before
    • Teachers have no way to quickly flag suspicious file submissions
    • Cross-student sharing of answers is hard to detect at scale
    • Reviewing dozens of documents manually for AI markers is time-consuming

    The Solution

    • Automatically extracts text from PDF and .docx submissions
    • Detects question/answer sections — each answer scored independently
    • 12-signal scoring: AI vocabulary, style consistency, cross-student similarity
    • Low / Medium / High badge visible to teachers in the grading interface
    • Detailed per-question breakdown report with evidence excerpts
    • No external service — all analysis runs inside Moodle™
    How It Works
    1
    Student submits a PDF or Word file

    When a student uploads a .pdf or .docx file to a Moodle™ Assignment, DocGuard's event observer fires automatically via Moodle's assignsubmission_file_uploaded event.

    2
    Text is extracted from the file

    DOCX files are unzipped and parsed via PHP's ZipArchive and DOMDocument — no external libraries required. PDF files are converted to text using the pdftotext command-line tool (if installed on the server) with a pure-PHP FlateDecode stream fallback for basic PDFs.

    3
    The question/section structure is detected

    DocGuard scans the text for common question patterns — 'Question 1', 'Q 1:', 'Activity 2', 'Task 3', numbered list items. If no structure is found, the whole document is treated as a single section.

    4
    Each section is scored across detection signals

    Each question/answer section is run through the 12-signal analyser independently. Signals check for AI vocabulary markers, sentence uniformity, transition word overuse, contraction absence, passive voice ratio, template phrases, trigram repetition, and more.

    5
    Cross-student similarity is calculated

    After each submission is processed, Signal 12 compares bigram (two-word pair) overlap between all students in the same assignment using Jaccard similarity. This catches shared content even when lightly paraphrased.

    6
    Risk badge appears next to the submission

    The final weighted score (0–100) maps to Low (0–34), Medium (35–64), or High (65–100) risk. A coloured badge appears inline next to the student's file in the assignment grading interface. Only teachers with the plagiarism/docguard:viewreport capability see the badge — students do not.

    Low Risk
    Score 0–34

    Linguistic signals consistent with genuine student writing. Low likelihood of AI-generated or copied content.

    Medium Risk
    Score 35–64

    One or more signals present. Warrants a closer look at the submission alongside the detailed report.

    High Risk
    Score 65–100

    Multiple strong indicators detected. Recommended for academic integrity review.

    Supported File Formats
    .docx
    Microsoft Word

    Extracted using PHP's built-in ZipArchive and DOMDocument. DOCX files are internally ZIP archives containing an XML document — DocGuard parses the word/document.xml file directly. No external libraries or server software required.

    .pdf
    PDF Documents

    Primary extraction uses pdftotext (part of the poppler-utils package). If pdftotext is not installed, a pure-PHP FlateDecode stream parser is used as a fallback for basic PDFs. Complex PDFs with scanned images (no text layer) are not supported.

    Moodle™ Assignment only. DocGuard works with the Moodle™ Assignment activity using file submissions. It does not analyse text typed directly into online text submissions — that is Essay Guard's role.

    The 12 Detection Signals

    Every answer section is scored across 12 independent signals. The total weighted score (0–100) determines the risk level. No single signal is definitive — the risk level reflects the combined weight of multiple indicators.

    S1

    AI Marker Vocabulary

    Up to 22 pts

    Checks for 50+ ChatGPT/LLM characteristic phrases — 'delve into', 'it is important to note', 'in the realm of', 'comprehensive understanding', 'leverage', 'multifaceted', 'nuanced approach', 'it is worth noting', and similar terms that appear disproportionately in AI-generated text. Each phrase hit adds to the score.

    S2

    Sentence Length Uniformity

    Up to 10 pts

    Measures the standard deviation of sentence lengths across the answer. Human writers vary their sentence length naturally — short punchy sentences mixed with longer explanatory ones. AI-generated text tends to produce sentences of unnaturally consistent length. A low standard deviation scores higher.

    S3

    Type-Token Ratio Uniformity

    Up to 8 pts

    Splits the answer into paragraphs and checks how consistently the unique-words-to-total-words ratio (TTR) appears in each. Humans have natural vocabulary variation across paragraphs. AI tends to produce eerily consistent TTR across all sections. Low variance between paragraph TTR scores triggers this signal.

    S4

    Formal Transition Overuse

    Up to 8 pts

    Counts transition phrases per 100 words — 'Furthermore', 'Moreover', 'Additionally', 'In addition', 'Consequently', 'Subsequently', 'Nevertheless', 'Notwithstanding'. AI uses these at roughly 3–5× the rate of human writers. Answers exceeding the threshold score points on this signal.

    S5

    Contraction Absence

    Up to 6 pts

    Checks for contractions (don't, it's, we're, can't, won't, I'd, they've) in answers over 150 words. Human writers naturally use contractions in informal assessment responses. AI almost exclusively writes in formal full forms. An answer with zero contractions in a long response is flagged.

    S6

    Passive Voice Ratio

    Up to 6 pts

    Calculates the percentage of sentences using passive voice constructions ('was completed by', 'is considered to be', 'have been identified as', 'it is suggested that'). AI generates passive voice at roughly 2× the human rate. Answers over the threshold score on this signal.

    S7

    Template Pattern Detection

    Up to 10 pts

    Detects generic AI intro and conclusion templates: 'This essay will discuss...', 'In conclusion, it can be seen that...', 'This response will explore...', 'To summarise the above...', 'In the context of this question...'. These formulaic openers and closers are a strong AI indicator when found in short assessment answers.

    S8

    Trigram Repetition

    Up to 8 pts

    Counts the ratio of unique three-word sequences (trigrams) to total trigrams across the answer. AI text reuses certain three-word patterns more than human writing. A low uniqueness ratio — meaning many trigrams are repeated — scores on this signal.

    S9

    Sentence-Start Uniformity

    Up to 6 pts

    Analyses how sentences begin across the answer. AI tends to start sentences with the same words or types of phrases repeatedly (e.g., multiple sentences beginning with 'The', 'This', 'In', 'It'). A high repetition rate in sentence-opening words scores on this signal.

    S10

    Vocabulary Richness Extremity

    Up to 6 pts

    Flags answers that are either suspiciously sophisticated (type-token ratio far above class average, suggesting AI-generated advanced vocabulary) or suspiciously plain (very low TTR suggesting templated/repetitive language). Both extremes relative to the submission context are scored.

    S11

    Cross-Section Style Inconsistency

    Up to 10 pts

    Compares the linguistic style between different questions/sections in the same document. If Question 1 reads like a nervous student and Question 4 reads like a PhD thesis, it suggests the student only AI-generated some answers. Detects significant style shifts using vocabulary and sentence structure comparison.

    S12

    Cross-Student Jaccard Similarity

    Up to 15 pts

    Compares every student's answer to every other student's answer using bigram (two-word pair) overlap — the Jaccard similarity index. Catches copy-paste sharing between students even when surface text has been lightly paraphrased. The most heavily weighted signal because shared content between students is the most reliable indicator of academic misconduct.

    Risk Level Thresholds (score out of 100)

    Low
    Score 0–34
    Medium
    Score 35–64
    High
    Score 65–100
    What Teachers See

    Risk Badge (Grading Interface)

    A Low / Medium / High badge appears inline next to each student's uploaded file in the Assignment grading interface. Clicking the badge opens the full report. Only users with the plagiarism/docguard:viewreport capability can see it — students cannot.

    Per-Student Report

    The full report shows a section-by-section breakdown: which signals fired on each question, the score each signal contributed, and example text excerpts from the student's own document as evidence. Colour-coded by signal severity.

    Class Report & Similarity Matrix

    The class report lists all students with their overall risk score and per-question breakdown. A cross-student similarity matrix highlights which pairs of students had high bigram overlap — the fastest way to spot shared answers across the cohort.

    Section-Level Scoring

    Each detected question/answer section gets its own score. If a student genuinely answered Q1 but used AI for Q3, the per-section scoring will show Q1 as Low and Q3 as High — rather than averaging everything into a misleading overall score.