Introduces some changes to the exising _extend_settings_navigation()
methods that utilize the global $PAGE object. In order to accomodate
the changes done for the secondary navigation for single activity
courses, the methods that extend the settings navigation can no longer
rely on the $PAGE object, instead the more reliabe way to obtain this
infomation is through the get_page() method from settings_navigation
class.
We update the dates with user/group overrides. The calculation of
the override in the lesson module is different from the assignment
module as the lesson_overrides table des not have a sortorder column.
See lesson::update_effective_access().
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.
Replace it for correct property_exists() when the element
being inspected is a property of object/class.
Amended and squased changes:
- keep mongo unmodified. The information is array, hence correct.
- fix a couple of messaging phpdocs that were incorrect.
Amended take#2:
- As far as mongo resturns BSONDocument that is ArrayObject, aka
implements ArrayAccess, we have decided to explicitly cast results
to array so existing array_key_exists() and other accesses will
continue working the same.
When some activities are manually completed by students, some are still showing in students' timeline.
This commit fix that for module assign,chat,choice,feedback,lesson,quiz,scorm and workshop.
Grades that have been hidden will appear in the outline/complete
report - even if the user is a student.
The modules that have been fixed are:
* mod_assign
* mod_data
* mod_forum
* mod_glossary
* mod_lesson
* mod_scorm
* mod_workshop
The capabilities changed ('contextlevel' => CONTEXT_COURSE changed to
'contextlevel' => CONTEXT_MODULE) are:
* moodle/site:accessallgroups
* moodle/site:viewfullnames
* moodle/site:trustcontent
* moodle/site:viewuseridentity
This list came from reviewing the _get_extra_capabilities functions in
all core activities. They were all somewhat inconsistent, but I think it
makes sense that these capabilities are consistently overridable in all
activities. E.g. moodle/site:accessallgroups affects conditional
availability even if there is no other user of groups, and
moodle/site:viewuseridentity and moodle/site:viewfullnames affect the
logs report, if nothing else.
As a result of this, several _get_extra_capabilities functions are no
longer needed, and all the rest have been simplified.
This commit reviews all continue uses in core happening within a
loop / switch / case hierarchy. This does not cover:
- Changes to libraries. Will be handled in another issue / commit.
- Uses out from loops, will be reviewed by other commit.
The policy followed has been:
- When possible, take rid of the continue.
- When clearly the intention was to jump to next element in loop
change to continue 2
- When it was not clear, keep old behavior switching to break, no
matter how weird the behavior may be.
AMOS BEGIN
CPY [openafterclose,mod_choice],[openafterclose,mod_lesson]
CPY [closebeforeopen,mod_choice],[closebeforeopen,mod_database]
CPY [openafterclose,mod_choice],[openafterclose,mod_database]
AMOS END
It was decided to roll only configuration dates and any date related to user content
such as 'timecreated' , 'timemodified' etc should not be rolled forward.
The lesson update events code depends on the "old" events in the
DB being returned in the same order as they were originally made,
however there was no guarantee that this would be the case.
There were also situations where the priority would not be explicitly
set (e.g., when creating the "original" event).
- Activities can have their custom completion rules added to cm_info
through the get_coursemodule_info callback.
- Descriptions of a modules active completion rules can be fetched using
the component callback mod_xxx_get_completion_active_rule_descriptions
which takes in a cm_info object and returns an array of strings.
Part of MDL-58138 epic