Gradebook not working correctly

Re: Gradebook not working correctly

by Nicolas Connault -
Number of replies: 8
Hi Tamara,

I just ran a test to verify your bug report. I set up a category and 2 assignments, one graded to 80 points and the other graded to 50. I edited the category settings and set it to drop the lowest grade. I then gave the first student 20/50 and 80/80.

Result: in both the grader report and the user report, the category and course total correctly report 100%.

Can you make sure that you have the latest release of Moodle 1.9? (1.9.1).

Regarding the issue of showing/hiding the percentage column: we decided not to include too many settings for each report for simplicity's sake. However the reports are modular, and it is simple to create new ones based on the grader report, the overview report and the user report. The Open University have their own customised user report for example.

Please let me know if you need instructions on how to edit the user report to hide the percentage column.
In reply to Nicolas Connault

Re: Gradebook not working correctly

by Fr de Thysebaert -
Hi
I also follow this post.
I use categoy and subcategories with some formulas to calculate the score of each student.
Do you have instructions to hide the percentage column of user report or to modify the calculation of this column .
Thanks


In reply to Nicolas Connault

Re: Gradebook not working correctly

by Tamara Snyder -
I was using version 1.9 + (Build: 20080430). After seeing your post, I upgraded, and now I am using 1.9.1+ (Build: 20080521).

There has been no change.

I have a category called "lab" It is set to sum the points and to drop the lowest score. I've created two labs, both worth 20 points. It does not matter what scores I enter for the two labs for my test student. The maximum grade for the category is still listed at 40 points (I can see this in the grader report).

Even stranger things happen if I turn the aggregation to "mean of grades" (still dropping the lowest) If I give my student 18/20 for one lab, and 15/20 for another lab, the student's total for the category is listed as 36 (twice 18) and the maximum grade is still listed at 40. There is a difference, however. I can edit the maximum grade in this case (on the grader page I can click the edit icon for the category total, and the maximum grade can be changed). If I change the aggregation to "sum" I can't edit the category total maximum grade.

Which version of moodle are you using, and how did you get things to work out for you? What am I doing wrong?
In reply to Tamara Snyder

Re: Gradebook not working correctly

by Tamara Snyder -
After doing some more searching, I've come across something in the Moodle Tracker (at http://tracker.moodle.org/browse/MDL-14831). It looks like this is a real bug. I can't tell from the conversation if it will be fixed or if dropping the lowest grade while summing will just be disabled. I hope it will be fixed, because this is something of a show stopper for us.

As a work around, I am very interested in learning how to create my own grade report, without the percentages. It looks like I would have to modify grade/report/user/lib.php. Is that correct?

Thanks!
In reply to Tamara Snyder

Re: Gradebook not working correctly

by Nicolas Connault -
Tamara,

I just realised that I had set up the category to aggregate the grades using the mean of grades strategy, while your problem is with Sum of grades. So I switched to sum of grades, and I can see that there is indeed a bug that needs fixing. I'll get onto it straight away.

For the user report, if you want to customise it, it's best to create a copy of the report folder (grade/report/user) and name it differently, like grade/report/myuser (I will use "myuser" throughout this tutorial but you can use any lower-case word starting with a letter, with optional underscores). Also make sure that it contains no CVS folders, otherwise it will get updated during your next upgrade, and may merge with your changes.

Once you have your copy of the report, you can edit /grade/report/myuser/lib.php, starting from line 100. Please do this only if you are familiar with PHP, else get a developer to do this simple customisation for you.

Throughout the entire file, replace all instances of "report_user" with "report_myuser". That should represent about 16 replacements. Do the same for the files index.php and settings.php.

Back to lib.php:

Remove the 'percentage' entry from the $tablecolumns array (line 110) and the corresponding header from the $tableheaders array (line 111).

Repeat the process a few lines later, where the arrays are once again defined.

Finally, remove the lines 247-253 that start with the comment

/// prints percentage
if ($grade_item->needsupdate) {
...

In index.php:

Change line 28 to point to myuser instead of user:

require_once $CFG->dirroot.'/grade/report/myuser/lib.php';

Do the same on line 96, regarding the path to index.php

print_graded_users_selector($course, 'report/myuser/index.php?id=' . $course->id, $userid);

On line 40, change the permission name from "user" to "myuser"

require_capability('gradereport/myuser:view', $context);

Create a language file for your report. Include at least the modulename, and optionally the strings for different capabilities.

 grade/report/myuser/lang/en_utf8/gradereport_myuser.php

 Example from user report here:

 $string['modulename'] = 'My User report';
 $string['myuser:view'] = 'View your own grade report';

Finally, you can Select your new report as the default user report in admin -> grades -> general settings -> User profile report.

Please let me know if you have trouble with this customisation, I can create a wiki page for it.

In reply to Nicolas Connault

Re: Gradebook not working correctly

by Tamara Snyder -
Thanks, Nicolas, your instructions are clear. I've been programming in php for years, so I don't think I'll have a problem. I will let you know if I do.
In reply to Tamara Snyder

Re: Gradebook not working correctly

by Tamara Snyder -
I'm sorry, but I seem to have another problem....

I've made all the changes, creating for myself a myuser report, just as you have specified (except I've called it 'no_percent' instead of 'myuser').

On the admin grades page, I can choose the 'no percent' report from the dropdown menu (the one that says 'choose an action') and the percents are gone.

But when I log in as a student I get the same old user report, the one with the percents. On the admin/grades/general settings page I have chosen my 'no percent' report as the default for the User profile report, and the page remembers my choice. But the student does not see the report I've chosen.

I must have gone wrong somewhere, but I don't know where. I followed your instructions carefully.

Also, a related question is: Is it possible for the course teacher, or the course creator to choose a different user report (other than the default one)? Or is the default (as set by the admin) the only option for all courses?

Thanks very much, I'm sorry to be such a bother sad
In reply to Tamara Snyder

Re: Gradebook not working correctly

by Bruce Webster -
With Moodle 1.9.2 I just tried making myuser report.
The instructions are incomplete.

You need to also open grade/report/myuser/db/access.php
and change both instances of 'user' with 'myuser' or whatever you called your report.

Now, go to your admin page [moodle-install]/admin/ page and it will update the database and should default to allowing students to view this report!

Unfortunately when students click grades it still tries to default to the standard 'user' report. If that has been disallowed it will jump to the first allowed report - likely 'overview'. See grade/report/index.php. I think the 2 instances of 'user' should be replaced with $CFG->grade_profilereport to fix this.

Replacing the report name so many times when making a new report is silly - it should defined as $report_name (perhaps from the URL path) at the top of the code.
It's very tempting to just do a small hack to the original user report!!
In reply to Nicolas Connault

Re: Gradebook not working correctly

by Andy Amos -
Please can you add further, more detailed instructions to do this (or just post the altered files) since I need to have this functionality in my school. Why does the no percent report not show up for a student as stated in an earlier post?