Print student's report

Print student's report

- Cécile Deruy の投稿
返信数: 14

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?

Cécile Deruy への返信

Re: Print student's report

- Joseph Rézeau の投稿
画像 Core developers 画像 Particularly helpful Moodlers 画像 Plugin developers 画像 Testers 画像 Translators
Hi Cécile,
Which version of Moodle? Which version of Questionnaire?
Using Moodle 3.10 and Questionnaire 2020111100 I do not see any problem with student capability to read their responses.
What exactly do you want your students to be able to do? You want or you don't want to allow them to print their own responses?
Joseph Rézeau への返信

Re: Print student's report

- Joseph Rézeau の投稿
画像 Core developers 画像 Particularly helpful Moodlers 画像 Plugin developers 画像 Testers 画像 Translators

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:


Hi Joseph,
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.

Joseph Rézeau への返信

Re: Print student's report

- Joseph Rézeau の投稿
画像 Core developers 画像 Particularly helpful Moodlers 画像 Plugin developers 画像 Testers 画像 Translators

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.

Joseph Rézeau への返信

Re: Print student's report

- Cécile Deruy の投稿
Hi Joseph,
1: I made this modif after getting the message to try to fix the problem and it worked, the error disappeared.
2: I understand well! In fact this is OK now with my modif, I was just wondering if it was a known bug.
Thank you for these answers!
Cécile Deruy への返信

Re: Print student's report

- Rik van den Eijnden の投稿

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.

Moodle 3.10 (Build: 20201109)

Questionnaire
mod_questionnaire
3.9.0 (Build - 2020062300)
2020062301

Thanks for your assistance.

Rik

添付 Screenshot 2021-01-18 at 15.54.16.png
添付 Screenshot 2021-01-18 at 15.54.45.png
Rik van den Eijnden への返信

Re: Print student's report

- Joseph Rézeau の投稿
画像 Core developers 画像 Particularly helpful Moodlers 画像 Plugin developers 画像 Testers 画像 Translators

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. "

  1. is your questionnaire set to separate groups?
  2. Is that "anonymous" student a member of any of those groups?
Joseph Rézeau への返信

Re: Print student's report

- Rik van den Eijnden の投稿
Hi Joseph,

Thanks for looking into this issue. The questionnaire is NOT set to separate groups. See attached image.

Best,
Rik
添付 Screenshot 2021-01-19 at 13.41.12.png
Rik van den Eijnden への返信

Re: Print student's report

- Joseph Rézeau の投稿
画像 Core developers 画像 Particularly helpful Moodlers 画像 Plugin developers 画像 Testers 画像 Translators

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.

Joseph Rézeau への返信

Re: Print student's report

- Joseph Rézeau の投稿
画像 Core developers 画像 Particularly helpful Moodlers 画像 Plugin developers 画像 Testers 画像 Translators
Joseph Rézeau への返信

Re: Print student's report

- Rik van den Eijnden の投稿
Thanks Joseph for your swift turnaround! I have applied your patch on our copy of the questionnaire module and it solved the problem.
As far as I am concerned this ticket is closed (although I did not open it ウインク )
Joseph Rézeau への返信

Re: Print student's report

- Blair F. の投稿
画像 Particularly helpful Moodlers
It seems like this patch hasn't been implemented, am I right? We've got the latest build installed (3.10.1 (Build - 2021080400) 2020111101) and the problem still exists.