Commit graph

100913 commits

Author SHA1 Message Date
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
Jun Pataleta
147a3a3661 MDL-70821 course: activity_information template changes
* Add activity name for completion conditions labels. This would give
  better information to screen reader users the activity that the list
  of automatic completion conditions belong to. This would be useful
  especially when the completion conditions are displayed on the course
  homepage.
* Add data-region attributes to activity dates and completion
  information divs.
* Reorganise activity dates and completion information divs so they
  are only rendered when they have data to show.
2021-04-12 11:41:37 +08:00
Jun Pataleta
32b76b34d8 MDL-70821 course: Remove old manual completion toggling
Remove the old ways of toggling manual completion via completion.js
and the ajax part of togglecompletion.php.
2021-04-12 11:41:37 +08:00
Jun Pataleta
e933044409 MDL-70821 course: Deprecate course_section_cm_completion()
Deprecate \core_course_renderer::course_section_cm_completion(). It is
not being used anymore and is being replaced by
\core_renderer::activity_information().
2021-04-12 11:41:37 +08:00
Jun Pataleta
13f88df351 MDL-70821 course: Cover availability conditions for manual completion
When an activity has manual completion tracking, pressing the manual
completion checkbox reloads the page after toggling the completion
state when the activity is linked to availability conditions.
The "Mark as done" button needs to mimic this behaviour as well.

The approach being taken here is to add a core_course/view JS module
for the course homepage which listens for the manualCompletionToggled
event and reloads the page when the activity module has availability
conditions tied to it.

Perhaps for future development, instead of reloading the page, the
container of the restricted course sections/activities can reloaded via
AJAX as well.
2021-04-12 11:41:37 +08:00
Jun Pataleta
642059155c MDL-70821 course: Create manualCompletionToggled event
Add a new "manualCompletionToggled" course event and dispatch this
when the manual completion state for an activity is toggled.
2021-04-12 11:41:37 +08:00
Jun Pataleta
7d8cc2c610 MDL-70821 course: Remove unused completion info from cm_format
With the activity information output component dealing with the
completion information of the activity, there's no need to pass
completion info to the cm_format renderable.
2021-04-12 11:41:34 +08:00
Jun Pataleta
abc5d76175 MDL-70821 course: Render activity information output component in course
Use the activity information output component to render activity
completion details and activity dates for activities on the course
homepage.

Includes fixup from Shamim Rezaie <shamim@moodle.com>
2021-04-12 11:40:54 +08:00
Eloy Lafuente (stronk7)
7467584517 Merge branch 'MDL-69102-master' of https://github.com/martygilbert/moodle 2021-04-11 23:52:41 +02:00
Eloy Lafuente (stronk7)
377d6dc12a
MDL-69102 phpunit: Add test to cover ALL cohort criteria
That way we can check that the expectations are
working ok for every database. Previously only the
ANY case was being tested.

Also, convert them to course badges and check, via
review_all_criteria() that the SQL structures returned
by award_criteria_cohort->get_completed_criteria_sql()
doesn't fail and return the expected counters.
2021-04-10 12:31:22 -04:00
Marty Gilbert
d8085396de
MDL-69102 badge: Fixes broken WHERE clause
When buildilng the 'WHERE' clause, the SQL generated
a query that selected any user who was a member of the
**last** group, not all of the groups.

I believe the query has to be re-worked so that it only
returns users who are in ALL of the groups. This can
be done by a GROUP BY and HAVING.
2021-04-10 12:26:22 -04:00
Mahmoud Kassaei
2d18de87ce MDL-71205 Default options for qtype_numerical 2021-04-09 18:39:37 +01:00
Juan Leyva
46a9a2b6c4 MDL-71251 qtype_essay: Return new min/max word limit settings via WS
Those settings are required by external clients such as the Moodle App
2021-04-09 17:15:18 +02:00
Dan Marsden
17ee54fcda MDL-32226 plagiarism: add span around links.
Make it easier for Mobile app to parse.
2021-04-09 12:03:04 +02:00
AMOS bot
11919a5bf5 Automatically generated installer lang files 2021-04-09 00:07:57 +00:00
Víctor Déniz
f85364c1ea Merge branch 'MDL-70769-master' of https://github.com/sharidas/moodle 2021-04-09 00:54:18 +01:00
Eric Merrill
59704c659c MDL-52724 editor_atto: Scrub atto html for invalid ol, ul, and li tags
Try to correct broken ul/ol/li tags, as they have an outsized impact
on course layout. Uses basic regex and loops to track open and closed
tags.

Also adds a deep clean option to the HTML cleaner, that runs less
frequent, more intensive cleanings. This is because normally _cleanHTML
gets called after each keystroke, which could cause problems with
large content on weak systems.

