bright-cloud-studio / contao-osi-test-import
Contao backend module to import test forms and multiple-choice questions from CSV (append-only).
Package info
github.com/brightcloudstudio/contao-osi-test-import
Type:contao-bundle
pkg:composer/bright-cloud-studio/contao-osi-test-import
v1.0.0
2026-08-21 18:20 UTC
Requires
- php: >=8.1
- contao/core-bundle: ^5.3
README
A Contao 5.3 back end module for bulk-importing test forms and multiple‑choice questions from a CSV file. It creates the corresponding tl_form and tl_form_field records so you don't have to build each certification/quiz form by hand.
What it does
- Adds a back end module CSV Test Form Importer under the System navigation group (
contao?do=bcs_osi_test_import). - Reads a CSV, groups rows by form title, and shows a preview before anything is written.
- On confirmation, creates one form per title plus a form field for each question (and a submit button), then shows a results summary with any skipped/invalid rows.
- Append‑only: it always creates new forms/fields; it never edits or deletes existing ones.
- Auto‑detects UTF‑8 / Windows‑1252 encoding and drops a sample file at
files/test_csv_importer/example_forms.csvon first run.
CSV format
Header row (only form_title, question, option_1, and correct_option are required):
form_title,embed_code,percentage,question,option_1,option_2, … ,option_10,correct_option
- form_title – rows sharing a title are grouped into one form.
- embed_code – optional HTML/iframe stored on the form.
- percentage – passing score (defaults to
90if blank). - question – the question text.
- option_1 … option_10 – answer choices (leave unused ones blank).
- correct_option – the correct choice number, or several separated by commas (e.g.
2or2,4). Multiple correct answers produce a multiple‑answer field.
Requirements
- Contao
^5.3 - PHP
>=8.1
Installation
composer require bright-cloud-studio/contao-osi-test-import
Then rebuild the Contao cache. The module appears under System for users whose group has access to it (admins by default).