220 Commits

Author SHA1 Message Date
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
Jun Pataleta
24bf4f58f5 MDL-70817 core_completion: Unit tests for cm_completion_details 2021-04-02 21:53:20 +08:00
Jun Pataleta
c81441f5c9 MDL-70817 core_completion: Course module completion details
* Class cm_completion_details builds the custom completion details
for an activity module.
2021-04-02 21:53:20 +08:00
Jun Pataleta
fc238f329d MDL-70815 completion: Cast custom data to array
Since cm_info::customdata can be of any type, we need to cast it to an
array first before checking for custom completion rules. Otherwise,
an exception can be thrown (e.g. customdata has been set as an stdClass)
2021-03-10 19:22:15 +01:00
Jun Pataleta
14234bf240 MDL-70815 core_completion: Unit tests for activity_custom_completion
Tests cover
 - get_overall_completion_state()
 - is_available()
 - validate_rule()
Tests don't cover
 - methods that rely on static methods such as:
   - is_defined()
 - static methods in the class because they can't be mocked
 - abstract methods that can be tested better by the plugins
   that extend activity_custom_completion such as:
   - get_state()
   - get_defined_custom_rules()
   - get_custom_rule_descriptions()
2021-03-09 19:27:46 +08:00
Jun Pataleta
beb0dd74f2 MDL-70815 core_completion: Activity custom completion details base class
* Base class for defining an activity module's custom completion details
2021-03-09 19:27:41 +08:00
Eloy Lafuente (stronk7)
f6711bb394 MDL-67673 phpunit: Fix the return type of template methods
All the setup/teardown/pre/post/conditions template methods
now are required to return void. This was warned with phpunit 7
and now is enforced.

At the same time, fix a few wrong function names,
provider data and param types, return statements...
2020-10-21 12:45:59 +02:00
Andrew Nicols
f908e8beef MDL-69192 mod_assign: Stop clicking OK on non-existent modal 2020-10-08 08:04:10 +08:00
Juan Leyva
417e5b9f84 MDL-65976 completion: New course completion message provider 2020-09-29 13:40:32 +02:00
Paul Holden
8acaa4e356 MDL-68715 completion: fix form default value for course prerequisites.
Adds filtering on the completion criteria form to ensure we are only
selecting actual course instances of this type. Prior to this change
we would also get NULL values from unrelated criteria types.
2020-07-14 12:46:02 +01:00
David Mudrák
2615e429f4 MDL-68753 lang: Remove a redundant okay string and use "OK" everywhere
The "Ok" (with lower-case "k") string was added in MDL-68409 to keep
backwards compatibility with YUI alerts that had it hard-coded. But we
should not need to explain to translators why we have two OK strings
like this and why they use different wording.

Additionally, there would be inconsistency in Behat tests and everywhere
depending on which "OK" or "Ok" string is used for buttons.

So instead, this patch changes the hard-coded 'Ok' string in the YUI and
we should stick to "OK" from now on everywhere.
2020-05-27 09:59:44 +02:00
David Mudrák
005b00dd9b MDL-68645 output: Do not apply filters when creating calendar events
Applying filters on an activity module description when using it as a
new calendar event's description is bad m'kay? We need to store the raw
text and apply the filters only when we actually display the text. That
way, filters (such as multi-language content) may actually fully work
and we do not initialise the theme and output machinery.

Additionally, we need to explicitly set the format of the description
text to HTML (because we have converted it to it already). Otherwise it
defaults to the current user's preferred editor format.

This is still a pragmatic hot-fix solution. The proper solution would be
to pass the raw text, format and embedded files.
2020-05-13 10:03:01 +02:00
Shamim Rezaie
99cac46162 MDL-67970 output: use div for content wraping instead of span
span is not a valid content wrapper tag.
Moreover, according to W3C validation service report, it is not valid to
have div elements as children of a span element.
We can safely replace span with div here because the element's css class
is .action and display of .action is set to flex in both boost and
classic themes.
2020-03-17 18:16:25 +11:00
Eloy Lafuente (stronk7)
ee439d017e MDL-67115 core: php74 params order for implode()/join()
Passing parameters to implode() in reverse order is deprecated, use
implode($glue, $parts) instead of implode($parts, $glue).

This commit corresponds to phpunit and manual detections, core files.
2020-01-19 18:47:07 +01:00
Jake Dallimore
26a94308ee Merge branch 'MDL-65276-master' of git://github.com/lameze/moodle 2019-04-30 20:47:26 +02:00
David Monllaó
45c8b226be Merge branch 'MDL-64782-master' of git://github.com/rezaies/moodle 2019-04-24 17:37:45 +02:00
Shamim Rezaie
a5f7de8777 MDL-64782 core_completion: Performance improvement 2019-04-23 17:01:48 +10:00
Alexander Bias
d6cea5ccd9 MDL-65056 completion: Hide checkboxes on course page for teachers 2019-04-19 11:40:00 +02:00
Simey Lameze
846c585910 MDL-65276 core: fix CiBoT complains 2019-04-08 10:30:09 +08:00
Simey Lameze
97fddc26f4 MDL-65276 core: delete orphaned cron.php 2019-04-05 13:45:06 +08:00
Simey Lameze
ea9428be7b MDL-65276 core: move functions to completion_regular_task
This commit shifts the content of legacy completion_cron_criteria()
and completion_cron_completions() functions to completion_regular_task.

Also, those functions are deleted as part of this commit.
2019-04-05 13:44:53 +08:00
Simey Lameze
a5a0d10e70 MDL-65276 core: convert legacy cron function to task 2019-04-05 13:38:07 +08:00
Dmitrii Metelkin
34945fa35f MDL-64898 core_completion: no progress for untracked users 2019-03-15 14:32:50 +11:00
Mark Johnson
272c7948d2 MDL-64889 completion: Fix performance of get_course_progress_percentage 2019-02-18 14:03:52 +00:00
Jun Pataleta
c18f59e155 Merge branch 'MDL-64644_master' of git://github.com/markn86/moodle 2019-02-11 15:29:04 +08:00
Eloy Lafuente (stronk7)
6ada5b713b Merge branch 'MDL-64528-master' of https://github.com/mackensen/moodle 2019-01-30 21:21:26 +01:00
Mark Nelson
ed6ac4634a MDL-64644 completion: fixed assertions in privacy test 2019-01-23 17:12:04 +08:00
Mark Nelson
6ff8d31434 MDL-64644 completion: set status correctly in provider 2019-01-23 17:11:49 +08:00
Mark Nelson
aaf7228fb4 MDL-64644 completion: ensure we return array for provider 2019-01-23 13:41:20 +08:00
Charles Fulton
7868aab181 MDL-64528 core_completion: prevent toggling completion in frozen context 2019-01-12 07:37:21 -08:00