SUI-614: [h5pauthor] Folge-Feature H5P.MultiChoice #108

Merged
johannes.moskaliuk merged 1 commit from dev/sven/SUI-614 into main 2026-08-04 19:57:53 +00:00

SUI-614 — [h5pauthor] Folge-Feature: H5P.MultiChoice

Follow-up to q02 (SUI-47): new content type multichoice built on H5P.MultiChoice — one question per package with one or more correct answers (real multiple selection via behaviour type: auto; single correct → radios, several → check boxes). H5P.QuestionSet stays out of scope per the SUI-614 Abgrenzung.

Changes (full vertical slice, mirrors singlechoice)

  • content_type: register MULTICHOICEH5P.MultiChoice 1.16 (admin override multichoice_version).
  • multichoice_content: build() (validates ≥2 answers + ≥1 correct, type=auto, shuffled) + parse_answer_lines() (every *-marked line is correct).
  • prompts::multichoice + generator::draft_multichoice (one question, {text, correct} answers).
  • authoring_service::create_multichoice + generate() branch.
  • MCP tool create_multichoice (+ db/services.php; generate type list updated).
  • DE/EN strings incl. mc_ runtime labels, error_noanswers / error_nocorrect.
  • Wizard content-type option; settings.php override.
  • DevFlow docs (01/02/03/05, 04-tasks q02→answered + task10), CHANGELOG, version.php0.6.0.

Tests / checks

  • php -l clean on all 16 changed PHP files; git diff --check clean except the DevFlow docs' pre-existing two-space markdown hard-breaks.
  • PHPUnit added: content_builder_test (+7), generator_test (+3), h5p_package_builder_test (+1) — pure-function mirrors of the existing green suite.
  • Codechecker (moodle-cs in demo-webserver-1): new files produce the identical sniff profile to their already-merged siblings (create_multichoice.php == create_singlechoice.php, multichoice_content.php == singlechoice_content.php) — 0 new violation classes; the flagged items are the plugin's accepted house style under that container's newer moodle-cs build.
  • Full PHPUnit run could not complete: the shared demo test env's init.php aborts during install_cli_database because of pre-existing, unrelated broken plugins (webservice_elediamcp has no version.php; local_elediaai_tutor_premium/version.php unreadable). My plugin passes Moodle's own init validation (-->local_elediaai_h5pauthor ++ Success). The consistent elediaai-moodle-1 container has no PHPUnit/composer provisioning.

Head: 26036156afc080857fa6f7b08c0c3f33f190ecbc

Refs SUI-614

