Certificate Module for Totara

Electronic Certificate Issuance and Management System

Overview

The Certificate module is a comprehensive module for Totara Learn designed to issue and manage electronic certificates for users upon completion of training courses or achievement of specific conditions.

This module provides an integrated system for creating, customizing, and issuing electronic certificates in PDF format with full support for Arabic, English, and other languages. The module supports different certificate types, custom editor, font management, QR Codes for certificate verification, and advanced customization tools.

Certificates can be fully customized in terms of design, content, fonts, colors, borders, seals, and signatures. The module also supports email notifications, certificate reports, and certificate verification via QR Code.

Key Features

📜 Electronic Certificate Issuance

  • Issue professional PDF certificates
  • Automatic issuance upon course completion
  • Issuance based on specific conditions (grades, time, activities)
  • Store issued certificates
  • Preview certificates before issuance

🎨 Multiple Certificate Types

  • A4 Embedded - A4 certificate with embedded fonts
  • A4 Non-Embedded - A4 certificate without embedded fonts
  • Letter Embedded - Letter certificate with embedded fonts
  • Letter Non-Embedded - Letter certificate without embedded fonts
  • Custom Editor - Custom certificate editor

✏️ Custom Editor

  • Visual editing interface for certificates
  • Drag and drop elements
  • Customize fonts, sizes, and colors
  • Add text and images
  • Add dynamic elements (user name, course name, date, etc.)
  • Instant preview of changes

🔤 Advanced Font Management

  • Advanced Font Manager
  • Upload custom fonts (TTF, OTF, WOFF, WOFF2)
  • Font preview
  • Font testing
  • Multi-language support
  • Default fonts included (Dejavusans, Dejavuserif)
  • Special Arabic fonts

🔲 QR Code Verification

  • Automatic QR Code generation for each certificate
  • Verify certificate validity via QR Code
  • Separate verification page
  • Secure certificates against forgery

🎨 Full Customization

  • Customize borders - lines or images
  • Add seals
  • Add signatures
  • Add watermarks
  • Customize text and fonts
  • Customize colors
  • Customize alignment (Left, Center, Right)

📄 Template Builder

  • Create custom certificate templates
  • Advanced element system
  • Dynamic elements
  • Export and import templates
  • Template validation

📊 Reports and Statistics

  • Issued certificates report
  • View certificates per user
  • View certificates per course
  • Export data
  • Delete issued certificates

📧 Email Notifications

  • Send certificates via email
  • Notifications to trainers when certificate is issued
  • Notifications to others (Notify Others)
  • Customize email content

🌐 Multi-language Support

  • Full support for Arabic language
  • Support for English language
  • RTL and LTR support
  • Special Arabic fonts
  • Date formatting by language

✅ Validation System

  • Validate certificate data
  • Validate fonts
  • Validate templates
  • Validate content

Installation

Requirements

Installation Steps

  1. Copy Files:

    Copy the certificate folder to the server/mod/ directory in Totara

    C:\wamp64\www\totara\server\mod\certificate
  2. Install Module:

    Navigate to the Site Administration page in Totara. The new module will be automatically detected and you will see a message indicating that the installation is complete.

  3. Upgrade Database:

    Click the "Upgrade database" button if a database upgrade message appears. The following tables will be created:

    • certificate - to store certificate information
    • certificate_issues - to store issued certificates
    • And other tables
  4. Configure Fonts (Optional):

    Upload custom fonts through Font Manager if you want to use special fonts.

💡 Note: Default fonts (Dejavusans, Dejavuserif) are supported built-in. You can use them directly or upload custom fonts.

Configuration

Module Settings

When creating a new Certificate activity in a course, you can configure:

Setting Description
Certificate Name Certificate name
Certificate Type Certificate type (A4, Letter, Embedded, Non-embedded, Custom)
Orientation Orientation (Portrait, Landscape)
Border Style Border style (Border Image or Lines)
Border Color Border color
Custom Text Custom text (for signatures and names)
Delivery Delivery method (Open in Browser, Force Download, Email)
Email Others Send notifications to others
Print Teacher Print trainer name on certificate
Print Seal Print seal on certificate
Print Signature Print signature on certificate
Locking Options Locking options (when to issue certificate)
Issue Options Issue options (on course completion, based on grade, etc.)

System Settings

You can configure system settings from:

Site Administration > Plugins > Activity modules > Certificate

Available settings:

Usage

Creating a Certificate Activity

  1. Navigate to the training course
  2. Enable "Turn editing on"
  3. Click "Add an activity or resource"
  4. Select "Certificate"
  5. Fill in the form:
    • Certificate name
    • Certificate type
    • Design settings
    • Issue options
  6. Click "Save and return to course"

Previewing Certificate

You can preview the certificate from:

/mod/certificate/certificate_preview.php?id=CERTIFICATE_ID

Or from within the activity - "Preview" button

The preview page allows:

Receiving Certificate

Users can receive the certificate from:

Viewing Own Certificates

Users can view all their certificates from:

