249 Commits

Author SHA1 Message Date
Sara Arjona
ff959d8f5d Merge branch 'MDL-72375-completion-id' of https://github.com/Peterburnett/moodle 2021-12-29 09:48:22 +01:00
Ferran Recio
43499d332c MDL-72898 core_courseformat: hidden activity link 2021-12-28 12:50:23 +01:00
Eloy Lafuente (stronk7)
e4a2d9c1d4 MDL-73348 phpunit: normalize all privacy provider tests
As far as now all them have correct privacy level2 namespace:
- Move them to "privacy" subdir.
- Rename the files to "provider_test.php", this includes old
  privacy_test.php and privacy_provider_test.php files
- Rename the testcase to provider_test too (to match file name)

Also, change some relative paths and comments to point to new
locations.
2021-12-17 14:21:02 +01:00
Eloy Lafuente (stronk7)
57e6fb7ad9 MDL-73348 phpunit: privacy and privacy_provider testcase names
All privacy_test and privacy_provider_test classes:

- Namespaced with component\privacy.
- Fixed incorrect use statements with leading backslash.
- Changed code to point to global scope when needed.
- Renamed a few files to make all be privacy_test or privacy_provider_test.php
- All them passing individually.
- Complete runs passing too.
2021-12-17 14:21:02 +01:00
Mihail Geshoski
17bfe7e79f MDL-72873 behat: Update behat tests 2021-12-16 00:10:13 +08:00
Peter Burnett
cab836cf8d MDL-72375 completion: Remove id from custom rules
The id stored in the default custom rules was the courseid, and would
incorrectly be applied to new activities as the activity id.
2021-12-13 11:52:03 +10:00
Ilya Tregubov
6f44f008d8 Merge branch 'MDL-73278' of https://github.com/stronk7/moodle 2021-12-10 18:51:40 +02:00
Jun Pataleta
107bcc143c Merge branch 'MDL-72090-master' of git://github.com/abgreeve/moodle 2021-12-09 11:17:32 +08:00
abgreeve
fcd4de8639 MDL-72090 navigation: Update to behat feature files for navigation.
This updates feature files to use the new steps to navigate to certain
pages.
2021-12-09 11:13:35 +08:00
Bas Brands
35a5288554 MDL-71691 core_behat: behat fixes for changed course design 2021-12-08 13:14:05 +01:00
Eloy Lafuente (stronk7)
deb0e76eee MDL-73278 phpunit: Rename already namespaced classes to match file name
These are the only cases 100% safe to apply the renaming of the
testcase class names to match the file names.

All other cases are not safe, because they are missing namespace
and may enter into name conflicts. Adding namespaces is not as
simple as imagined because it implies to, also, add a good number
of modifications to core. See the issue for more details.
2021-12-07 23:54:29 +01:00
Mathew May
b983003e2e MDL-70197 navigation: Remove old navigation elements and migrate behat 2021-11-29 15:47:42 +08:00
Adrian Greeve
b72fa5fbae MDL-71912 behat: Updating various tests using assign steps. 2021-11-09 11:24:08 +08:00
Angelia Dela Cruz
89c4c803e8 MDL-72655 behat: Use assign generators
Replace steps that manually add assignment instances via the UI
and use Behat generators. This improves the speed of Behat test
runs.
2021-11-03 11:34:26 +08:00
Peter Dias
cb2afc668d MDL-72827 completion: Revert completion flow logic
- Reverts the custom flow logic introduced in the 52206
- Expand unit tests to cover different grade based completion settings
2021-10-28 11:38:10 +08:00
Víctor Déniz
9ef79d0b36 Merge branch 'master-MDL-64576-v2' of https://github.com/golenkovm/moodle 2021-10-07 22:24:37 +01:00
Peter
7a9e3db9dc MDL-52206 completion: Behat test
Co-authored-by: aanabit
2021-10-07 10:17:25 +08:00
Peter Dias
2c7893cf9f MDL-52206 core: Update new activity_custom_completion
Update the custom_completion classes to accept the new completion
criteria
2021-10-04 19:45:47 +08:00
Peter Dias
d975251813 MDL-52206 completion: New criteria to handle behaviour between modules 2021-10-04 19:45:45 +08:00
Peter Dias
cd52b46e89 MDL-52206 quiz: Remove completionpass completion from quiz
AMOS BEGIN
 MOV [completionpass,mod_quiz],[completionpassgrade,core_completion]
 MOV [completionpassdesc,mod_quiz],[completionpassgrade_desc,core_completion]
 MOV [completionpass_help,mod_quiz],[completionpassgrade_help,core_completion]
AMOS END
2021-10-04 19:44:03 +08:00
Peter
90acd8d381 MDL-52206 core: Add completion criteria to course_modules 2021-10-04 19:44:02 +08:00
Peter
663137748e MDL-52206 core: Add completion based on pass grade
Add new completion based on pass grade to the completion criteria.
2021-10-04 19:42:34 +08:00
Mikhail Golenkov
17df506879 MDL-64576 completion: Fix criteria and course completion dates 2021-10-04 10:51:38 +11:00
Bas Brands
16c726cde7 MDL-71610 core_behat: use new edit mode step in feature files 2021-09-29 09:25:36 +02:00
Mihail Geshoski
7d821080f0 MDL-72093 navigation: Update behat tests 2021-09-14 12:02:35 +08:00
Huong Nguyen
3150612163 MDL-71899 performance: Improve activity completion data caching
- Modified SQL in get_data() to get the activity completion of all course modules without calling get_fast_modinfo() to reduce the DB queries.
 - Building activity completion cache for the whole course in one time instead of building the cache for each course module by passing $wholecourse = true to get_data()
