Note: You are currently viewing documentation for Moodle 3.8. Up-to-date documentation for the latest stable version of Moodle may be available here: Grades min max.

Grades min max: Difference between revisions

From MoodleDocs
(copying description from MDL-48618 as starting point)
 
m (copying improvements from 28 docs)
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Grades}}
{{Grades}}
{{Work in progress}}
==Summary==
==Summary==


If a grade item of has its max points changed after someone receives a grade, then the resulting computed grade becomes very different from previous version of Moodle.
When grading in Moodle, either in an activity or directly in the gradebook, you assign the student a score from a specified range. The Grades min max setting controls how the grade will be displayed if the maximum or minimum grades are changed after student has been graded.
Steps to reproduce


You can recreate the problem in 2.8 without the upgrade step. You will need a course with two users, A and B.
The 2 options are:


# Go into your gradebook and create a new manual Grade Item, leave it at the default 100 points and change the display to 'Real (Percent)'
1) "Min and max grades as specified in grade item settings" - The student's grade will be displayed out of the new range and this will affect their percentage.  
# Give User A a grade of '10' and save.
# You should see the user has a grade of '10 (10%)'.
# Edit the grade item and set the maximum points to 10.
# Go back to the gradebook and give User B a grade of 10 and save.
# You will now see that User A has a grade of '10 (10%)' while User B has a grade of '10 (100%)'
# If you did this under 2.7, both users would have '10 (100%)', but then when you upgrade the site to 2.8, the grades would change to how you see them in the above example.


==Background/Cause==
2) "Initial min and max grades" - The student's grades are displayed with the range that was defined at the time the student was graded.


When a grade is entered for a user, it is recorded in the grade_grade table. We record various bits of data, include the then current maxgrade of the grade_item, but under rawgrademax. In versions of Moodle prior to 2.8, when making derivative computations off the grade, we would always fetch grade_item->maxgrade, which contains the now max grade for the grade_item, and use that as the number of available points.
Example:
* Assignment is created with maximum grade of 10
* Sally Student receives a score of 5 out of 10 (50%)
* The assignment maximum grade is changed to 20


After the gradebook changes, grade_grade->rawgrademax is now used for the computation, in large part to support the computation of grades for different users with different sets of hidden grades. This has lead to a number of side effects:
If "Min and max grades used in calculation" is set to "Min and max grades as specified in grade item settings", Sally Student will have a score of 5 out of 20 (25%)


* Percentages and any downstream computed grades (and number of points available) have changed for grade entries that have this problem.
If "Min and max grades used in calculation" is set to "Initial min and max grades", Sally Student will have a score of 5 out of 10 (50%) until a teacher manually regrades Sally Student out of 20.
* Two users with the same number of points for an item can see different percentages.
* Drop lowest/keep highest selections are wrong.
* If you have the Range rows on in the gradebook, it will show the 'expanded' range. So in our above example it will show 0-100, even though 10 is the max points.
* In the user report the user will see the expanded range.


==How do users cause it==
== Information for sites upgrading from earlier versions of Moodle ==


The most common thing we see is that teachers create a grade item for something, and forget to change the max points to what they want (usually 4 points). They then go and grade people. Then they see the mistake and change the max grade to be 4, with their intent (and the previous behavior being) that a user with a grade of 4 points has a 100%.
The default behaviour is "Min and max grades as specified in grade item settings".
 
In Moodle 2.8.0 - 2.8.6 and 2.9.0 the behaviour was unintentionally changed to "Initial min and max grades".
 
In Moodle 2.8.7 and Moodle 2.9.1 it was restored to "Min and max grades as specified in grade item settings" and this setting was added to allow changing the behaviour. Some courses affected by the upgrade will display notices to alert them to the new setting.
 
== How to find all courses that are affected ==
 
    SELECT * FROM mdl_config WHERE name LIKE 'show_min_max_grades_changed_%' ORDER BY name
 