/mod/certificate/viewarchive.php

This page displays:

Verifying Certificate

You can verify certificate validity from:

/mod/certificate/verify.php

Or by scanning the QR Code on the certificate

Certificate Types

A4 Embedded

A4-sized certificate with embedded fonts. Uses Dejavusans and Dejavuserif fonts. Suitable for languages that use special characters such as Arabic.

Features:

A4 Non-Embedded

A4-sized certificate without embedded fonts. Uses Helvetica and Times fonts. Suitable when fonts are available on user devices.

Features:

Letter Embedded

Letter-sized certificate (8.5 × 11 inches) with embedded fonts. Same features as A4 Embedded but Letter size.

Letter Non-Embedded

Letter-sized certificate without embedded fonts. Same features as A4 Non-Embedded but Letter size.

Custom Editor

Custom certificate editor. Allows creating fully custom certificate designs using a visual editing interface.

Features:

💡 Tip: Use Embedded types for languages that use special characters like Arabic, and use Non-Embedded types for English if you want smaller file sizes.

Custom Editor

Overview

The Custom Editor is an advanced tool that allows creating and editing certificate designs visually and easily. You can add elements, edit them, move them, and customize them easily.

Accessing the Editor

Access the Custom Editor from:

/mod/certificate/certificate_editor.php?id=CERTIFICATE_ID

Or from within Certificate activity - "Edit Certificate" button

Available Elements

You can add the following elements:

Element Description
Text Element Static text element
Dynamic Element Dynamic element (user name, course name, date, etc.)
Image Element Image
Border Element Border
Seal Element Seal
Signature Element Signature
Watermark Element Watermark

Customizing Elements

You can customize each element:

Dynamic Elements

Available dynamic elements:

Font Management

Font Manager

Access the Font Manager from:

/mod/certificate/font_manager.php

The Font Manager allows:

Uploading a New Font

  1. Navigate to Font Manager
  2. Click "Upload Font"
  3. Select font file (TTF, OTF, WOFF, WOFF2)
  4. Enter font name (optional)
  5. Click "Upload"
  6. Font will be saved in fonts/ folder

Supported Fonts

The module supports:

Default Fonts

The module comes with default fonts:

Testing Fonts

You can test fonts to find out:

QR Code Verification

Overview

Each issued certificate gets a unique QR Code. This QR Code can be used to verify certificate validity and ensure it is authentic and not forged.

How It Works

  1. When a certificate is issued, a unique code is generated
  2. A QR Code containing the verification link is created
  3. QR Code is printed on the certificate
  4. QR Code can be scanned to verify certificate validity

Verifying Certificate

You can verify the certificate from:

/mod/certificate/verify.php?code=CERTIFICATE_CODE

Or through:

Verification Page

The verification page displays:

💡 Note: QR Code provides additional security for certificates and helps prevent forgery.

Template Builder

Overview

The Template Builder system allows creating custom certificate templates using a programming interface. Complex and advanced templates can be built using this system.

Using Template Builder

use mod_certificate\builder\template_builder; $builder = new template_builder('A4_embedded'); $template = $builder ->addTextElement('Certificate Title', 10, 30, 'freesans', 30, '#000080', 'C') ->addTextElement('This is to certify that', 10, 50, 'freeserif', 20, '#000000', 'C') ->addDynamicElement('user_name', 10, 70, ['font' => 'freesans', 'size' => 30]) ->addTextElement('has completed the course', 10, 90, 'freeserif', 20, '#000000', 'C') ->addDynamicElement('course_name', 10, 110, ['font' => 'freesans', 'size' => 20]) ->addDynamicElement('date', 10, 130, ['font' => 'freeserif', 'size' => 14]) ->build();

Template Validation

Templates can be validated to ensure they are correct and contain no errors. The system validates:

Customization

Borders

You can customize borders in two ways:

Seals

You can add seals from:

Signatures

You can add signatures from:

Watermarks

You can add watermarks from:

Text Customization

You can customize:

Issue Options

You can specify when to issue the certificate:

Capabilities

The module includes the following capabilities:

Capability Description Default
certificate:addinstance Add Certificate activity Managers and trainers
certificate:view View certificate All authenticated users
certificate:student Receive certificate All authenticated users
certificate:manage Manage Certificate activity Managers and trainers
certificate:printteacher Print trainer name on certificate Trainers
certificate:receivenotification Receive notifications when certificate is issued Trainers
💡 Note: These capabilities can be customized from Site Administration > Users > Permissions > Define roles

Troubleshooting

Common Issues

Certificate Not Issuing

Fonts Not Displaying Correctly

QR Code Not Working

Images Not Appearing

Custom Editor Not Working

Certificate Not Sending via Email

Error Logs

Error logs can be found in Totara's log files. All errors are logged with the prefix [CERTIFICATE] for easy searching.

Debug Mode

To enable debug mode in Totara to see detailed error messages:

  1. Navigate to Site Administration > Development > Debugging
  2. Enable "Debug messages"
  3. Set debug level
  4. Save changes