Your input wanted - grade report at site level in 1.9

Your input wanted - grade report at site level in 1.9

by Matt Campbell -
Number of replies: 15
I've got a very specific issue, and before I file it as a bug or feature request, I thought I'd ask here what the expected behavior is and go from there.

The issue specifically deals with how grades are reported at the site level. Currently, if you go to a user's profile, click activity reports, and then grades, you get a list of the grades for front page activities (course id = 1).

This may be exactly what you want if you are doing graded activities on the front page, which may be the case with some installs that only have one or two teachers, but if you're not doing any graded activities on the front page, this report is not useful at all, and in fact is not at all what we need - we have parents that log in regularly to check on their students and would expect to see the overview report - showing the grades overview for all the student's courses, instead.

What I'd like to find out is this: what is the expected behavior at the front page level when you click on a user's profile, then activity reports, and then grades?

Should this be an option the site administrator should be able to configure? (e.g - an option in Grades->Grade Settings that shows a drop-down for Front Page or All Courses)

Thanks,
Matt


In reply to Matt Campbell

Re: Your input wanted - grade report at site level in 1.9

by Matt Gibson -
Seeing aggregated grades from all courses on the site or in a category is a large part of my moodle fantasizing these days smile I think what you've described has always been the behaviour that was supposed to occur, but I agree that it is definitely short of ideal.
In reply to Matt Gibson

Re: Your input wanted - grade report at site level in 1.9

by Matt Campbell -
I hadn't thought about it by category - we use categories mostly for structure for admins and course creators - but we do have students that are in multiple categories, so I could see how that would be beneficial to them.

I may just figure out how to make it happen for me at the site level and then post the code.

Thanks,
Matt
In reply to Matt Campbell

Re: Your input wanted - grade report at site level in 1.9

by Matt Campbell -

Here's what I'm doing to enable mentors, students, admins, etc - anyone with rights to view student activities - to see the grade overview for that student when they look at the student's user profile:

In /course/user.php, line 71 (where it says case "grade":), you'll want to replace everything from the case statement to the break with the following:

 case "grade":
 $course = get_record('course', 'id', required_param('id', PARAM_INT));
 require_once $CFG->dirroot.'/grade/lib.php';
 if ($course->id == 1) {
 require_once $CFG->dirroot.'/grade/report/overview/lib.php';
 $context = get_context_instance(CONTEXT_COURSE, $id);
 /// return tracking object
 $gpr = new grade_plugin_return(array('type'=>'report', 'plugin'=>'overview', 'userid'=>$user->id));
 // Create a report instance
 $report = new grade_report_overview($user->id, $gpr, $context);
 }
 if ($course->id <> 1 and !empty($course->showgrades)) {
 require_once $CFG->dirroot.'/grade/report/user/lib.php';
 $context = get_context_instance(CONTEXT_COURSE, $id);
 /// return tracking object
 $gpr = new grade_plugin_return(array('type'=>'report', 'plugin'=>'user', 'courseid'=>$id, 'userid'=>$user->id));
 // Create a report instance
 $report = new grade_report_user($id, $gpr, $context, $user->id);
 }

 $gradetotal = 0;
 $gradesum = 0;

 // print the page
 print_heading(get_string('modulename', 'gradereport_user'). ' - '.fullname($report->user));

 if ($report->fill_table()) {
 echo $report->print_table(true);
 }
 // print_student_grade($user, $course);
 break;

I'd appreciate any comments about this - it would be a nice feature to get into core, but I'd like to get more input on what the desired behavior would be.

Thanks,

Matt

In reply to Matt Campbell

Re: Your input wanted - grade report at site level in 1.9

by Dennis Green -
Matt, thanks for sharing. Is there any way I could show the course percentage grade instead?
In reply to Dennis Green

Re: Your input wanted - grade report at site level in 1.9

by Matt Campbell -
Hmmm. I'm showing percentage on my installs, and changing the settings on the user report don't seem to make a difference to what I see, so I'm not sure what you might need to do to change this. Anyone have any ideas?

Thanks,
Matt
In reply to Matt Campbell

Re: Your input wanted - grade report at site level in 1.9

by Dennis Green -

Hmmm..

Well it's showing the grade, but not the percentage column. The two do not match up in some courses, so it's important to see both.

In reply to Matt Campbell

Re: Your input wanted - grade report at site level in 1.9

by Olaf Nöhring -
Hi

I just tried with 1.9.4 - and it did not seem to work for me.
Linux server - I was unable to see more grades (maybe I just looked at the wrong place?

Where exactly to I need to look? (I am administrator)

Olaf
In reply to Olaf Nöhring

Re: Your input wanted - grade report at site level in 1.9

by Matt Campbell -
I'm using this on several 1.9.4 installs, and you just need to go to a user's profile, click activity reports, and then grades to view this.

Thanks,
Matt
In reply to Matt Campbell

Re: Your input wanted - grade report at site level in 1.9

by Felix Berger -
Thank you so much. Worked all nice on my moodle installation (1.9.5+). The user profile now shows all courses in which a user is enroled as student. But there is one thing i am missing:

Those courses where the only assignments i activated were offline-activities are not shown on the profile page. Even though i enroled users and filled in gradings for their offline assignments.

Does anyone hav an idea why those courses won't show and what's to be changed to make them appear on my list?

Thx a lot, Felix
In reply to Felix Berger

Re: Your input wanted - grade report at site level in 1.9

by Felix Berger -
Okay-sorry, this one was my fault - i forgot to set the course's grade visibility to "yes".
In reply to Matt Campbell

Re: Your input wanted - grade report at site level in 1.9

by Jamie Tinley -

This code above worked for me in 1.9 for many many years.  Thanks Matt and Anthony!

I would love to see this updated for Moodle 2.5 which I use now.  Please vote for both of these issues below:

MDL-12874

MDL-30054

Thank you!

In reply to Matt Campbell

Re: Your input wanted - grade report at site level in 1.9

by Lauran de Bever -
Hi,

I am also looking for this feature.
I want to have an overview of all grades of all students in 1 moodle site, or in allor one categorie.
Is this allready made? Or is this whisfull thinking?


Lauran
In reply to Lauran de Bever

Re: Your input wanted - grade report at site level in 1.9

by Matt Campbell -
The code I gave works for Moodle 1.9 Beta 3 - I'm using it now. You will have to add it yourself, as it is not part of Moodle core. This will work for one student at a time, not for all students.

Or, vote for MDL-12874 and see if we can get this included in 1.9.

Thanks,
Matt
In reply to Matt Campbell

Re: Your input wanted - grade report at site level in 1.9

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Matt - I have added a screenshot to the bug to demonstrate what the final product looks like as well as a diff to facilitate developers in evaluating this patch. Personally, I like it so I have voted for this. I think the issue needs to be re-assigned so I will take care of that to make sure it gets seen. Peace - Anthony
In reply to Anthony Borrow

Re: Your input wanted - grade report at site level in 1.9

by Sharon Goodson -
Code works like a charm, Matt! Thanks for saving me from more sleepless nights!