diff --git a/main/exercise/Draggable.php b/main/exercise/Draggable.php
index f4b94dbd03..9a130e7156 100644
--- a/main/exercise/Draggable.php
+++ b/main/exercise/Draggable.php
@@ -223,6 +223,8 @@ class Draggable extends Question
}
} else {
$header .= '
'.get_lang('ElementList').' | ';
+ $header .= ''.get_lang('YourChoice').' | ';
+ $header .= ''.get_lang('ExpectedChoice').' | ';
}
$header .= ''.get_lang('Status').' | ';
$header .= '';
diff --git a/main/exercise/exercise.class.php b/main/exercise/exercise.class.php
index 300613f0a0..44a3c40d78 100755
--- a/main/exercise/exercise.class.php
+++ b/main/exercise/exercise.class.php
@@ -4705,12 +4705,17 @@ class Exercise
if (!empty($s_user_answer)) {
if (DRAGGABLE == $answerType) {
+ $sql = "SELECT answer FROM $table_ans WHERE iid = $s_user_answer";
+ $rsDragAnswer = Database::query($sql);
+ $dragAns = Database::result($rsDragAnswer, 0, 0);
if ($s_user_answer == $i_answer_correct_answer) {
$questionScore += $i_answerWeighting;
$totalScore += $i_answerWeighting;
$user_answer = Display::label(get_lang('Correct'), 'success');
if ($this->showExpectedChoice() && !empty($i_answer_id)) {
$user_answer = $answerMatching[$i_answer_id];
+ } else {
+ $user_answer = $dragAns;
}
$status = Display::label(get_lang('Correct'), 'success');
} else {
@@ -4719,6 +4724,8 @@ class Exercise
/*$data = $options[$real_list[$s_user_answer] - 1];
$user_answer = $data['answer'];*/
$user_answer = $correctAnswers[$s_user_answer] ?? '';
+ } else {
+ $user_answer = $dragAns;
}
}
} else {
@@ -4866,6 +4873,8 @@ class Exercise
} else {
echo ''.$s_answer_label.' | ';
echo ''.$user_answer.' | ';
+ echo ''.$counterAnswer.' | ';
+ echo ''.$status.' | ';
echo '';
if (in_array($answerType, [MATCHING, MATCHING_DRAGGABLE])) {
if (isset($real_list[$i_answer_correct_answer]) &&
diff --git a/main/exercise/matching.class.php b/main/exercise/matching.class.php
index eff5713754..fd67fd7f44 100755
--- a/main/exercise/matching.class.php
+++ b/main/exercise/matching.class.php
@@ -293,6 +293,9 @@ class Matching extends Question
}
if ($exercise->showExpectedChoice()) {
+ if ($exercise->showExpectedChoiceColumn()) {
+ $header .= ' | '.get_lang('ExpectedChoice').' | ';
+ }
$header .= ''.get_lang('Status').' | ';
} else {
if ($exercise->showExpectedChoiceColumn()) {