The username field in questionnaire_response was changed to userid in release 3.3.0. What version are you using? It would seem that somehow your code might be older than your database.
Questionnaire (plugin)
Erro Database one course
This discussion has been locked so you can no longer reply to it.