Skip to content

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

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

[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
Copy link
Copy Markdown
Contributor

@Saaweel Saaweel commented Jun 3, 2026

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
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.

1 participant