There is an error when a student click on the top-left print icon in his/her report: permission missing.
I have modified report.php to check the "readallresponses" capability instead of function "can_view_all_responses()", is it OK?
Hi Cecile,
Usual forum rules apply, one question/topic only per discussion thread! I just split your reply to a new discussion, because the second part was a new question, unrelated to the first.
Below I have copied the first part of your post:
Sorry,I forgot! Moodle 3.9.2 and Questionnaire 3.9.1, but I also tried with Moodle 3.10 and it's the same.
The problem is when a student wants to print the report with this icon ("Print this response") :
He/she gets this message:
Only for students, not for teachers.
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.
Hi all,
We are running into the exact same issue here.
Students trying to print their own questionnaire response receive an error message. See attached images.
Questionnaire mod_questionnaire | 3.9.0 (Build - 2020062300) 2020062301 |
Thanks for your assistance.
Rik
Somewhere in the questionnaire files this comment says:
"If questionnaire is set to separate groups, prevent user who is not member of any group and is not a non-editing teacher to view All responses. "
- is your questionnaire set to separate groups?
- Is that "anonymous" student a member of any of those groups?
I think I got it.
The bug happens when student clicks on the "Print this Response button" of a questionnaire which is still open. The Questionnaire mod then wrongly tries to print "all responses" instead of the student's individual report, which triggers the error message.
I will investigate and post my results here after I've hopefully found a fix.
This has now been integrated into the MOODLE_310_STABLE branch and will be available with the next release.