I think the problem is whether you used the endswith(...) function or did you do if text1 in text 2... I faced the same problem. If you did the 'in', it might work but that doesn't necessarily mean its just checking the ending of the strings. That's why Moodle brings a hidden test error. So try again using endswith(...).