4900 Commits

Author SHA1 Message Date
Andrew Nicols
9e09693da3
Merge branch 'MDL-81039' of https://github.com/timhunt/moodle 2024-03-12 11:00:12 +08:00
Andrew Nicols
9cdc5850c5
Merge branch 'MDL-75952' of https://github.com/stronk7/moodle 2024-03-12 10:45:02 +08:00
Mathew May
886d86623e MDL-72438 question: Final deprecations 2024-03-11 13:26:18 +08:00
Eloy Lafuente (stronk7)
361dfe8145
MDL-75952 general: Since php81, refection->setAccessible() is no-op
Refereces:
- https://wiki.php.net/rfc/make-reflection-setaccessible-no-op
- https://www.php.net/manual/en/reflectionproperty.setaccessible.php
- https://www.php.net/manual/en/reflectionmethod.setaccessible.php

As of PHP 8.1.0, calling this method has no effect; all methods are
invokable by default. So, let's remove all uses from core, they are
no-op.
2024-03-10 21:15:00 +01:00
Huong Nguyen
7701e6a079 Merge branch 'MDL-78547' of https://github.com/timhunt/moodle 2024-03-08 08:51:57 +07:00
Jun Pataleta
3278ce7aba
Merge branch 'MDL-65292' of https://github.com/stronk7/moodle 2024-03-08 08:00:41 +08:00
Tim Hunt
3020d180d8 MDL-78547 quiz: in a preview, if a question has been edited, update it
As part of implementing this, there is a new more efficient method
get_version_information_for_questions_in_attempt to see if any
questions in a quiz need to be updated. The regrade code was updated
to take advantage of this.

Co-authored-by: Khoa Nguyen Dang <khoanguyend7@nashtechglobal.com>
2024-03-07 16:14:47 +00:00
Tim Hunt
05da465b7c MDL-78547 questions: a way to replace a attempt in a usage
... without keeping the old attempt

Co-authored-by: Khoa Nguyen Dang <khoanguyend7@nashtechglobal.com>
2024-03-07 16:14:47 +00:00
Sara Arjona
e1034deb8b
Merge branch 'MDL-75670-main' of https://github.com/roland04/moodle 2024-03-04 16:05:18 +01:00
Mikel Martín
d0d62fd06c MDL-75670 theme: Refactor form-inline helper class dropped in BS5
- Replace .form-inline Bootstrap helper class with .d-flex.flex-wrap.align-items-center
- Refactor .form-inline occurrences in SCSS files or remove when unneeded
2024-02-29 13:56:46 +01:00
Mikel Martín
4ce883ae21 MDL-75670 theme: Refactor form-group helper class dropped in BS5
- Replace .form-group Boostrap helper class with .mb-3. The .form-group class was only
adding margin bottom styles, so it is an straightforward change.
- Replace .form-group references in SCSS files with .fitem now .form-group has been removed.
- There were some other .form-group occurrences in the code that were using it not for styling
but incorrectly for managing some logic. These have been also replaced with .fitem or removed.
2024-02-29 13:55:37 +01:00
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
Eloy Lafuente (stronk7)
ba1f804ffa
MDL-65292 style: Fix all function declarations white space
This has been generated running the following Sniffs, all
them part of the Moodle's CodeSniffer standard:
- PSR12.Functions.ReturnTypeDeclaration
- PSR12.Functions.NullableTypeDeclaration
- moodle.Methods.MethodDeclarationSpacing
- Squiz.Whitespace.ScopeKeywordSpacing

All them are, exclusively, about correct spacing, so the changes
are, all them, only white space changes.

Only exceptions to the above are 3 changes what were setting the
return type in a new line, and, when that happens, the closing
parenthesis (bracket) has to go to the same line than the colon.
2024-02-28 23:33:26 +01:00
Matthias Opitz
2dce0b3b9f MDL-52891 calculatedsimple question: forcing new gen. values into form
* forcing new generated sets of wildcard values into the question edit form so they can be saved.
* added Behat test to check new generated values are used.
2024-02-27 11:18:18 +00:00
Tim Hunt
02de9a1e3e MDL-81039 qtype_multichoice: better way to control feedback display 2024-02-23 22:36:06 +00:00
Tim Hunt
e73888a107 MDL-81039 question: Improve some comments in question_display_options 2024-02-23 22:36:06 +00:00
Sara Arjona
3bfec9398a
Merge branch 'mdl-79151-master' of https://github.com/Fragonite/moodle 2024-02-21 17:36:12 +01:00
Jun Pataleta
457274ab03
Merge branch 'MDL-79003-main' of https://github.com/andrewnicols/moodle 2024-02-21 10:36:21 +08:00
Huong Nguyen
e8d5dc93e0
MDL-76024 qtype calculated: Fix deprecation related to dynamic property 2024-02-20 16:38:49 +07:00
Alexander Van der Bellen
0aea55c3e6 MDL-79151 backup: Add custom field backup and restore API 2024-02-20 15:28:28 +08:00
Matthias Opitz
1c96f28569 MDL-76024 calculated questions: improving coding style 2024-02-16 10:20:48 +00:00
Matthias Opitz
97e3b9d657 MDL-76024 calculated questions: cast float type before comparison
* added calculated question for multiplication to tests/helper.php.
* added test_grading_of_negative_responses() test to question/type/calculated/tests/question_test.php
2024-02-16 10:20:48 +00:00
Andrew Nicols
74e0266abe
Merge branch 'MDL-36733-master' of https://github.com/PascalHamar/moodle 2024-02-08 15:32:28 +08:00
Ilya Tregubov
219510b7d9 Merge branch 'MDL-79527' of https://github.com/timhunt/moodle 2024-02-07 09:26:46 +08:00
Tim Hunt
049bff63bc MDL-79527 questions: category tree loading handling bad data
It should always be the case that a question category and its parent
category belong to the same context. However, over the years, we have
observed that this becomes violated by some data in some Moodle sites.
(The suspicion is that this is a backup/restor bug of some sort which
has never been tracked down.)

