I set up a demo questionnaire with "visible groups", and a course that had a couple of users in different groups. Each user completed the questionnaire and then went to view the results clicking on the "all responses" link.
Error reading from database
More information about this error
Debug info: ERROR: operator does not exist: character varying = bigint
LINE 7: R.username=GM.userid
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
SELECT R.id, R.survey_id, R.submitted, R.username
FROM mdl_questionnaire_response R,
WHERE R.survey_id=2 AND
ORDER BY R.id
• line 391 of /lib/dml/moodle_database.php: dml_read_exception thrown
• line 232 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
• line 672 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
• line 163 of /mod/questionnaire/report.php: call to pgsql_native_moodle_database->get_records_sql()
This is caused because R.username is a character not integer field. The SQL needs to be (cast (R.username as int))=GM.userid.
Once fixed at line 163,176,199 the same error is revealed at lines and in choose_group_form.php at line 61 and in locallib.php at line 2271.
There may be other places that use a similar query which I haven't uncovered yet!