5845 Commits

Author SHA1 Message Date
abgreeve
1a9e810e06 Merge branch 'MDL-71207_master' of https://github.com/TomoTsuyuki/moodle 2021-06-08 10:44:04 +08:00
Tomo Tsuyuki
14d11b8f0e MDL-71207 course: Add info for task error 2021-06-08 09:44:59 +10:00
Sara Arjona
5f91cbb611 MDL-71135 course: core_course_get_state external method 2021-06-04 16:43:28 +02:00
Sara Arjona
f7b0960d18 MDL-71135 course: add legacy_format_renderer support
Until Moodle 4.0, renderer.php file was optional (although highly recommended)
for course formats. From Moodle 4.0 onwards, renderer is required to support
the new course editor implementation.
The legacy_format_renderer class has been created for backward compatibility,
to avoid some errors with course formats (such as social) without the renderer
file. Apart from that, course_format->get_renderer() method has been reviewed
to use this legacy_format_renderer when no renderer.php file is found.
2021-06-04 16:43:06 +02:00
Paul Holden
7f6364971e MDL-71052 course: use filetypes setting for course overview files. 2021-06-04 09:35:15 +01:00
Paul Holden
e2327b5219 MDL-71682 course: remove deprecated non-AJAX activity chooser call.
The deprecated method to render the dropdown based activity chooser
from 430746d3 was still being called, which produced debugging on
the site when doing so.
2021-06-02 21:00:24 +01:00
Ilya Tregubov
b071a7b838 MDL-71382 course: Don't allow empty name for section 0. 2021-06-02 08:42:12 +02:00
Andrew Nicols
a1ccefe2ac MDL-70990 core_form: Standardise event name usage
The `types` object introduced in Moodle 3.11 has been replaced with the
`eventTypes` object which is used consistently across all CustomEvent
definitinos.

Likewise the trigger functions have been renamed from
`triggerUploadStarted` to `notifyUploadStarted` and from
`triggerUploadCompleted` to `notifyUploadCompleted`.

Backwards compatability is maintained.
2021-05-26 10:46:52 +08:00
Eloy Lafuente (stronk7)
9d6aa39985 MDL-71583 versions: Add all the missing full-stops to version/requires
It seems that the new phpcs3 checker is now controlling those
line comments that previously were ignored.

This commit just looks for all the cases and bulk-add
them when needed. The bash script (mac) used to add all them is:

