Commit graph

100997 commits

Author SHA1 Message Date
Anupama Sarjoshi
8c2e5b3997 MDL-71172 quiz: Improve quiz Behat tests 2021-04-12 11:37:58 +01:00
Juan Leyva
fdb4792293 MDL-65983 airnotifier: Configuration check report 2021-04-12 11:23:40 +02:00
Jake Dallimore
37fcd2554f Merge branch 'MDL-71251-311' of git://github.com/jleyva/moodle into MOODLE_311_STABLE 2021-04-12 14:48:44 +08:00
Adrian Greeve
aaf93840d0 Merge branch 'MDL-70821-311-5' of git://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-04-12 14:44:58 +08:00
Jun Pataleta
24b48fd2e7 MDL-70821 course: Activity information fixes
* Make sure the activity is visible to the user (cm_info::uservisible)
before showing the activity completion information.
* Add to-do status for overridden automatic completion
2021-04-12 12:29:24 +08:00
Jun Pataleta
28a1a56762 MDL-70821 course: Check activity dates on course homepage
* Check the activity dates on the course homepage depending on
  the value of the showactivitydates course setting
* Plus use the new Behat steps for checking activity dates
2021-04-12 12:29:24 +08:00
Jun Pataleta
d0f819e165 MDL-70821 course: New Behat steps for activity dates
* activity_date_in_activity_should_contain_text()
  - Checks the presence of the given text in the activity's date info.
* activity_dates_information_in_activity_should_exist()
  - Checks the presence of activity dates information in the activity
    information output component.
* activity_dates_information_in_activity_should_not_exist()
  - Checks the absence of activity dates information in the activity
    information output component.
2021-04-12 12:29:23 +08:00
Jun Pataleta
0da0a3d344 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 12:29:23 +08:00
Jun Pataleta
bfedbc37c5 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 12:29:23 +08:00
Jun Pataleta
b8afe46573 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 12:29:23 +08:00
Jun Pataleta
9f8a137211 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 12:29:23 +08:00
Jun Pataleta
6163123c8e 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 12:29:23 +08:00
Jun Pataleta
b37b5e992d 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 12:29:23 +08:00
Jun Pataleta
41d9edf9d5 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 12:29:23 +08:00
Jun Pataleta
9ec5602f7b MDL-70821 course: Render activity information output component in course
Includes fixup from Shamim Rezaie <shamim@moodle.com>
2021-04-12 12:29:23 +08:00
Eloy Lafuente (stronk7)
61004c89af Merge branch 'MDL-69102-311' of https://github.com/martygilbert/moodle into MOODLE_311_STABLE 2021-04-12 00:01:54 +02:00
Eloy Lafuente (stronk7)
ecc8fc3974
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:39:45 -04:00
Marty Gilbert
e4fabe4ae8
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:16 -04:00
Issam Taboubi
f3499b80c6 MDL-71303 core: HTML not escaped in block skip link 2021-04-09 17:27:51 -04:00
Mahmoud Kassaei
87a1a3ebed MDL-71205 Default options for qtype_numerical 2021-04-09 18:33:02 +01:00
Juan Leyva
5327284deb 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:16:23 +02:00
Dan Marsden
7e7b6daddf MDL-32226 plagiarism: add span around links.
Make it easier for Mobile app to parse.
2021-04-09 12:03:31 +02:00
AMOS bot
4a1a97ed78 Automatically generated installer lang files 2021-04-09 00:07:35 +00:00
Víctor Déniz
f8f9911cbd Merge branch 'MDL-70769-311' of https://github.com/sharidas/moodle into MOODLE_311_STABLE 2021-04-09 00:54:45 +01:00
Eric Merrill
c88ad5c182 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:26:55 -04:00
Eloy Lafuente (stronk7)
c1e84df96f Merge branch 'MDL-70802-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-04-08 18:34:10 +02:00
Sara Arjona
586814d928 Merge branch 'MDL-65616-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-08 17:46:05 +02:00
Eloy Lafuente (stronk7)
919943b742 Merge branch 'm311_MDL_32226' of https://github.com/danmarsden/moodle into MOODLE_311_STABLE 2021-04-08 17:30:33 +02:00
Víctor Déniz
33aaac019c Merge branch 'MDL-71116-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-04-08 01:05:06 +01:00
Víctor Déniz
e48f35e850 Merge branch 'MDL-71178-311' of git://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-04-07 16:09:51 +01:00
Amaia Anabitarte
13d89cdcb5 MDL-71107 core_contentbank: Behat test. Authoring when copying a course 2021-04-07 10:03:38 +02:00
Amaia Anabitarte
78a10f1724 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
8d638989f1 Merge branch 'MDL-70935-311-4' of git://github.com/mickhawkins/moodle into MOODLE_311_STABLE 2021-04-07 15:40:28 +08:00
Shamim Rezaie
26856f48fa MDL-70935 mod_quiz: Custom completion implementation 2021-04-07 15:12:34 +08:00
Shamim Rezaie
e5ac4fd1d9 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:12:34 +08:00
Shamim Rezaie
1ef67caf2c 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:12:34 +08:00
Michael Hawkins
d938c0f299 MDL-70935 mod_scorm: Custom completion implementation 2021-04-07 15:12:34 +08:00
Michael Hawkins
7d594cb0d3 MDL-70935 mod_lesson: Custom completion implementation 2021-04-07 15:12:34 +08:00
Adrian Greeve
a0f778a5bf Merge branch 'MDL-70820-311' of git://github.com/lameze/moodle into MOODLE_311_STABLE 2021-04-07 13:25:24 +08:00
Simey Lameze
0484b4b91a MDL-70820 mod_forum: custom completion implementation 2021-04-07 12:18:16 +08:00
Simey Lameze
62c7ce69de MDL-70820 mod_glossary: custom completion implementation 2021-04-07 12:18:16 +08:00
Simey Lameze
58a575c5f2 MDL-70820 mod_assign: custom completion implementation 2021-04-07 12:18:16 +08:00
Simey Lameze
3429235bc6 MDL-70820 mod_data: custom completion implementation 2021-04-07 12:18:16 +08:00
Simey Lameze
716ba1224b MDL-70820 mod_feedback: custom completion implementation 2021-04-07 12:18:16 +08:00
Simey Lameze
8a578bad20 MDL-70820 mod_survey: custom completion implementation 2021-04-07 12:18:16 +08:00
Alex Rowe
69a8d5043e MDL-70049 assign: count_submissions_need_grading call when can't grade 2021-04-07 08:57:36 +10:00
Eloy Lafuente (stronk7)
947512995e Merge branch 'MDL-68635-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-06 22:23:26 +02:00
Víctor Déniz
033c5fd4ff Merge branch 'MDL-71128-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-06 19:50:54 +01:00
Eloy Lafuente (stronk7)
66dbfadd2d 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:49 +02:00
Eloy Lafuente (stronk7)
42200cfd95 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:49 +02:00