260 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
29a541724f
MDL-65292 style: Fix all the function declaration ordering
This has been generated running the following Sniff,
part of the Moodle's CodeSniffer standard:
- PSR2.Methods.MethodDeclaration

It just ensures all the function declarations have
the correct order for:
- abstract and final.
- visibility (public, protected, private).
- static.

So, all the lines modified by this commit are function declarations
and the only changes are in the positions of those keywords.
2024-02-28 23:47:47 +01:00
Stefan Van der Vyver
719e5dedac MDL-76716 grades: handle open delegated transaction on grade delete 2024-01-23 10:12:24 +00:00
Ilya Tregubov
b3c12c8219 Merge branch 'MOODLE_master_MDL-73378' of https://github.com/danielneis/moodle 2023-12-07 09:01:25 +08:00
Andrew Nicols
75587e23c6
MDL-79890 core: Update uses of array_keys with multiple params
These now call the newly minted `moodle_array_keys_filter` method.
2023-11-15 09:14:40 +08:00
Daniel Neis Araujo
3632537b5b MDL-73378 gradebook: Category grade null when all subgrades are null 2023-10-31 13:54:04 -03:00
Shamim Rezaie
22a97437d1 MDL-78217 grade: Improve front-end grade item weight calculations
This change enhances the user experience in the grade report grader by
moving grade item weight calculations to the front-end. Previously,
these calculations were done on form submission, resulting in slower
performance and less interactivity.

With this improvement, grade item weights are now calculated dynamically
in the browser as users make changes, providing instant feedback and a
more responsive interface. This change improves the usability and
efficiency of the grade report grader.

This is only applicable to natural aggregation type.
2023-09-19 21:00:15 +10:00
Shamim Rezaie
4cf11157c2 MDL-78082 core_grades: Fix locking inconsistency
Problem:
In Moodle 4.2, an unintended change in behaviour occurred when locking
and unlocking grade items. Previously, in Moodle 4.1, locking a grade
item and then subsequently unlocking the grade item left specific grades
for students still locked if they were being locked individually.
However, in Moodle 4.2, the unintended change caused the individual
grades to be unlocked along with the grade item.

Solution:
To address this issue, I modified the set_locked calls in action.php to
pass the cascade parameter as false. Now, when locking or unlocking a
grade item, only the grade item itself is affected, leaving individual
grades unchanged. I have also modified the locking behaviour in the
grade_category class. So, similarly, when locking or unlocking a grade
category, the change applies only to the grade items and grade
categories within the category, without expanding to individual grades.

Explanation:
By making this change, we ensure that the locking mechanism behaves as
expected, providing a consistent and desirable user experience. Locking
and unlocking a grade item or category will no longer inadvertently
affect individual grades, preserving their locked status and avoiding
loss of data when unlocking a grade item associated with the total mark
of a category.
2023-09-06 22:20:39 +10:00
Meirza
337bc1554a MDL-78164 lib: Added class properties that are not declared in grade
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.

Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2023-06-21 14:41:35 +07:00
Marina Glancy
8fc1486d36 MDL-77164 various: fix incorrect phpdocs 2023-04-13 11:35:06 +01:00
sam marshall
100e38fe38 MDL-76956 core_grades: Regrade progress bar should be more granular
This change makes the regrade progress bar send frequent updates to
the web browser, even when processing within the same grade item, to
avoid timeout problems when there are a large number of users.
2023-01-19 16:43:51 +00:00
Sujith Haridasan
73d604369d MDL-71062 core: Step 1 deprecation of print_error function 2022-07-13 08:20:54 +05:30
Luca Bösch
aa9a591ecd MDL-70433 grades: prevent double escaping in titles 2021-08-27 10:56:20 +02:00
Ilya Tregubov
4819625349 MDL-32103 completion: Allow instant completion updates.
For activity based course completion criteria allow instant
course completion updates if the activity completion state was changed
for a single user.
2021-07-13 12:07:53 +02:00
Martin Gauk
966556074c MDL-51694 core_grades: use transactions when deleting 2020-05-04 12:48:41 +00:00
Eloy Lafuente (stronk7)
f4feabb83f MDL-66968 php74: array_key_exists() for objects is deprecated
Replace it for correct property_exists() when the element
being inspected is a property of object/class.

