Print student's report

Print student's report

by Cécile Deruy -
Number of replies: 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?

Average of ratings: -
In reply to Cécile Deruy

Re: Print student's report

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of 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?
In reply to Joseph Rézeau

Re: Print student's report

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of 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.

In reply to Joseph Rézeau

Re: Print student's report

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of 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.

In reply to Joseph Rézeau

Re: Print student's report

by 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!
In reply to Cécile Deruy

Re: Print student's report

by 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

Attachment Screenshot 2021-01-18 at 15.54.16.png
Attachment Screenshot 2021-01-18 at 15.54.45.png
In reply to Rik van den Eijnden

Re: Print student's report

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of 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?
In reply to Joseph Rézeau

Re: Print student's report

by 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
Attachment Screenshot 2021-01-19 at 13.41.12.png
In reply to Rik van den Eijnden

Re: Print student's report

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of 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.thoughtful

I will investigate and post my results here after I've hopefully found a fix.

In reply to Joseph Rézeau

Re: Print student's report

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Average of ratings: Useful (1)
In reply to Joseph Rézeau

Re: Print student's report

by 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 wink )
In reply to Joseph Rézeau

Re: Print student's report

by Blair F. -
Picture of 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.