Since this happens, we should make the code robust to it, which is what
this change does. It ensure that when loading child categories, we only
consider ones in the same context.
2024-02-02 11:26:57 +00:00
Tim Hunt
cefcedebcb MDL-80537 question bank: escape plain text display of question text 2024-02-01 16:15:04 +00:00
Andrew Nicols
f457725b3a
MDL-79003 js: Use our own jsdoc wrapper
grunt-jsdoc is abandoned and only works with an older version of jsdoc.

This is a very simple wrapper around jsdoc itself.

This commit also includes a fix for broken docs.
2024-01-30 12:19:51 +08:00
Sara Arjona
8b36abdb9d
Merge branch 'MDL-80259-main' of https://github.com/roland04/moodle 2024-01-24 09:16:12 +01:00
Paul Holden
d0cab9a4a0
MDL-79256 customfield: add new valuetrust to data table schema. 2024-01-23 08:18:58 +00:00
Mikel Martín
a198884333 MDL-80259 theme_boost: Refactor badge helper classes for Bootstrap 5 2024-01-23 08:27:23 +01:00
Ilya Tregubov
1fdd34a08f MDL-67335 qtype_calculatedmulti: Fix upgrade query. 2024-01-17 17:22:30 +08:00
Jun Pataleta
06146da7cb
Merge branch 'MDL-80005-main-squashed' of https://github.com/andrewnicols/moodle 2024-01-17 16:52:33 +08:00
Philipp Imhof
cf62f5cc76
MDL-67335 qtype_calculatedmulti: allow HTML in answer options 2024-01-17 08:03:14 +01:00
Andrew Nicols
b05fc42db9
MDL-80005 core: Emit deprecation notices for params
Most params are formally deprecated here. This was originally planned
for MDL-80042, but I realised that having an emit, and final param is a
very useful option going forward.

This patch also moves the is_deprecated(), and related methods to the
\core\deprecated attribute.
2024-01-17 12:19:45 +08:00
Jun Pataleta
c67b184f4c
Merge branch 'MDL-79780' of https://github.com/timhunt/moodle 2024-01-11 10:44:41 +08:00
Paul Holden
b98fd96084
MDL-71733 behat: final removal of deprecated 400 step definitions. 2024-01-04 12:43:52 +00:00
Tim Hunt
9ee42d0a34 MDL-79780 quiz_statistics: take advantage of get_fieldset method
This updates the MDL-79639 code.
2023-12-22 12:09:42 +00:00
Ilya Tregubov
b642d2710b MDL-79708 question_bank: Fix legacy filter condition.
build_query_from_filter method expects includesubcategories
to be inside filteroptions array
2023-12-11 11:27:21 +08:00
Huong Nguyen
e1d02270eb Merge branch 'MDL-77136-main' of https://github.com/lucaboesch/moodle 2023-12-07 08:36:27 +07:00
Jun Pataleta
a6ee7e7396
Merge branch 'MDL-80127' of https://github.com/timhunt/moodle 2023-12-06 22:12:25 +08:00
Jun Pataleta
030def7a46
Merge branch 'MDL-80079-master' of https://github.com/andrewnicols/moodle 2023-12-06 21:59:47 +08:00
Luca Bösch
9c2c8c63de MDL-77136 qtype_randomsamatch: Newest versions for shortanswer questions 2023-12-06 14:02:14 +01:00
Luca Bösch
b53ab7e800 MDL-77136 core_question: Newest versions get_questions_from_categories 2023-12-06 14:02:14 +01:00
Jun Pataleta
04bc690557
Merge branch 'MDL-80221-main-enfix' of https://github.com/mudrd8mz/moodle 2023-12-04 16:12:07 +08:00
Ilya Tregubov
37737a92d6 Merge branch 'MDL-79890-master' of https://github.com/andrewnicols/moodle 2023-11-30 10:44:35 +08:00
Pascal Hamar
38ac75d674 MDL-36733 qtype_calculated: Wildcards in calculated question hints
The placeholders for the hints are properly replaced by this change and any formulas present are replaced.

The validation is performed by the existing function qtype_calculated_find_formula_errors(),
which is called by the calculate() function,
which in turn is called by the variable substituter "vs" using the replace_expressions_in_text() function.

vs -> replace_expressions_in_text() -> calculate() -> qtype_calculated_find_formula_errors().
2023-11-28 19:02:27 +01:00
Helen Foster
de4f02d809 MDL-80221 lang: Import fixed English strings (en_fix) 2023-11-22 22:48:47 +01:00
Andrew Nicols
525212f2d2
MDL-78496 core: Address phpcs issues with upgrade.php files 2023-11-19 21:20:53 +08:00
Andrew Nicols
545b36cd4a
MDL-78496 upgrade: remove all the < 4.1.0 upgrade steps
Also includes an upgrade step to prevent upgrading from any
version < 2021112802 (v4.1.0) as anti-cheating measure.
2023-11-17 23:25:36 +08:00
Tim Hunt
0336443db6 MDL-80127 question engine: prevent fatal errors from old bad data 2023-11-15 16:34:35 +00:00