Custom Reports, results different for audience than builder

Custom Reports, results different for audience than builder

by Jesse Cain -
Number of replies: 7

Hello, 

 I have a custom report that I built for a manager that oversees several departments. I added an optional checkbox attribute to user accounts that are under this manager.

I then made a report that "should" filter out courses that have a particular word in title, that have a particular department number and include any users that have the optional check box value.

When I run the report, I get the expected result but when the audience member runs the report they get results for all users in the system.

Please advise why this might be.

 - J

Attachment Derek_Group_Report_conditions.png
Average of ratings: -
In reply to Jesse Cain

Re: Custom Reports, results different for audience than builder

by Jesse Cain -
No takers on the Moodle community?
In reply to Jesse Cain

Re: Custom Reports, results different for audience than builder

by Paul Holden -
Picture of Core developers Picture of Moodle HQ Picture of Moodle Workplace team Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Jesse, when you say:

When I run the report, I get the expected result but when the audience member runs the report they get results for all users in the system.

Do you mean they get users whose department does contain "9999", are suspended, and/or users who have your custom check box field as "No" (or all)? Could you please describe the setup/configuration of both the user profile field, and the report - nothing immediately springs to mind as to why the conditions wouldn't be applying for a user

My first thought was that said user had extra filters applied, but that would mean they see less data, not more as filters cannot override conditions (they are additive)

Perhaps worth an issue on https://tracker.moodle.org/secure/Dashboard.jspa with as much information as you can provide to aid reproduction

Thanks!

In reply to Paul Holden

Re: Custom Reports, results different for audience than builder

by Jesse Cain -

Paul, Thanks for your attention.

 The real key part of this is that the report is supposed to show only people that have the attribute in their profile under "Multiple Departments" checked for "Derek Bryant Group".

When I, as an administrator, run the report it gives the expected results and I get 793 rows of data in the report. When the report audience user, a regular student account, runs the report they get data back on all students in the system with 4035 rows of data that includes department 9999 and that are not marked as "Derek Bryant Group". It seems to completely ignore the conditions. It does apply the formatting/columns as designed.

The accounts are LDAP, login is authenticated against our Active Directory. I have cloned the account for the end user and I get the same results with excess data.

Is there some reason why attributes like the multi department check box would not be accessible for view by that report end user so the report ignores those conditions? If so how could I correct that? Although if as the end user I view profile it does show the check mark in the attribute. 

 Thanks again.

In reply to Jesse Cain

Re: Custom Reports, results different for audience than builder

by Ballard Ingram -

Howdy!

Mr. Cain - thank you for creating this post. I ran into this same issue and tried everything. Here is what I found was the issue.

It is related to the visibility of the custom profile field. When you say that you "added an optional checkbox attribute to user accounts," did you do that as a checkbox for the profile fields?

In my report, I created a text-input field titled "Report Role" with the value of "Student." This helps us filter out user data related to profiles that are just listed as "Student." My client advised that they see everyone, not just "student." This was because the profile field visibility was set as "User, Teachers, and Admins only." It needs to be "visible to everyone." Once I made that change, boom. It worked. The audience was able to see the report I intended them to see.

Can you try that and see if that fixes it?

Average of ratings: Useful (3)
In reply to Ballard Ingram

Re: Custom Reports, results different for audience than builder

by Paul Holden -
Picture of Core developers Picture of Moodle HQ Picture of Moodle Workplace team Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Thanks a lot Ballard for diagnosing this one. The behaviour you describe is definitely unexpected, so I've created MDL-82809 to fix it (feel free to any extra context to the issue)
Average of ratings: Useful (2)
In reply to Ballard Ingram

Re: Custom Reports, results different for audience than builder

by Jesse Cain -

Hello Ballard,

 Making the attribute visible to everyone seems to have corrected the report results for end user. The underlying cause should get corrected though due to fact that it causes data to be exposed that may want to keep restricted.

 Thank you. 

In reply to Jesse Cain

Re: Custom Reports, results different for audience than builder

by Ballard Ingram -
Hello Jesse,

Yeah that is definitely something that should be corrected. For our site, we don't have that profile information visible on the actual profile, or in any reports, and we did not give any of the users access to update the profile information, so although it is "visible," the end-users can't actually see it.