Behat changes are a fix for setting multiline strings in Atto, and
creating a multiline match step.
2021-04-08 15:20:24 -04:00
Eloy Lafuente (stronk7)
c06ed30430 Merge branch 'MDL-70802-master' of git://github.com/andrewnicols/moodle 2021-04-08 18:30:13 +02:00
Sara Arjona
fc59c4773e Merge branch 'MDL-65616' of git://github.com/paulholden/moodle 2021-04-08 17:45:41 +02:00
Eloy Lafuente (stronk7)
c33b5efaad Merge branch 'master_MDL-32226' of https://github.com/danmarsden/moodle 2021-04-08 17:30:12 +02:00
Víctor Déniz
25b8cb9783 Merge branch 'MDL-71116-master' of git://github.com/sarjona/moodle 2021-04-08 01:01:15 +01:00
Víctor Déniz
6bd0e7b34d Merge branch 'MDL-71178-master' of git://github.com/junpataleta/moodle 2021-04-07 16:09:15 +01:00
Amaia Anabitarte
33fed53ad9 MDL-71107 core_contentbank: Behat test. Authoring when copying a course 2021-04-07 10:03:38 +02:00
Amaia Anabitarte
9b7b70ca9b MDL-71107 core_contentbank: Fill content author when copying a course
'usercreated' and 'usermodified' fields can not be always mapped.
We are filling those fields with 'old' users when working on the same
site, or with current user when working on a different instance.
2021-04-07 10:03:38 +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
Michael Hawkins
663b273a55 MDL-70935 mod_scorm: Custom completion implementation 2021-04-07 15:09:36 +08:00
Michael Hawkins
f85b36edc5 MDL-70935 mod_lesson: Custom completion implementation 2021-04-07 15:09:36 +08:00
Adrian Greeve
7ef3653b65 Merge branch 'MDL-70820-master' of git://github.com/lameze/moodle 2021-04-07 13:26:12 +08:00
Simey Lameze
7c7c1aafc8 MDL-70820 mod_forum: custom completion implementation 2021-04-07 12:17:30 +08:00
Simey Lameze
d8e2ca0aae MDL-70820 mod_glossary: custom completion implementation 2021-04-07 12:17:30 +08:00
Simey Lameze
c8cb54f15a MDL-70820 mod_assign: custom completion implementation 2021-04-07 12:17:30 +08:00
Simey Lameze
f807863ba3 MDL-70820 mod_data: custom completion implementation 2021-04-07 12:17:30 +08:00
Simey Lameze
5e26acf0b0 MDL-70820 mod_feedback: custom completion implementation 2021-04-07 12:17:30 +08:00
Simey Lameze
20e5a04776 MDL-70820 mod_survey: custom completion implementation 2021-04-07 12:17:30 +08:00
Eloy Lafuente (stronk7)
68a6915c06 Merge branch 'MDL-68635' of https://github.com/paulholden/moodle 2021-04-06 22:23:15 +02:00
Víctor Déniz
f72cc98503 Merge branch 'MDL-71128' of git://github.com/paulholden/moodle 2021-04-06 19:41:04 +01:00
Eloy Lafuente (stronk7)
aa8c07276b MDL-71264 behat: Change date(time) element update order
This includes 2 change to the order date(time) elements are filled,
each one addressing one type of problem, where current order is
problematic and can lead to unexpected dates.

1) Changing date, when current month only has X days and target
   month has more than X days. Example, being 1 April, change
   the date to 31 May.
     This is solved by changing the order of introduction
     from current D => M => Y to Y => M => D.
2) Changing date, when target month only has X days and current
   month has more that X days. Example, being 31 March, change
   the date to 28 Feb.
     This is solved by always setting the D to 1, before the
     Y => M => D sequence commented @ 1) begins.
2021-04-06 16:25:46 +02:00
Eloy Lafuente (stronk7)
068430e3ce MDL-71264 behat: New feature covering all day/month/year date changes
Because of the order that dates and datetimes are filled by behat
sometimes there are some intermediate results that are impossible
and then the form (javascript) automatically reacts and fixes the
date, ultimate leading to a different date that the one we wanted
to set with Behat.

This is noticeable when switching between months (with some day
being the last day of the month) and the 2 months have a different
number of days. For example April date => March date (or the opposite).

This test covers all the critical changes (day, month and year),
back and forth. All times are Perth/Australia.
2021-04-06 16:25:46 +02:00
Sara Arjona
18aafd0ed4 weekly release 4.0dev 2021-04-06 15:29:06 +02:00
Sara Arjona
28d90a0be6 Merge branch 'install_master' of https://git.in.moodle.com/amosbot/moodle-install 2021-04-06 15:29:02 +02:00
Eloy Lafuente (stronk7)
0384e9d254 Merge branch 'MDL-71215-master' of https://github.com/sammarshallou/moodle 2021-04-06 15:13:16 +02:00
sam marshall
af3c05ca44 MDL-71215 Acceptance test: Missing Behat for webservice service_users 2021-04-06 11:52:56 +01:00
Adrian Greeve
9a58a5f7e6 Merge branch 'MDL-70817-master' of git://github.com/abgreeve/moodle 2021-04-06 16:35:17 +08:00
Adrian Greeve
03e0523e22 MDL-70817 lib: Update the install xml file to use the correct length.
The showactivitydates field had the wrong length of 4. This changes
it to 1.
2021-04-06 15:42:27 +08:00
Michael Hawkins
a3e2e2d669 MDL-70595 core: Updated security.txt expiry 2021-04-06 13:01:19 +08:00
Adrian Greeve
b816b9566d Merge branch 'MDL-70817-master-8' of git://github.com/junpataleta/moodle 2021-04-06 13:00:53 +08:00
Peter Dias
c8c39e403b MDL-70207 core_navigation: Primary nav unit tests 2021-04-06 11:45:44 +08:00