Hi Cecile,
1.- You wrote "I have modified report.php to check the "readallresponses" capability instead of function "can_view_all_responses()", is it OK?"
Did you do this modification before or after you noticed the error message? If you did the modification after you noticed the error, did the error disappear?
2.- As I wrote before I do not see that error on my own Moodle sites. If I can't reproduce it then I can't help.

