4543 Commits

Author SHA1 Message Date
Shamim Rezaie
e25be6bd22 MDL-71163 quizaccess_openclosedate: remove duplicate date info
The quiz module now showa the quiz open and close dates at the top of
the page. So there is no need for the quizaccess_openclosedate plugin to
display these dates in the middle of the page.
2021-04-30 17:13:56 +10:00
Jun Pataleta
11df82e9f7 Merge branch 'MDL-71410-master' of git://github.com/rezaies/moodle 2021-04-27 12:36:24 +08:00
Shamim Rezaie
796e82124f MDL-71410 mod_quiz: implement activity_dates for the quiz module 2021-04-27 14:32:26 +10:00
Shamim Rezaie
ec519a6488 MDL-71410 mod_quiz: Cache quiz times in modinfo for performance
We update the dates with user/group overrides. The calculation of
the override in the quiz module is different from the assignment
module as the quiz_overrides table des not have a sortorder column.
See quiz_update_effective_access().
2021-04-27 14:32:26 +10:00
Shamim Rezaie
d61f18433f MDL-71410 mod_quiz: Cache user and group overrides 2021-04-27 14:32:26 +10:00
Sara Arjona
7046626952 Merge branch 'MDL-71392' of git://github.com/paulholden/moodle 2021-04-26 11:52:46 +02:00
Sara Arjona
12f64a02c9 Merge branch 'MDL-71144-master' of git://github.com/rezaies/moodle 2021-04-23 13:16:01 +02:00
Andrew Nicols
1a34066129 Merge branch 'master-MDL-71376' of https://github.com/rjnl/moodle 2021-04-23 11:52:21 +08:00
Andrew Nicols
b124832fe6 Merge branch 'MDL-70970' of git://github.com/paulholden/moodle 2021-04-23 11:26:53 +08:00
Shamim Rezaie
7d102bb67d MDL-71144 mod_quiz: custom_completion should not use deprecated function
This commit also removes an unnecessary DB query.
2021-04-22 21:11:43 +10:00
Shamim Rezaie
d9d0ae01d3 MDL-71144 mod_quiz: Deprecate quiz_get_completion_state() 2021-04-22 21:02:02 +10:00
Paul Holden
0de5ab4b43 MDL-71392 mod_quiz: don't display grade to pass if not set. 2021-04-22 09:53:24 +01:00
Jake Dallimore
49c97a866c Merge branch 'MDL-71030-master' of https://github.com/NashTechOpenUniversity/moodle 2021-04-21 12:06:50 +08:00
Paul Holden
6c159262f0 MDL-70970 quizaccess_seb: consistent property array sorting by key.
In PHP8.0 using `ksort` was producing incorrect results by sorting
keys differing only in case in the wrong order. This change makes
sorting consistent between PHP versions.

Co-Authored-By: Tim Hunt <T.J.Hunt@open.ac.uk>
2021-04-20 14:36:13 +01:00
Rajneel Totaram
2ff9484417 MDL-71376 mod_quiz: fix undefined object reference 2021-04-20 20:10:04 +12:00
Thong Bui
a8c868822f MDL-71030 Quiz: Add 'who' made changes in question response history 2021-04-20 09:06:15 +07:00
Víctor Déniz
f7dd6b26b7 Merge branch 'MDL-71118-master' of git://github.com/lucaboesch/moodle 2021-04-19 19:43:32 +01:00
Eloy Lafuente (stronk7)
973a4a2ae1 Merge branch 'MDL-71181-master' of https://github.com/ettolrah/moodle 2021-04-19 18:58:14 +02:00
Luca Bösch
aee27d0a9b MDL-71118 core: Add grade (verb) string.
AMOS BEGIN
 CPY [grade,core],[gradenoun,core]
 CPY [grade,core],[gradeverb,core]
AMOS END
2021-04-17 11:46:09 +02:00
Adrian Greeve
83b71194cd Merge branch 'MDL-71161-master-4' of git://github.com/junpataleta/moodle 2021-04-13 11:42:30 +08:00
Eloy Lafuente (stronk7)
6e39487123 Merge branch 'mdl_71172' of https://github.com/AnupamaSarjoshi/moodle 2021-04-13 00:46:55 +02:00
Michael Hawkins
a219b812b4 MDL-71161 mod_quiz: Display activity completion information 2021-04-13 01:21:12 +08:00
Anupama Sarjoshi
c4fa89d55a MDL-71172 quiz: Improve quiz Behat tests 2021-04-12 11:31:44 +01:00
Adrian Greeve
d24df2a201 Merge branch 'MDL-70821-master-5' of git://github.com/junpataleta/moodle 2021-04-12 14:45:59 +08:00
Jun Pataleta
1c15796a75 MDL-70821 behat: Use new activity completion steps for Behat tests
Replace usages of completion Behat steps that check for the completion
checkboxes with the new activity completion Behat steps.
2021-04-12 11:41:37 +08:00
Eloy Lafuente (stronk7)
c33b5efaad Merge branch 'master_MDL-32226' of https://github.com/danmarsden/moodle 2021-04-08 17:30:12 +02:00
Adrian Greeve
1145cf4659 Merge branch 'MDL-70935-master-4' of git://github.com/mickhawkins/moodle 2021-04-07 15:41:04 +08:00
Shamim Rezaie
a75861f78e MDL-70935 mod_quiz: Custom completion implementation 2021-04-07 15:09:36 +08:00
Shamim Rezaie
7a9f13e37f MDL-70935 mod_quiz: combine 'pass' and 'attemptsexhausted' rules
Custom rules are combined using the AND operator. However, the
'completionpass' and 'completionattemptsexhausted' rules are exceptions
because they are combined together with OR, and form a single new rule
that then will be combined with the rest of the rules using AND.
This commit combines the mentioned rules into a single rule named
'completionpassorattemptsexhausted'.
2021-04-07 15:09:36 +08:00
Shamim Rezaie
24b9ff4c71 MDL-70935 mod_quiz: Missing completionminattempts rule description
The mod_quiz_get_completion_active_rule_descriptions() function was not
returning the description for the 'completionminattempts' rule. Added
that.
2021-04-07 15:09:36 +08:00
Víctor Déniz
f72cc98503 Merge branch 'MDL-71128' of git://github.com/paulholden/moodle 2021-04-06 19:41:04 +01:00
sam marshall
611e2569aa MDL-71215 core_user: User fields - remaining deprecated functions
This change removes references in code and comments to a few
deprecated functions that were accidentally missed in the larger
change.

The code changes only affect service_users.php. I made it support
custom user profile fields in this query, because it was easy
enough, rather than adding another TODO to fix later.
2021-03-31 11:12:16 +01:00
Dan Marsden
21778d8d16 MDL-32226 mod_quiz: Add Plagiarism hooks to quiz and essay question. 2021-03-27 09:13:41 +13:00
sam marshall
5e72715e4f MDL-71099 Lib: Move new user_fields class from core to core_user
This class would belong more appropriately within the 'user' API
(core_user) instead of within the 'core' API, since it is
directly related to user data.

Since the class has only just been added to Moodle, now is a good
time to move it.
2021-03-25 13:47:23 +00:00
Simey Lameze
1fcd850859 MDL-71182 calendar: Revert "Merge branch 'MDL-67494-master' of git://github.com/lameze/moodle"
This reverts commit 9d58d4de46e9415eb4ac405a340381de44c510c1, reversing
changes made to 535c0277de3547f02d94959fbe103e44a6706d4e.
2021-03-24 09:11:01 +08:00
Charlotte Peachey
e10428aa00 MDL-71181 Quiz: Pass grade not displayed on front page 2021-03-23 16:49:58 +00:00
Paul Holden
50d3268a6c MDL-71128 mod_quiz: escape question idnumber on display. 2021-03-16 20:27:14 +00:00
Eloy Lafuente (stronk7)
81407f18ec MDL-71036 phpunit: Mock->setMethods() silently deprecated
The current ->setMethods() has been silently (won't emit any
warning) in PHPUnit 9. And will stop working (current plans)
in PHPUnit 10.

Basically the now deprecated method has been split into:

- onlyMethods(): To point to existing methods in the mocked artifact.
- addMethods(): To point to non existing (yet) methods in the mocked
  artifact.

In practice that means that all our current setMethods() calls can be
converted to onlyMethods() (existing) and done. The addMethods() is
mostly useful on development phases, not final testing.

Finally note that <null> isn't accepted anymore as parameter to
double all the methods. Instead empty array [] must be used.

Link: https://github.com/sebastianbergmann/phpunit/issues/3770
2021-03-11 23:04:31 +01:00
Eloy Lafuente (stronk7)
8a14a7bd22 MDL-71036 phpunit: assertContains() now performs strict comparison
The methods assertContains() and assertNotContains() now perform
strict (type and value) comparison, pretty much like assertSame()
does.

A couple of new assertContainsEquals() and assertNotContainsEquals()
methods have been created to provide old (non-strict) behavior, pretty
much like assertEquals() do.

Apart from replacing the calls needing a relaxed comparison to those
new methods, there are also a couple of alternative, about how to
fix this, depending of every case:

- If the test is making any array_values() conversion, then it's better
  to remove that conversion and use assertArrayHasKey(), that is not
  strict.
- Sometimes if may be also possible to, simply, cast the expectation
  to the exact type coming in the array. I've not applied this technique
  to any of the cases in core.

Link: https://github.com/sebastianbergmann/phpunit/issues/3426
2021-03-11 23:04:31 +01:00
sam marshall
558cc1b85e MDL-45242 Lib: Replace calls to deprecated functions
In all cases changes have been kept to a minimum while not making
the code completely horrible. For example, there are many instances
where it would probably be better to rewrite a query entirely, but
I have not done that (in order to reduce the risk of changes).
2021-03-10 10:57:10 +00:00
Marina Glancy
9cfacff738 MDL-65552 user: escape idnumber and email in table_sql 2021-03-03 23:15:07 +08:00
Sara Arjona
9d58d4de46 Merge branch 'MDL-67494-master' of git://github.com/lameze/moodle 2021-03-03 11:45:28 +01:00
Sara Arjona
187801ccf5 Merge branch 'MDL-70966-master' of git://github.com/marinaglancy/moodle 2021-03-03 09:30:41 +01:00
Simey Lameze
ac0a0bad63 MDL-67494 calendar: only user overrides should retain userid 2021-03-03 16:06:32 +08:00
Marina Glancy
612c230709 MDL-70966 various: Under PHP8 empty string is no longer equals to 0 2021-02-28 19:16:09 +01:00
Helen Foster
422e70e308 MDL-70964 lang: Import fixed English strings (en_fix) 2021-02-25 16:18:57 +01:00
Mahmoud Kassaei
4a571882db MDL-66600 quiz manual grading: show any automated grading and feedback 2021-02-15 08:19:31 +00:00
Adrian Greeve
007c270507 Merge branch 'MDL-70755' of https://github.com/mkassaei/moodle 2021-02-11 10:54:38 +08:00
Adrian Greeve
e54ee9e512 Merge branch 'MDL-70773' of https://github.com/mkassaei/moodle 2021-02-11 10:19:39 +08:00
Adrian Greeve
f83156fcf9 Merge branch 'MDL-70513' of https://github.com/timhunt/moodle 2021-02-11 10:06:50 +08:00