2021-09-09 10:03:21 +07:00
Andrew Nicols
c79d58a50b MDL-71209 behat: Fix behat for new changes
Co-authored-by: Ilya Tregubov <ilya@moodle.com>
2021-08-20 16:49:06 +02:00
Andrew Nicols
776f4bd80c MDL-72179 behat: Make use of page resolvers 2021-07-26 15:14:28 +08: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
Luca Bösch
9fc6c45b10 MDL-71634 course: Do not show "Your progress" info any more. 2021-06-17 19:22:13 +02:00
David Mudrák
ad30fde448 MDL-71425 lang: Fix reworded strings in tests 2021-05-04 17:45:18 +02:00
Víctor Déniz
6d3107641d Merge branch 'MDL-71189-master-3' of git://github.com/mickhawkins/moodle 2021-05-03 08:08:34 +01:00
Michael Hawkins
f105612d7f MDL-71189 core_completion: Implementing custom completion sort ordering
This adds the requirement for activities supporting custom completion to
specify the order all completion conditions should be displayed for that
activity. It also implements the sorting that takes place.
2021-05-03 13:36:11 +08:00
Michael Hawkins
c997fc7784 MDL-71189 core_completion: Updates to meet current coding standards 2021-05-03 13:36:11 +08:00
Ilya Tregubov
cf1cf222e7 MDL-66431 core: Fix behat tests.
Move activity creation to data generators. Only fixing those
tests failing due to removing usemodchooser preference.
2021-05-01 16:22:03 +02:00
Dongsheng Cai
36bc7b07db MDL-71235 webservices: add activity completion data to web services 2021-04-29 13:52:32 +10:00
Jun Pataleta
d9a8245efb MDL-71252 completion: Fix Behat test for manual completion display
Adjusting the test since the manual completion button is now being
hidden from the course homepage when completion is disabled.
2021-04-26 19:53:28 +08:00
Jun Pataleta
93ab8c089e Merge branch 'MDL-71252-master' of git://github.com/HuongNV13/moodle 2021-04-26 15:55:11 +08:00
Sara Arjona
b8d4e8f251 Merge branch 'MDL-71370-master-test' of git://github.com/junpataleta/moodle 2021-04-26 09:50:40 +02:00
Huong Nguyen
3f9035b989 MDL-71252 completion: Avoid showing the 'Mark as done' button
The following activites will be applied:
 - Label
 - File (Force download/Open/In pop-up)
 - URL (Open/In pop-up)
2021-04-26 14:24:41 +07:00
Jun Pataleta
fca42002f7 MDL-71370 course: Make showcompletionconditions nullable
* When completion tracking is not enabled for the course, it does not
make sense for the course's showcompletionconditions setting to
be set according to the default value indicated by the
"moodlecourse | showcompletionconditions" admin setting. Setting
showcompletionconditions as enabled when completion tracking is disabled
makes even less sense. So in such a case, we should not be setting a
default value for showcompletionconditions and allow it to be null.

* When the course is edited and completion tracking is enabled, this
also would set the "Show completion conditions" field to default to the
value set in the "moodlecourse | showcompletionconditions" admin
setting.
2021-04-24 19:07:42 +08:00
Sara Arjona
12f64a02c9 Merge branch 'MDL-71144-master' of git://github.com/rezaies/moodle 2021-04-23 13:16:01 +02:00
Jun Pataleta
7af3fa1cdd Merge branch 'MDL-71288-master' of git://github.com/lameze/moodle 2021-04-22 10:29:25 +08:00
Simey Lameze
f518f61757 MDL-71288 completion: add fallback for plugins
This commits adds a fallback for plugins which does not have
custom_completion implementation.

For those cases, it will search for {modulename}_get_completion_state
callback in the plugin and call get_overall_completion() method in
cm_completion_details class to get the overall completion state for
a course module and user.
2021-04-22 09:45:11 +08:00
Jun Pataleta
d0963c711f MDL-71144 completion: Deprecate get_completion_state callbacks
* *_get_completion_state() callback functions have been deprecated and
should no  longer be used. Plugins that define custom completion rules
must implement the mod_[modname]\completion\custom_completion class that
extends the \core_completion\activity_custom_completion base class.
2021-04-22 09:48:50 +10: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
Jun Pataleta
bb5ed7d4af MDL-70821 core_completion: Fix completion settings Behat tests 2021-04-13 00:57:46 +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
Jun Pataleta
300b72f81a MDL-70821 completion: New Behat steps for activity completion
* activity_completion_condition_displayed_as()
  - Shows the status of an automatic completion condition for a given
    activity
* activity_should_have_the_completion_condition()
  - Checks that the activity displays the given completion condition
* manual_completion_button_displayed_as()
  - Shows the status of the manual completion button for a given
    activity
* the_manual_completion_button_for_activity_should_be_disabled()
  - Checks that the manual completion button for the given activity is
    disabled.
* there_should_be_no_completion_for_activity()
  - Checks that the activity does not show completion information
* toggle_the_manual_completion_state()
  - Toggles the manual completion button's state for a given activity
* overridden_manual_completion_button_displayed_as()
  - Checks the manual completion state of an activity.
* overridden_activity_completion_condition_displayed_as()
  - Checks if the activity with specified name is maked as complete.
2021-04-12 11:41:37 +08:00
Simey Lameze
ec270a3fef MDL-70781 completion: behat coverage for new setting
Part of MDL-70817
2021-04-02 21:53:20 +08:00