Amended and squased changes:
- keep mongo unmodified. The information is array, hence correct.
- fix a couple of messaging phpdocs that were incorrect.

Amended take#2:
- As far as mongo resturns BSONDocument that is ArrayObject, aka
implements ArrayAccess, we have decided to explicitly cast results
to array so existing array_key_exists() and other accesses will
continue working the same.
2019-10-25 00:49:04 +02:00
Nathan Nguyen
2aaac3f670 MDL-46978 core_grades: preserve category total visibility 2019-09-19 14:05:01 +10:00
Jake Dallimore
7e93539cf6 MDL-36255 core_grade: fix to ensure correct context used for filters
Some grade object (outcomes,scales) can be created at site or course
context, so this patch just makes sure we use the respective context
when applying format_string to the name in the get_name() function.
2018-08-22 17:55:50 +08:00
Luca Bösch
8ad225b431 MDL-36255 grades: allow multilang filters in grades 2018-08-20 08:29:36 +02:00
Ankit Agarwal
cb9abded42 MDL-50729 gradelib: Regrade event should be assigned to system 2017-02-14 10:15:52 +05:30
Russell Smith
82905c097c MDL-51584 gradebook: use direct $CFG access for freeze.
get_config() is called a lot of times on freeze and is expensive,
using $CFG is much lower overhead.
2016-10-10 15:42:04 +11:00
David Monllao
1076e02f29 MDL-53309 grades: Only update when required 2016-04-15 15:15:32 +08:00
David Monllao
8f8517ec1f MDL-53543 cache: Invalidate grade_categories by event
We can switch the cache to session level if we are able to purge
different users caches, not only the one that belongs to the user
updating a grade category.
2016-03-18 10:02:05 +08:00
Andrew Nicols
37f9c6a2d6 Merge branch 'MDL-53301_master' of git://github.com/dmonllao/moodle 2016-03-15 15:50:15 +08:00
David Monllao
28774c9263 MDL-48838 grades: New grade_categories cache 2016-03-14 11:20:35 +08:00
David Monllao
488366bed8 MDL-53301 grades: Update gradeitems aggregationcoef2 only when required 2016-03-14 08:08:39 +08:00
Colin Campbell
70ba1f6bcb MDL-51715 lib/grade: Zero out aggregationweight for novalue and dropped
set_usedinaggregation was setting aggregationweight to zero in these
cases for non-category grades, but not for category grades.
2015-11-02 10:14:50 -06:00
Sam Chaffee
84ab39cf77 MDL-51514 gradebook: Optimize set_usedinaggregation query for MySQL 2015-10-02 11:28:15 -06:00
Mark Nielsen
5f6e2fc9d3 MDL-51498 core_grades: Prevent unnecessary grade record fetching
All of these changes make use of already
fetched grade data.  Without these changes,
the gradebook regrade process does not scale
well with very large courses because it fetches
many grade records, one at a time.
2015-09-22 12:04:28 -07:00
Mark Nelson
53914e4465 MDL-51051 core_grades: 'Categories and items' => 'Gradebook setup' 2015-09-14 08:23:32 +08:00
Frederic Massart
5419cbc9eb MDL-50062 grades: Carry agg. settings between categories when possible 2015-08-06 10:24:25 +08:00
Dave Cooper
135efd5116 MDL-50062 gradebook: Fixed behaviour when changing aggregation mathods. 2015-08-06 10:24:25 +08:00
Adrian Greeve
4d4dcc2718 MDL-48239 gradebook: Calculated grades maxgrade now able to be set. 2015-07-02 11:13:25 +08:00
Marina Glancy
156d048659 MDL-49257 grades: fix bugs with extra credit weights
When we adjust the weights in natural grading (setup screen), the extra credit items
should not depend on other overrides. If extra credit item's weight was overriden, it stays as it is.
Otherwise it is calculated as itemgrademax / totalgrademax (total excludes extra credit items)
2015-06-23 14:25:50 +08:00
Frederic Massart
ebea19cb26 MDL-48618 grades: Handling of inconsistencies due to min/max grades 2015-06-10 12:33:41 +08:00
Eric Merrill
c07775dfff MDL-48618 gradebook: Only use individual min/max for aggrigate grades 2015-06-05 17:05:24 +08:00
Eric Merrill
4ea7da7828 MDL-47911 gradebook: Improve the performance of set_usedinaggregation
This function is called many many times during grade calculation, so it
should be as efficient as possible.
2015-02-27 09:46:34 +08:00
Dan Poltawski
31d6d2ae41 Merge branch 'MDL-47703-master' of git://github.com/FMCorz/moodle 2014-10-28 11:40:27 +00:00
Frederic Massart
8b5c454562 MDL-47703 core_grades: Prevent use of weights with non-aggregated scales 2014-10-27 11:23:54 +08:00
Dan Poltawski
7dc62ed3cb Merge branch 'wip-MDL-47676-master' of git://github.com/abgreeve/moodle 2014-10-24 14:30:44 +01:00
Dan Poltawski
f335c9a1f1 Merge branch 'MDL-47637-master' of git://github.com/FMCorz/moodle 2014-10-24 11:48:15 +02:00
Marina Glancy
3824556c9a Merge branch 'MDL-47704-master' of git://github.com/damyon/moodle 2014-10-24 11:48:06 +02:00
Adrian Greeve
cd5c7965e0 MDL-47676 core_grades: Negative positive weight combo working.
The combination of negative and positive weights was not normalising
properly.
2014-10-24 08:43:16 +08:00
Frederic Massart
6aeebc259a MDL-47637 core_grades: Outcomes must not be weighted when non aggregated 2014-10-22 14:58:17 +08:00
Marina Glancy
2d2661e3d7 Merge branch 'MDL-47503-master' of git://github.com/damyon/moodle 2014-10-20 17:08:20 +08:00
Frederic Massart
8427dc3a23 MDL-47489 core_grades: Adjust weights of extra credit items for Simple 2014-10-20 13:52:18 +08:00
Frederic Massart
e8ac04c191 MDL-47489 core_grades: Adjust weights of extra credit items for Mean 2014-10-20 13:52:17 +08:00
Damyon Wiese
47d6e6a7d3 MDL-47503 Grades: Completely remove aggregationsubcats
This setting is not compatible with combinations of aggregation methods
and the ways in which it does and does not work are not documented. It
was voted to remove it completely by the gradebook workshop, so I have
completely removed it and added a warning for all affected courses + restored
backups.
2014-10-20 12:03:18 +08:00
Frederic Massart
86974893c8 MDL-47489 core_grades: Adjust weights of extra credit items for Natural 2014-10-20 11:50:43 +08:00
Frederic Massart
f8c8f980c7 MDL-47681 core_grades: Ignore weights of grade items 'none' or 'text'
It can happen that some grade items with the type 'None' have a max
grade different than 0, in which case we would have set a weight for
them which is wrong as they must not have any. This patch always
ignores the grade items 'None' and 'Text' when calculating the
weights and locks the weight UI fields for those items too.
2014-10-16 18:42:27 +08:00
Damyon Wiese
ba0d27735a MDL-47704 Grades: Fix for set_usedinaggregation
Used in aggregation was not resetting previously set values
when recalculating an aggregation. This meant that items no longer
in the aggregation, were displayed with stale weights in the user report.
2014-10-16 17:14:02 +08:00