Skip to content

48210 - Cloze gaps ignore their configured field width - #12033

Closed
lorenzgith wants to merge 1 commit into
ILIAS-eLearning:release_10from
lorenzgith:fix/48210-cloze-gap-width
Closed

48210 - Cloze gaps ignore their configured field width#12033
lorenzgith wants to merge 1 commit into
ILIAS-eLearning:release_10from
lorenzgith:fix/48210-cloze-gap-width

Conversation

@lorenzgith

Copy link
Copy Markdown
Contributor

https://mantis.ilias.de/view.php?id=48210

A cloze question lets the author define the width of a text gap, either per gap or for the whole question via the fixed text length. ILIAS still writes this into the markup correctly, the rendered input carries size="20" maxlength="20" for a configured length of 20.

In ILIAS 10 the field nevertheless always spans the full width of the line, so the setting has no visible effect. The character limit still works, only the width is ignored.

The cause is a rule that was newly introduced in ILIAS 10, in templates/default/070-components/legacy/Modules/_component_test.scss:

.ilc_qanswer_Answer.ilc_answers.answers.ilAssClozeTest p input[type=text] {
	width: 100%;
}

An explicit width overrides the size attribute of an input element, so every gap is rendered full width regardless of its configuration. ILIAS 9 had no comparable rule, the only styling for these inputs was a line-height. The gap templates and the size handling in assClozeTestGUI are unchanged between 9 and 10, so the regression is limited to this rule.

Assuming the rule is meant to keep gaps usable on narrow screens, this scopes it to the mobile breakpoint instead of applying it unconditionally. That is the same pattern the neighbouring rule for .ilc_qinput_TextInput in _component_test_legacy.scss already uses, and it keeps max-width: 65vw as the upper bound on wide screens.

The compiled templates/default/delos.css is included, since it is committed in the repository. To keep it free of noise from a different sass version, I compiled delos.scss before and after the change with the same binary and verified that the only difference is this one rule, then applied exactly that block to the committed file.

Limit the full-width rule for cloze text gaps to the mobile breakpoint so
the size attribute governs the width again on wider screens. Includes the
regenerated block in the compiled delos.css.
@thojou

thojou commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Hey @lorenzgith,

thanks for the PR.
I've reviewed and tested your PR and see a duplication to #12032, which addresses the same problem within another Mantis issue.

Your change works in the test player view, but it reintroduces a regression in manual scoring that was fixed in #11513 (https://mantis.ilias.de/view.php?id=47413): cloze inputs in the scoring view no longer span the full width.

#12032 restores the configured gap width in the test view without breaking the manual scoring layout. I will therefore proceed with #12032 and close this PR.

Again thanks for the effort.

Kind regards,
@thojou

@thojou thojou closed this Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants