diff --git a/public/main/admin/questions.php b/public/main/admin/questions.php
index db69552a91d..db3dfe18131 100644
--- a/public/main/admin/questions.php
+++ b/public/main/admin/questions.php
@@ -63,11 +63,32 @@
// Answer type
$answerType = isset($_REQUEST['answer_type']) ? (int) $_REQUEST['answer_type'] : null;
$questionList = Question::getQuestionTypeList();
-$questionTypesList = [];
-$questionTypesList['-1'] = get_lang('All');
+$questionTypesList = ['-1' => get_lang('All')];
foreach ($questionList as $key => $item) {
- $questionTypesList[$key] = get_lang($item[1]);
+ // Try to use the Question instance naming logic
+ $instance = Question::getInstance($key);
+ if ($instance instanceof Question) {
+ $label = $instance->get_question_type_name();
+ } else {
+ // Fallback: best-effort human-readable label
+ if (is_array($item)) {
+ $raw = $item[2] ?? $item[1] ?? reset($item);
+ } else {
+ $raw = (string) $item;
+ }
+
+ // Try to translate; if not translated, keep a nicer label
+ $translated = get_lang($raw);
+ if ($translated !== $raw) {
+ $label = $translated;
+ } else {
+ // Turn "UniqueAnswer" into "Unique Answer"
+ $label = preg_replace('/(?read($exerciseId);
$exerciseData .= $exercise->title.' ';
$exerciseData .= Display::url(
- Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')),
- $urlExercise.api_get_cidreq_params($courseInfo['id'], $exercise->sessionId).'&'.http_build_query(
- [
- 'exerciseId' => $exerciseId,
- 'type' => $question->getType(),
- 'editQuestion' => $question->getIid(),
- ]
- ),
- ['target' => '_blank']
- ).'
';
+ Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')),
+ $urlExercise.api_get_cidreq_params($courseInfo['id'], $exercise->sessionId).'&'.http_build_query(
+ [
+ 'exerciseId' => $exerciseId,
+ 'type' => $question->getType(),
+ 'editQuestion' => $question->getIid(),
+ ]
+ ),
+ ['target' => '_blank']
+ ).'
';
}
$question->questionData .= '
'.$exerciseData;
} else {
@@ -308,13 +329,13 @@
);
}
$question->questionData .= '