Export math problems to Canvas, Moodle, D2L, H5P, and QTI quiz formats.
This package converts competition math problems into standardized quiz formats compatible with major LMS platforms. Each generator produces a ready-to-import file with multiple-choice questions, correct answer marking, and solution feedback where supported.
| Format | Notes | Output |
|---|---|---|
| Canvas LMS | QTI-compatible XML. Import via Settings → Import Course Content → QTI. | canvas_quiz.xml |
| Moodle | Moodle XML format with full HTML and LaTeX support. Import via Question bank → Import. | moodle_quiz.xml |
| D2L / Brightspace | D2L-specific XML with multiple choice questions and solution feedback. Import via Quizzes → Import. | d2l_quiz.xml |
| H5P | Interactive HTML5 quiz package with MathJax support, progress tracking, and retry controls. | quiz.h5p |
| QTI 2.1 | IMS QTI standard XML. Compatible with Blackboard, Sakai, and most modern LMS platforms. | qti_quiz.xml |
Install via Composer:
composer require waterloobae/quizconverter
Register download routes in routes/web.php:
use Waterloobae\QuizConverter\CanvasQuizGenerator;
use Waterloobae\QuizConverter\MoodleQuizGenerator;
use Waterloobae\QuizConverter\D2LQuizGenerator;
use Waterloobae\QuizConverter\H5PQuizGenerator;
use Waterloobae\QuizConverter\QTIQuizGenerator;
Route::post('/quiz/canvas/download', function(Request $request) {
$generator = new CanvasQuizGenerator();
$generator->setQuestions($request->input('questions'));
return $generator->download();
});
Route::post('/quiz/moodle/download', function(Request $request) {
$generator = new MoodleQuizGenerator();
$generator->setQuestions($request->input('questions'));
return $generator->download();
});
Canvas, D2L, and QTI use a simple array format:
$questions = [
[
'text' => 'What is $2 + 2$?',
'choices' => ['3', '4', '5', '6'],
'correct_index' => 1,
'solution' => '$2 + 2 = 4$.',
],
];
Moodle uses a named answers structure:
$questions = [
[
'type' => 'multiple_choice',
'question' => 'What is $2 + 2$?',
'answers' => [
['text' => '3', 'correct' => false],
['text' => '4', 'correct' => true],
['text' => '5', 'correct' => false],
],
'solution' => '$2 + 2 = 4$.',
],
];
H5P uses the same structure as Moodle but with a text key instead of question:
$questions = [
[
'type' => 'multiple_choice',
'text' => 'What is $2 + 2$?',
'choices' => [
['text' => '3', 'correct' => false],
['text' => '4', 'correct' => true],
],
'solution' => '$2 + 2 = 4$.',
],
];
setVersion().Controller for easy route integration.ext-zip for H5P package generation.ext-json for JSON operations.