sborniktestov / embed
Embed interactive quizzes from sborniktestov.ru into any PHP application. Generates embed HTML with 20+ customizable parameters.
Requires
- php: >=7.4
This package is auto-updated.
Last update: 2026-04-21 10:32:16 UTC
README
Embed interactive quizzes from sborniktestov.ru into any PHP application. 15,000+ quizzes: personality tests, knowledge checks, professional assessments, and more.
Generates the exact HTML that the embed loader expects — a div.st-embed container with data-attributes + the async loader script.
Install
composer require sborniktestov/embed
Usage
use SbornikTestov\Embed; // Basic embed $embed = new Embed(12345); echo $embed->render(); // With customization $embed = new Embed(12345, [ 'comments' => '1', 'header' => '0', 'color-accent' => '4CAF50', 'color-bg' => 'f5f5f5', 'radius' => '12', 'font-question'=> '18', ]); echo $embed->render();
Output
<div class="st-embed" data-quiz-id="12345" data-comments="1" data-color-accent="4CAF50"> <a href="https://sborniktestov.ru">Sbornik Testov</a> </div> <script async src="https://sborniktestov.ru/embed/loader.js"></script>
Multiple quizzes on one page
$quiz1 = new Embed(111); $quiz2 = new Embed(222); echo $quiz1->div(); echo $quiz2->div(); // One script tag is enough for all quizzes echo $quiz1->script();
Direct iframe URL
$embed = new Embed(12345, ['color-accent' => 'ff5500']); echo $embed->iframeUrl(); // https://sborniktestov.ru/embed/?id=12345&color_accent=ff5500
Available Options
Display: comments (0/1), related (0/1), header (0/1), desc (0/1), stats (0/1)
Layout: width, min-height, max-width
Colors (hex, no #): color-accent, color-bg, color-title, color-text, color-btn-text, color-selected-bg, color-progress-bg, color-progress-fill, color-border, color-border-selected, color-btn-prev, color-hover
Typography (px): font-title, font-desc, font-stats, font-question, font-answer, radius, padding
CMS Plugins
- WordPress —
[sborniktestov id="12345"] - Joomla —
{sborniktestov id=12345} - Moodle — auto-embed filter
- Drupal — module
Visual Configurator
Use the embed configurator to customize with a live preview.
License
MIT — sborniktestov.ru