Skip to content

[ILIAS 11] [FIX] TestQuestionPool: Translate plugin question types#11643

Closed
Saaweel wants to merge 1 commit into
ILIAS-eLearning:release_11from
surlabs:ilias11_TA_fix_QPL_labels
Closed

[ILIAS 11] [FIX] TestQuestionPool: Translate plugin question types#11643
Saaweel wants to merge 1 commit into
ILIAS-eLearning:release_11from
surlabs:ilias11_TA_fix_QPL_labels

Conversation

@Saaweel

@Saaweel Saaweel commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Fix: Plugin question type is not translated in question pool

Mantis: #0047758

Problem

The question list in a question pool was not translating the type name of plugin questions. The ilAssQuestionList::load function was calling $this->lng->txt($row['question_type']) directly, bypassing the plugin's own translation mechanism. The same issue existed in assQuestionGUI::outQuestionType(), used by ilTestCorrectionsGUI::populatePageTitleAndDescription.

Solution

Added a getQuestionTypeTranslation() helper method in both ilAssQuestionList and assQuestionGUI that checks whether the question belongs to a plugin and, if so, delegates to $plugin->getQuestionTypeTranslation(). Otherwise it falls back to the standard language translation.

Files changed

  • components/ILIAS/TestQuestionPool/classes/class.ilAssQuestionList.php
  • components/ILIAS/TestQuestionPool/classes/class.assQuestionGUI.php

How to test

  1. Install a question type plugin.
  2. Add a question of that plugin to a question pool.
  3. Open the question list in the pool — the type column should now show the plugin's translated type name.
  4. Also verify the question type label in the test corrections view (ilTestCorrectionsGUI).

@Saaweel Saaweel self-assigned this Jun 3, 2026
@Saaweel Saaweel added bugfix php Pull requests that update Php code labels Jun 3, 2026
@dsstrassner

Copy link
Copy Markdown
Contributor

PR ILIAS 10: #11642 / Trunk: #11644

@kergomard

Copy link
Copy Markdown
Contributor

Thanks @Saaweel for this PR.

I still close it as it will be hard to see if there are differences from the original discussion in the PR for ILIAS 10. Please only provide PRs towards the oldest version of ILIAS you want your change to support. If we see problems with picking we will let you know and ask you to create PRs for the picks, if we don't, we feel comfortable picking ourselves.

Best,
@kergomard

@kergomard kergomard closed this Jun 8, 2026
@Saaweel Saaweel deleted the ilias11_TA_fix_QPL_labels branch June 9, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants