230 Commits

Author SHA1 Message Date
Ilya Tregubov
7fc818ebb8 MDL-51360 core_grades: Improve documentation of grade_get_grades(). 2024-05-10 09:17:03 +08:00
Marina Glancy
ef1759da74 MDL-80820 various: fix incorrect phpdocs 2024-04-08 10:13:10 +01: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
sam marshall
fbd61d1268 MDL-75878 Course: Adding graded activity too slow when lots of grades
Adding an activity with a grade item previously triggered a course
regrade, which can be extremely slow. This change makes it so that on
courses where regrading is slow, when you add an activity that
requires regrading, it takes you to an intermediate screen with a
progress bar.

This change also fixes a bug in the existing grade overview report,
which shows grades across multiple courses, but previously only
checked, and if necessary regraded, one course.
2023-01-03 16:04:58 +00:00
Tomo Tsuyuki
b3e046df7e MDL-72451 core: Stop keep regrading when there is an error
Set needsupdate to finish to avoid regrading each call.
Add error messages for regrading.
Display the error message on the quiz page.

Co-authored-by: Mark Johnson <mark.johnson@catalyst-eu.net>
2022-11-17 08:54:47 +00:00
Sujith Haridasan
73d604369d MDL-71062 core: Step 1 deprecation of print_error function 2022-07-13 08:20:54 +05:30
Eloy Lafuente (stronk7)
b3b1006201 MDL-74516 activities: Better handling of floats for gradepass fields
Current code was relying on grade_floatval() that is not a validation
function. Instead, the gradepass field must be defined as proper float
and then perform the needed validations using unformat_float().

Note that the float element form has some particularities, see
MDL-73994 for more information and that makes us to have to check
for some values (null, zero) manually. Once that form element type
gets its behaviour fixed, the code will need to be revisited, hence
we have annotated it as comments for easier finding it in the future
(the same changes already were applied to other gradebook forms).

Also, remove an unreachable line of code (comparing with empty string)
within the grade_floatval() function because it's not possible anymore
to pass any string to it, as far as it's "?float" typed.

Covered as many cases with quiz completion as have been able to imagine.
2022-07-01 13:55:51 +02:00
Sujith Haridasan
f2c7f35f78 MDL-74300 core_grades: Fix errors in bulk to gradebook
This change prevents the printing of header when the
moodles page's state is STATE_IN_BODY. Due to the absence
of this check when user entered graded in bulk was causing
errors.
2022-03-28 11:12:40 +05:30
Eloy Lafuente (stronk7)
e2821bf1ce MDL-73824 gradebook: Stricter float check to some gradelib functions
It has been detected that, right now, some localised floats are
being passed to those functions (say comma separator, say thousands)
and that's leading to all sort of problems later when comparing,
processing or storing those "wrong-floats" (user entered).

This just makes all those functions to be stricter, so any attempt
of passing to them a wrong float will fail with a clear TypeError.

Any existing case must be converted to a corrrect (X.Y) format, using
unformat_float() or PARAM_LOCALISEDFLOAT before any processing.

Localised floats cannot be used.

Also, fix all the places where those functions are called from
files having strict_types enabled because, with that, now float-like
strings are not accepted any more. Luckily, there is only case,
within the grade/classes/component_gradeitem.php file, and it has
been fixed by casting the float-like string coming from DB to float.
2022-03-03 12:19:02 +01:00
Ilya Tregubov
b26608d1d4 MDL-32103 completion: Fix CiBoT errors.
Old code still uses underscores in variable names, so CiBoT is
not happy. Making it constistant with Moodle code style.
2021-07-13 12:07:53 +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
Tomo Tsuyuki
745d4c2a4f MDL-70245 core_grade: Fix grade_get_setting unit test failures
To fix the phpunit issue, change from static variable to use cache
2020-12-10 16:46:09 +11:00
Marcus Boon
f1f5ba36ad MDL-68388 core_grades: Use MUC for grade letters
In the get_grade_letters there is a static variable that is used
to cache grade letters, we should use MUC for this so that it is
reset properly between unit tests.
2020-05-26 09:06:50 +10:00
Andrew Nicols
f8da1b9353 MDL-66722 forum: Add gradeitem storage handler
Part of MDL-66074
2019-10-30 10:23:40 +08:00
Peter
0320040469 MDL-66971 core: Update the convenience date grade getter to allow nulls 2019-10-22 10:30:17 +08:00
Andrew Nicols
4bb39eabc7 MDL-66733 grade: Add helper to get correct user date for grade 2019-09-20 09:50:17 +08:00
Simey Lameze
a5f691e43c MDL-65044 core: remove legacy grade_cron() function 2019-03-27 11:21:50 +08:00
Eric Merrill
d64e545a36 MDL-64609 gradebook: Prevent infinite loop in regrading 2019-01-22 21:40:12 -05:00
Damyon Wiese
091365330a MDL-63761 grade: Performance fix for regrading
Don't use a separate variable to count the number of items in finalids.
2019-01-02 10:23:20 +08:00
Eloy Lafuente (stronk7)
bd5fdcfccd MDL-63422 general: review core loop / switch / case / continue
This commit reviews all continue uses in core happening within a
loop / switch / case hierarchy. This does not cover:

- Changes to libraries. Will be handled in another issue / commit.
- Uses out from loops, will be reviewed by other commit.

The policy followed has been:
- When possible, take rid of the continue.
- When clearly the intention was to jump to next element in loop
  change to continue 2
- When it was not clear, keep old behavior switching to break, no
  matter how weird the behavior may be.
2018-10-31 00:17:59 +01:00
Damyon Wiese
c98e9fbae1 MDL-27520 core: Rewrite pluginfile URLs 2018-10-17 15:57:26 +08:00
Mark Nelson
5d7a9ea6f9 MDL-27520 core_grades: accept feedback files via grade_update() 2018-10-16 12:32:44 +08:00
Mark Nelson
8bfe908209 MDL-63002 core: fixed incorrect calls to non-existent delete_record() 2018-07-30 20:59:42 +08:00
Stephen Bourget
b4993d29f7 MDL-45837 Grades: Minor fixes to grade_letter events 2018-02-14 17:31:57 +01:00
John Okely
ea1d9f7c86 MDL-37168 grade: Debugging if gradebook callbacks are not both present 2017-03-20 16:02:11 +08:00
Juan Leyva
1896b8009a MDL-56307 course: API changes to support retrieve by time 2016-10-25 10:10:52 +01:00
David Mudrák
d676f6bd19 MDL-55987 gradebook: Claim extra memory when updating final grades
As we experienced in a bigger moodle.org course (7500 users, 70 grade
items), the standard memory limit 256M may not be enough here. We were
not able to find any obvious memory leak in the processing. Requiring
extra memory helped in this particular case and it seems reasonable to
have it in the core.
2016-09-16 12:39:47 +02:00
Adrian Greeve
93d3f310b0 MDL-55707 grades: Stop infinite loop when regrading. 2016-09-01 10:25:13 +08:00
Adrian Greeve
41abbbbde5 MDL-45390 gradebook: sql tidy up and version alignment. 2016-05-18 10:41:30 +08:00
Adrian Greeve
405b90bcd2 MDL-45390 gradebook: Grade boundary fix.
Code to upgrade, fix, and freeze the gradebook for
courses with letter boundary problems.
2016-05-18 09:56:00 +08:00
Adrian Greeve
5cb5d459c9 MDL-53279 grades: Additional comments
In the hopes that other people will understand this code.
2016-03-15 12:18:31 +08:00
David Monllao
f32e6ffc00 MDL-53279 grades: Recalculate only required items
Skip grade categories and calculated grade items that do not depend
on .
2016-03-15 12:18:23 +08:00
Andrew Nicols
87d71ecf69 MDL-49324 grade: Ensure weights adjusted message is displayed
The grade settings page displays a message to inform users that weights
have been adjusted if they did not previously add up to the required 100%.

With the change to sometimes displaying a progress bar, whether the message
is displayed must be calculated immediately after the regrade took place,
and before the page redirects.

I have added a callback with arguments to the regrade_if_required function
which is called immediately after regrade has taken place (regardless of
whether the progress bar is required).

This callback modifies the PAGE URL such that the redirect message will be
displayed after the redirect. This does not use the session as the message
should only be displayed immediately after a change. If the user does not
click on the continue button after the progress bar has been displayed, and
comes back to the page later, this may be confusing.
2016-02-24 14:39:09 +08:00
Andrew Nicols
0a802c9c4e MDL-49324 grades: Create helper function for regrading on report view 2016-02-24 14:39:08 +08:00
Damyon Wiese
30be6c846a MDL-49324 Grades: Use a progress bar when recalculating gradebook grades 2016-02-23 08:35:10 +08:00
Eric Merrill
17e56698ec MDL-49332 gradebook: Raise time limit if we get into regrade
Because all regrading should (and does) start from this point, it
is safe and best to call it just once, from this point.
2015-03-05 10:09:40 -05:00
Juan Leyva
a7888487f0 MDL-46527 grades: grade_get_grades external function rewritten 2014-10-21 12:10:01 +02:00
Frederic Massart
ef1b3e56f7 MDL-47345 core_grades: Pre-regrade method is executed from children to parent
Part of: MDL-46576
2014-10-03 13:53:02 +08:00
Frederic Massart
fcf6e01517 MDL-47056 core_grades: Prevent items being displayed as 'Error'
Before this patch we would be marking some items as 'needsupdate'
during an update. Leaving them aside and not effectively updating
them.

Part of: MDL-46576
2014-10-03 13:51:30 +08:00
Tim Hunt
5bcfd504df MDL-45618 Fix @since PHPdoc tags. 2014-05-19 17:03:04 +01:00
Juan Leyva
198e802f9d MDL-30085 core_grades functions moved to correct location 2014-03-31 15:15:17 +02:00
Andrew Davis
d35499312d MDL-30085 core_grade: added a grade web service 2014-03-31 15:15:17 +02:00
Petr Škoda
2f1e464a88 MDL-40438 migrate all collatorlib:: and textlib:: uses 2013-08-06 21:04:35 +02:00
Petr Škoda
bd3b3bba9f MDL-40220 use new core_component::get_plugin_list() 2013-07-16 22:36:11 +02:00
Frederic Massart
8e8891b76b MDL-40403 libraries: Deprecate get_parent_contexts() 2013-07-09 13:34:44 +08:00
Andrew Davis
459843d495 MDL-32913 core_grade:made it more obvious when the gradebook is broken due to a broken calculation 2013-05-02 09:03:02 +08:00
Andrew Davis
69bcca5e9c MDL-36061 core_grade: added some unit tests related to refresh_grades() 2012-11-15 11:14:21 +08:00
Adrian Greeve
b0c6dc1cac MDL-34465 - lib - Replacing get_context_instance with context_XXXX::instance (group 8) 2012-07-27 10:10:46 +08:00
Andrew Davis
ca540697f1 MDL-31362 grade: removed GRADE_UPDATE_ITEM_DELETED as it is not genuinely being used anywhere 2012-03-03 10:00:01 +07:00