That will return rows containing things like "show_min_max_grades_changed_211". That means that course 211 is affected. So, the URL to get to the gradebook for that course is .../grade/index.php?id=211 within your Moodle site. With a bit of clever search-and-replace, you can probably turn the output from the gradebook query into a set of URLs. For example the following is a more sophisicated version of this query that works well with the [https://moodle.org/plugins/view/report_customsql Ad-hoc database queries] plugin.
 
    SELECT substr(cfg.name, 29) AS Course_id,
        course.shortname AS Course_shortname,
        CONCAT('%%WWWROOT%%', '/grade/report/grader/index.php', CHR(63), 'id=', substr(cfg.name, 29)) AS Grader_report_url
   
    FROM {config} cfg
    JOIN {course} course ON course.id = CAST(substr(name, 29) AS INT)
   
    WHERE name LIKE 'show_min_max_grades_changed_%'
   
    ORDER BY course.shortname
 
==Who will see the warning message and button in the gradebook?==
 
Only users with the [[Capabilities/moodle/grade:manage|moodle/grade:manage]] capability (by default teacher, manager and admin) will see the warning message and button.
 
== How can I see what grades will change before I click the button? ==
 
The only way to do this is to have a copy of your live site where you can test. (Testing with a copy of your live site is recommended good practice.)
 
In that test copy you can use the report above to find all course gradebooks that are affected. Then, by using the [[Grade history]] report, you can see which grades change when you click the button, and confirm you are happy with the changes before doing the same on your live site.
 
==See also==
 
* MDL-48618 Unexpected changes on grades after upgrade to Moodle 2.8
 
[[es:Calificaciones min max]]

Latest revision as of 16:24, 19 November 2015

Summary

When grading in Moodle, either in an activity or directly in the gradebook, you assign the student a score from a specified range. The Grades min max setting controls how the grade will be displayed if the maximum or minimum grades are changed after student has been graded.

The 2 options are:

1) "Min and max grades as specified in grade item settings" - The student's grade will be displayed out of the new range and this will affect their percentage.

2) "Initial min and max grades" - The student's grades are displayed with the range that was defined at the time the student was graded.

Example:

  • Assignment is created with maximum grade of 10
  • Sally Student receives a score of 5 out of 10 (50%)
  • The assignment maximum grade is changed to 20

If "Min and max grades used in calculation" is set to "Min and max grades as specified in grade item settings", Sally Student will have a score of 5 out of 20 (25%)

If "Min and max grades used in calculation" is set to "Initial min and max grades", Sally Student will have a score of 5 out of 10 (50%) until a teacher manually regrades Sally Student out of 20.

Information for sites upgrading from earlier versions of Moodle

The default behaviour is "Min and max grades as specified in grade item settings".

In Moodle 2.8.0 - 2.8.6 and 2.9.0 the behaviour was unintentionally changed to "Initial min and max grades".

In Moodle 2.8.7 and Moodle 2.9.1 it was restored to "Min and max grades as specified in grade item settings" and this setting was added to allow changing the behaviour. Some courses affected by the upgrade will display notices to alert them to the new setting.

How to find all courses that are affected

   SELECT * FROM mdl_config WHERE name LIKE 'show_min_max_grades_changed_%' ORDER BY name

That will return rows containing things like "show_min_max_grades_changed_211". That means that course 211 is affected. So, the URL to get to the gradebook for that course is .../grade/index.php?id=211 within your Moodle site. With a bit of clever search-and-replace, you can probably turn the output from the gradebook query into a set of URLs. For example the following is a more sophisicated version of this query that works well with the Ad-hoc database queries plugin.

   SELECT substr(cfg.name, 29) AS Course_id,
       course.shortname AS Course_shortname,
       CONCAT('%%WWWROOT%%', '/grade/report/grader/index.php', CHR(63), 'id=', substr(cfg.name, 29)) AS Grader_report_url
   
   FROM {config} cfg
   JOIN {course} course ON course.id = CAST(substr(name, 29) AS INT)
   
   WHERE name LIKE 'show_min_max_grades_changed_%'
   
   ORDER BY course.shortname

Who will see the warning message and button in the gradebook?

Only users with the moodle/grade:manage capability (by default teacher, manager and admin) will see the warning message and button.

How can I see what grades will change before I click the button?

The only way to do this is to have a copy of your live site where you can test. (Testing with a copy of your live site is recommended good practice.)

In that test copy you can use the report above to find all course gradebooks that are affected. Then, by using the Grade history report, you can see which grades change when you click the button, and confirm you are happy with the changes before doing the same on your live site.

See also

  • MDL-48618 Unexpected changes on grades after upgrade to Moodle 2.8