- What is TestInvite?
- Build Your First Test
- Run Your First Assessment
- Taking the Assessment
- Viewing the Results
- Question Bank Overview
- Common Question Features
- Scoring
- Question Types
- Question Authoring
- Browsing Questions
- Content Blocks
- Media Library
- Metadata Rules & Schema
- Tasks Overview
- Creating a Task
- Task Dashboard
- Steps
- Task Settings
- Candidates
- Test Sessions
- Sent Mails
- Proctoring
- Analytics
- Data Operations
- Analytics Overview
- Test Analytics
- Question Analytics
- Per-Question Analytics
- Results Explorer
- Segment Analysis
Snippets
Snippets are reusable code assets that can be embedded into task interfaces and portal pages to extend their behavior beyond the standard configuration. There are four kinds of snippets, each serving a distinct purpose.
Data Sources
Data sources provide dynamic data that can be referenced inside task interfaces — for example, fetching a list of options to populate a question.
Templates
Templates are reusable HTML/CSS markup blocks that can be injected into task or portal page layouts.
Functions
Functions are reusable JavaScript logic blocks that can be called from within task interfaces to perform calculations or transformations.
Handlers
Handlers are event-driven code blocks that respond to specific events within a task interface, such as a candidate submitting an answer or navigating between questions.
Data sources are reusable snippets that provide dynamic data to task interfaces. Instead of hardcoding data inside a question or task, you define it once as a data source and reference it wherever needed.
Use Cases
- Populating dropdown or selection options in questions.
- Providing a shared dataset referenced across multiple questions.
- Injecting configuration values into a task interface at runtime.
Data sources are managed in Organization → Content → Snippets → Data Sources.
Templates are reusable HTML and CSS markup blocks that can be injected into task interfaces or portal pages. They let you define a consistent visual structure once and reuse it across multiple tasks.
Use Cases
- Defining a shared layout for a custom task interface.
- Injecting styled content blocks (headers, instruction panels) into multiple questions.
- Reusing a branded page section across portal pages.
Templates are managed in Organization → Content → Snippets → Templates.
Functions are reusable JavaScript logic blocks that can be called from within task interfaces. They encapsulate calculations, transformations, or validation logic that you want to share across multiple questions or tasks.
Use Cases
- Calculating a score or derived value from candidate input.
- Transforming or formatting data before it is displayed.
- Validating candidate input against custom rules.
Functions are managed in Organization → Content → Snippets → Functions.
A handler turns a test session's data into output. It combines an optional function (JavaScript that computes values from the session data) with a template (Nunjucks or Mustache that renders those values as HTML or text). Handlers are managed in Organization › Snippets › Handlers.
Use cases
| Use Case | What the handler produces | Where it is used |
|---|---|---|
| Test session report summary | An HTML report | Custom reports on a test |
| Notification email subject generator | The email subject (plain text) | A step's admin notification email |
| Notification email body generator | The email body (HTML) | A step's admin notification email |
| Notification email attachment generator | An attachment, for example rendered to PDF | A step's admin notification email |
Every use case receives the same input — the session's Report Input. For notification emails, the step's notification settings decide whether the benchmark, the test's reporting settings and the questions and answers are added to it.
Building a handler
- Set the Use Case, and for report handlers the Test ID of the test it belongs to.
- Save real session data under Sample data to preview the output while you work.
- Turn on Enable function and Enable template as needed; Output: Data and Output: Report show the result live.
The function and template rules are the same for every use case: see Writing the Function and Writing the Template, or start with Build Your First Custom Report.