diff --git a/mod/lesson/pagetypes/matching.php b/mod/lesson/pagetypes/matching.php
index 83c175a..60428d8 100644
--- a/mod/lesson/pagetypes/matching.php
+++ b/mod/lesson/pagetypes/matching.php
@@ -186,7 +186,8 @@ class lesson_page_type_matching extends lesson_page {
             if (array_key_exists($id, $answers)) {
                 $answer = $answers[$id];
                 $result->studentanswer .= '<br />'.format_text($answer->answer, $answer->answerformat
-                if ($id == $value) {
+                if ($id == $value 
+                    || strcmp($answers[$id]->response, $answers[$value]->response) == 0) {
                     $hits++;
                 }
             }