## SUI-614 — [h5pauthor] Folge-Feature: H5P.MultiChoice Follow-up to `q02` (SUI-47): new content type **`multichoice`** built on `H5P.MultiChoice` — one question per package with **one or more** correct answers (real multiple selection via behaviour `type: auto`; single correct → radios, several → check boxes). `H5P.QuestionSet` stays out of scope per the SUI-614 Abgrenzung. ### Changes (full vertical slice, mirrors `singlechoice`) - `content_type`: register `MULTICHOICE` → `H5P.MultiChoice` 1.16 (admin override `multichoice_version`). - `multichoice_content`: `build()` (validates ≥2 answers + ≥1 correct, `type=auto`, shuffled) + `parse_answer_lines()` (every `*`-marked line is correct). - `prompts::multichoice` + `generator::draft_multichoice` (one question, `{text, correct}` answers). - `authoring_service::create_multichoice` + `generate()` branch. - MCP tool `create_multichoice` (+ `db/services.php`; `generate` type list updated). - DE/EN strings incl. `mc_` runtime labels, `error_noanswers` / `error_nocorrect`. - Wizard content-type option; `settings.php` override. - DevFlow docs (`01`/`02`/`03`/`05`, `04-tasks` q02→answered + `task10`), CHANGELOG, `version.php` → `0.6.0`. ### Tests / checks - `php -l` clean on all 16 changed PHP files; `git diff --check` clean except the DevFlow docs' pre-existing two-space markdown hard-breaks. - PHPUnit added: `content_builder_test` (+7), `generator_test` (+3), `h5p_package_builder_test` (+1) — pure-function mirrors of the existing green suite. - Codechecker (moodle-cs in `demo-webserver-1`): new files produce the **identical** sniff profile to their already-merged siblings (`create_multichoice.php` == `create_singlechoice.php`, `multichoice_content.php` == `singlechoice_content.php`) — 0 new violation classes; the flagged items are the plugin's accepted house style under that container's newer moodle-cs build. - Full PHPUnit run could not complete: the shared demo test env's `init.php` aborts during `install_cli_database` because of **pre-existing, unrelated** broken plugins (`webservice_elediamcp` has no `version.php`; `local_elediaai_tutor_premium/version.php` unreadable). My plugin passes Moodle's own init validation (`-->local_elediaai_h5pauthor ++ Success`). The consistent `elediaai-moodle-1` container has no PHPUnit/composer provisioning. Head: `26036156afc080857fa6f7b08c0c3f33f190ecbc` Refs SUI-614
feat(elediaai_h5pauthor): add H5P.MultiChoice content type
Some checks failed
Repo-Gates / gates (push) Has been cancelled
Repo-Gates / Notify CI-Fixer (push) Has been cancelled
PHPCS quality / PHPCS ratchet (push) Has been cancelled
PHPCS quality / PHPCS full scan (push) Has been cancelled
PHPCS quality / Notify CI-Fixer (push) Has been cancelled
Repo-Gates / gates (pull_request) Failing after 24s
Moodle Plugin CI / changes (pull_request) Successful in 25s
PHPCS quality / PHPCS full scan (pull_request) Has been skipped
PHPCS quality / PHPCS ratchet (pull_request) Failing after 35s
Repo-Gates / Notify CI-Fixer (pull_request) Has been skipped
Moodle Plugin CI / subscription (MOODLE_502_STABLE) (, , subscription, MOODLE_502_STABLE, local/elediaai_subscription) (pull_request) Successful in 4m51s
Moodle Plugin CI / tutor (MOODLE_502_STABLE) (, , tutor, MOODLE_502_STABLE, blocks/elediaai_tutor) (pull_request) Successful in 5m19s
Moodle Plugin CI / tutor-with-quota (MOODLE_502_STABLE) (, local/elediaai_core, tutor-with-quota, MOODLE_502_STABLE, blocks/elediaai_tutor) (pull_request) Successful in 5m8s
Moodle Plugin CI / Behat chat (MOODLE_502_STABLE) (, local/elediaai_core, chat, MOODLE_502_STABLE, blocks/elediaai_chat mod/aichat mod/aifeedback, @mod_aichat) (pull_request) Has been skipped
Moodle Plugin CI / Behat tactics (MOODLE_502_STABLE) (lernhive, , tactics, MOODLE_502_STABLE, local/elediaai_tactics blocks/elediaai_tactics, @local_elediaai_tactics,@block_elediaai_tactics) (pull_request) Has been skipped
PHPCS quality / Notify CI-Fixer (pull_request) Has been skipped
Moodle Plugin CI / chat (MOODLE_502_STABLE) (, local/elediaai_core, chat, MOODLE_502_STABLE, blocks/elediaai_chat mod/aichat mod/aifeedback) (pull_request) Successful in 6m31s
Moodle Plugin CI / authoring (MOODLE_502_STABLE) (, local/elediaai_core, authoring, MOODLE_502_STABLE, local/elediaai_questiongen local/elediaai_coursegen qbank/elediaai_questiongen local/elediaai_h5pauthor qtype/aitext) (pull_request) Successful in 7m21s
Moodle Plugin CI / tactics (MOODLE_502_STABLE) (lernhive, , tactics, MOODLE_502_STABLE, local/elediaai_tactics blocks/elediaai_tactics) (pull_request) Successful in 4m52s
ci-fixer/error Moodle CI core (MOODLE_502_STABLE): No syntax error found There was 1 failure: Failed asserting that two strings are identical.
Moodle Plugin CI / core (MOODLE_502_STABLE) (customerportal, local/elediaai_core qtype/aitext, core, MOODLE_502_STABLE, ai/provider/eledia local/activityfilter local/aitransparency auth/eledia_eduplaces admin/tool/taskrunner customfield/field/languageselect filter/eledia… (pull_request) Failing after 5m16s
Moodle Plugin CI / learning (MOODLE_502_STABLE) (lernhive, local/elediaai_core mod/aichat, learning, MOODLE_502_STABLE, local/elediaai_selfstudy local/elediaai_strategy local/elediaai_teachertools local/elediaai_tutor_premium blocks/elediaai_path) (pull_request) Successful in 5m17s
Moodle Plugin CI / Notify CI-Fixer (pull_request) Has been skipped
26036156af
Follow-up to q02 (SUI-47): a new "multichoice" content type built on
H5P.MultiChoice — one question per package with one or more correct
answers (real multiple selection via behaviour type "auto"). Wired
through the full vertical slice like singlechoice: content_type
registry, multichoice_content builder + parse_answer_lines, prompt +
generator::draft_multichoice, authoring_service::create_multichoice and
the generate() branch, MCP tool create_multichoice (+ db/services),
settings override multichoice_version, DE/EN strings incl. runtime
labels, the wizard content-type option, and PHPUnit tests
(content_builder, generator, h5p_package_builder). Bumps to 0.6.0.
H5P.QuestionSet stays out of scope (SUI-614 Abgrenzung).

Refs SUI-614

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
johannes.moskaliuk/eledia.ai!108
No description provided.