while read -r line; do
    arr=(${line//:/ })
    if [[ -n ${arr[0]} ]] && [[ -n ${arr[1]} ]]; then
        echo "  file ${arr[0]}, line ${arr[1]}"
        sed -i "${arr[1]}s/\$/\./" ${arr[0]}
    fi
done < <(find . -name version.php | xargs ag --nomultiline '>(version|requires) *=.*//.*[^;\.]$')
2021-05-11 20:11:07 +02:00
Jun Pataleta
91f398ce84 Merge branch 'MDL-71234-master' of git://github.com/HuongNV13/moodle 2021-05-07 12:21:33 +08:00
Huong Nguyen
860b5d8abc MDL-71234 usertours: Create tours for the activity completion output 2021-05-07 11:11:23 +07:00
Víctor Déniz
e41ff4f15e Merge branch 'MDL-71402' of git://github.com/paulholden/moodle 2021-05-06 16:46:19 +01:00
Paul Holden
2877501ad8 MDL-71402 availability: fix group restriction button in mod form.
* The button to "Add group/grouping access restriction" under
   common module settings should only be present if corresponding
   availability plugins are enabled; and
 * Prevent the same button behaving as a submit button, which
   intercepted the user hitting return in the form and added a
   restriction without deliberate action taken by the user.
2021-05-06 14:20:37 +01:00
Jun Pataleta
e8b3ab767b Merge branch 'MDL-71518-master' of git://github.com/rezaies/moodle 2021-05-05 13:26:29 +08:00
Shamim Rezaie
35d1ac13d2 MDL-71518 core: Add weekday to activity dates 2021-05-05 13:56:06 +10:00
Sara Arjona
5a0cca1e3c Merge branch 'MDL-71274-master' of git://github.com/aanabit/moodle 2021-05-04 17:10:36 +02:00
Sara Arjona
b04d1c3041 Merge branch 'MDL-71163-master' of git://github.com/rezaies/moodle 2021-05-03 11:59:58 +02:00
Ilya Tregubov
bff4be683a MDL-66431 core: Fix section 0 not being dispayed on course page.
This is just to make Behat tests to pass. There is a bug
discovered MDL-71382. We will address that tracker after 3.11
release. For now we just replicate stables behavior.
2021-05-01 16:22:03 +02: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
Ilya Tregubov
430746d3a2 MDL-66431 core: Remove activity chooser user preference.
This commit removes activity chooser user preference and
course preference page. Separate dropdowns to activity and
resource is also removed.
2021-05-01 16:21:59 +02:00
Shamim Rezaie
9e3b2d6f47 MDL-71163 core: support relative dates in activity dates
AMOS BEGIN
 CPY [relativedatessubmissionduedateafter,mod_assign],[relativedatessubmissionduedateafter,core_course]
 CPY [relativedatessubmissionduedatebefore,mod_assign],[relativedatessubmissionduedatebefore,core_course]
AMOS END
2021-04-30 17:13:51 +10:00
Jun Pataleta
c646a8eaec Merge branch 'MDL-70947-master' of git://github.com/HuongNV13/moodle 2021-04-30 10:34:11 +08:00
Amaia Anabitarte
8732ddd5d3 MDL-71274 analytics: Don't generate insight for hidden courses
Hidden courses can be used for training
but we do not want to generate insights for them
because students do not have access to hidden courses.
This was fixed in MDL-66806 for "Students at risk" model.
Fixed for "Students who have not accessed the course recently" in this issue.
2021-04-29 11:13:37 +02:00
Huong Nguyen
c6fb80b639 MDL-70947 File upload: Upload protection
Interacts badly with double-submit protection, and not all uploads protected
2021-04-29 15:28:19 +07:00
Adrian Greeve
e17333c342 Merge branch 'MDL-71141-master' of git://github.com/ferranrecio/moodle 2021-04-29 15:40:51 +08:00
Adrian Greeve
98edee3c4a Merge branch 'MDL-71235-master' of https://github.com/dcai/moodle 2021-04-29 14:42:35 +08:00
Dongsheng Cai
36bc7b07db MDL-71235 webservices: add activity completion data to web services 2021-04-29 13:52:32 +10:00
Andrew Nicols
430caa5de1 Merge branch 'MDL-70897-master' of git://github.com/kabalin/moodle 2021-04-29 10:18:01 +08:00
Jun Pataleta
ce01d49e6b Merge branch 'MDL-71252-master' of git://github.com/HuongNV13/moodle 2021-04-27 10:41:03 +08:00
Huong Nguyen
5e7ff4b80c MDL-71252 completion: PHPUnit failure 2021-04-27 08:42:37 +07:00
Jun Pataleta
93ab8c089e Merge branch 'MDL-71252-master' of git://github.com/HuongNV13/moodle 2021-04-26 15:55:11 +08: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
Marina Glancy
881b4258f7 MDL-70897 various: uasort callback can not return bool
Co-authored-by: Ruslan Kabalin <ruslan.kabalin@gmail.com>
2021-04-20 14:58:25 +01: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
Luca Bösch
3316562636 MDL-71324 course: Render hasinfo class only if necessary. 2021-04-17 11:49:39 +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
4cc1d6c56e Merge branch 'MDL-70821-master-5' of git://github.com/junpataleta/moodle 2021-04-13 10:59:02 +08:00
Jun Pataleta
f5d9ac9626 MDL-70821 course: Render activity information only when necessary
Render the activity information output component in the course homepage
only if either completion details or activity dates are to be displayed.
This can help reduce the number of files being included when loading the
course homepage (e.g. the activity information template for each
activity in the course homepage).
2021-04-13 00:51:48 +08:00
Ferran Recio
6ae566c55d MDL-71141 course: fix frontpage section warning 2021-04-12 12:41:10 +02: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
a5e6df51a7 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 11:41:37 +08:00
Jun Pataleta
15a9b2c51c 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 11:41:37 +08:00
Jun Pataleta
5dee6f45d8 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 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